System interaction method and device, electronic equipment and storage medium
Through the combination of natural language input and multi-layer index corpus, the problem of inefficient interaction of existing big data systems is solved, and a higher level of intelligence and user experience is achieved, and the needs of different scenarios are adapted to the needs of different scenarios.
Patent Information
- Application Number
- CN202411985727.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-05-27
AI Technical Summary
The interaction methods of existing big data systems are inefficient, which leads to users who need to invest in high learning costs to operate skillfully, especially under complex functional structures, which are inconvenient and inefficient.
Through natural language input, the preset multi-layer index corpus and function coding tables are used to realize the call of system functions, reducing learning costs and operational complexity.
It significantly improves the intelligence level and user experience of the big data interaction system, improves the system interaction efficiency, and adapts to different application scenarios and user needs.
Smart Images

Figure CN120045093A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a system interaction method, device, electronic equipment and storage medium. Background Art
[0002] In the context of the rapid development of information technology, big data systems are core tools for enterprise decision support and business operations. The convenience and efficiency of their interactive methods directly affect the user experience and the actual application effect of the system. However, the interactive functions such as menu jump, event search, and report output in existing big data systems generally use traditional interactive methods such as continuous selection, switching, and clicking of the mouse. These traditional interactive methods require users to invest a high learning cost to operate proficiently when there are many system function option parameters and deep nesting levels. Even experienced users often feel inconvenient and inefficient when faced with complex functional structures. Therefore, how to provide a system interaction method that can improve the efficiency of system interaction has become an urgent problem to be solved. Summary of the invention
[0003] The embodiment of the present invention provides a system interaction method, which aims to solve the problem of low interaction efficiency of existing system interaction methods. Through natural language input, users do not need to remember complex menu structures and operation steps, and can call system functions through concise statements, which greatly reduces the learning cost and operation complexity. The preset multi-layer index corpus design can quickly and accurately determine the corpus matching results when performing corpus matching, further improving the matching efficiency and response speed. In addition, the target interaction parameter set determination mechanism based on the function coding table can flexibly adapt to different application scenarios and user needs, and enhance the scalability and adaptability of the system. In summary, due to the introduction of natural language processing and multi-layer index corpus matching mechanism, the intelligence level and user experience of the big data interaction system can be significantly improved, so as to achieve the purpose of improving the system interaction efficiency.
[0004] In a first aspect, an embodiment of the present invention provides a system interaction method, the method comprising the following steps:
[0005] Get the system interaction statements input by the user;
[0006] Based on the system interaction statement, matching processing is performed in a preset corpus to obtain a corpus matching result, wherein the preset corpus includes a main corpus and a limited corpus;
[0007] When the corpus matching result includes a main corpus and at least one restricted corpus, combining the main corpus and the restricted corpus to obtain the intention corpus corresponding to the system interaction sentence;
[0008] Based on the intention corpus and a preset function coding table, determining a target interaction parameter set corresponding to the intention corpus;
[0009] System interaction processing is performed based on the target interaction parameter set to obtain a system interaction interface corresponding to the system interaction statement.
[0010] Optionally, before performing matching processing in a preset corpus based on the system interaction statement to obtain a corpus matching result, the method further includes:
[0011] Get interaction data of different attribute types;
[0012] Classify the interaction data based on the attribute type to obtain the corpus type corresponding to the interaction data;
[0013] Mapping the interaction data based on usage scenarios of the interaction data to obtain corpus keywords corresponding to each interaction data;
[0014] The preset corpus is constructed based on the corpus keywords, the attribute type, and the corpus type.
[0015] Optionally, the preset corpus includes a first index layer, a second index layer, and a third index layer, and the step of constructing the preset corpus based on the corpus keywords, the attribute type, and the corpus type includes:
[0016] Extracting the first character and the last character from the corpus keyword, and the corpus length from the first character to the last character;
[0017] Based on the first character, construct the first index layer;
[0018] Based on the length of the corpus and the last character, construct the second index layer;
[0019] The third index layer is constructed based on the corpus keywords, the attribute type, and the corpus type.
[0020] Optionally, the preset corpus includes a first index layer, a second index layer, and a third index layer, and the matching process is performed in the preset corpus based on the system interaction statement to obtain a corpus matching result, including:
[0021] Extracting one character in the system interaction statement in sequence according to a preset order as the first character;
[0022] Based on the first character, matching processing is performed in the first index layer, the second index layer, and the third index layer in sequence to obtain the corpus matching result.
[0023] Optionally, each first index layer in the preset corpus corresponds to one second index layer, each second index layer corresponds to one third index layer, and the matching process is performed in the first index layer, the second index layer, and the third index layer in sequence based on the first character to obtain the corpus matching result, including:
[0024] Perform matching processing on all the first index layers based on the first character to obtain a first matching processing result;
[0025] If the first matching processing result is that the first character successfully matches the first character in the first target index layer, then based on the correspondence between the first index layer and the second index layer, determine the second target index layer corresponding to the first target index layer, the first target index layer is one of the multiple first index layers, the second target index layer is one of the multiple second index layers, and each of the second index layers includes the tail character and the corpus length;
[0026] Determining a second character corresponding to the first character based on the length of the corpus in the second target index layer;
[0027] Perform matching processing based on the second character and the tail character in the target second index layer to obtain a second matching result;
[0028] Based on the second matching result, determining a third target index layer corresponding to the first character and the second character;
[0029] Based on all the third target index layers, the corpus matching result is determined.
[0030] Optionally, the combining and processing based on the main corpus and the limiting corpus to obtain the intention corpus corresponding to the system interaction sentence includes:
[0031] Based on the main corpus, determining a processing strategy for the limited corpus;
[0032] Processing the restricted corpus based on the processing strategy to obtain target restricted corpus;
[0033] Combining and processing the subject corpus and the target-restricted corpus to obtain the intention corpus corresponding to the system interaction sentence.
[0034] Optionally, the determining, based on the main corpus, a processing strategy for the restricted corpus includes:
[0035] Obtaining a preset corpus relationship table, wherein the preset corpus relationship table includes a main corpus of each attribute type, a restricted corpus corresponding to the main corpus of each attribute type, and an operator symbol of the restricted corpus corresponding to the main corpus of each attribute type;
[0036] Based on the attribute type of the main corpus, determining the operator symbol corresponding to the restricted corpus in the preset corpus relationship table;
[0037] Based on the operator symbol, a processing strategy for the restricted corpus is determined.
[0038] In a second aspect, an embodiment of the present invention further provides a system interaction device, the system interaction device comprising:
[0039] An acquisition module is used to acquire system interaction statements input by users;
[0040] A matching module, used for performing matching processing in a preset corpus based on the system interaction statement to obtain a corpus matching result, wherein the preset corpus includes a main corpus and a limited corpus;
[0041] A combining module, configured to, when the corpus matching result includes a main corpus and at least one limiting corpus, perform combining processing based on the main corpus and the limiting corpus to obtain the intention corpus corresponding to the system interaction sentence;
[0042] A determination module, configured to determine a target interaction parameter set corresponding to the intention corpus based on the intention corpus and a preset function coding table;
[0043] The interaction module is used to perform system interaction processing based on the target interaction parameter set to obtain a system interaction interface corresponding to the system interaction statement.
[0044] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the system interaction method provided in the embodiment of the present invention when executing the computer program.
[0045] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the system interaction method provided in the embodiment of the invention are implemented.
[0046] In an embodiment of the present invention, a system interaction statement input by a user is obtained; matching processing is performed in a preset corpus based on the system interaction statement to obtain a corpus matching result, wherein the preset corpus contains a main corpus and a restricted corpus; when the corpus matching result contains a main corpus and at least one restricted corpus, combination processing is performed based on the main corpus and the restricted corpus to obtain the intention corpus corresponding to the system interaction statement; based on the intention corpus and a preset function coding table, a target interaction parameter set corresponding to the intention corpus is determined; system interaction processing is performed based on the target interaction parameter set to obtain a system interaction interface corresponding to the system interaction statement. Through natural language input, users do not need to remember complex menu structures and operation steps, and can call system functions through simple statements, which greatly reduces the learning cost and operation complexity. The preset multi-layer index corpus design can quickly and accurately determine the corpus matching results when performing corpus matching, further improving the matching efficiency and response speed. In addition, the target interaction parameter set determination mechanism based on the function coding table can flexibly adapt to different application scenarios and user needs, and enhance the scalability and adaptability of the system. In summary, the introduction of natural language processing and multi-layer indexing corpus matching mechanism can significantly improve the intelligence level and user experience of the big data interaction system, so as to achieve the goal of improving the system interaction efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention 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 the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 is a flow chart of a system interaction method provided by an embodiment of the present invention;
[0049] Figure 2 is a schematic diagram of the structure of a preset corpus provided by an embodiment of the present invention;
[0050] Figure 3 is a flow chart of a matching method provided by an embodiment of the present invention;
[0051] Figure 4 It is a schematic diagram of the structure of a preset corpus relationship table provided in an embodiment of the present invention;
[0052] Figure 5 is a flow chart of a second system interaction method provided by an embodiment of the present invention;
[0053] Figure 6 is a flow chart of a third system interaction method provided by an embodiment of the present invention;
[0054] Figure 7 is a structural schematic diagram of a system interaction device provided in an embodiment of the present invention;
[0055] Figure 8 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] like Figure 1 As shown, Figure 1 is a flow chart of a system interaction method provided by an embodiment of the present invention, including:
[0058] 101. Obtain system interaction statements input by the user.
[0059] In the embodiment of the present invention, the above system interaction method can be applied to any system that requires human-computer interaction, such as big data systems, financial systems, autonomous driving systems, ERP systems, etc. The above system can be deployed in a server or server cluster, and the above server or server cluster can be any electronic device with functions such as data processing, data analysis, data storage, and data transmission.
[0060] The system interaction statement may be a statement output by the user when the user interacts with the system in any way, such as querying, closing the interface, managing, etc. The user may upload the system interaction statement to the system in any way, such as voice recognition, text input, etc.
[0061] 102. Perform matching processing in a preset corpus based on the system interaction sentences to obtain corpus matching results.
[0062] In the embodiment of the present invention, the above-mentioned preset corpus includes a main body corpus and a restricted corpus. The above-mentioned main body corpus and the above-mentioned restricted corpus are essentially text corpus. The difference between the two is that if the corpus type of the corpus is the main body, the corresponding corpus is the main body corpus, and if the corpus type of the corpus is restricted, the corresponding corpus is the restricted corpus. The above-mentioned restricted corpus can be understood as a specific restriction or condition on the main body corpus. For example, if the main body corpus is an event, the corresponding restricted corpus can include restricted corpus such as time, place and object (or be understood as conditional corpus).
[0063] Specifically, the above-mentioned system interaction sentences can be used as matching targets, and the corpus corresponding to the text units in the above-mentioned system interaction sentences can be matched in the above-mentioned preset corpus by keyword precise matching or word vector model or cosine similarity fuzzy matching and other methods. Each corpus has a corresponding corpus type (i.e., subject or restriction). It should be noted that if the corpus type of the corresponding corpus is subject, it is a subject corpus, and if the corpus type of the corresponding corpus is restriction, it is a restriction corpus.
[0064] Therefore, the above corpus matching result may include any number of main corpora and any number of limiting corpora, and the above arbitrary number may be zero or a positive integer.
[0065] 103. When the corpus matching result includes a main corpus and at least one restricted corpus, a combination process is performed based on the main corpus and the restricted corpus to obtain the intent corpus corresponding to the system interaction sentence.
[0066] In an embodiment of the present invention, if the corpus matching result includes multiple main corpora, it means that the operation object is unclear, or there is no main corpus in the corpus matching result, that is, the number of main corpora is zero, which means that there is no operation object. Therefore, the process can be ended directly and an explanation that the system cannot respond to the system interaction statement is output.
[0067] On the contrary, if there is only one main corpus and at least one restrictive corpus in the corpus matching result, it means that there is a unique operation object and has corresponding conditions. Therefore, the main corpus and the restrictive corpus can be combined to obtain the intention corpus corresponding to the system interaction sentence. The above combination processing can be spliced, or according to the division of corpus types, an intention corpus table is constructed, and the above intention corpus is used as the intention corpus corresponding to the above system interaction sentence.
[0068] 104. Based on the intent corpus and a preset function coding table, determine a target interaction parameter set corresponding to the intent corpus.
[0069] In the embodiment of the present invention, although the above-mentioned intention corpus can express the user's interaction intention, it cannot be used directly as a text corpus, and the system cannot directly perform corresponding actions according to the above-mentioned intention corpus to obtain the system interaction interface. Therefore, according to the above-mentioned preset function coding table (i.e., the system predefined function coding table), the data mapped by the above-mentioned intention corpus can be combined to generate a parameter set (i.e., the target interaction parameter set) that can be used by the system. So that the system can respond to the system interaction statement to perform corresponding actions and obtain the system interaction interface.
[0070] 105. Perform system interaction processing based on the target interaction parameter set to obtain a system interaction interface corresponding to the system interaction statement.
[0071] In an embodiment of the present invention, after obtaining the above-mentioned target interaction parameter set, since the above-mentioned target interaction parameter set can be directly applied to the system, the above-mentioned system can directly perform corresponding actions according to each parameter in the above-mentioned target interaction parameter set to realize system interaction processing, and after responding to all parameters in the system parameter set, the system interaction interface corresponding to the system interaction statement can be obtained for user use.
[0072] In an embodiment of the present invention, a system interaction statement input by a user is obtained; matching processing is performed in a preset corpus based on the system interaction statement to obtain a corpus matching result, wherein the preset corpus contains a main corpus and a restricted corpus; when the corpus matching result contains a main corpus and at least one restricted corpus, combination processing is performed based on the main corpus and the restricted corpus to obtain the intention corpus corresponding to the system interaction statement; based on the intention corpus and a preset function coding table, a target interaction parameter set corresponding to the intention corpus is determined; system interaction processing is performed based on the target interaction parameter set to obtain a system interaction interface corresponding to the system interaction statement. Through natural language input, users do not need to remember complex menu structures and operation steps, and can call system functions through simple statements, which greatly reduces the learning cost and operation complexity. The preset multi-layer index corpus design can quickly and accurately determine the corpus matching results when performing corpus matching, further improving the matching efficiency and response speed. In addition, the target interaction parameter set determination mechanism based on the function coding table can flexibly adapt to different application scenarios and user needs, and enhance the scalability and adaptability of the system. In summary, the introduction of natural language processing and multi-layer indexing corpus matching mechanism can significantly improve the intelligence level and user experience of the big data interaction system, so as to achieve the goal of improving the system interaction efficiency.
[0073] It can be understood that in the specific implementation of this application, it involves system interaction statements, function coding tables, interaction data and other related data. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data and the construction and use of the corpus need to comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0074] It should be noted that the system interaction method provided in the embodiment of the present invention can be applied to devices such as computers and servers that can perform system interaction.
[0075] Optionally, before performing matching processing in a preset corpus based on system interaction statements to obtain corpus matching results, it is also possible to obtain interaction data of different attribute types; classify the interaction data based on the attribute type to obtain the corpus type corresponding to the interaction data; map the interaction data based on the usage scenario of the interaction data to obtain the corpus keywords corresponding to each interaction data; and construct a preset corpus based on the corpus keywords, attribute types, and corpus types.
[0076] In an embodiment of the present invention, the above-mentioned interactive data may be data within the system (i.e., data available for interaction within the system), and the above-mentioned attribute types may include types such as events, addresses, time, and menus. Different attribute types may correspond to corpus types as subject or limitation. For example, assuming that the attribute type of any corpus is event, the corresponding corpus type may be subject, or assuming that the attribute type of any corpus is time, the corresponding corpus type may be limitation. Therefore, the interactive data may be classified and processed according to the corresponding relationship between the attribute type and the corpus type to determine the corpus type corresponding to the interactive data.
[0077] After determining the corpus type, the corpus keywords to be mapped can be extracted from the interactive data. However, generally, the corpus keywords to be mapped cannot be used directly, so they need to be mapped according to the usage scenario of the corpus keywords to be mapped. For example, assuming that the usage scenario is to perform image query in the monitoring management system, and the corpus keyword to be mapped is "today", its attribute type is time, and its corpus type is limited. "Today" cannot be used directly, and it needs to be translated into the specific time of zero o'clock or midnight of the day to realize image query in the monitoring management system. Or assuming that the corpus keyword to be mapped is a place name, but it cannot be used directly according to the place name, it needs to be translated into the corresponding number of the monitoring equipment in the area corresponding to the place name, etc., to realize image query in the monitoring management system. After the corpus keywords to be mapped are mapped according to the above usage scenario, the corpus keywords corresponding to each interactive data can be obtained. And each corpus keyword can correspond to an attribute type and a corpus type.
[0078] Therefore, the preset corpus can be constructed based on the correspondence between the corpus keywords and the attribute types and corpus types. In the preset corpus, the corresponding corpus types and attribute types can be queried through the corpus keywords.
[0079] Optionally, in the step of constructing a preset corpus based on corpus keywords, attribute types and corpus types, the first character and the last character, as well as the corpus length from the first character to the last character can also be extracted from the corpus keywords; based on the first character, a first index layer is constructed; based on the corpus length and the last character, a second index layer is constructed; based on the corpus keywords, attribute types and corpus types, a third index layer is constructed.
[0080] In an embodiment of the present invention, the above-mentioned preset corpus includes a first index layer, a second index layer, and a third index layer. Specifically, the first character and the last character can be extracted from the above-mentioned corpus keyword, and the corpus length from the first character to the last character can be determined. The first character is used as the first index layer, the last character and the corpus length are used as the second index layer, and the corpus keyword, attribute type, and corpus type are used as the third index layer.
[0081] Specifically, the above-mentioned preset corpus can be obtained by Figure 2 A schematic diagram of the structure of a preset corpus is shown for further explanation. Figure 2 The corpus keywords to be mapped are included: "Pinghu Street", "Ping'an Street", "Today" and "Event". The first index layer corresponding to "Pinghu Street" stores its first character "Ping", the second index layer corresponding to "Pinghu Street" stores its last character "Dao" and the corpus length "4", and the third index layer corresponding to "Pinghu Street" stores the corpus keyword to be mapped "Pinghu Street", the corpus type "limited", the attribute type "address" and the mapping data (that is, the data obtained after mapping the corpus keyword to be mapped, the corpus keyword) "[1,3,4,6]".
[0082] Similarly, the first index layer corresponding to "Ping'an Street" stores its first character "Ping", the second index layer corresponding to "Ping'an Street" stores its last character "Dao" and the corpus length "4", and the third index layer corresponding to "Ping'an Street" stores the corpus keyword to be mapped "Ping'an Street", the corpus type "limitation", the attribute type "address" and the mapping data (that is, the data obtained after mapping the corpus keyword to be mapped, the corpus keyword) "[7,8,9]".
[0083] Similarly, in the first index layer corresponding to "today", the first character "今" is stored; in the second index layer corresponding to "today", the last character "天" and the corpus length "2" are stored; in the third index layer corresponding to "today", the corpus keyword to be mapped "today", the corpus type "qualifier", the attribute type "time", and the mapping data (i.e., the data obtained after mapping the corpus keyword to be mapped, the corpus keyword) "JT" are stored.
[0084] Similarly, in the first index layer corresponding to "事件", the first character "事" is stored; in the second index layer corresponding to "事件", the last character "件" and the corpus length "2" are stored; in the third index layer corresponding to "事件", the corpus keyword to be mapped "事件", the corpus type "subject", the attribute type "event", and the mapping data (i.e., the data obtained after mapping the corpus keyword to be mapped, the corpus keyword) "1" are stored.
[0085] Optionally, in the step of performing matching processing on the preset corpus based on the system interaction statement to obtain the corpus matching result, a character can also be sequentially extracted from the system interaction statement in the preset order as the first character; based on the first character, matching processing is sequentially performed in the first index layer, the second index layer, and the third index layer to obtain the corpus matching result.
[0086] In the embodiment of the present invention, the above-mentioned preset corpus includes a first index layer, a second index layer, and a third index layer, and each of the above-mentioned first index layers in the above-mentioned preset corpus corresponds to one of the above-mentioned second index layers, and each of the above-mentioned second index layers corresponds to one of the above-mentioned third index layers. The above-mentioned first target index layer is one of the multiple above-mentioned first index layers, and the above-mentioned second target index layer is one of the multiple above-mentioned second index layers.
[0087] The above-mentioned preset order can be set according to the semantic order of the text. For example, the semantic order of "平湖街道" is from left to right, and the semantic order of "道街湖平" is from right to left. Specifically, it can also be from beginning to end according to the above-mentioned semantic order, or the first character can be determined as the above-mentioned first character from the Nth character according to the above-mentioned semantic order, or the semantic order can be ignored, and only the Nth character is randomly extracted from the above-mentioned system interaction statement as the above-mentioned first character.
[0088] After extracting the first character, the first character can be matched in the first index layer, the second index layer and the third index layer in turn. If the first character fails to match in any index layer, the matching is stopped and the first character is extracted again in the preset order for matching. Correspondingly, if the first character is successfully matched in the first index layer, the second index layer and the third index layer, the corpus matching result corresponding to the first character can be determined. After all the first characters are extracted in the preset order, the corpus matching result can be obtained after all the first characters are matched in the first index layer, the second index layer and the third index layer.
[0089] Optionally, in the step of performing matching processing in the first index layer, the second index layer and the third index layer in sequence based on the first character to obtain a corpus matching result, matching processing can also be performed in all first index layers based on the first character to obtain a first matching processing result; if the first matching processing result is that the first character successfully matches the first character in the first target index layer, then based on the correspondence between the first index layer and the second index layer, the second target index layer corresponding to the first target index layer is determined; based on the corpus length in the second target index layer, the second character corresponding to the first character is determined; matching processing is performed based on the second character and the last character in the target second index layer to obtain a second matching result; based on the second matching result, the third target index layer corresponding to the first character and the second character is determined; and the corpus matching result is determined based on all third target index layers.
[0090] In an embodiment of the present invention, the first character can be matched in all first index layers to obtain a first matching result. If the first character successfully matches the first character in any first index layer, the first index layer can be determined as the first target index layer corresponding to the first character. Therefore, if the first matching result is that the first character successfully matches the first character in the first target index layer, the second target index layer corresponding to the first target index layer can be determined based on the correspondence between the first index layer and the second index layer. And in the second target index layer, according to the length of the corpus, the second character corresponding to the first character is determined according to the semantic order in the system interaction sentence. And the second character is matched with the last character in the second target index layer to obtain a second matching result.
[0091] Similarly, if the second matching result is that the second character successfully matches the last character in the second target index layer, then it can be determined that the third index layer corresponding to the second target index layer is the third target index layer corresponding to the first character and the second character. Extract all characters between the first character and the second character in the system interaction sentence and combine them with the first character and the second character in semantic order to obtain the semantic keyword to be matched. Match the semantic keyword to be matched with the semantic keyword in the above-mentioned third target index layer. When the match is successful, the content in the above-mentioned third target index layer can be used as a corpus matching result. After completing the matching of all first characters, any number of the above-mentioned semantic matching results can be obtained, and the corpus matching result corresponding to the above-mentioned system interaction sentence can be obtained by the same construction.
[0092] Specifically, the matching process of the first character in the first index layer, the second index layer and the third index layer can be performed as follows: Figure 3 The flowchart of a matching method shown in FIG. further illustrates the method. The method includes the following steps:
[0093] Step 1: Get a sentence X (i.e., system interaction sentence);
[0094] The second step is to read the Nth character in a sentence X (i.e., extract a first character according to a preset order);
[0095] The third step is to determine whether the extracted Nth character is the ending character in the system interaction statement;
[0096] Step 4: If the Nth character extracted is the ending character in the system interaction statement, the matching process ends;
[0097] Step 5: If the extracted Nth character is not the ending character in the system interactive sentence, determine whether it hits the first-level index (i.e., determine whether the first character successfully matches the first character in the first index layer);
[0098] Step 6: If the match is successful, then according to the length L of the second-level index record (i.e., the length of the corpus), obtain the character at the N+L-1th position in the sentence X;
[0099] Step 7: If the match fails, read the N+1th character and return to step 3;
[0100] Step 8: Determine whether the character at position N+L-1 in sentence X is equal to the last character T of the second index layer (i.e., whether the second character successfully matches the last character in the second target index layer);
[0101] Step 9: If the character at position N+L-1 in sentence X is equal to the second-level index tail character T, the match fails, then read the N+1th character and return to step 3;
[0102] Step 10: If the character at the N+L-1th position in the sentence X is equal to the second-level index tail character T and matches successfully, then determine whether it is equal to the corpus object keyword (that is, whether the corpus keyword to be matched composed of all characters between the first character and the second character matches successfully with the corpus keyword in the third target index layer);
[0103] Step 11: If they are equal, it means the match is successful. The content in the corresponding third target index layer can be used as a corpus matching result and return to step 3. Here, the N+1th character can also be read and then return to step 3.
[0104] Optionally, in the step of performing combined processing based on the main corpus and the restricted corpus to obtain the intention corpus corresponding to the system interaction sentence, a processing strategy for the restricted corpus can also be determined based on the main corpus; the restricted corpus can be processed based on the processing strategy to obtain the target restricted corpus; and the main corpus and the target restricted corpus can be combined to obtain the intention corpus corresponding to the system interaction sentence.
[0105] In the embodiment of the present invention, the above-mentioned main body corpus and the restricted corpus can be directly combined to obtain the above-mentioned intention corpus. It is also possible to determine the processing strategy for the restricted corpus according to the attribute type of the main body corpus. And the restricted corpus is processed according to the processing strategy to obtain the target restricted corpus. Thus, the intention corpus that better meets the user's intention can be obtained according to the target restricted corpus and the main body corpus.
[0106] The above processing strategies may include different strategies such as intersection, union and elimination. For example, assuming that the attribute type of the main corpus is event, when the corresponding limiting corpus includes multiple limiting corpora with the attribute type of address, the multiple limiting corpora with the attribute type of address may be subjected to union processing to obtain the maximum event range. For another example, if the attribute type of the main corpus is camera, when the corresponding limiting corpus includes multiple limiting corpora with the attribute type of address, the multiple limiting corpora with the attribute type of address may be subjected to intersection processing to obtain the minimum range of the camera. For another example, if the attribute type of the main corpus is menu, and the limiting corpora with the attribute type of time are not related to the menu, the limiting corpora with the attribute type of time may be eliminated.
[0107] Optionally, in the step of determining a processing strategy for the restricted corpus based on the main corpus, a preset corpus relationship table can also be obtained; based on the attribute type of the main corpus, the operator symbol corresponding to the restricted corpus is determined in the preset corpus relationship table; based on the operator symbol, the processing strategy for the restricted corpus is determined.
[0108] In the embodiment of the present invention, the above-mentioned preset corpus relationship table includes the main corpus of each attribute type, the limiting corpus corresponding to the main corpus of each attribute type, and the operator symbol of the limiting corpus corresponding to the main corpus of each attribute type. Specifically, the main corpus S of each attribute type and the possible limiting corpus J can be mapped, and each limiting corpus J is provided with an intersection and union operator symbol to construct the above-mentioned preset corpus relationship table.
[0109] The above preset corpus relationship table can be obtained by Figure 4 The schematic diagram of the structure of a preset corpus relationship table shown in FIG. further illustrates that, Figure 4 As shown, the corpus relationship table includes a main corpus S1 and a main corpus S2, wherein the limiting corpus corresponding to the main corpus S1 (i.e., the main corpus with the attribute type of S1) includes J1, J2 and J3, and the limiting corpus corresponding to the main corpus S2 (i.e., the main corpus with the attribute type of S2) includes J1, J2 and J3. In actual use, if the attribute type of the main corpus obtained is consistent with that of the main corpus S1, and also includes limiting corpus J1, J2 and J3, then the limiting corpus with the attribute type of J2 or J1 can be intersected, and the limiting corpus with the attribute type of J3 can be unioned. If the attribute type of the main corpus obtained is consistent with that of the main corpus S2, and also includes limiting corpus J1, J2 and J3, then the limiting corpus with the attribute type of J1 can be unioned, the limiting corpus with the attribute type of J2 can be intersectioned, and the limiting corpus with the attribute type of J3 can be eliminated. It can be seen that the operator symbols include "intersection", "union" and "invalid". When the corresponding operator symbol is "intersection", the restricted corpus of the corresponding attribute type can be processed by intersection. When the corresponding operator symbol is "union", the restricted corpus of the corresponding attribute type can be processed by union. When the corresponding operator symbol is "invalid", the restricted corpus of the corresponding attribute type can be eliminated.
[0110] like Figure 5 As shown, the embodiment of the present invention also provides a flowchart of a second system interaction method, which specifically includes the following steps:
[0111] The first step is to obtain the system interaction statement, that is, to search for urban management and traffic incidents that occurred in Bantian Street, Longgang District last week;
[0112] In the second step, corpus matching and grouping processing are performed in the preset corpus according to the system interaction sentences, and the corpus keywords of the main corpus are obtained as events, and the corpus keywords of the limited corpus are last week, Longgang District, Urban Management, Bantian Street, and Traffic;
[0113] In the third step, the main corpus is combined with the restricted corpus to obtain the intent corpus, which includes "last week" with the attribute type of time, "Bantian Street" with the attribute type of address, "Urban Management, Traffic" with the attribute type of type, and the main corpus "Event" with the attribute type of event.
[0114] The fourth step is to encode the intent corpus to obtain the intent encoding (i.e., the target interaction parameter set);
[0115] In the fifth step, the system makes corresponding UI changes based on the intent code to obtain the system interaction interface corresponding to the system interaction statement.
[0116] like Figure 6 As shown, the embodiment of the present invention also provides a flowchart of a third system interaction method, which specifically includes the following steps:
[0117] The first step is to obtain a sentence (i.e. the system interaction sentence input by the user);
[0118] The second step is to match the system interaction statements in the preset corpus to obtain the corpus matching results;
[0119] The third step is to group the corpus in the corpus results and determine the main corpus and the limited corpus;
[0120] The fourth step is to determine whether there is only one main body corpus;
[0121] Step 5: If there is no unique subject corpus, the process ends;
[0122] Step 6: If there is only one main corpus, combine the main corpus with the restricted corpus to obtain the intended corpus;
[0123] Step 7: Encode the intent corpus to obtain the intent code;
[0124] In the eighth step, the intent code is provided to the system for UI response, the target interaction interface is obtained and the process ends.
[0125] like Figure 7 As shown, an embodiment of the present invention further provides a system interaction device, including:
[0126] An acquisition module 701 is used to acquire a system interaction statement input by a user;
[0127] A matching module 702 is used to perform matching processing in a preset corpus based on the system interaction statement to obtain a corpus matching result, wherein the preset corpus includes a main corpus and a limited corpus;
[0128] A combining module 703 is used for, when the corpus matching result includes a main corpus and at least one limiting corpus, performing combining processing based on the main corpus and the limiting corpus to obtain the intention corpus corresponding to the system interaction sentence;
[0129] A determination module 704 is used to determine a target interaction parameter set corresponding to the intention corpus based on the intention corpus and a preset function coding table;
[0130] The interaction module 705 is used to perform system interaction processing based on the target interaction parameter set to obtain a system interaction interface corresponding to the system interaction statement.
[0131] Optionally, the system interaction device further includes:
[0132] The second acquisition module is used to acquire interaction data of different attribute types;
[0133] A first classification module, used to classify the interaction data based on the attribute type to obtain the corpus type corresponding to the interaction data;
[0134] A first mapping module, configured to perform mapping processing on the interaction data based on the usage scenario of the interaction data, to obtain a corpus keyword corresponding to each interaction data;
[0135] The first construction module is used to construct the preset corpus based on the corpus keyword, the attribute type, and the corpus type.
[0136] Optionally, the preset corpus includes a first index layer, a second index layer and a third index layer, and the first construction module includes:
[0137] A first extraction submodule is used to extract the first character and the last character from the corpus keyword, and the corpus length from the first character to the last character;
[0138] A first construction submodule, used to construct the first index layer based on the first character;
[0139] A second construction submodule, configured to construct the second index layer based on the length of the corpus and the tail character;
[0140] The third construction submodule is used to construct the third index layer based on the corpus keywords, the attribute type, and the corpus type.
[0141] Optionally, the preset corpus includes a first index layer, a second index layer and a third index layer, and the matching module 702 includes:
[0142] A second extraction submodule, configured to extract one character in turn in a preset order from the system interaction sentence as the first character;
[0143] The first matching submodule is used to perform matching processing in the first index layer, the second index layer and the third index layer in sequence based on the first character to obtain the corpus matching result.
[0144] Optionally, in the preset corpus, each first index layer corresponds to one second index layer, each second index layer corresponds to one third index layer, and the first matching submodule includes:
[0145] A first matching unit, configured to perform matching processing in all the first index layers based on the first character to obtain a first matching processing result;
[0146] A first determining unit is configured to determine, if the first matching processing result is that the first character successfully matches the first character in the first target index layer, based on the correspondence between the first index layer and the second index layer, a second target index layer corresponding to the first target index layer, the first target index layer being one of the plurality of first index layers, the second target index layer being one of the plurality of second index layers, each of the second index layers including a tail character and a corpus length;
[0147] A second determining unit, configured to determine a second character corresponding to the first character based on a length of the corpus in the second target index layer;
[0148] A second matching unit, configured to perform matching processing based on the second character and the tail character in the target second index layer to obtain a second matching result;
[0149] a third determining unit, configured to determine, based on the second matching result, a third target index layer corresponding to the first character and the second character;
[0150] The fourth determining unit is used to determine the corpus matching result based on all the third target index layers.
[0151] Optionally, the combining module 703 includes:
[0152] A first determination submodule is used to determine a processing strategy for the restricted corpus based on the main corpus;
[0153] A first processing submodule, configured to process the restricted corpus based on the processing strategy to obtain a target restricted corpus;
[0154] The first combination submodule is used to perform combination processing based on the main corpus and the target-restricted corpus to obtain the intention corpus corresponding to the system interaction sentence.
[0155] Optionally, the first determining submodule includes:
[0156] A first acquisition unit is used to acquire a preset corpus relationship table, wherein the preset corpus relationship table includes a main corpus of each attribute type, a restricted corpus corresponding to the main corpus of each attribute type, and an operator symbol of the restricted corpus corresponding to the main corpus of each attribute type;
[0157] A fifth determining unit, configured to determine, based on the attribute type of the main corpus, the operator symbol corresponding to the restricted corpus in the preset corpus relationship table;
[0158] A sixth determining unit is used to determine a processing strategy for the restricted corpus based on the operator symbol.
[0159] like Figure 8 As shown, an embodiment of the present invention further provides an electronic device, characterized in that it includes a processor, and the processor can execute any one of the above-mentioned system interaction methods.
[0160] Specifically, it includes a processor 801 and a memory 802, and a computer program for executing the system interaction method stored in the memory 802 and capable of running on the processor 801, wherein:
[0161] The processor 801 runs the computer program of the system interaction method stored in the memory 802 to perform the following steps:
[0162] Get the system interaction statements input by the user;
[0163] Based on the system interaction statement, matching processing is performed in a preset corpus to obtain a corpus matching result, wherein the preset corpus includes a main corpus and a limited corpus;
[0164] When the corpus matching result includes a main corpus and at least one restricted corpus, combining the main corpus and the restricted corpus to obtain the intention corpus corresponding to the system interaction sentence;
[0165] Based on the intention corpus and a preset function coding table, determining a target interaction parameter set corresponding to the intention corpus;
[0166] System interaction processing is performed based on the target interaction parameter set to obtain a system interaction interface corresponding to the system interaction statement.
[0167] Optionally, before performing matching processing in a preset corpus based on the system interaction statement to obtain a corpus matching result, the method executed by the processor 801 further includes:
[0168] Get interaction data of different attribute types;
[0169] Classify the interaction data based on the attribute type to obtain the corpus type corresponding to the interaction data;
[0170] Mapping the interaction data based on usage scenarios of the interaction data to obtain corpus keywords corresponding to each interaction data;
[0171] The preset corpus is constructed based on the corpus keywords, the attribute type, and the corpus type.
[0172] Optionally, the preset corpus includes a first index layer, a second index layer, and a third index layer, and the processor 801 executes the step of constructing the preset corpus based on the corpus keywords, the attribute type, and the corpus type, including:
[0173] Extracting the first character and the last character from the corpus keyword, and the corpus length from the first character to the last character;
[0174] Based on the first character, construct the first index layer;
[0175] Based on the length of the corpus and the last character, construct the second index layer;
[0176] The third index layer is constructed based on the corpus keywords, the attribute type, and the corpus type.
[0177] Optionally, the preset corpus includes a first index layer, a second index layer, and a third index layer, and the processor 801 performs matching processing in the preset corpus based on the system interaction statement to obtain a corpus matching result, including:
[0178] Extracting one character in the system interaction statement in sequence according to a preset order as the first character;
[0179] Based on the first character, matching processing is performed in the first index layer, the second index layer, and the third index layer in sequence to obtain the corpus matching result.
[0180] Optionally, each first index layer in the preset corpus corresponds to one second index layer, and each second index layer corresponds to one third index layer, and the processor 801 performs matching processing in the first index layer, the second index layer, and the third index layer in sequence based on the first character to obtain the corpus matching result, including:
[0181] Perform matching processing on all the first index layers based on the first character to obtain a first matching processing result;
[0182] If the first matching processing result is that the first character successfully matches the first character in the first target index layer, then based on the correspondence between the first index layer and the second index layer, determine the second target index layer corresponding to the first target index layer, the first target index layer is one of the multiple first index layers, the second target index layer is one of the multiple second index layers, and each of the second index layers includes the tail character and the corpus length;
[0183] Determining a second character corresponding to the first character based on the length of the corpus in the second target index layer;
[0184] Perform matching processing based on the second character and the tail character in the target second index layer to obtain a second matching result;
[0185] Based on the second matching result, determining a third target index layer corresponding to the first character and the second character;
[0186] Based on all the third target index layers, the corpus matching result is determined.
[0187] Optionally, the processor 801 performs the combined processing based on the main corpus and the restricted corpus to obtain the intention corpus corresponding to the system interaction sentence, including:
[0188] Based on the main corpus, determining a processing strategy for the limited corpus;
[0189] Processing the restricted corpus based on the processing strategy to obtain target restricted corpus;
[0190] Combining and processing the subject corpus and the target-restricted corpus to obtain the intention corpus corresponding to the system interaction sentence.
[0191] Optionally, the determining, based on the main corpus, a processing strategy for the restricted corpus performed by the processor 801 includes:
[0192] Obtaining a preset corpus relationship table, wherein the preset corpus relationship table includes a main corpus of each attribute type, a restricted corpus corresponding to the main corpus of each attribute type, and an operator symbol of the restricted corpus corresponding to the main corpus of each attribute type;
[0193] Based on the attribute type of the main corpus, determining the operator symbol corresponding to the restricted corpus in the preset corpus relationship table;
[0194] Based on the operator symbol, a processing strategy for the restricted corpus is determined.
[0195] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the system interaction method or the application-side system interaction method provided in the embodiment of the present invention are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0196] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the above-mentioned computer program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the above-mentioned computer-readable storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0197] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A system interaction method, characterized in that: The method comprises the following steps: Get the system interaction statements input by the user; Based on the system interaction statement, matching processing is performed in a preset corpus to obtain a corpus matching result, wherein the preset corpus includes a main corpus and a limited corpus; When the corpus matching result includes a main corpus and at least one restricted corpus, combining the main corpus and the restricted corpus to obtain the intention corpus corresponding to the system interaction sentence; Based on the intention corpus and a preset function coding table, determining a target interaction parameter set corresponding to the intention corpus; System interaction processing is performed based on the target interaction parameter set to obtain a system interaction interface corresponding to the system interaction statement.
2. The system interaction method according to claim 1, characterized in that: Before performing matching processing in a preset corpus based on the system interaction statement to obtain a corpus matching result, the method further includes: Get interaction data of different attribute types; Classify the interaction data based on the attribute type to obtain the corpus type corresponding to the interaction data; Mapping the interaction data based on usage scenarios of the interaction data to obtain corpus keywords corresponding to each interaction data; The preset corpus is constructed based on the corpus keywords, the attribute type, and the corpus type.
3. The system interaction method according to claim 2, characterized in that: The preset corpus includes a first index layer, a second index layer and a third index layer. The step of constructing the preset corpus based on the corpus keywords, the attribute type and the corpus type includes: Extracting the first character and the last character from the corpus keyword, and the corpus length from the first character to the last character; Based on the first character, construct the first index layer; Based on the length of the corpus and the last character, construct the second index layer; The third index layer is constructed based on the corpus keywords, the attribute type, and the corpus type.
4. The system interaction method according to claim 1, characterized in that: The preset corpus includes a first index layer, a second index layer and a third index layer. The matching process is performed in the preset corpus based on the system interaction statement to obtain a corpus matching result, including: Extracting one character in the system interaction statement in sequence according to a preset order as the first character; Based on the first character, matching processing is performed in the first index layer, the second index layer, and the third index layer in sequence to obtain the corpus matching result.
5. The system interaction method according to claim 4, characterized in that: Each first index layer in the preset corpus corresponds to one second index layer, each second index layer corresponds to one third index layer, and performing matching processing in the first index layer, the second index layer, and the third index layer in sequence based on the first character to obtain the corpus matching result includes: Perform matching processing on all the first index layers based on the first character to obtain a first matching processing result; If the first matching processing result is that the first character successfully matches the first character in the first target index layer, then based on the correspondence between the first index layer and the second index layer, determine the second target index layer corresponding to the first target index layer, the first target index layer is one of the multiple first index layers, the second target index layer is one of the multiple second index layers, and each of the second index layers includes the tail character and the corpus length; Determining a second character corresponding to the first character based on the length of the corpus in the second target index layer; Perform matching processing based on the second character and the tail character in the target second index layer to obtain a second matching result; Based on the second matching result, determining a third target index layer corresponding to the first character and the second character; Based on all the third target index layers, the corpus matching result is determined.
6. The system interaction method according to claim 1, characterized in that: The combining and processing based on the main corpus and the restricted corpus to obtain the intention corpus corresponding to the system interaction sentence includes: Based on the main corpus, determining a processing strategy for the limited corpus; Processing the restricted corpus based on the processing strategy to obtain target restricted corpus; Combining and processing the subject corpus and the target-restricted corpus to obtain the intention corpus corresponding to the system interaction sentence.
7. The system interaction method according to claim 6, characterized in that: The determining, based on the main corpus, a processing strategy for the restricted corpus includes: Obtaining a preset corpus relationship table, wherein the preset corpus relationship table includes a main corpus of each attribute type, a restricted corpus corresponding to the main corpus of each attribute type, and an operator symbol of the restricted corpus corresponding to the main corpus of each attribute type; Based on the attribute type of the main corpus, determining the operator symbol corresponding to the restricted corpus in the preset corpus relationship table; Based on the operator symbol, a processing strategy for the restricted corpus is determined.
8. A system interaction device, characterized in that: The system interaction device comprises: An acquisition module is used to acquire system interaction statements input by users; A matching module, used for performing matching processing in a preset corpus based on the system interaction statement to obtain a corpus matching result, wherein the preset corpus includes a main corpus and a limited corpus; A combining module, configured to, when the corpus matching result includes a main corpus and at least one limiting corpus, perform combining processing based on the main corpus and the limiting corpus to obtain the intention corpus corresponding to the system interaction sentence; A determination module, configured to determine a target interaction parameter set corresponding to the intention corpus based on the intention corpus and a preset function coding table; The interaction module is used to perform system interaction processing based on the target interaction parameter set to obtain a system interaction interface corresponding to the system interaction statement.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the system interaction method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the system interaction method according to any one of claims 1 to 7 are implemented.