Process branch matching method and system based on power value coding and bit operation judgment

By using a process branch matching method based on power-value encoding and bitwise operations, the inefficiency and maintenance complexity of large-scale branch conditions in intelligent dialogue systems are solved, achieving efficient branch matching judgment and simplified condition expression, adapting to rapid business changes.

CN121581597BActive Publication Date: 2026-04-10BEIJING YULORE INNOVATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-27
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing intelligent dialogue systems and business process engines suffer from inefficiency, complex condition expression, and high maintenance costs when handling large-scale branch conditions. In particular, performance loss is significant when there are hundreds of nodes, and there is a lack of efficient condition combination judgment mechanism.

Method used

A process branch matching method based on power-value encoding and bit operations is adopted. By mapping the intent category to a power of 2, bit operations are used to perform fast branch matching judgment, generating an intent encoding mapping table and a node mask configuration table, thus achieving branch matching with O(1) time complexity.

Benefits of technology

It improves system performance, simplifies condition expression and maintenance, supports complex condition combinations, adapts to rapid business iteration and expansion, and allows business processes to be adjusted through configuration files without modifying the code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121581597B_ABST
    Figure CN121581597B_ABST
Patent Text Reader

Abstract

The application provides a flow branch matching method and system based on power value coding and bit operation judgment. The method comprises the following steps: generating an intention coding mapping table by assigning the power value of a specified base as the intention allocation coding; querying the target coding of each intention branch based on the intention branch set supported by the flow node, performing bit operation to generate a node mask value, and forming a node mask configuration table; identifying the user intention from the user input content and querying the user intention coding from the intention coding mapping table; extracting the target node mask value from the node mask configuration table, performing bit operation on the user intention coding and the target node mask value, judging whether the intention branch supported by the current flow node is matched according to the bit operation result, determining the target flow node corresponding to the matched intention branch, and generating the node execution information required by the target flow node. The application solves the problems of low flow branch judgment efficiency, complex condition expression and high maintenance cost.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent dialogue systems and business process engines, and particularly relates to a process branch matching method and system based on power value coding and bit operation judgment. BACKGROUND

[0002] In the field of intelligent dialogue systems and business process engines, process branch judgment is one of the core technical links. Such systems need to quickly determine the next execution path according to user input or system state, involving a large number of condition judgments and branch matching operations. With the increasing complexity of business scenarios, the number of process nodes and conditions is growing explosively, which puts higher requirements on branch judgment efficiency and maintainability.

[0003] Current process branch judgment mainly adopts keyword list matching and condition traversal methods. Taking an intelligent outbound call system as an example, a plurality of keyword libraries are usually maintained, and string matching is performed between user input and the keyword library to determine the user intent, and then branch transfer is performed. Another common way is to use decision trees or condition statement chain judgment to evaluate each branch condition in a predetermined order.

[0004] More advanced solutions adopt a combination mode of intent recognition and rule judgment. The system first identifies the user input as a structured intent through an NLP model, and then determines the matching branch through traversal of a condition array or Hash table query. This method has improved in semantic understanding, but still has significant bottlenecks in large-scale node and complex condition combination scenarios.

[0005] However, these technical solutions have many shortcomings in handling large-scale branch conditions: first, the condition judgment efficiency is low, especially when the number of nodes reaches hundreds, traversal judgment brings obvious performance loss; second, the condition expression structure is complex, and there is a lack of unified and efficient coding method, resulting in high maintenance cost; third, the branch relationship between nodes is expressed in a long and complex way, making it difficult to clearly show the condition combination logic; finally, there is a lack of efficient judgment mechanism to support complex condition combinations, making it difficult to meet the rapid iteration needs of business. SUMMARY

[0006] The purpose of the present application is to provide a process branch matching method and system based on power value coding and bit operation judgment, which maps intent categories to 2 power values and uses bit operation for fast branch matching judgment, to solve the technical problems of low efficiency, complex condition expression, and high maintenance cost in the prior art.

[0007] In a first aspect, the present application provides a process branch matching method based on power value coding and bit operation judgment, comprising the following steps:

[0008] An intent encoding mapping table is generated by assigning a power value of a specified base to each intent in a preset intent category set as an encoding;

[0009] Based on a set of supported intent branches of a process node, a target encoding corresponding to each intent branch in the set of supported intent branches is queried from the intent encoding mapping table, at least one target encoding that is queried is subjected to a bit operation, a node mask value is generated to form a node mask configuration table, and the node mask configuration table is used to indicate an association between the process node and the node mask value;

[0010] User input content in a current dialogue process is obtained, a user intent is identified from the user input content, and an encoding corresponding to the user intent is queried from the intent encoding mapping table as a user intent encoding;

[0011] A target node mask value corresponding to a process node in which the current dialogue process is located is extracted from the node mask configuration table, a bit operation is performed on the user intent encoding and the target node mask value, and whether the bit operation result matches an intent branch supported by the current process node is determined;

[0012] Based on the matching result, a target process node corresponding to the matched intent branch is determined, and node execution information required by the target process node is generated to enable process jumping to the target process node according to the node execution information, and the node execution information includes execution context and parameter information.

[0013] In some embodiments, the intent encoding mapping table is generated by assigning a power value of a specified base to each intent in a preset intent category set, including:

[0014] According to business requirements and scene characteristics, a set of intent categories that need to be identified is defined;

[0015] A power value of a specified base is used as an encoding of each intent in the set of intent categories, and the power value of the specified base includes a power value of 2;

[0016] The intent and the corresponding encoding are one-to-one mapped to construct the intent encoding mapping table.

[0017] In some embodiments, the node mask value is generated by querying a target encoding corresponding to each intent branch in the set of supported intent branches of a process node from the intent encoding mapping table, and performing a bit operation on at least one target encoding that is queried, including:

[0018] Node branch configuration data is obtained through a preset configuration file, and a set of allowed intent branches is selected for each process node in the node branch configuration data;

[0019] querying, from the intent encoding mapping table, an encoding corresponding to each intent in the set of intent branches as a target encoding;

[0020] performing a bit operation on at least one target encoding supported by the process node to generate a single integer value as a node mask value;

[0021] storing the process node in association with the corresponding node mask value to form the node mask configuration table.

[0022] In some embodiments, the obtaining of the user input content in the current dialogue process and the identification of the user intent from the user input content and the querying of the encoding corresponding to the user intent from the intent encoding mapping table as the user intent encoding comprises:

[0023] obtaining the user input content in the current dialogue process through a voice interface and / or a text interface, wherein the user input content comprises voice input text, and the voice input text is text content obtained by converting voice input content obtained by the voice interface through a preset ASR service model;

[0024] performing cleaning, word segmentation and stop word removal processing on the user input content to obtain target input content;

[0025] identifying the target input content through regular matching, keyword recognition or a preset machine learning model to determine a user intent;

[0026] querying, from the intent encoding mapping table, an encoding corresponding to the user intent as a user intent encoding.

[0027] In some embodiments, the extracting of the target node mask value corresponding to the process node in which the current dialogue process is located from the node mask configuration table and the performing of a bit operation on the user intent encoding and the target node mask value to determine whether the current process node supports the intent branch according to the bit operation result comprises:

[0028] identifying the process node in which the current dialogue process is located and querying, from the node mask configuration table, a node mask value corresponding to the identified process node as a target node mask value;

[0029] performing a bit operation on the user intent encoding and the target node mask value to obtain a bit operation result;

[0030] determining whether the bit operation result is consistent with the user intent encoding;

[0031] If it is judged that the operation result is consistent with the user intention encoding, it is confirmed that the intention branch supported by the current process node is matched.

[0032] In some embodiments, the node mask value includes a node composite mask value; the intention branch set supported by the process node is used to query the target encoding corresponding to each intention branch in the intention branch set from the intention encoding mapping table, at least one target encoding is subjected to a bit operation to generate a node mask value to form a node mask configuration table, and the method further includes:

[0033] A service level target priority is assigned to each intention branch in the intention branch set, and the service level target priority includes a critical branch, a core branch and a normal branch sorted in descending order of priority;

[0034] Based on the service level target priority of the intention branch, the target encoding of the intention branch is expanded into a composite encoding with multiple levels, wherein the first level in the composite encoding represents the target encoding, the second level in the composite encoding represents a priority encoding corresponding to the service level target priority, and the third level in the composite encoding represents a business domain encoding related to a business domain and / or a scene encoding related to a scene type;

[0035] The composite encodings corresponding to the intention branches supported by the process node are subjected to a bit operation combination to generate a node composite mask value of the process node;

[0036] The target node mask value includes a target node composite mask value; the target node mask value corresponding to the process node where the current dialogue process is located is extracted from the node mask configuration table, and the user intention encoding and the target node mask value are subjected to a bit operation to determine whether the intention branch supported by the current process node is matched according to the bit operation result, and the method further includes:

[0037] The target node composite mask value is subjected to mask pre-screening according to the current business domain to obtain the to-be-processed intention branch supported by the current process node;

[0038] According to the current load condition and the quality of service target, a priority strategy for execution judgment is determined, and the target intention branch is subjected to judgment processing according to the priority strategy, wherein the priority strategy is used to indicate that when the current load condition is higher than a preset load threshold, the to-be-processed intention branch whose service level target priority indicated by the priority encoding in the target node composite mask value is higher than a preset priority condition is preferentially judged, or when the current load condition is lower than the load threshold, all to-be-processed intention branches are judged in parallel;

[0039] The user intention code is subjected to a bit operation with the target node composite mask value, and it is judged whether the bit operation result matches the target intention branch supported by the current flow node.

[0040] In some embodiments, the intention encoding mapping table is generated by assigning a power value of a specified base to each intention in the preset intention category set, and further comprising:

[0041] A version number and a time stamp are assigned to each set of intention encoding mapping tables, and a corresponding vector clock is marked for an update event of the intention encoding mapping table, and an encoding dependency graph is established based on the version number, the time stamp and the vector clock, the encoding dependency graph being used to indicate that the related codes in the intention encoding mapping table are updated in accordance with a causal order;

[0042] The target flow node corresponding to the matched intention branch is determined based on the matching result, and node execution information required by the target flow node is generated to enable flow jumping to the target flow node in accordance with the node execution information, including:

[0043] When determining the target flow node, state information of the current flow node is obtained;

[0044] A corresponding state dependency chain is determined for each flow instance, the state dependency chain being used to indicate a state dependency relationship between flow nodes related to the flow instance;

[0045] A causal identifier marked on the target flow node is generated based on the state information of the current flow node, the state dependency chain of the flow instance, the vector clock and the encoding dependency graph;

[0046] A multi-level causal cache structure is determined, the multi-level causal cache structure including a local cache, a service cache and a global cache;

[0047] A causal dependency directed graph is formed based on a causal dependency relationship of cache entries in the multi-level causal cache structure, and a cache invalidation strategy is determined based on the causal dependency directed graph;

[0048] The state information of the flow node is converted into a highly compressed bitmap representation, and the bitmap representation is stored in a state slice based on the flow node and a corresponding time window in accordance with the multi-level causal cache structure and the multi-level causal cache structure.

[0049] In some embodiments, the intention encoding mapping table is generated by assigning a power value of a specified base to each intention in the preset intention category set, and further comprising:

[0050] The business process and historical interaction data corresponding to the business process are determined through a preset static analysis algorithm, and an intent association graph is constructed based on the business process and the historical interaction data. The intent association graph is used to indicate the correlation and mutual exclusivity between intents. An intent feature vector and a conflict recognition result are generated according to the constructed intent association graph.

[0051] Based on the intent feature vector and the conflict recognition result, an intent conflict set is formed, and a preset global intent pool is grouped according to the conflict relationship to form a relatively independent coding domain. The intent conflict set is used to indicate the conflict relationship between intents that do not logically share the same coding bit.

[0052] A search space for coding allocation is constructed, and the search space is traversed. In combination with the coding domain, a coding allocation scheme is searched through a pre-established Monte Carlo tree search model until the conflict is minimized and the coding efficiency is maximized, and a current coding allocation scheme is obtained. The coding allocation scheme is used to indicate that the intent is allocated coding by specifying the power value of the base.

[0053] The 32-bit or 64-bit integer space is divided according to the business domain to form a multi-layer coding structure. According to the multi-layer coding structure, the current coding allocation scheme is optimized to a coding mapping scheme.

[0054] The usage frequency and hit rate of the coding of each intent in the current actual use process are obtained. A coding efficiency prediction model is trained according to the usage frequency and the hit rate, and the current coding allocation scheme is optimized according to the coding efficiency prediction model.

[0055] In some embodiments, the search space for coding allocation is constructed, and the search space is traversed. In combination with the coding domain, a coding allocation scheme is searched through a pre-established Monte Carlo tree search model until the conflict is minimized and the coding efficiency is maximized, and a current coding allocation scheme is obtained. The coding allocation scheme is used to indicate that the intent is allocated coding by specifying the power value of the base.

[0056] An initial coding allocation state tree is established. According to the action space and state transition rules of the coding allocation indicated by the coding allocation state tree, a Monte Carlo tree search model is established. The root node of the coding allocation state tree represents an empty coding allocation state.

[0057] Based on the current coding state and a preset UCB1 selection strategy, a coding allocation action whose coding allocation evaluation value reaches a preset evaluation threshold is selected. The selected coding allocation action is expanded to generate a new node in the Monte Carlo tree search model.

[0058] For the new node, a complete coding allocation process is simulated through a preset random strategy, and an evaluation score of the simulated coding allocation process is calculated.

[0059] Based on the evaluation score, the visit times and average returns of each node are updated along the search path of the Monte Carlo tree search model, and the back propagation update of the Monte Carlo tree search model is completed;

[0060] The selection of the encoding allocation action, the expansion of the encoding allocation action, the simulation of the encoding allocation process and the back propagation of the Monte Carlo tree search model are repeatedly performed until a preset iteration number is reached, the node corresponding to the maximum visit time or the maximum average return and the corresponding encoding allocation action are selected, and a corresponding encoding allocation scheme is obtained.

[0061] In a second aspect, the present application provides a flow branch matching system based on power value encoding and bit operation judgment, comprising:

[0062] An intention encoding module is configured to assign an encoding to each intention in a preset intention category set by a power value of a specified base, and generate an intention encoding mapping table.

[0063] A node mask generation module is configured to query a target encoding corresponding to each intention branch in the intention branch set supported by a flow node from the intention encoding mapping table, perform a bit operation on the at least one target encoding, generate a node mask value, and form a node mask configuration table to indicate an association between the flow node and the node mask value.

[0064] A user intention recognition module is configured to obtain user input content in a current dialogue flow, recognize a user intention from the user input content, and query an encoding corresponding to the user intention from the intention encoding mapping table as a user intention encoding.

[0065] A branch matching judgment module is configured to extract a target node mask value corresponding to a flow node where the current dialogue flow is located from the node mask configuration table, perform a bit operation on the user intention encoding and the target node mask value, and judge whether the current flow node supports the matched intention branch according to the bit operation result.

[0066] A flow jump execution module is configured to determine a target flow node corresponding to the matched intention branch based on the matching result, and generate node execution information required by the target flow node, so as to perform flow jump to the target flow node according to the node execution information, wherein the node execution information includes execution context and parameter information.

[0067] Compared with the prior art, the technical scheme of the present application has the following beneficial effects: the branch matching judgment of O(1) time complexity is realized through bit operation, which greatly improves the system performance compared with the traditional traversal judgment mode; the power value of 2 is used as the intent encoding, so that each intent occupies a unique binary bit, which is convenient for combination and identification; through the node mask value, all branch combinations supported by the node are intuitively represented, simplifying the configuration and maintenance of complex conditions; the matching mechanism based on bit operation naturally supports complex condition combination and can adapt to the rapid iteration and expansion requirements of business; the intent encoding mapping table and the node mask configuration table are defined and updated through the configuration file, and the business process can be adjusted without modifying the code. BRIEF DESCRIPTION OF DRAWINGS

[0068] Figure 1 A flow branch matching method based on power value encoding and bit operation judgment is provided for the embodiment of the present application.

[0069] Figure 2 A structure diagram of a flow branch matching system based on power value encoding and bit operation judgment is provided for the embodiment of the present application. DETAILED DESCRIPTION

[0070] The technical scheme in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0071] As shown in the figure, the present embodiment provides a flow branch matching method based on power value encoding and bit operation judgment, which includes the following steps S101-S105. Figure 1

[0072] S101, assign an encoding to each intent in a preset intent category set by a power value of a specified base, and generate an intent encoding mapping table.

[0073] In some embodiments, step S101 includes:

[0074] According to the business requirements and scene characteristics, define the intent category set that needs to be identified;

[0075] Use the power value of a specified base as the encoding of each intent in the intent category set, and the power value of the specified base includes the power value of 2;

[0076] Map the intent and the corresponding encoding one-to-one to construct the intent encoding mapping table.

[0077] ​In this embodiment, first, according to the business requirements and scene characteristics, the set of intent categories that need to be identified is defined. Among them, the set of intent categories refers to the set of all intent types that the user may express and need to be identified and processed in a specific business scene, for example, in the customer service scene, it may include intent categories such as "consultation", "complaint", "handling business" and the like. These intent categories are usually pre-defined according to business domain knowledge and user interaction requirements to constitute the basic semantic units that need to be processed. After determining the set of intent categories, the power of a specified base is used as the encoding rule. The power of encoding is a special encoding method, in which each encoding value is the power of a certain base, and the power of 2 (i.e. 1, 2, 4, 8, 16...) is preferably used as the encoding. This encoding method is that each encoding has only one bit as 1 in binary representation, and the remaining bits are all 0, so that each intent has independence and orthogonality in binary bit representation. For example, the binary representation of 1 is "001", the binary representation of 2 is "010", and the binary representation of 4 is "100". Therefore, through independent bit representation, the subsequent bit operation judgment is more efficient and reliable.

[0078] Next, the embodiment one-to-one maps the intent and the corresponding encoding to construct an intent encoding mapping table. The intent encoding mapping table is a key-value pair data structure, in which the key is the intent identifier (such as the intent name or ID), and the value is the corresponding power encoding value. Therefore, by constructing the intent encoding mapping table, the embodiment realizes the form of hash table, associative array or database table, etc., supports fast bidirectional query, and can query the encoding through the intent, and can also query the intent through the encoding.

[0079] For example, the embodiment defines the encoding of the "affirmative" intent as 1 (i.e. 2^0), and its binary representation is "0001"; the encoding of the "negative" intent is 2 (i.e. 2^1), and its binary representation is "0010"; the encoding of the "reject" intent is 4 (i.e. 2^2), and its binary representation is "0100"; the encoding of the "skip" intent is 8 (i.e. 2^3), and its binary representation is "1000". Through this encoding method, each intent occupies a unique bit in binary representation, ensuring the exclusivity and uniqueness of the encoding, and realizing the subsequent fast judgment based on bit operation.

[0080] It should be noted that in the mapping table construction process, it is necessary to ensure that each intent is assigned a unique code to avoid code conflicts. At the same time, since the power-of-2 code is used, theoretically, using a 32-bit integer can support up to 32 different intent encodings, and using a 64-bit integer can support 64 intents, meeting the needs of most business scenarios. For a large-scale intent set, grouping encoding or multi-level encoding structure can be used for expansion. Therefore, the embodiment converts the intent into a power-of-2 code, laying a foundation for subsequent bit operation judgment, and providing an efficient and unified intent representation method.

[0081] S102, based on the intent branch set supported by the flow node, querying the target code corresponding to each intent branch in the intent branch set from the intent encoding mapping table, performing bit operation on the at least one target code obtained by querying, generating a node mask value to form a node mask configuration table, the node mask configuration table is used to indicate the association relationship between the flow node and the node mask value.

[0082] In the present application, the flow node refers to a specific execution point in the dialogue flow or business process, and each node may support multiple different intent branches. The intent branch set refers to the set of all possible intents allowed by a certain flow node, which defines which user intent input the node can accept. The node mask value is an integer value obtained by performing bit operation (usually bitwise OR operation or simple addition) on all intent encodings supported by the node, and each position in the binary representation corresponds to a specific intent. The bit with a value of 1 indicates that the node supports the intent corresponding to the bit, and the bit with a value of 0 indicates that it does not support it. The node mask configuration table is an association structure that records the mapping relationship between each flow node and its corresponding mask value.

[0083] In some embodiments, step S102 includes:

[0084] Obtaining node branch configuration data through a preset configuration file, selecting the allowed intent branch set for each flow node in the node branch configuration data;

[0085] Querying the code corresponding to each intent in the intent branch set from the intent encoding mapping table as the target code;

[0086] Performing bit operation on the at least one target code supported by the flow node to generate a single integer value as the node mask value;

[0087] After associating the flow node with the corresponding node mask value, it is stored to form the node mask configuration table.

[0088] In this embodiment, first, the node branch configuration data is obtained through a preset configuration file, which specifies the set of intent branches supported by each process node. The node branch configuration data refers to structured data describing the intent branch information supported by each node in the process, usually stored in JSON, XML or special configuration format. These configuration data define which user intent inputs each node in the flowchart can accept, and the corresponding process jump target. The configuration file can be generated by business personnel through a visual process design tool, or directly written through code or script. Then, based on the node branch configuration data, the system selects the allowed intent branch set for each process node. The intent branch set refers to the set of all possible intents supported by a single process node, representing the branching decision capability of the node. For example, the "ask user intention" node may support "affirmative", "negative", and "uncertain" intent branches. This explicit definition makes the process logic clearer, facilitating later maintenance and adjustment.

[0089] Next, this embodiment queries the encoding corresponding to each intent in the intent branch set from the intent encoding mapping table as the target encoding. The target encoding refers to the power encoding value corresponding to each intent supported by a specific process node. By creating the intent encoding mapping table described above, these encoding values can be quickly queried and obtained. Then, at least one target encoding supported by the process node is subjected to bit operation to generate a single integer value as the node mask value. The node mask value is an integer value obtained by bit operation (usually bitwise OR operation) on all intent encodings supported by the node, which contains the bit information of all supported intents of the node in binary representation. Bit operation is a high-efficiency operation method that directly operates binary bits. The principle of bitwise OR operation (symbol "|") is that if there is only one 1 in the corresponding bits of the two operands, the result will be 1. For example, if a node supports "affirmative" (encoding 1, binary 001), "negative" (encoding 2, binary 010), and "uncertain" (encoding 4, binary 100), the mask value of the node is 1|2|4=7, represented in binary as 111.

[0090] Finally, the embodiment associates the process nodes with the corresponding node mask values and stores them to form a node mask configuration table. The node mask configuration table is a special data structure used to store the mapping relationship between the process node ID and its corresponding mask value. This table can be implemented in the form of a hash table, an associative array, or a database table, etc., supporting fast query of the corresponding mask value through the node ID. The node mask configuration table is the core data basis for subsequent branch matching judgment. Therefore, through the node mask configuration table, the embodiment only needs to record an integer value to express all the intention branch combinations supported by a node, greatly simplifying the data structure and improving the storage and query efficiency. At the same time, this representation method enables the subsequent branch matching judgment to be completed through efficient bit operations without traversing the condition array or performing multiple string comparisons.

[0091] For example, a simplified node mask configuration table can be as follows: node ID "node_001" (ask user intention) -> mask value 7 (support "affirmative", "negative", "uncertain"); node ID "node_002" (confirm user information) -> mask value 3 (support "affirmative", "negative"); node ID "node_003" (handle user complaint) -> mask value 24 (support "transfer to human", "consult details").

[0092] Therefore, the embodiment realizes efficient expression and storage of the branches supported by a node by combining multiple intention encodings into a single mask value, laying a foundation for subsequent fast matching judgment.

[0093] S103, obtaining user input content in the current dialogue process, and identifying a user intention from the user input content and querying an encoding corresponding to the user intention from the intention encoding mapping table as a user intention encoding.

[0094] It should be noted that the user input content refers to the original interactive information provided by the user through voice or text. The user intention refers to the structured intention information extracted from the user input content, indicating the core purpose or demand that the user wants to express. The user intention encoding refers to the power value encoding corresponding to the identified user intention, which is used for subsequent branch matching judgment.

[0095] In some embodiments, step S103 includes:

[0096] obtaining the user input content in the current dialogue process through a voice interface and / or a text interface, wherein the user input content includes voice input text, and the voice input text is text content obtained by converting voice input content obtained by the voice interface through a preset ASR service model;

[0097] The user input content is cleaned, segmented, and stop word removed to obtain target input content;

[0098] The target input content is identified by regular matching, keyword recognition, or a preset machine learning model to determine the user intent.

[0099] The encoding corresponding to the user intent is queried from the intent encoding mapping table as the user intent encoding.

[0100] In this embodiment, the user input content in the current dialogue flow is first obtained through a voice interface and / or a text interface. The user input content refers to the original information provided by the user in the interaction process, which can be in the form of voice or text. The voice interface is usually implemented based on WebRTC, audio acquisition SDK, etc. and is responsible for collecting and transmitting the user's voice data; the text interface obtains the user's input text content through input boxes, chat windows, and other UI components. In the voice interaction scene such as intelligent outbound call, the user input is mainly provided in the form of voice. When the user input is voice, a preset ASR service model is called to convert the voice into text content. ASR (Automatic Speech Recognition) is a technology that automatically converts human speech into text, and its core principles include acoustic models and language models: acoustic models convert speech signals into phonemes or other acoustic units, and language models predict the most likely sequence of characters based on context. It should be noted that modern ASR systems are usually implemented based on deep learning technologies such as LSTM, Transformer, etc. and can provide high recognition accuracy in various noise environments and accents. This embodiment can call third-party ASR services (such as APIs provided by Ali Cloud, Baidu, and Xunfei) or deploy self-developed ASR models. The converted text is referred to as voice input text, which serves as the basis for subsequent processing.

[0101] Next, the user input content is cleaned, segmented, and stop word removed to obtain target input content. Text cleaning refers to removing noise, errors, and irrelevant content from the text, such as special characters, repeated words, misspelled words, etc.; segmentation is to divide Chinese and other texts without natural separators into meaningful word units; and stop word removal is to remove functional words that contribute less to intent recognition, such as "of", "of", "of", etc. Through preprocessing, the accuracy and efficiency of subsequent intent recognition can be improved, and the target input content obtained after processing is a normalized text that is more suitable for semantic analysis and intent recognition.

[0102] Then, this embodiment uses regular expression matching, keyword recognition, or a pre-defined machine learning model to identify the target input content and determine the user's intent. Regular expression matching is a pattern-matching-based text processing technique that uses predefined regular expression rules to identify specific patterns in the text; keyword recognition is based on a pre-defined keyword list to detect whether the text contains specific words or phrases; machine learning models, such as classifiers and sequence labeling models, automatically identify the intent category of new text by learning patterns from historical data. These methods can be used individually or in combination to improve recognition accuracy.

[0103] For example, taking regular expression matching as an example, the following rule might be maintained: regular expression "". (Okay | Yes | Agreed | Yes) → Matches the "affirmative" intent; regular expression. (No | Not needed | Refuse | Not interested) → Matches the intent of "negation"; regular expression. (Reconsider | Uncertain | Possibly | Will decide later) → Matches the intent of “uncertainty”.

[0104] In this embodiment, user intent is an abstract representation of the core intention and purpose currently expressed by the user, typically represented by predefined labels or categories. The identified user intent serves as a key basis for determining process branches. Finally, the code corresponding to the user intent is retrieved from the intent encoding mapping table and used as the user intent code. The user intent code is the power-law encoding value corresponding to the current user's expressed intent, obtained by querying the intent encoding mapping table created above. This code will be used in subsequent steps to perform bitwise operations with the node mask value to determine whether it matches a specific branch.

[0105] For example, if the user's current intent is identified as "negation", the corresponding code 2 is retrieved from the intent encoding mapping table and used as the current user intent code.

[0106] Therefore, this embodiment transforms the user's natural language input into a structured intent representation and further maps it into an encoding form that is easy for computers to process, providing input parameters for subsequent efficient bitwise operations. Furthermore, through preprocessing and recognition, the user's intent can be accurately understood, improving the interactive experience and process efficiency.

[0107] S104. Extract the target node mask value corresponding to the current process node in the node mask configuration table, perform bitwise operations on the user intent encoding and the target node mask value, and determine whether it matches the intent branch supported by the current process node based on the bitwise operation result.

[0108] In the present application, the target node mask value refers to the mask value corresponding to the node in which the current dialogue flow is located in the node mask configuration table. Bit operation refers to logical operation at the binary level, and in the present embodiment, bitwise AND (&) operation is mainly used. The principle of bitwise AND operation is to perform AND operation on each bit of two operands, and only when the corresponding bits of the two operands are both 1, the corresponding bit of the result is 1, otherwise it is 0.

[0109] In some embodiments, step S104 comprises:

[0110] identifying the flow node in which the current dialogue flow is located, querying the node mask value corresponding to the identified flow node in the node mask configuration table as the target node mask value;

[0111] performing bit operation on the user intent encoding and the target node mask value to obtain a bit operation result;

[0112] judging whether the bit operation result is consistent with the user intent encoding;

[0113] If it is judged that the operation result is consistent with the user intent encoding, it is confirmed that the intent branch supported by the current flow node is matched.

[0114] In the present embodiment, the flow node in which the current dialogue flow is located needs to be identified first. The flow node is the basic constituent unit in the dialogue flowchart, representing a state or step in the process of flow execution, and each node has a unique identifier (node ID) and carries a specific business function. The present embodiment tracks the flow node in which each dialogue instance is currently located by maintaining session state information (Session State). The session state information is usually stored in memory cache or persistent storage, and contains current node ID, historical path, context parameters and other key information. Identifying the current node is the premise of subsequent matching judgment, ensuring that the user intent can be interpreted in the correct context.

[0115] After determining the current flow node, the present embodiment queries the node mask value corresponding to the identified flow node in the node mask configuration table as the target node mask value. The target node mask value refers to the encoding combination value of all intent branches supported by the current flow node, and each bit in its binary representation corresponds to a possible intent branch. The query process is usually implemented based on hash table, and the time complexity is O(1), that is, no matter how many nodes there are, the query operation can be completed in constant time. This efficient query is one of the key factors of the performance advantage of the present method.

[0116] Next, the user intent encoding and the target node mask value are subjected to a bitwise operation to obtain a bitwise operation result. The bitwise operation is a high-efficiency calculation method of directly operating binary bits. In this embodiment, a bitwise AND operation (symbol "&") is used. The principle of the bitwise AND operation is that the corresponding bit of the result is 1 only when the corresponding bits of the two operands are both 1, otherwise the corresponding bit of the result is 0. In this embodiment, the bitwise AND operation is used to check whether the current user intent belongs to the branch set supported by the node. Specifically, when the corresponding bit of the user intent encoding in the binary representation of the node mask value is 1, it indicates that the node supports this intent branch; if the corresponding bit is 0, it indicates that it is not supported.

[0117] For example, assuming that the current node mask value is 11 (binary 1011, indicating that the "affirmative", "negative", and "reject" intents are supported), and the user intent encoding is 2 (binary 0010, indicating the "negative" intent), the bitwise operation result is 2&11=2 (binary 0010).

[0118] Then, the embodiment determines whether the bitwise operation result is consistent with the user intent encoding. It should be noted that this determination is based on a key principle: if the node supports a specific intent branch, then the result of the bitwise AND operation between the intent encoding and the node mask value should be equal to the intent encoding itself. This is because in the power-of-two encoding system, each intent encoding has only one bit as 1 in the binary representation. If the bit in the node mask value is also 1 (indicating that the intent is supported), the result of the bitwise AND operation will keep the bit as 1 and the remaining bits as 0, i.e., equal to the original intent encoding. The equality determination can be achieved through a simple integer comparison, with a time complexity of O(1).

[0119] Then, if it is determined that the operation result is consistent with the user intent encoding, it is confirmed that the intent branch supported by the current flow node is matched. A successful match indicates that the user's current expression of intent is one of the valid branches preset by the node, and the embodiment should continue processing according to the logic corresponding to the branch. If the operation result is not consistent with the user intent encoding, it indicates that the current node does not support the intent branch, and the user may need to be prompted to re-enter or the default processing logic may be executed.

[0120] It should be noted that the traditional method usually needs to traverse all branch conditions supported by the node, with a time complexity of O(n), where n is the number of branches. In this embodiment, the branch matching determination method based on bitwise operation has a time complexity of O(1), and no matter how many branches there are, only one bitwise AND operation and one comparison operation need to be performed. This constant-time complexity determination mechanism is particularly important in high-concurrency and large-scale node scenarios, and can significantly improve the response speed and throughput.

[0121] Therefore, the embodiment realizes the rapid judgment of the branch condition through the efficient bit operation mechanism, converts the traditional traversal judgment into a single bit operation operation, greatly improves the system performance, and meanwhile maintains the clarity and maintainability of the judgment logic.

[0122] In S105, a target process node corresponding to the matched intent branch is determined based on the matching result, and node execution information required by the target process node is generated to enable process jump to the target process node according to the node execution information. The node execution information includes execution context and parameter information.

[0123] In the present application, first, a target process node corresponding to the matched intent branch is determined based on the matching result. The target process node refers to the next process node that should be executed after the matching is successful, representing the next state or step of process execution. Determining the target node usually depends on process configuration information, which defines the conversion relationship and conditions between nodes. The present application maintains a process conversion mapping table (Transition Mapping Table), which records the correspondence between the source node, the trigger intent and the target node. When the matching is successful, the corresponding target node ID is queried from the mapping table according to the current node ID and the matched intent. For example, if the current node is "ask for loan intention", the matched intent is "negative", and the corresponding target node may be "end process".

[0124] Next, the present application generates the node execution information required by the target process node. The node execution information refers to various data and context environment required to support the correct execution of the target node, which is a key mechanism for data transmission and state maintenance between nodes. The node execution information mainly includes two parts: execution context and parameter information. The execution context (ExecutionContext) refers to the environment and state information required for node execution, including session ID, user identification, current session state, historical interaction record, etc. The parameter information (Parameter Information) is the specific business data required for node execution, such as user intent content, intent confidence, extracted key entity, form filling state, etc.

[0125] The process of generating node execution information includes: first, extracting basic context information from the current session state; second, determining the specific parameters to be transmitted according to the type of the matched intent; third, extracting possible entity information or business data from user input; and finally, integrating these information into a standard format of execution information data packet. These information is usually organized in JSON or other structured format, facilitating efficient transmission and processing between nodes.

[0126] Then, the system performs process jump to the target process node according to the node execution information. Process jump refers to the process of transferring control from the current node to the target node, which is the core mechanism of advancing the dialogue process. Jump execution usually includes the following steps: first, the system updates the session state, recording information such as the current node ID, matched intent, and timestamp; second, the generated execution information is passed to the target node; then, the initialization method of the target node is called to prepare the execution environment; finally, the main processing logic of the target node is activated to start the next operation.

[0127] In actual implementation, process jump can be implemented through various technical means, such as function call, event triggering, message queue, etc. In a distributed system, jump may involve cross-service communication, which needs to be implemented through mechanisms such as RPC, REST API, or message middleware. Regardless of the technical implementation, the key is to ensure the complete transfer of execution information and the consistency of state maintenance.

[0128] In addition, the present application usually performs log recording and monitoring reporting before and after executing the jump. Logging is used to record the jump path, execution time, and key parameters, facilitating post-auditing and problem diagnosis; monitoring reporting is used to collect performance indicators and business indicators, supporting real-time monitoring and analysis of the running status.

[0129] Therefore, the present application realizes the orderly advancement and state transfer of the dialogue process through standardized node execution information and process jump, ensuring that the corresponding business logic can be correctly executed according to the user intent, providing a coherent and natural dialogue experience. At the same time, the perfect log and monitoring mechanism provides necessary support for operation and continuous optimization.

[0130] In some embodiments, the present embodiment further provides a composite coding structure based on service level objectives. The node mask value includes a node composite mask value; based on the set of intent branches supported by the process node, querying the target code corresponding to each intent branch in the set of intent branches from the intent encoding mapping table, performing bit operations on the at least one target code obtained by querying, to generate a node mask value, to form a node mask configuration table, further comprising:

[0131] allocating a service level objective priority to each intent branch in the set of intent branches, the service level objective priority including key branches, core branches, and ordinary branches sorted in descending order of priority;

[0132] based on the service level objective priority of the intent branch, the target code of the intent branch is extended to a composite code with multiple levels, wherein a first level in the composite code represents the target code, a second level in the composite code represents a priority code corresponding to the service level objective priority, and a third level in the composite code represents a business domain code related to a business domain and / or a scenario code related to a scenario type;

[0133] bit operation combination is performed on the composite codes corresponding to the intent branches supported by the flow node to generate a node composite mask value of the flow node.

[0134] In the embodiment, the concept of service level objective (SLO) is introduced to prioritize the intent branches. The service level objective is a quantitative indicator for measuring service quality, which is used in the embodiment to distinguish the importance and processing priority of different intent branches. According to the business importance and response time requirement, the intent branches are divided into three priority levels: critical branch, core branch and regular branch. The critical branch usually involves core business processes or emergency handling, which requires the highest priority guarantee; the core branch involves important but non-urgent business scenarios; the regular branch is a general function or a secondary business scenario. Then, through priority classification, the original single-level power value coding is extended to a multi-level composite coding structure. The composite coding is a technology for encoding multi-dimensional information into a single integer value, which realizes compact representation and efficient processing of information through bit segment division. In the embodiment, the composite coding contains three levels: the first level (usually low 8 bits or 16 bits) represents the basic intent code, i.e. the power value coding assigned above; the second level (middle 8 bits or 16 bits) represents the priority code corresponding to the service level objective priority, which is used to identify the processing priority of the intent branch; the third level (high 8 bits or 16 bits) represents the business domain code and / or the scenario code, which is used to distinguish the intents of different business domains or application scenarios.

[0135] For example, in a 32-bit integer composite code, the possible coding structure is: bits 0-7 represent the basic intent code (up to 8 different intents); bits 8-15 represent the priority code (e.g. critical branch = 1, core branch = 2, regular branch = 3); bits 16-23 represent the business domain code (e.g. loan business = 1, credit card business = 2); bits 24-31 represent the scenario code (e.g. outbound scenario = 1, online customer service scenario = 2).

[0136] Then, based on the composite coding structure, the "affirmative" intent of the "key" priority in the "loan business" domain can be coded as 0x01010001 (hexadecimal), where 01 represents the outbound call scenario, 01 represents the loan business, 01 represents the key priority, and 01 represents the "affirmative" intent. The present embodiment performs bit operation combination on the composite codes corresponding to the intent branch supported by the flow node to generate a node composite mask value. The node composite mask value is the result of combining multiple composite codes through bit operation (usually bitwise OR), and contains the multi-dimensional information of all intent branches supported by the node in binary representation. Through the composite mask structure, the present embodiment can consider more dimensional information in the matching judgment, and realize more fine-grained branch management.

[0137] In the branch matching judgment stage, first, the target node composite mask value is pre-screened by the current business domain mask. Mask pre-screening refers to quickly filtering out relevant mask information under a specific business domain or scenario through bit operation, reducing the data amount for subsequent processing. In this way, through the bitwise AND operation of the composite mask and the business domain mask, the processing efficiency of a large-scale multi-domain system can be significantly improved. Then, according to the current load condition and the quality of service target, the priority strategy for execution judgment is determined. The priority strategy is a rule set for adjusting the branch processing order and resource allocation under different load conditions. The current load condition is judged by monitoring indicators such as CPU usage, memory occupancy, and request queue length. If the current load condition exceeds the preset threshold, high-priority branches are processed first to ensure the response time of core business processes; in the case of low load, all priority branches can be processed in parallel to improve the overall throughput. Finally, the user intent code and the target node composite mask value are subjected to bit operation, and the operation result is used to judge whether the target intent branch supported by the current flow node is matched, which considers more dimensional information and can realize more fine-grained branch matching control.

[0138] Therefore, the composite coding mechanism based on the service level target in the present embodiment can maintain efficient bit operation judgment while obtaining differentiated service quality management capability. Through dynamic adjustment of the priority strategy, the execution efficiency of key business processes can be prioritized in the case of resource constraints, while the overall throughput capacity is maximized when resources are sufficient, achieving a balance between performance and business importance.

[0139] In some embodiments, the target node mask value includes a target node composite mask value; and the extracting, from the node mask configuration table, the target node mask value corresponding to the flow node where the current dialogue flow is located, and performing bit operation on the user intent code and the target node mask value, and judging whether the intent branch supported by the current flow node is matched according to the bit operation result, further includes:

[0140] mask pre-screening the target node composite mask value according to a current service domain to obtain a to-be-processed intent branch supported by a current flow node;

[0141] determining a priority policy for performing the judgment according to a current load condition and a quality of service target, and judging the target intent branch according to the priority policy, wherein the priority policy is used to indicate that when the current load condition is higher than a preset load threshold, a to-be-processed intent branch with a service level target priority indicated by a priority code in the target node composite mask value higher than a preset priority condition is preferentially judged, or when the current load condition is lower than the load threshold, all to-be-processed intent branches are judged in parallel;

[0142] performing a bit operation on the user intent code and the target node composite mask value, and judging whether the target intent branch supported by the current flow node is matched according to a bit operation result.

[0143] In the embodiment, when it is needed to judge whether the user intent is matched with the support branch of the current flow node, a mask pre-screening operation is needed first. The mask pre-screening is a technology for quickly narrowing the range of candidate intents through bit operation, and is used for preliminary filtering in a specific dimension (such as a service domain) to reduce the amount of data for subsequent processing. Specifically, the current service domain is determined first. The service domain refers to a specific business field or functional module, such as a loan business, a credit card business, customer service, etc. Each service domain occupies a specific bit segment in the composite code, usually in the high bit part.

[0144] The embodiment realizes the pre-screening by constructing a service domain mask (Domain Mask). It should be noted that the service domain mask is a special bit mask, in which only the bit segment corresponding to the target service domain is 1, and the other bit segments are 0. For example, if the current service domain is "loan business", the corresponding code is 1, which is located in the 16-23 bit of the composite code, and the service domain mask can be 0x01000000 (hexadecimal). The embodiment performs a bit-wise AND operation on the target node composite mask value and the service domain mask to quickly screen out the mask information related to the current service domain. Through the pre-screening, it is particularly important in a large-scale multi-domain system to significantly reduce unnecessary calculation amount and improve system response speed. After the pre-screening, the embodiment obtains the to-be-processed intent branch supported by the current flow node. The to-be-processed intent branch refers to the set of intent branches that can be supported by the current node after the service domain pre-screening. These branches belong to the current service domain, but can have different service level target priorities and need to be processed differently according to the load condition.

[0145] Next, the embodiment determines the priority strategy for execution judgment according to the current load condition and the service quality target. The load condition refers to the current resource occupation condition, which is usually measured by multiple indicators such as CPU usage, memory occupation rate, request queue length, average response time, etc. The embodiment monitors these indicators in real time and compares them with the preset load threshold to determine whether the current state is high load or low load. The load threshold is a critical value preset according to performance characteristics and business requirements, such as CPU usage exceeding 80%, request queue length exceeding 1000, etc.

[0146] In this embodiment, the priority strategy defines how to handle different priority intent branches under different load conditions. Specifically, when the current load condition is higher than the preset load threshold, the priority filtering mode is adopted to prioritize high-priority intent branches. In this mode, the priority code is first extracted from the pending intent branches and compared with the preset priority condition. The priority code is a bit segment in the composite code that represents the priority of the service level target, usually located in the middle position (such as bits 8-15). The preset priority condition is a threshold set by the administrator according to the importance of the business, used to distinguish branches that need to be processed first under high load conditions.

[0147] For example, if the priority code of critical branches is set to 1, the priority code of core branches is set to 2, and the priority code of ordinary branches is set to 3, and the preset priority condition is "less than or equal to 2", then under high load conditions, critical branches and core branches will be processed first, and the processing of ordinary branches will be temporarily suspended, ensuring that the execution efficiency of critical business processes can be guaranteed under resource constraints.

[0148] On the contrary, when the current load condition is lower than the preset load threshold, the parallel judgment mode is adopted to process all pending intent branches simultaneously. In this mode, the priority difference is not considered, and the available resources are maximized to improve overall throughput. Parallel judgment can be achieved through multi-threading, asynchronous computing or vectorization operations, etc., which can provide optimal performance when resources are sufficient.

[0149] By determining the priority strategy, the embodiment processes the pending intent branches to obtain the target intent branches. The target intent branches refer to the set of intent branches that need to be matched and judged after the priority strategy filtering. Under high load conditions, the target intent branches are usually a subset of high-priority branches; under low load conditions, the target intent branches include all pending branches.

[0150] Finally, the embodiment encodes the user intent and performs a bitwise operation on the composite mask value of the target node. According to the result of the bitwise operation, it is determined whether the target intent branch supported by the current flow node is matched. The multi-level structure of the composite encoding is considered. Specifically, the embodiment needs to construct a composite query mask corresponding to the user intent encoding. The mask remains unchanged in the intent encoding bit segment, and uses a wildcard (all 1) in other bit segments (such as priority, business domain). Then, the embodiment performs a bitwise AND operation on the composite query mask and the target node composite mask value, and checks whether the result contains the feature bit pattern of the user intent encoding.

[0151] For example, assuming that the user intent is "affirmative" (basic encoding is 1), the current business domain is "loan business" (encoding is 1), and the composite query mask constructed by the embodiment is 0xFFFF0001 (hexadecimal, where FFFF represents that the priority and business domain bit segments use wildcards). If the target node composite mask value is 0x01010007 (indicating that it supports "affirmative", "negative" and "uncertain" intents, all of which are "key" priorities in the "loan business" domain), the result of the bitwise AND operation is 0x01010001, which contains the feature bit of the "affirmative" intent, so it is determined that the match is successful.

[0152] Therefore, through this matching based on composite mask and dynamic priority strategy, the embodiment can achieve the following technical advantages: First, through the multi-level encoding structure, more rich semantic information can be encoded in a single integer value, supporting more fine-grained branch management and control. Compared with the single-layer encoding in the basic scheme, the composite encoding can express multi-dimensional information such as intent, priority, business domain, etc., providing more rich decision basis for the system. Second, the mask pre-screening mechanism based on business domain significantly improves the processing efficiency of large-scale multi-domain systems. In a complex system containing multiple business domains, through the business domain mask, more than 90% of unnecessary calculations can be reduced, especially in the cross-domain calling scenario under the micro-service architecture, this optimization is particularly important. Third, through the dynamic priority strategy, the processing logic can be adaptively adjusted according to the load status, and in the case of resource limitation, the key business process is prioritized, and in the case of sufficient resources, the overall throughput is maximized. This differentiated quality of service management capability is crucial for high-availability systems that need to run 24 / 7, and can still maintain the responsiveness of core functions under peak load. Finally, although the multi-level structure and dynamic strategy are introduced, the embodiment still maintains the high efficiency of bitwise operation. All judgment operations are still based on bitwise mask and bitwise operation, and the time complexity remains O(1), ensuring that the performance is not sacrificed while enhancing the function.

[0153] In practical applications, this composite mask mechanism is particularly suitable for complex intelligent dialogue systems with multiple service lines and multiple scene fusion. For example, in a comprehensive service platform in the financial industry, dialogue processes of multiple business domains such as loans, credit cards, and investment and financial planning may be processed at the same time. Through composite masking and priority strategy, the responsiveness of core transaction processes can be prioritized during peak periods, while providing comprehensive service capabilities during idle time, achieving the best balance between resource utilization and user experience.

[0154] In some embodiments, the present embodiment further provides a state management mechanism based on causal caching. The generating an intent encoding mapping table by assigning a power value of a specified base to each intent in a preset intent category set also includes:

[0155] A version number and a timestamp are assigned to each set of intent encoding mapping tables, and a corresponding vector clock is marked for an update event of the intent encoding mapping table. Based on the version number, the timestamp, and the vector clock, an encoding dependency graph is established, which is used to indicate that the related encodings in the intent encoding mapping table are updated according to a causal order;

[0156] The target flow node corresponding to the matched intent branch is determined based on the matching result, and node execution information required by the target flow node is generated, so that flow jumping to the target flow node is performed according to the node execution information, including:

[0157] When determining the target flow node, the state information of the current flow node is obtained;

[0158] A corresponding state dependency chain is determined for each flow instance, which is used to indicate the state dependency relationship between the flow nodes related to the flow instance;

[0159] Based on the state information of the current flow node, the state dependency chain of the flow instance, the vector clock, and the encoding dependency graph, a causal identifier marked on the target flow node is generated;

[0160] A multi-level causal caching structure is determined, including a local cache, a service cache, and a global cache;

[0161] Based on the causal dependency relationship of the cache items in the multi-level causal caching structure, a causal dependency directed graph is formed, and a cache invalidation strategy is determined based on the causal dependency directed graph;

[0162] The state information of the flow node is converted into a highly compressed bitmap representation, and the bitmap representation is stored in a state slice based on the flow node and the corresponding time window according to the multi-level causal caching structure and the multi-level causal caching structure.

[0163] In this embodiment, the corresponding vector clock is marked for the update event of the intent encoding mapping table. The vector clock is a logical clock mechanism used to track the causal relationship of events in distributed systems, which does not rely on the global synchronization of physical time, but maintains a vector to record the logical time of each node. In this embodiment, the vector clock is used to track the update order and causal dependence of the intent encoding mapping table in a distributed environment. Specifically, each vector clock is an N-dimensional vector, where N is the number of nodes, and the i-th element of the vector represents the logical time known by node i. When a node performs a local event (such as updating the mapping table), it increases the value of its corresponding element; when a node receives a message from another node, it merges its vector clock with the vector clock in the message, taking the maximum value of each element.

[0164] For example, in a system containing 3 nodes, the initial vector clock is [0, 0, 0]. If node 1 updates the mapping table, it will increase its clock to [1, 0, 0]; if node 2 subsequently modifies the mapping table based on node 1's update, its vector clock will become [1, 1, 0]. This mechanism ensures that the "happens-before" relationship between events can be identified, even if the events are on different nodes.

[0165] Then, based on the version number, timestamp and vector clock, an encoding dependency graph is established. The encoding dependency graph is a directed graph structure used to represent the dependencies and causal relationships between intent encodings. In the graph, nodes represent specific versions of intent encodings, edges represent dependencies between encodings, and weights may represent dependency strength or update frequency. Through the graph structure of the encoding dependency graph, the evolution history of the encoding can be tracked, the mutual influence between different encoding versions can be understood, and the correct causal order can be followed when updating is needed.

[0166] Specifically, the construction process of the encoding dependency graph includes: first, representing each version of the intent encoding mapping table as a node in the graph; second, determining the "happens-before" relationship between nodes by analyzing the vector clock and adding the corresponding directed edge; third, determining the dependency type and strength based on the type of update operation (such as addition, deletion, modification); finally, determining the optimal order of encoding updates through graph algorithms (such as topological sorting). Therefore, by constructing the encoding dependency graph, not only does it support the system to maintain consistency, but it also provides a visualization and analysis tool for the evolution of intent encodings.

[0167] In the process node jumping link, the embodiment introduces state dependence and causal consistency mechanism. First, when determining the target process node, the state information of the current process node is obtained. The state information is a data set describing the current running state of the process node, including node ID, execution phase, context variable, input and output parameter, etc. These information together constitute the complete state description of the node, which is the basis for process continuous execution and state recovery. Next, the embodiment determines the corresponding state dependence chain for each process instance. Process instance refers to the running instance of specific process being executed in a specific user session, each instance has a unique identifier and independent execution state. The state dependence chain is an ordered list or chain structure, which is used to describe the state dependence relationship between nodes in the process instance. The dependence relationship is usually based on data flow and control flow analysis: if node B uses the data generated by node A, or the execution condition of node B depends on the execution result of node A, then node B is dependent on node A. Through the state dependence chain, the propagation path of node state can be understood, which provides the basis for consistency maintenance and fault recovery.

[0168] Further, based on the state information of the current process node, the state dependence chain and vector clock of the process instance, and the encoding dependence relationship graph, the causal identifier marked on the target process node is generated. The causal identifier is a special metadata mark used to represent the causal relationship between the target node and its dependent nodes. It usually contains the current vector clock, dependent node list and state summary information, which can verify the causal consistency in subsequent execution and ensure that the nodes are executed in the correct causal order. The generation process of the causal identifier comprehensively considers the direct dependence relationship in the state dependence chain and the indirect dependence relationship in the encoding dependence relationship graph, forming a complete causal description.

[0169] In order to efficiently manage node state and causal relationship, the embodiment determines a multi-level causal cache structure. The multi-level causal cache is a hierarchical cache architecture used to store and manage the state information and causal relationship data of process nodes. The cache architecture includes three levels: local cache, service cache and global cache. Among them, the local cache is located inside a single service instance, uses memory storage, provides the fastest access speed but limited capacity; the service cache is shared among multiple instances of the same service, usually implemented using distributed memory cache such as Redis, providing faster access speed and moderate capacity; the global cache is shared among all services in the entire system, usually implemented based on distributed cache cluster or database, providing the largest capacity but relatively slow access speed.

[0170] Therefore, the embodiment adopts the design concept of CPU cache in computer architecture by using multi-level cache structure, balances the access speed, capacity and consistency maintenance cost through the cooperative work of different levels of cache. When accessing the state of a node, the local cache is checked first, and if it is not hit, the service cache and global cache are queried in turn; the write operation adopts the write-through or write-back strategy to ensure the consistency of different levels of cache. Based on the causal dependency relationship of cache items in the multi-level causal cache structure, a causal dependency directed graph is formed. The causal dependency directed graph is a special graph structure used to represent the causal dependency relationship between cache items. In the graph, nodes represent cache data items (usually process node states), and edges represent the causal dependency between data items, which can track the dependency chain of data items and support consistency maintenance and invalidation propagation.

[0171] Specifically, the process of constructing the causal dependency directed graph includes: first, each cache data item is represented as a node in the graph; second, the dependency relationship between data items is analyzed based on the state dependency chain and the encoding dependency graph, and the corresponding directed edges are added; then, the edges are assigned weights to represent the dependency strength or update frequency; finally, the graph structure is optimized by graph algorithm to remove redundant edges or merge similar nodes, improving the efficiency of subsequent operations.

[0172] Further, based on the causal dependency directed graph, a cache invalidation strategy is determined. The cache invalidation strategy defines a set of rules for identifying and processing other data items affected when a certain data item is changed. In traditional cache systems, the invalidation strategy is usually based on time (such as TTL) or capacity (such as LRU, LFU); while in systems with complex causal dependencies, the invalidation strategy needs to consider the dependency relationship between data items to ensure consistency.

[0173] Specifically, the cache invalidation strategy adopted by the embodiment is based on the analysis of the causal dependency directed graph, mainly including the following mechanisms:

[0174] Firstly, we adopt a Cascading Invalidation mechanism. When a data item is changed, we identify all the data that directly or indirectly depends on it through the causal dependency directed graph and mark them as invalid. This ensures consistency on the dependency chain, but may cause large-scale invalidation and increase system load. Secondly, we introduce a Priority-based Invalidation mechanism. According to the importance, access frequency and dependency strength of data items, we assign priorities to them. In the case of resource constraints, we prioritize the consistency of high-priority data. This differentiated strategy balances consistency and performance, suitable for large-scale distributed systems. Finally, we implement a Lazy Validation mechanism. Instead of immediately deleting or updating all affected cache items, we add validation tags to them. When these items are accessed next time, we check whether the data they depend on has been changed. Only when necessary do we perform actual updates. This on-demand validation mechanism significantly reduces unnecessary calculations and network transmissions, improving system efficiency.

[0175] To further optimize storage efficiency, we convert the state information of flow nodes into a highly compressed bitmap representation. Bitmap representation is a technique that encodes complex data structures into binary bit sequences, which can significantly reduce storage space requirements. In this embodiment, bitmap representation is mainly used to encode the state information of flow nodes, including execution phase, input and output parameters, context variables, etc. The conversion process usually includes the following steps: first, define the state encoding mapping to determine the position and encoding rules of various state information in the bitmap; second, convert the state information into a binary sequence according to the predefined rules; then, apply bit compression algorithms (such as run-length encoding, Huffman encoding, etc.) to further reduce data volume; finally, add check bits to ensure data integrity. This bitmap representation not only reduces storage space, but also improves serialization and transmission efficiency, especially suitable for state management in large-scale distributed systems.

[0176] Further, based on the multi-level causal cache structure and causal dependency, the embodiment stores state slice storage of bitmap representation based on process nodes and corresponding time windows. Among them, state slice is a technology that decomposes large state data into multiple smaller fragments for independent storage, which can improve parallel processing capability and fault isolation. Time window refers to a set of state data within a specific time range, which is usually divided based on the time dimension of process execution. Specifically, the implementation of state slice storage includes the following mechanisms: first, determine the slicing strategy according to node ID and time window, divide the state data into multiple logical slices; second, allocate storage locations for each slice, which may be distributed on different cache levels or physical nodes; third, maintain a slice index table to record the mapping relationship between slices and storage locations; finally, implement slice access and aggregation logic to support cross-slice state query and update operations.

[0177] Optionally, by introducing time windows, time-dimension state management can be achieved, such as preserving historical state snapshots, supporting point-in-time recovery, or performing time series analysis. Typical time window strategies include fixed windows (dividing the time axis into equal-length intervals), sliding windows (continuous intervals over time), and session windows (dynamic intervals based on activity intervals). The embodiment can select appropriate window strategies according to business needs and resource conditions, balancing storage costs and query performance.

[0178] Therefore, through state management based on bitmap representation and slice storage, there are several technical advantages: first, bitmap representation significantly reduces storage space requirements, with actual measurements showing a reduction of more than 70% compared to JSON format; second, slice storage improves parallel processing capability, allowing simultaneous processing of multiple slice state data; third, time window-based management supports historical state access and point-in-time recovery, enhancing reliability and maintainability; finally, combined with multi-level cache and causal dependency management, it ensures the consistency and availability of state data in a distributed environment.

[0179] In practical applications, this complex state management and causal consistency mechanism is particularly suitable for large-scale distributed intelligent dialogue systems. For example, in a cross-regional deployed financial service platform, the embodiment may handle millions of users' dialogue processes simultaneously, each with independent state and execution path. Through the above technical means, the embodiment can ensure state consistency while providing high-performance, high-availability service experience, even in the case of network partitioning or node failure, maintaining basic functionality and significantly improving system robustness and reliability.

[0180] Therefore, the embodiment supports complex multi-turn dialogues and context understanding through state management. In the intelligent customer service scenario, the interaction between the user and the system usually spans multiple rounds, and the dialogue context needs to be accurately understood and maintained. Through accurate modeling of causal dependency and efficient state management, the context continuity can be maintained during a long dialogue process, the evolution of the user's intention can be accurately understood, and a coherent and natural interaction experience can be provided. Practice has proved that this mechanism can improve the context understanding accuracy in complex multi-turn dialogues by more than 15%, which is significantly better than the traditional dialogue management method based on a simple state machine.

[0181] In some embodiments, the embodiment further provides an encoding automatic optimization mechanism based on static analysis and Monte Carlo tree search. The encoding is assigned to each intent in the preset intent category set by specifying the power value of the base, and an intent encoding mapping table is generated. It also includes:

[0182] Through a preset static analysis algorithm, a business process and historical interaction data corresponding to the business process are determined, and an intent association graph is constructed based on the business process and the historical interaction data. According to the constructed intent association graph, an intent feature vector and a conflict recognition result are generated. The intent association graph is used to indicate the correlation and mutual exclusivity between intents;

[0183] Based on the intent feature vector and the conflict recognition result, an intent conflict set is formed, and a preset global intent pool is grouped according to the conflict relationship based on the intent conflict set, forming a relatively independent encoding domain. The intent conflict set is used to indicate the conflict relationship between intents that do not logically share the same encoding bit.

[0184] A search space for encoding allocation is constructed, and the search space is traversed. In combination with the encoding domain, a pre-established Monte Carlo tree search model is used to search for an encoding allocation scheme until the conflict is minimized and the encoding efficiency is maximized, obtaining the current encoding allocation scheme. The encoding allocation scheme is used to indicate that the encoding is assigned to the intent by specifying the power value of the base;

[0185] Divide the 32-bit or 64-bit integer space according to the business domain to form a multi-layer encoding structure. According to the multi-layer encoding structure, the current encoding allocation scheme is optimized to an encoding mapping scheme;

[0186] Obtain the usage frequency and hit rate of the encoding of each intent in the current actual use process. According to the usage frequency and the hit rate, train an encoding efficiency prediction model, and according to the encoding efficiency prediction model, optimize the current encoding allocation scheme.

[0187] In this embodiment, an intent association graph is constructed based on business processes and historical interaction data. The intent association graph is a special weighted directed graph that represents the correlation and mutual exclusivity between different intents. In the graph, nodes represent intent categories, edges represent relationships between intents, and edge weights represent relationship strengths. Correlation refers to the tendency of two intents to co-occur in the same session or adjacent nodes, usually quantified by conditional probability or mutual information indicators; mutual exclusivity refers to the degree to which two intents cannot coexist in the same context, usually determined by exclusivity analysis or opposite intent recognition.

[0188] Specifically, the process of constructing the intent association graph includes: first, extracting intent transition sequences from historical interaction data, recording the frequency of intent A followed by intent B; second, calculating the conditional probability and mutual information between intent pairs through statistical analysis; third, analyzing the logical relationships between intents based on business process graphs, such as mutual exclusivity or mutual dependence; finally, constructing a complete association graph by integrating the above information, where the edge weights consider both statistical correlation and logical relationships. For example, "affirmative" and "negative" intents are logically exclusive, even if they may statistically co-occur (e.g., user utterances contain both affirmative and negative expressions), this embodiment will mark them as mutually exclusive based on logical relationships.

[0189] Then, based on the constructed intent association graph, intent feature vectors and conflict recognition results are generated. The intent feature vector is a multi-dimensional numerical representation that describes the position and characteristics of an intent in the association network, usually containing indicators such as centrality (measuring the importance of the intent), clustering coefficient (measuring the association tightness with adjacent intents), transition probability (measuring the tendency to transition to other intents), etc. The conflict recognition result is a list of intent conflicts obtained by analyzing mutual exclusivity in the intent association graph, recording which intents should avoid using the same bit when encoding is assigned. Specifically, this embodiment calculates the structural characteristics of each intent node through network analysis algorithms (such as PageRank, centrality analysis, etc.), forming a feature vector; at the same time, it identifies mutually exclusive intent pairs through graph coloring or conflict detection algorithms, generating a conflict matrix. These analyses not only consider statistical correlation, but also integrate business rules and domain knowledge to ensure that the results meet the actual application requirements.

[0190] Further, based on the intent feature vectors and the conflict identification results, an intent conflict set is formed. The intent conflict set is a data structure used to record the set of intents that need to avoid sharing the same encoding bits during the encoding allocation process. It is usually represented as a set of intent pairs, each pair representing two intents that should not use the same encoding bits. The construction of the conflict set is not only based on mutual exclusivity analysis, but also considers encoding efficiency and performance requirements, aiming to balance encoding space utilization and conflict risk. In addition, according to the intent conflict set, the embodiment groups the pre-set global intent pool according to the conflict relationship to form relatively independent encoding domains. The global intent pool is a set of all possible intents supported, usually containing tens to hundreds of intent categories. The encoding domain is a set of relatively independent intent subsets in encoding allocation, and the intents in the domain may share encoding bits, but the intents in different domains usually use different encoding bit segments. Therefore, through the domain grouping strategy, the key to solving the large-scale intent encoding allocation problem is to divide the global optimization problem into multiple local optimization problems, significantly reducing the computational complexity.

[0191] It should be noted that the grouping process usually uses graph partitioning algorithms such as spectral clustering (Spectral Clustering) or community detection (Community Detection) algorithms to divide the intent association graph into multiple subgraphs, each subgraph corresponding to an encoding domain. The goal of partitioning is to minimize the sum of the weights of the edges between domains, i.e., to try to divide strongly related or mutually exclusive intents into the same domain and reduce cross-domain conflicts. The number and size of the domains are usually determined according to the bit width of the integer space and the business characteristics, for example, for a 32-bit integer, it may be divided into 4-8 domains, each domain using 4-8 bits of encoding space.

[0192] Further, constructing the search space of encoding assignments and traversing the search space are core steps of encoding optimization. The search space refers to the set of all possible encoding assignment schemes, the size of which grows exponentially with the number of intents. To efficiently explore this vast space, the present embodiment employs a Monte Carlo Tree Search (MCTS) model. Monte Carlo Tree Search is a heuristic search algorithm particularly suitable for large-scale search spaces and uncertain decision-making problems, widely used in game AI and combinatorial optimization. The working principle of MCTS is based on four main steps: Selection, Expansion, Simulation, and Backpropagation. In the encoding assignment problem, in the selection phase, the algorithm starts from the root node (initial state) and selects the most promising search path based on Upper Confidence Bound (UCB) or its variants; in the expansion phase, the algorithm adds new child nodes to the selected node, representing new encoding assignment decisions; in the simulation phase, the algorithm randomly simulates from the new node until the termination state, evaluating the quality of the encoding scheme; in the backpropagation phase, the algorithm propagates the evaluation results along the search path in reverse, updating the node value estimates and visit counts.

[0193] When applying MCTS for encoding assignment search, the present embodiment combines the search process with the encoding domain, prioritizing encoding assignments for intents within the domain, and then coordinating the assignment relationships between domains. The goal of the search is to minimize conflicts and maximize encoding efficiency. Conflict minimization refers to avoiding the use of encoding bits by mutually exclusive intents as much as possible, reducing ambiguity and incorrect recognition caused by intent conflicts; encoding efficiency maximization refers to pursuing a more compact encoding space and more efficient bit operation, usually achieved by reducing the number of bits used and optimizing bit distribution. It should be noted that one of the key advantages of MCTS is the ability to balance exploration and exploitation: it can both explore unknown solution spaces and exploit known high-value areas, making it very suitable for encoding assignment problems with large search spaces but obvious local patterns. The present embodiment runs MCTS multiple times through iterations, constantly optimizing the encoding assignment scheme until the preset termination condition is reached (such as the upper limit of the number of iterations, the convergence threshold, or the time limit for calculation).

[0194] After the search is completed, the present embodiment obtains the current encoding assignment scheme, which specifies the encoding assigned to each intent through the power value of the base. Specifically, each intent is assigned an integer value equal to 2 raised to the power of n (n is a specific integer), ensuring that there is only one bit set to 1 in binary representation, thereby supporting efficient bit operation.

[0195] To further optimize the encoding structure, the embodiment divides the 32-bit or 64-bit integer space by service domain to form a multi-layer encoding structure. The multi-layer encoding structure is a hierarchical division of the integer space, and different levels correspond to different semantic dimensions. For example, in a 32-bit integer space, the possible division is: bits 0-15 for basic intent encoding, bits 16-23 for service domain identification, and bits 24-31 for control flags. This hierarchical design enables the encoding to not only represent the intent itself, but also carry meta-information such as service domain and priority, enhancing the expressiveness and scalability of the encoding.

[0196] Furthermore, according to the multi-layer encoding structure, the current encoding allocation scheme is optimized to an encoding mapping scheme. Specifically, the encoding positions are adjusted to meet the hierarchical structure requirements; dedicated bit segments are allocated for different service domains; necessary control bits and metadata bits are added; and high-frequency usage intents are ensured to obtain more favorable encoding positions (such as low bits or specific bit segments). Therefore, by optimizing the encoding allocation scheme to the encoding mapping scheme, not only the static encoding structure is considered, but also the runtime performance requirements such as bit operation efficiency under specific hardware architecture, cache line alignment, and other factors are combined.

[0197] Finally, the embodiment optimizes the encoding scheme through a continuous learning mechanism. Specifically, the usage frequency and hit rate of each intent's encoding in the current actual use process are obtained. The usage frequency refers to the proportion of the number of times a specific intent is identified or processed in the running to the total number of intent processing times; the hit rate refers to the accurate matching rate of the intent encoding in the bit operation matching process, reflecting the effectiveness of the encoding design. These runtime data are collected through log analysis, performance monitoring, and user feedback, forming the empirical basis for encoding optimization.

[0198] In this embodiment, according to the collected usage frequency and hit rate data, the embodiment trains an encoding efficiency prediction model. The model is a machine learning model designed to predict the system performance and matching efficiency under different encoding allocation schemes. It usually uses supervised learning methods, taking encoding features (such as position, bit number, distribution pattern, etc.) as input and performance indicators (such as average matching time, memory usage, accuracy, etc.) as output, learning the mapping relationship between them. Common model types include regression models, decision trees, or neural networks, depending on the data size and complexity. After training is complete, the encoding efficiency prediction model is used to optimize the current encoding allocation scheme. The optimization process may include: adjusting the encoding position of high-frequency intents to obtain more favorable hardware processing characteristics; reallocating intent encodings with high conflict rates to reduce false matches; dynamically adjusting the size and boundaries of the encoding domain to adapt to business changes; or even completely reconstructing the encoding mapping table to achieve global optimization. This optimization based on actual usage data forms a closed-loop feedback mechanism, which can continuously evolve with business development and usage pattern changes, maintaining optimal performance.

[0199] It should be noted that coding optimization is usually not a one-time operation, but a continuous process. The above optimization process is performed periodically (e.g., weekly or monthly) to adjust the coding scheme according to new usage data and business needs. In order to ensure stability, coding changes usually follow strict version management and smooth transition strategies, such as compatibility processing of old codes, phased promotion of new codes, setting rollback mechanisms, etc.

[0200] Therefore, the embodiment has multiple technical advantages through the coding optimization mechanism based on intent association analysis and advanced search algorithm: first, it can customize the coding scheme according to actual business needs and usage patterns, avoiding the inefficiency of general coding; second, the multi-layer coding structure and domain division strategy significantly improve the utilization rate of coding space, supporting more efficient processing of intent categories; third, advanced algorithms such as Monte Carlo tree search can find near-optimal solutions in a large search space, balancing computational complexity and solution quality; finally, the continuous optimization mechanism based on actual usage data makes the coding system adaptive, which can continuously improve with the development of business.

[0201] In practical applications, this optimization mechanism is particularly important for large enterprise-level dialogue systems. For example, in a bank comprehensive business platform, it may need to support hundreds of different intent categories, spanning more than a dozen business domains, and the usage frequency and importance of each intent differ significantly. Through the optimization mechanism of the embodiment, the optimal coding can be allocated for high-frequency core intents, significantly improving overall performance; at the same time, through the multi-layer coding structure, cross-business domain intent collaborative processing is realized, supporting complex mixed domain dialogue scenarios. Practice has proved that this optimization mechanism can improve intent matching throughput by more than 40%, while reducing CPU and memory consumption by 30%, which has important value for high-concurrency enterprise-level applications.

[0202] Based on the above embodiment, in some embodiments, the search space of coding allocation is constructed, and the search space is traversed, and a coding domain is combined to search a coding allocation scheme through a pre-established Monte Carlo tree search model until a coding allocation scheme is obtained, which minimizes conflicts and maximizes coding efficiency, including:

[0203] An initial coding allocation state tree is established, and a Monte Carlo tree search model is established according to an action space and a state transition rule of coding allocation indicated by the coding allocation state tree, wherein a root node of the coding allocation state tree represents an empty coding allocation state;

[0204] Based on the current coding state and a preset UCB1 selection strategy, a coding allocation action whose coding allocation evaluation value reaches a preset evaluation threshold is selected, and the selected coding allocation action is expanded to generate a new node in the Monte Carlo tree search model.

[0205] For the new node, simulate the complete encoding allocation process by a preset random strategy, and calculate an evaluation score of an encoding allocation scheme corresponding to the simulated encoding allocation process;

[0206] Based on the evaluation score, propagate and update the visit times and average returns of each node upward along the search path of the Monte Carlo tree search model, and complete the back propagation update of the Monte Carlo tree search model;

[0207] The selection of the encoding allocation action, the expansion of the encoding allocation action, the simulation of the encoding allocation process, and the back propagation of the Monte Carlo tree search model are repeatedly performed until a preset iteration number is reached, a node corresponding to a maximum value of visit times or a maximum value of average returns and a corresponding encoding allocation action are selected, and a corresponding encoding allocation scheme is obtained.

[0208] In the embodiment, the construction of the state tree is based on two key concepts: action space and state transition rule. The action space refers to a set of all possible encoding allocation actions that can be performed in a specific state. In the encoding allocation problem, the action is usually represented in the form of "allocating encoding X to intent A". Among them, the action space dynamically changes as the allocation process proceeds: as more and more intents are allocated encodings, the available encoding bits and unallocated intents will decrease, and the action space will correspondingly shrink. The state transition rule defines the rule of how the system state changes after a specific action is performed. In the encoding allocation, after the allocation action is performed, the new state will contain an updated intent-encoding mapping table, and the available encoding set and the unallocated intent set will also be updated accordingly.

[0209] Then, a Monte Carlo tree search model is established according to the action space and the state transition rule indicated by the encoding allocation state tree. It should be noted that MCTS is a heuristic search algorithm based on sampling, which is particularly suitable for handling decision-making problems with a huge state space that cannot be fully traversed. By selectively expanding the search tree and randomly simulating to evaluate the value of the decision path, the calculation resources and search effect are balanced. The core idea of MCTS is "explore as much as possible, exploit as much as possible", which makes it particularly suitable for problems such as encoding allocation that need to find an approximate optimal solution in a huge solution space. Then, in the constructed MCTS model, the root node of the search tree represents the initial state, i.e. the empty state where all intents are not allocated encodings. Starting from the root node, the algorithm will repeatedly perform four key steps: selection, expansion, simulation and back propagation, constantly expanding the search tree and optimizing the decision path.

[0210] The first stage is the selection stage. In this stage, the present embodiment traverses the search tree downward from the current node based on the current encoding state and a preset UCB1 selection policy until a node that has not been fully expanded (i.e., there are untried actions) is reached. The UCB1 (Upper Confidence Bound 1) selection policy is a commonly used node selection algorithm in MCTS, which aims to balance the trade-off between exploration and exploitation. The UCB1 formula takes into account two factors: the average return of the node (exploit known high-value paths) and the access uncertainty of the node (explore insufficiently evaluated paths). The UCB1 selection policy ensures that the algorithm can both deeply explore known high-value paths and appropriately try new paths that have not been fully explored, avoiding falling into local optimal solutions.

[0211] Specific to the encoding allocation problem, UCB1 calculates the "upper bound of value" of each possible encoding allocation action, taking into account the historical average return of the action and the degree of insufficient exploration. The present embodiment selects the action with the highest UCB1 value, which either has good historical performance or has not been fully explored and has potential high value. Only when the encoding allocation evaluation value of the action reaches a preset evaluation threshold, the action will be considered. The evaluation threshold is a minimum value standard preset by the system, which is used to filter out obviously poor allocation actions and improve search efficiency.

[0212] Once the action is selected, the present embodiment enters the expansion stage. In this stage, the system expands the selected encoding allocation action to generate a new node in the MCTS model. Expansion refers to implementing the selected action and creating a new tree node representing the new state after executing the action. The expansion process follows the state transition rules to update the intent-encoding mapping table, the set of available encodings, and the set of unallocated intents. For example, if the selected action is "allocate encoding 2^3 (i.e., binary 00001000) for intent 'query balance'", the new node will represent a state in which "query balance" has been mapped to the encoding, and the encoding has been removed from the available set.

[0213] After the expansion generates a new node, the present embodiment enters the simulation stage. For the newly generated node, the present embodiment simulates the complete encoding allocation process through a preset random policy and calculates the evaluation score of the simulated encoding allocation scheme. Simulation is the core link of MCTS, which simulates the complete encoding allocation process by randomly (or according to simple heuristic rules) executing actions from the current state until reaching a termination state (i.e., all intents are allocated encodings or cannot continue to allocate), and then evaluating the value of the final state.

[0214] In the encoding allocation problem, the random strategy usually adopts a controlled random approach: this embodiment randomly selects one from the unallocated intents, and then selects one from the available encodings that matches it (taking into account encoding domain partitioning and conflict constraints). This process is repeated until all intents are allocated an encoding or constraints cannot be satisfied. The design of the random strategy needs to balance pure randomness (to ensure extensive exploration) and problem-specific heuristic rules (to improve the quality of the solution). For example, this embodiment can prioritize allocating better encoding bits for high-frequency intents or core business intents, or try to avoid allocation patterns that are known to cause conflicts.

[0215] After the simulation is complete, this embodiment calculates the evaluation score of the complete encoding allocation scheme obtained from the simulation. The evaluation score is a comprehensive indicator of the quality of the encoding scheme, usually taking into account multiple factors: conflict minimization (the degree to which mutually exclusive intents do not share encoding bits), encoding efficiency (the optimization of the number of bits used and their distribution), business priority (the degree to which high-priority intents obtain high-quality encodings), etc. This embodiment can use a weighted sum or a multi-objective evaluation function to integrate these factors to generate a single score value.

[0216] After obtaining the evaluation score, this embodiment enters the backpropagation phase. Based on the evaluation score, this embodiment propagates updates to the visit counts and average rewards of each node along the search path of the MCTS model, completing the backpropagation update. Backpropagation is the last step of MCTS, which transmits the simulation results (evaluation score) from the leaf nodes back to the root node, updating the statistical information of all nodes on the path. Specifically, for each node on the path, increase its visit count and update its average reward (combine the current average reward with the new simulation result according to the weight). These updated statistical information will affect the calculation of UCB1 in the next round of iteration, thereby adjusting the search strategy. It should be noted that the essence of backpropagation is information transmission and value update: by transmitting the evaluation results of leaf nodes back to ancestor nodes, the entire search tree can "learn" which decision paths are more valuable. This mechanism enables MCTS to gradually concentrate search resources in more promising areas as the number of iterations increases, improving algorithm efficiency.

[0217] After completing a round of selection, expansion, simulation, and backpropagation, the embodiment will repeat these four steps to continuously explore the encoding assignment space and optimize the assignment scheme. The repeated process will continue until a preset termination condition is reached, such as a preset number of iterations (fixed computational resource limit), upper limit of computation time, convergence threshold (optimal scheme changes very small for consecutive multiple iterations), etc. In this embodiment, the preset number of iterations is used as the termination condition, which is a simple and effective resource control method. After the iteration ends, the embodiment needs to select the final encoding assignment scheme from the search tree. There are usually two selection criteria: maximum access frequency or maximum average return. The node with the maximum access frequency represents the path that is most frequently explored during the search process, which usually means that this path has a higher potential value; the node with the maximum average return directly represents the path that performs best in the historical simulation. Both criteria have their advantages: access frequency focuses more on the sufficiency of exploration, while average return more directly reflects the quality of the scheme. The embodiment can choose one of them or consider both according to the specific problem characteristics.

[0218] In the encoding assignment problem, if the search space is particularly large or complex, access frequency may be a more reliable indicator, as it reduces the impact of simulation randomness; if the simulation strategy is well designed and the evaluation function is accurate, the average return may be a more direct reflection of the quality of the scheme. In practice, the embodiment may set a minimum access frequency threshold, and then select the node with the highest average return among the nodes that meet the threshold, which ensures sufficient exploration and prioritizes high-quality schemes.

[0219] After selecting the final node, the embodiment extracts the encoding assignment action sequence corresponding to the node and applies these actions to obtain the complete encoding assignment scheme. The encoding assignment scheme is a mapping table that specifies the encoding value (power of the base number value) corresponding to each intent. This scheme will be used for subsequent intent recognition and flow control, and is also the basis for optimizing the multi-layer encoding structure.

[0220] It is worth noting that there are several key optimization techniques for applying MCTS to the encoding assignment problem: first, the action space can be structured according to the encoding domain, prioritizing intra-domain assignments to reduce search complexity; second, the simulation strategy can incorporate domain knowledge and heuristic rules to improve simulation efficiency; third, the evaluation function can dynamically adjust the weights to adjust the focus of subsequent assignments according to the characteristics of the assigned intents; finally, parallel MCTS can take advantage of multi-core processing capabilities to simultaneously explore multiple search paths, significantly improving algorithm efficiency.

[0221] This MCTS-based encoding allocation method has multiple technical advantages: first, it can effectively handle a large search space, finding near-optimal solutions even with a large number of intents (such as hundreds); second, the exploration-exploitation balance mechanism of the algorithm allows it to avoid local optimal solutions and discover innovative allocation patterns; third, the scalability of MCTS allows the system to adjust the search depth and breadth based on available computing resources, finding a balance between performance and quality; finally, this method is easy to combine with other optimization techniques (such as encoding domain division and multi-layer encoding structure) to form a comprehensive optimization solution.

[0222] In actual deployment, the MCTS-based encoding allocation system usually runs as an offline or quasi-real-time component, updating the encoding scheme based on the latest intent usage data and business requirements on a regular basis (such as weekly or monthly). This embodiment compares the newly generated scheme with the current running scheme, evaluates the improvement, and only replaces it after confirming significant improvement to ensure stability. To support smooth transition, this embodiment usually implements a dual-version running mechanism, allowing the new and old encoding schemes to run in parallel for a period of time until the stability and superiority of the new scheme are confirmed.

[0223] Therefore, through the encoding allocation optimization mechanism, this embodiment can support diversified intents while maintaining efficient bit operation performance and accurate branch matching, providing a strong technical foundation for intelligent dialogue systems. Practice has proved that compared with traditional manual encoding or simple heuristic methods, the MCTS-based method can improve encoding efficiency by 15-25%, significantly reducing computing resource consumption, while improving the scalability and maintainability of the system, especially suitable for the development and optimization of enterprise-level complex dialogue systems.

[0224] As shown in Figure 2 , the embodiment provides a flow branch matching system based on power value encoding and bit operation judgment, which includes:

[0225] The intent encoding module 201 is configured to assign an encoding to each intent in a preset intent category set by specifying the power value of a base, and generate an intent encoding mapping table.

[0226] The node mask generation module 202 is configured to query the target encoding corresponding to each intent branch in the intent branch set from the intent encoding mapping table based on the intent branch set supported by the flow node, perform bit operation on the at least one target encoding, and generate a node mask value to form a node mask configuration table, wherein the node mask configuration table is used to indicate the association relationship between the flow node and the node mask value.

[0227] The user intention recognition module 203 is configured to acquire user input content in a current dialogue process, recognize a user intention from the user input content, and query an encoding corresponding to the user intention from the intention encoding mapping table as a user intention encoding;

[0228] The branch matching judgment module 204 is configured to extract a target node mask value corresponding to a process node where the current dialogue process is located from the node mask configuration table, perform a bit operation on the user intention encoding and the target node mask value, and judge whether an intention branch supported by the current process node is matched according to a bit operation result.

[0229] The process jump execution module 205 is configured to determine a target process node corresponding to the matched intention branch based on the matching result, and generate node execution information required by the target process node, so as to perform process jump to the target process node according to the node execution information. The node execution information includes execution context and parameter information.

[0230] Therefore, the technical scheme combining power value encoding and bit operation solves the efficiency bottleneck and maintenance difficulty in the traditional process branch judgment, and is suitable for scenarios such as intelligent dialogue systems, business process engines and the like that require efficient branch judgment. The present application can provide flexible branch condition combination capability while maintaining time complexity, and significantly improve system performance and development and maintenance efficiency.

[0231] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A process branch matching method based on power-value encoding and bitwise operation judgment, characterized in that, Includes the following steps: An intent coding mapping table is generated by assigning a code to each intent in a preset intent category set by a power of a specified base value. Based on the set of intent branches supported by the process node, the target code corresponding to each intent branch in the intent branch set is queried from the intent encoding mapping table. Bitwise operations are performed on at least one target code found to generate a node mask value, thereby forming a node mask configuration table. The node mask configuration table is used to indicate the association between the process node and the node mask value. The system obtains user input content in the current dialogue flow, identifies user intent from the user input content, and queries the intent encoding mapping table to find the encoding corresponding to the user intent, which is then used as the user intent encoding. Extract the target node mask value corresponding to the current process node in the node mask configuration table, perform bitwise operations on the user intent encoding and the target node mask value, and determine whether it matches the intent branch supported by the current process node based on the bitwise operation result. Based on the matching results, the target process node corresponding to the matched intent branch is determined, and the node execution information required for the target process node is generated so that the process jump to the target process node is performed according to the node execution information. The node execution information includes execution context and parameter information.

2. The method according to claim 1, characterized in that, The process of assigning codes to each intent in a preset intent category set by using a power of a specified base value to generate an intent code mapping table includes: Define the set of intent categories that need to be identified based on business needs and scenario characteristics; The specified power of a cardinality is used as the encoding for each intent in the intent category set, where the specified power of a cardinality includes powers of 2. The intent and its corresponding encoding are mapped one-to-one to construct the intent-encoding mapping table.

3. The method according to claim 2, characterized in that, The intent branch set supported by the process node is used to query the target code corresponding to each intent in the intent branch set from the intent encoding mapping table, and bitwise operations are performed on at least one of the queried target codes to generate a node mask value, thereby forming a node mask configuration table, including: Obtain node branch configuration data through a preset configuration file, and select an allowed set of intent branches for each process node in the node branch configuration data; The code corresponding to each intent in the intent branch set is retrieved from the intent encoding mapping table and used as the target code. Perform bitwise operations on at least one target code supported by the process node to generate a single integer value as the node mask value; The process nodes are associated with their corresponding node mask values ​​and stored to form the node mask configuration table.

4. The method according to claim 3, characterized in that, The step of obtaining user input content in the current dialogue flow, identifying user intent from the user input content, and querying the code corresponding to the user intent from the intent encoding mapping table as the user intent code includes: The user input content in the current dialogue flow is obtained through a voice interface and / or a text interface, wherein the user input content includes voice input text, which is text content obtained by converting the voice input content obtained by the voice interface through a preset ASR service model; The user input content is cleaned, segmented, and stop word removed to obtain the target input content; The target input content is identified through regular expression matching, keyword recognition, or a preset machine learning model to determine the user's intent; The code corresponding to the user intent is retrieved from the intent encoding mapping table and used as the user intent code.

5. The method according to claim 4, characterized in that, The step of extracting the target node mask value corresponding to the current flow node in the node mask configuration table, performing bitwise operations on the user intent encoding and the target node mask value, and determining whether it matches the intent branch supported by the current flow node based on the bitwise operation result includes: Identify the current process node in the dialogue flow, and query the node mask value corresponding to the identified process node in the node mask configuration table as the target node mask value; Perform bitwise operations on the user intent encoding and the target node mask value to obtain the bitwise operation result; Determine whether the result of the bitwise operation is consistent with the user intent encoding; If the calculation result is determined to be consistent with the user intent encoding, then it is confirmed that the intent branch supported by the current process node has been matched.

6. The method according to claim 5, characterized in that, The node mask value includes a node composite mask value; the step of querying the target code corresponding to each intent branch in the intent branch set supported by the process node from the intent encoding mapping table, performing bitwise operations on at least one of the queried target codes to generate a node mask value, and forming a node mask configuration table, further includes: Assign a service level target priority to each intent branch in the intent branch set, wherein the service level target priority includes critical branches, core branches and ordinary branches sorted from high to low priority; Based on the service level target priority of the intent branch, the target code of the intent branch is expanded into a multi-level composite code, wherein the first level of the composite code represents the target code, the second level of the composite code represents the priority code corresponding to the service level target priority, and the third level of the composite code represents the business domain code related to the business domain and / or the scene code related to the scene type. Bitwise operations are performed on the composite codes corresponding to the intent branches supported by the process node to generate the node composite mask value of the process node. The target node mask value includes a target node composite mask value; the step of extracting the target node mask value corresponding to the current flow node from the node mask configuration table, performing bitwise operations on the user intent encoding and the target node mask value, and determining whether it matches the intent branch supported by the current flow node based on the bitwise operation result further includes: The target node composite mask value is pre-filtered according to the current business domain to obtain the pending intent branch supported by the current process node. Based on the current load status and service quality target, a priority strategy for execution judgment is determined, and the target intent branch is judged and processed according to the priority strategy. The priority strategy is used to indicate that when the current load status is higher than a preset load threshold, the pending intent branch whose service level target priority indicated by the priority encoding in the target node composite mask value is higher than the preset priority condition is judged first, or when the current load status is lower than the load threshold, all pending intent branches are judged in parallel. Bitwise operations are performed on the composite mask value of the user intent encoding and the target node, and the result of the bitwise operations is used to determine whether it matches the target intent branch supported by the current process node.

7. The method according to claim 6, characterized in that, The step of assigning codes to each intent in a preset intent category set by using a power of a specified base to generate an intent code mapping table also includes: Assign a version number and a timestamp to each intent encoding mapping table, and mark the update event of the intent encoding mapping table with a corresponding vector clock. Based on the version number, the timestamp and the vector clock, establish an encoding dependency graph, which is used to indicate the relevant encodings in the intent encoding mapping table to be updated according to causal order. The step of determining the target process node corresponding to the matched intent branch based on the matching result, and generating the node execution information required for the target process node, so as to execute the process jump to the target process node according to the node execution information, includes: When determining the target process node, obtain the current status information of the process node; For each process instance, a corresponding state dependency chain is determined, which is used to indicate the state dependency relationship between process nodes related to the process instance. Based on the current state information of the process node, the state dependency chain and vector clock of the process instance, and the encoded dependency graph, a causal identifier is generated and marked on the target process node. A multi-level causal cache structure is determined, which includes a local cache, a service cache, and a global cache. Based on the causal dependencies of cached items in the multi-level causal cache structure, a causal dependency directed graph is formed, and a cache invalidation strategy is determined based on the causal dependency directed graph. The state information of the process node is converted into a highly compressed bitmap representation, and the bitmap representation is stored in state segments based on the process node and the corresponding time window, according to the multi-level causal cache structure.

8. The method according to claim 7, characterized in that, The step of assigning codes to each intent in a preset intent category set by using a power of a specified base to generate an intent code mapping table also includes: A business process and corresponding historical interaction data are determined by a preset static analysis algorithm. Based on the business process and the historical interaction data, an intent association graph is constructed. Based on the constructed intent association graph, intent feature vectors and conflict identification results are generated. The intent association graph is used to indicate the correlation and mutual exclusion between schematic diagrams. Based on the intent feature vector and the conflict identification result, an intent conflict set is formed. According to the intent conflict set, the preset global intent pool is grouped according to the conflict relationship to form a relatively independent coding domain. The intent conflict set is used to indicate the conflict relationship between intents that do not logically share the same coding bit. Construct a search space for encoding allocation, traverse the search space, and combine it with the encoding domain to search for encoding allocation schemes using a pre-established Monte Carlo tree search model until conflicts are minimized and encoding efficiency is maximized, thereby obtaining the current encoding allocation scheme. The encoding allocation scheme is used to indicate the intention to allocate encodings by powers of a specified cardinality. The 32-bit or 64-bit integer space is divided according to the business domain to form a multi-layer coding structure. Based on the multi-layer coding structure, the current coding allocation scheme is optimized into a coding mapping scheme. Obtain the usage frequency and hit rate of the encoding of each intent in the current actual use process, train the encoding efficiency prediction model based on the usage frequency and the hit rate, and optimize the current encoding allocation scheme based on the encoding efficiency prediction model.

9. The method according to claim 8, characterized in that, The process involves constructing a search space for encoding allocation, traversing the search space, and combining it with the encoding domain to search for encoding allocation schemes using a pre-established Monte Carlo tree search model until conflicts are minimized and encoding efficiency is maximized, thereby obtaining the current encoding allocation scheme. This includes: An initial encoding allocation state tree is established. Based on the action space and state transition rules of encoding allocation indicated by the encoding allocation state tree, a Monte Carlo tree search model is established, wherein the root node of the encoding allocation state tree represents an empty encoding allocation state. Based on the current encoding state and the preset UCB1 selection strategy, the encoding allocation action whose encoding allocation evaluation value reaches the preset evaluation threshold is selected, and the selected encoding allocation action is expanded to generate a new node in the Monte Carlo tree search model. For the new node, a complete coding allocation process is simulated using a preset random strategy, and the evaluation score of the coding allocation scheme corresponding to the simulated coding allocation process is calculated. Based on the evaluation score, the number of visits and average revenue of each node are updated by propagating upwards along the search path of the Monte Carlo tree search model, thus completing the backpropagation update of the Monte Carlo tree search model. The selection of encoding allocation actions, the expansion of encoding allocation actions, the simulation of the encoding allocation process, and the backpropagation of the Monte Carlo tree search model are repeatedly performed until a preset number of iterations are reached. The node corresponding to the maximum number of visits or the maximum average return and the corresponding encoding allocation action are selected to obtain the corresponding encoding allocation scheme.

10. A process branch matching system based on power-value encoding and bitwise operation judgment, characterized in that, include: The intent encoding module is used to assign an encoding to each intent in a preset intent category set by using a power of a specified base value, and to generate an intent encoding mapping table. The node mask generation module is used to query the target code corresponding to each intent branch in the intent branch set supported by the process node from the intent encoding mapping table, perform bit operations on at least one target code found, generate node mask values, and form a node mask configuration table. The node mask configuration table is used to indicate the association between the process node and the node mask values. The user intent recognition module is used to obtain user input content in the current dialogue flow, identify user intent from the user input content, and query the code corresponding to the user intent from the intent encoding mapping table as the user intent code; The branch matching judgment module is used to extract the target node mask value corresponding to the process node in the current dialogue flow from the node mask configuration table, perform bit operations on the user intent encoding and the target node mask value, and determine whether the intent branch supported by the current process node is matched based on the bit operation result. The process jump execution module is used to determine the target process node corresponding to the matched intent branch based on the matching result, and generate the node execution information required for the target process node, so as to execute the process jump to the target process node according to the node execution information. The node execution information includes execution context and parameter information.

Citation Information

Patent Citations

  • Response information generation method, device and equipment and computer readable storage medium

    CN113515705A

  • Process node jumping method and device based on intention recognition, equipment and medium

    CN113593533A