Process branch matching method and system based on power value coding and bit operation judgment
By employing a process branch matching method based on power-value encoding and bitwise operations in the intelligent dialogue system, the problem of low efficiency in existing technologies is solved, achieving efficient and simplified branch matching and condition expression, and adapting to the rapid changes in complex business scenarios.
Patent Information
- Application Number
- CN202610107360.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-27
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2046-01-27
AI Technical Summary
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.
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 and using bit operations for fast branch matching judgment, an intent encoding mapping table and a node mask configuration table are generated, achieving branch matching with O(1) time complexity.
It improves system performance, simplifies condition configuration and maintenance, supports complex condition combinations, adapts to rapid business iteration and expansion needs, and does not require code modification or business process adjustment.
Smart Images

Figure CN121581597A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of intelligent dialogue systems and business process engines, and in particular to a process branch matching method and system based on power-value encoding and bitwise operation judgment. Background Technology
[0002] In the fields of intelligent dialogue systems and business process engines, process branch determination is one of the core technical aspects. These systems need to quickly determine the next execution path based on user input or system status, involving numerous conditional judgments and branch matching operations. As business scenarios become increasingly complex, the number of process nodes and conditions is growing exponentially, placing higher demands on the efficiency and maintainability of branch determination.
[0003] The current process primarily uses keyword list matching and conditional traversal for branch decision-making. Taking an intelligent outbound calling system as an example, multiple keyword dictionaries are typically maintained. User input is matched against these dictionaries to determine the user's intent before branching off. Another common approach is to use decision trees or chained conditional statements to evaluate each branch condition in a preset order.
[0004] A more advanced approach combines intent recognition with rule-based decision-making. The system first uses an NLP model to identify user input as structured intent, and then determines the matching branch by traversing an array of conditions or querying a hash table. This method improves semantic understanding, but still faces significant bottlenecks in scenarios with large-scale nodes and complex condition combinations.
[0005] However, these technical solutions have many shortcomings when dealing with large-scale branch conditions: First, the condition judgment is inefficient, especially when the number of nodes reaches hundreds or more, the traversal judgment brings significant performance loss; second, the condition expression structure is complex and lacks a unified and efficient coding method, resulting in high maintenance costs; third, the expression of branch relationships between nodes is lengthy and it is 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 cope with the needs of rapid business iteration. Summary of the Invention
[0006] The purpose of this invention is to provide a process branch matching method and system based on power value encoding and bit operation judgment. By mapping intent categories to powers of 2 and using bit operations for fast branch matching judgment, it solves the technical problems of low efficiency, complex condition expression and high maintenance cost in the prior art.
[0007] In a first aspect, the present invention provides a process branch matching method based on power-value encoding and bitwise operation judgment, comprising the following steps:
[0008] 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.
[0009] In some embodiments, the step of assigning codes to each intent in a preset intent category set by a power of a specified cardinality 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.
[0010] In some embodiments, the step of querying the target code corresponding to each intent 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, includes: 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.
[0011] In some embodiments, 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.
[0012] In some embodiments, 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 the bitwise operation result matches the intent branch supported by the current flow node 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.
[0013] In some embodiments, 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, and generating a node mask value to form 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.
[0014] In some embodiments, the step of assigning codes to each intent in a preset intent category set by a power of a specified cardinality to generate an intent code mapping table further 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.
[0015] In some embodiments, the step of assigning codes to each intent in a preset intent category set by a power of a specified cardinality to generate an intent code mapping table further 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.
[0016] In some embodiments, the construction of the encoding allocation search space, traversing the search space, and combining 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 to obtain the current encoding allocation scheme, 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.
[0017] Secondly, the present invention provides a process branch matching system based on power-value encoding and bitwise operation judgment, comprising: 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 the at least one target code found, generate a node mask value, 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 value. 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.
[0018] Compared with the prior art, the technical solution of the present invention has the following advantages: it achieves branch matching judgment with O(1) time complexity through bit operations, which greatly improves system performance compared with the traditional traversal judgment method; it uses power of 2 values as intent encoding, so that each intent occupies a unique binary bit, which is convenient for combination and recognition; it intuitively represents all branch combinations supported by the node through the node mask value, which simplifies the configuration and maintenance of complex conditions; the bit operation-based matching mechanism naturally supports complex condition combinations and can adapt to the needs of rapid business iteration and expansion; by defining and updating the intent encoding mapping table and the node mask configuration table through the configuration file, the business process can be adjusted without modifying the code. Attached Figure Description
[0019] Figure 1 A flowchart illustrating a process branch matching method based on power-value encoding and bitwise operation judgment provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a process branch matching system based on power value encoding and bit operation judgment provided in an embodiment of the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] like Figure 1 As shown, this embodiment provides a process branch matching method based on power value encoding and bit operation judgment, including the following steps S101 to S105.
[0022] S101. Assign codes to each intent in the preset intent category set by using the power of the specified base value, and generate an intent code mapping table.
[0023] In some embodiments, step S101 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.
[0024] In this embodiment, firstly, a set of intent categories to be identified is defined based on business needs and scenario characteristics. This set of intent categories refers to the collection of all types of user intents that need to be identified and processed in a specific business scenario. For example, in a customer service scenario, it might include intent categories such as "inquiry," "complaint," and "processing business." These intent categories are typically predefined based on business domain knowledge and user interaction requirements, constituting the basic semantic units to be processed. After determining the set of intent categories, a power of a specified base is used as the encoding rule. Power-law encoding is a special encoding method where each encoded value is a power of a certain base, preferably a power of 2 (i.e., 1, 2, 4, 8, 16...). This encoding method ensures that each code has only one bit set to 1 in its binary representation, with the remaining bits being 0, making each intent independent and orthogonal in its binary 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, by using independent bit representations, subsequent bitwise operations and judgments become more efficient and reliable.
[0025] Next, this embodiment maps intents to their corresponding codes one-to-one, constructing an intent-to-code mapping table. The intent-to-code mapping table is a key-value pair data structure, where the key is the intent identifier (such as the intent name or ID), and the value is the corresponding power-law encoded value. Therefore, this embodiment constructs the intent-to-code mapping table in the form of a hash table, associative array, or database table, supporting fast bidirectional queries; it allows querying the code through the intent and vice versa.
[0026] For example, in this embodiment, the encoding of a "positive" intention is defined as 1 (i.e., 2^0), and its binary representation is "0001"; the encoding of a "negative" intention is 2 (i.e., 2^1), and its binary representation is "0010"; the encoding of a "reject" intention is 4 (i.e., 2^2), and its binary representation is "0100"; and the encoding of a "skip" intention is 8 (i.e., 2^3), and its binary representation is "1000". Through this encoding method, each intention occupies a unique bit in the binary representation, ensuring mutual exclusion and uniqueness of the encoding, and enabling subsequent fast judgment based on bitwise operations.
[0027] It should be noted that during the mapping table construction process, it is necessary to ensure that each intent is assigned a unique code to avoid encoding conflicts. Furthermore, since power-of-two encoding is used, theoretically, a 32-bit integer can support up to 32 different intent codes, and a 64-bit integer can support 64 intents, meeting the needs of most business scenarios. For very large-scale intent sets, group encoding or multi-level encoding structures can be used for expansion. Therefore, this embodiment lays the foundation for subsequent bitwise operation judgments by converting intents into power-of-two encodings, while also providing an efficient and unified intent representation method.
[0028] S102. Based on the intent branch set supported by the process node, query the target code corresponding to each intent branch in the intent branch set from the intent encoding mapping table, perform bit operations on the at least one target code found, generate a node mask value, 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 value.
[0029] In this application, a process node refers to a specific execution point in a dialogue 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 given process node, defining which user intent inputs the node can accept. The node mask value is an integer value obtained by performing bitwise operations (usually bitwise OR or simple addition) on all the intents supported by the node. Each position in the binary representation corresponds to a specific intent; a bit with a value of 1 indicates that the node supports the intent corresponding to that bit, and a bit with a value of 0 indicates that it does not. The node mask configuration table is an associative structure that records the mapping relationship between each process node and its corresponding mask value.
[0030] In some embodiments, step S102 includes: 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.
[0031] In this embodiment, node branch configuration data is first obtained through a preset configuration file. This data specifies the set of intent branches supported by each process node. The node branch configuration data refers to structured data describing the intent branches supported by each node in the process, typically stored in JSON, XML, or a dedicated configuration format. This configuration data defines 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 using a visual process design tool, or it can be written directly using code or scripts. Then, based on the node branch configuration data, the system selects the allowed set of intent branches for each process node. The intent branch set refers to the set of all possible intents that a single process node supports processing, representing the node's branch decision-making capability. For example, the "ask user intent" node may support three intent branches: "affirmative," "negative," and "uncertain." This explicit definition makes the process logic clearer and facilitates later maintenance and adjustment.
[0032] Next, this embodiment queries the intent encoding mapping table to find the code corresponding to each intent in the intent branch set, which is then used as the target code. The target code refers to the power-law encoding value corresponding to each intent supported by a specific process node. These encoding values can be quickly queried and obtained using the intent encoding mapping table created above. Then, bitwise operations are performed on at least one target code supported by the process node to generate a single integer value as the node mask value. The node mask value is an integer value obtained by performing bitwise operations (usually bitwise OR) on all intent codes supported by the node, and its binary representation contains bit information of all intents supported by the node. Bitwise operations are an efficient way to directly manipulate binary bits. The principle of bitwise OR (symbol "|") is: if any corresponding bit of the two operands is 1, the corresponding bit of the result is 1. For example, if a node supports three intents: "affirmative" (encoding 1, binary 001), "negative" (encoding 2, binary 010), and "uncertain" (encoding 4, binary 100), then the mask value of this node is 1|2|4=7, which is represented as 111 in binary.
[0033] Finally, this embodiment associates and stores the process nodes with their corresponding node mask values, forming a node mask configuration table. The node mask configuration table is a special data structure used to store the mapping relationship between process node IDs and their corresponding mask values. This table can be implemented as a hash table, an associative array, or a database table, supporting quick lookup of the corresponding mask value by node ID. The node mask configuration table is the core data basis for subsequent branch matching judgments. Therefore, this embodiment, through the node mask configuration table, only needs to record an integer value to express all possible combinations of intent branches supported by a node, greatly simplifying the data structure and improving storage and query efficiency. Simultaneously, this representation method allows subsequent branch matching judgments to be completed through efficient bitwise operations, without needing to traverse the condition array or perform multiple string comparisons.
[0034] For example, a simplified node mask configuration table might look like this: Node ID "node_001" (ask user intent) → mask value 7 (supports "affirm", "negative", "uncertain"); Node ID "node_002" (confirm user information) → mask value 3 (supports "affirm" and "negative"); Node ID "node_003" (handle user complaints) → mask value 24 (supports "transfer to human agent" and "inquire about details").
[0035] Therefore, this embodiment achieves efficient expression and storage of node support branches by combining multiple intent codes into a single mask value, laying the foundation for subsequent fast matching and judgment.
[0036] S103. Obtain the user input content in the current dialogue flow, identify the 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.
[0037] It should be noted that user input refers to the raw interactive information provided by the user through voice or text. User intent refers to the structured intent information extracted from the user input, representing the core purpose or need the user wants to express. User intent encoding refers to the power-value encoding corresponding to the identified user intent, used for subsequent branch matching judgments.
[0038] In some embodiments, step S103 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; Identify the user intention by regular matching, keyword recognition, or a pre-set machine learning model for the target input content. Query the code corresponding to the user intention from the intention coding mapping table as the user intention code.
[0039] In this embodiment, first obtain the user input content in the current conversation flow through the voice interface and / or text interface. The user input content refers to the original information provided by the user during the interaction, which can be in the form of voice or text. The voice interface is usually implemented based on technologies such as WebRTC and audio capture SDKs, and is responsible for capturing and transmitting the user's voice data; the text interface obtains the text content input by the user through UI components such as input boxes and chat windows. In voice interaction scenarios such as intelligent outbound calls, the user input is mainly provided in the form of voice. When the user input is voice, call a pre-set ASR service model 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 an acoustic model and a language model: the acoustic model converts the voice signal into phonemes or other acoustic units, and the language model predicts the most likely sequence of words based on the context. It should be noted that modern ASR systems are usually implemented based on deep learning technologies such as LSTM and Transformer, and can provide high recognition accuracy in various noise environments and accent conditions. This embodiment can call third-party ASR services (such as APIs provided by Alibaba Cloud, Baidu, iFlytek, etc.), or deploy a self-developed ASR model. The converted text is called the voice input text and serves as the basis for subsequent processing.
[0040] Next, clean, segment, and remove stop words from the user input content to obtain the target input content. Text cleaning refers to removing noise, errors, and irrelevant content in the text, such as special characters, repeated words, and typos; word segmentation is to segment text without natural delimiters such as Chinese into meaningful word units; stop word removal is to remove function words that contribute less to intention recognition, such as "de", "le", "ma", etc. Through preprocessing, the accuracy and efficiency of subsequent intention recognition can be improved, and the target input content obtained after processing is a normalized text, which is more suitable for semantic analysis and intention recognition.
[0041] 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.
[0042] 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 "uncertain".
[0043] 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.
[0044] 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.
[0045] 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.
[0046] 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.
[0047] In this application, the target node mask value refers to the mask value corresponding to the node in the current dialogue flow in the node mask configuration table. Bitwise operations refer to logical operations performed at the binary level. In this embodiment, the bitwise AND (&) operation is mainly used. The principle of the bitwise AND operation is to perform an AND operation on each bit of the two operands. Only when the corresponding bits of the two operands are both 1, the corresponding bit of the result is 1; otherwise, it is 0.
[0048] In some embodiments, step S104 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.
[0049] In this embodiment, the first step is to identify the current process node in the dialogue flow. A process node is a basic unit in the dialogue flowchart, representing a state or step in the process execution. Each node has a unique identifier (node ID) and carries specific business functions. This embodiment tracks the current process node of each dialogue instance by maintaining session state information. Session state information is typically stored in a memory cache or persistent storage and includes key information such as the current node ID, historical path, and context parameters. Identifying the current node is a prerequisite for subsequent matching judgments, ensuring that the user's intent can be interpreted in the correct context.
[0050] After determining the current process node, this embodiment queries the node mask configuration table to find the node mask value corresponding to the identified process node, which is then used as the target node mask value. The target node mask value refers to the encoded combination value of all intent branches supported by the current process node; each bit in its binary representation corresponds to a possible intent branch. The query process is typically implemented using a hash table, with a time complexity of O(1), meaning that regardless of the number of nodes, the query operation can be completed in constant time. This efficient query is one of the key factors contributing to the performance advantage of the method in this invention.
[0051] Next, this embodiment performs bitwise operations on the user intent encoding and the target node mask value to obtain the bitwise operation result. Bitwise operations are an efficient computational method that directly manipulates binary bits; this embodiment uses a bitwise AND operation (symbol "&"). The principle of the bitwise AND operation is: the corresponding bit of the result is 1 only when both operands have corresponding bits of 1; otherwise, it is 0. In this embodiment, the bitwise AND operation is used to check whether the user's current intent belongs to the set of branches supported by the node. Specifically, when the corresponding bit in the binary representation of the user intent encoding in 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 does not support it.
[0052] For example, assuming the current node mask value is 11 (binary 1011, indicating support for “affirmative”, “negative” and “reject” intents), and the user intent is encoded as 2 (binary 0010, indicating a “negative” intent), then the bitwise operation result is 2&11=2 (binary 0010).
[0053] Then, this 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 a node supports a specific intent branch, then the bitwise AND operation between the intent encoding and the node mask value should result in the intent encoding itself. This is because in the power-law encoding system, each intent encoding has only one bit set to 1 in binary. If this bit is also 1 in the node mask value (indicating support for the intent), the bitwise AND result will retain this bit as 1, with the remaining bits as 0, which is equal to the original intent encoding. The equality check can be implemented through a simple integer comparison, with a time complexity of O(1).
[0054] Subsequently, if the calculation result is determined to be consistent with the user intent encoding, it is confirmed that an intent branch supported by the current process node has been matched. A successful match indicates that the user's current expressed intent is one of the preset valid branches of that node, and in this embodiment, processing should continue according to the logic corresponding to that branch. If the calculation result is inconsistent with the user intent encoding, it indicates that the current node does not support that intent branch, and the user may need to be prompted to re-enter the information, or the default processing logic may need to be executed.
[0055] It should be noted that traditional methods typically require traversing all branch conditions supported by a node, resulting in a time complexity of O(n), where n is the number of branches. In contrast, the branch matching method in this embodiment, based on bitwise operations, has a time complexity of O(1). Regardless of the number of branches, it only requires one bitwise AND operation and one comparison operation. This constant-time complexity mechanism is particularly important in high-concurrency, large-scale node scenarios, significantly improving response speed and throughput.
[0056] Therefore, this embodiment achieves rapid judgment of branch conditions through an efficient bitwise operation mechanism, transforming the traditional traversal judgment into a single bitwise operation, which greatly improves system performance while maintaining the clarity and maintainability of the judgment logic.
[0057] S105. Based on the matching result, determine the target process node corresponding to the matched intent branch, and generate the node execution information required for the target process node, 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.
[0058] In this application, the target process node corresponding to the matched intent branch is first determined based on the matching results. The target process node refers to the next process node to be executed after a successful match, representing the next state or step in the process execution. Determining the target node typically relies on process configuration information, which defines the transition relationships and conditions between nodes. This application maintains a Transition Mapping Table, which records the correspondence between source nodes, triggering intents, and target nodes. Upon successful matching, the corresponding target node ID is retrieved from the mapping table based on the current node ID and the matched intent. For example, if the current node is "inquire about loan intention" and the matched intent is "negative," the corresponding target node might be "end process."
[0059] Next, this application generates the node execution information required for the target process nodes. Node execution information refers to the various data and contextual environments necessary to support the correct execution of the target nodes, and is a key mechanism for data transfer and state maintenance between nodes. Node execution information mainly consists of two parts: execution context and parameter information. Execution context refers to the environment and state information upon which node execution depends, including session ID, user identifier, current session state, historical interaction records, etc.; parameter information is the specific business data required for node execution, such as user intent content, intent confidence, extracted key entities, form completion status, etc.
[0060] 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 based on the matched intent type; then, extracting possible entity information or business data from user input; and finally, integrating this information into a standard-format execution information data packet. This information is typically organized in JSON or other structured formats for efficient transmission and processing between nodes.
[0061] Then, the system executes a flow jump to the target flow node based on the node execution information. Flow jump refers to the process by which the system transfers control from the current node to the target node, and it is the core mechanism for advancing the dialogue flow. Jump execution typically includes the following steps: First, the system updates the session state, recording information such as the current node ID, matching 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 its execution environment; finally, the main processing logic of the target node is activated, and the next operation begins.
[0062] In practice, process redirection can be achieved through various technologies, such as function calls, event triggering, and message queues. In distributed systems, redirection may involve cross-service communication, requiring mechanisms such as RPC, REST APIs, or message queues. Regardless of the technology used, the key is to ensure the complete transmission of execution information and the maintenance of consistent state.
[0063] In addition, this application typically performs logging and monitoring reporting before and after the redirection. Logging records the redirection path, execution time, and key parameters to facilitate later auditing and problem diagnosis; monitoring reports collect performance and business metrics to support real-time monitoring and analysis of operational status.
[0064] Therefore, this application achieves orderly progress and status transmission of the dialogue process through standardized node execution information and process jumps, ensuring that the corresponding business logic can be correctly executed according to the user's intent, providing a coherent and natural dialogue experience. Meanwhile, a robust logging and monitoring mechanism provides necessary support for operation and maintenance and continuous optimization.
[0065] In some embodiments, this embodiment further provides a composite coding structure based on service level objectives. 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 coding mapping table, performing bitwise operations on at least one queried target code 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.
[0066] In this embodiment, the concept of Service Level Objective (SLO) is introduced to manage the priority of intent branches. SLO is a quantitative indicator for measuring service quality, used in this embodiment to distinguish the importance and processing priority of different intent branches. Based on business importance and response time requirements, intent branches are divided into three priority levels: Critical Branch, Core Branch, and Regular Branch. Critical Branches typically involve core business processes or emergency handling, requiring the highest priority; Core Branches involve important but non-urgent business scenarios; and Regular Branches handle general functions or secondary business scenarios. Subsequently, through priority grading, the original single-level power-value encoding is expanded into a multi-level composite encoding structure. Composite encoding is a technique that encodes multi-dimensional information into a single integer value, achieving compact representation and efficient processing of information through bit segmentation. In this embodiment, the composite encoding comprises three levels: the first level (usually the lower 8 bits or 16 bits) represents the basic intent encoding, i.e., the power-value encoding allocated above; the second level (the middle 8 bits or 16 bits) represents the priority encoding corresponding to the service level target priority, used to identify the processing priority of the intent branch; and the third level (the higher 8 bits or 16 bits) represents the business domain encoding and / or scenario encoding, used to distinguish the intents of different business domains or application scenarios.
[0067] For example, in a composite encoding of a 32-bit integer, the possible encoding structure is as follows: bits 0-7 represent the basic intent encoding (supporting up to 8 different intents); bits 8-15 represent the priority encoding (e.g., critical branch = 1, core branch = 2, ordinary branch = 3); bits 16-23 represent the business domain encoding (e.g., loan business = 1, credit card business = 2); bits 24-31 represent the scenario encoding (e.g., outbound call scenario = 1, online customer service scenario = 2).
[0068] Subsequently, based on the composite coding structure, the "affirmative" intent of the "key" priority in the "loan business" domain may be encoded 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. This embodiment performs bitwise operations to combine the composite codes corresponding to the intent branches supported by the process node, generating a node composite mask value. The node composite mask value is the result of combining multiple composite codes through bitwise operations (usually bitwise OR), and its binary representation contains multi-dimensional information about all intent branches supported by the node. Through the composite mask structure, this embodiment can consider more dimensions of information during matching judgments, achieving more refined branch management.
[0069] In the branch matching and judgment phase, the composite mask value of the target node is first pre-filtered according to the current business domain. Mask pre-filtering refers to quickly filtering out relevant mask information under specific business domains or scenarios through bitwise operations, reducing the amount of data processed subsequently. This bitwise AND operation between the composite mask and the business domain mask significantly improves the processing efficiency of large-scale multi-domain systems. Then, based on the current load and service quality goals, a priority strategy for execution is determined. This priority strategy is a set of rules for adjusting the branch processing order and resource allocation under different load conditions. Current CPU utilization, memory usage, request queue length, and other indicators are monitored to determine if the current load exceeds preset thresholds. Under high load, high-priority branches are processed first to ensure the response time of core business processes; under low load, all priority branches can be processed in parallel to improve overall throughput. Finally, a bitwise operation is performed between the user intent encoding and the composite mask value of the target node. The result is used to determine whether it matches the target intent branch supported by the current process node. This considers more dimensions of information and enables more refined branch matching control.
[0070] Therefore, this composite coding mechanism based on service level objectives, as described in this embodiment, achieves differentiated service quality management capabilities while maintaining efficient bitwise operation judgment. Through dynamic adjustment of priority strategies, it can prioritize the execution efficiency of critical business processes under resource constraints, while maximizing overall throughput when resources are sufficient, thus achieving a balance between performance and business importance.
[0071] In some embodiments, 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 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 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.
[0072] In this embodiment, when it is necessary to determine whether a user's intent matches a supported branch of the current process node, a mask pre-filtering operation is first required. Mask pre-filtering is a technique that uses bitwise operations to quickly narrow down the range of candidate intents, performing preliminary filtering based on specific dimensions (such as business domains) to reduce the amount of data processed subsequently. Specifically, the current business domain is first determined. A business domain refers to a specific business area or functional module, such as loan business, credit card business, customer service, etc. Each business domain occupies a specific bit segment in the composite encoding, typically located in the high-order bits.
[0073] This embodiment achieves pre-screening by constructing a domain mask. It should be noted that a domain mask is a special bitmask where only the bit field corresponding to the target domain is 1, and the remaining bit fields are 0. For example, if the current domain is "loan business," the corresponding code is 1, located at bits 16-23 of the composite code, then the domain mask might be 0x01000000 (hexadecimal). This embodiment performs a bitwise AND operation between the target node's composite mask value and the domain mask to quickly filter out mask information related to the current business domain. Pre-screening is particularly important in large-scale multi-domain systems, significantly reducing unnecessary computation and improving system response speed. After pre-screening, this embodiment obtains the pending intent branches supported by the current process node. Pending intent branches refer to the set of intent branches that the current node may support after domain pre-screening. Although these branches belong to the current business domain, they may have different service level target priorities, requiring differentiated processing based on load conditions.
[0074] Next, this embodiment determines the priority strategy for execution based on the current load status and service quality objectives. Load status refers to the current resource utilization, typically measured by multiple indicators such as CPU utilization, memory usage, request queue length, and average response time. This embodiment monitors these indicators in real time and compares them with preset load thresholds to determine whether the current load is high or low. Load thresholds are pre-set critical values based on performance characteristics and business requirements, such as CPU utilization exceeding 80% or request queue length exceeding 1000.
[0075] In this embodiment, a priority strategy defines how intent branches of different priorities should be handled under different load conditions. Specifically, when the current load exceeds a preset load threshold, a priority filtering mode is adopted to prioritize high-priority intent branches. In this mode, priority codes are first extracted from the intent branches to be processed and compared with preset priority conditions. The priority code is a bit segment in the composite code that represents the service level target priority, usually located in the middle position (e.g., bits 8-15). The preset priority condition is a threshold set by the administrator based on business importance, used to distinguish branches that need to be prioritized under high load conditions.
[0076] For example, if the priority code for critical branches is set to 1, core branches to 2, and ordinary branches 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, while the processing of ordinary branches will be temporarily suspended. This ensures that resources can be concentrated to guarantee the execution efficiency of critical business processes when resources are limited.
[0077] Conversely, when the current load is below a preset load threshold, a parallel decision-making mode is adopted, processing all pending intent branches simultaneously. In this mode, priority differences are disregarded; instead, available resources are maximized to improve overall throughput. Parallel decision-making can be implemented through techniques such as multithreading, asynchronous computation, or vectorized operations, providing optimal performance when resources are plentiful.
[0078] Based on a defined priority strategy, this embodiment performs judgment processing on the branches of intent to be processed to obtain the target intent branch. The target intent branch refers to the set of intent branches that need to be matched and judged after being filtered by the priority strategy. Under high load conditions, the target intent branch is usually a subset of branches with high priority; under low load conditions, the target intent branch includes all branches to be processed.
[0079] Finally, this embodiment performs bitwise operations on the user intent encoding and the target node composite mask value. Based on the bitwise operation result, it determines whether the target intent branch supported by the current process node is matched, considering the multi-level structure of the composite encoding. Specifically, this embodiment needs to construct a composite query mask corresponding to the user intent encoding. This mask remains unchanged in the intent encoding bit fields, while wildcards (all 1s) are used in other bit fields (such as priority and business domain). Then, this embodiment performs a bitwise AND operation between the composite query mask and the target node composite mask value, and checks whether the result contains the characteristic bit pattern of the user intent encoding.
[0080] For example, assuming the user intent is "affirmative" (basic encoding is 1) and the current business domain is "loan business" (encoded as 1), the composite query mask constructed in this embodiment might be 0xFFFF0001 (hexadecimal, where FFFF indicates that the priority and business domain bit fields use wildcards). If the target node's composite mask value is 0x01010007 (indicating support for "affirmative," "negative," and "uncertain" intents, all of which are "key" priorities in the "loan business" domain), then the bitwise AND operation result is 0x01010001, which includes the characteristic bits of the "affirmative" intent, thus indicating a successful match.
[0081] Therefore, through this matching based on composite masks and dynamic priority strategies, this embodiment achieves the following technical advantages: First, the multi-level encoding structure enables the encoding of richer semantic information within a single integer value, supporting more granular branch management and control. Compared to the single-level encoding in the basic scheme, composite encoding can express multi-dimensional information such as intent, priority, and business domain, providing the system with richer decision-making basis. Second, the business domain-based mask pre-screening mechanism significantly improves the processing efficiency of large-scale multi-domain systems. In complex systems containing multiple business domains, quickly filtering irrelevant branches through business domain masks can reduce unnecessary computation by more than 90%, especially important in cross-domain call scenarios under microservice architectures. Third, the dynamic priority strategy can adaptively adjust the processing logic according to the load, prioritizing critical business processes under resource constraints and maximizing overall throughput when resources are sufficient. This differentiated service quality management capability is crucial for high-availability systems that require 24 / 7 operation, maintaining the responsiveness of core functions even under peak loads. Finally, despite the introduction of a multi-level structure and dynamic strategy, this embodiment still maintains the high efficiency of bitwise operations. All judgment operations are still based on bitmasks and bit operations, keeping the time complexity at O(1), ensuring that performance is not sacrificed while enhancing functionality.
[0082] In practical applications, this composite masking mechanism is particularly suitable for complex intelligent dialogue systems that integrate multiple business lines and scenarios. For example, in a comprehensive service platform in the financial industry, dialogue processes from multiple business domains such as loans, credit cards, and investment management may be processed simultaneously. Through composite masking and prioritization strategies, the responsiveness of core transaction processes can be prioritized during peak periods, while providing comprehensive service capabilities during off-peak hours, achieving an optimal balance between resource utilization and user experience.
[0083] In some embodiments, this embodiment further provides a state management mechanism based on causal caching. The step of assigning an code to each intent in a preset intent category set by a power of a specified cardinality, and generating an intent code mapping table, further 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.
[0084] In this embodiment, update events of the intent encoding map are marked with corresponding vector clocks. A vector clock is a logical clock mechanism used in a distributed system to track the causal relationships of events. It does not rely on global synchronization of physical time, but instead 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 dependencies of the intent encoding map 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 known logical time of node i. When a node executes a local event (such as updating the map), it increments its corresponding element value; when a node receives a message from another node, it merges its own vector clock with the vector clock in the message, taking the maximum value of each element.
[0085] For example, in a system with 3 nodes, the initial vector clock is [0,0,0]. If node 1 updates the mapping table, it increments its clock to [1,0,0]; if node 2 subsequently modifies the mapping table again based on node 1's update, its vector clock will become [1,1,0]. This mechanism ensures that "preceded" relationships between events can be identified, and the causal order of events can be determined even for events on different nodes.
[0086] Subsequently, an encoding dependency graph was established based on version numbers, timestamps, and vector clocks. The encoding dependency graph is a directed graph structure used to represent the dependencies and causal relationships between intent codes. In the graph, nodes represent specific versions of intent codes, edges represent dependencies between codes, and weights may represent dependency strength or update frequency. Through the graph structure of the encoding dependency graph, it is possible to track the evolutionary history of codes, understand the mutual influence between different encoding versions, and follow the correct causal order when updates are needed.
[0087] Specifically, the process of constructing the encoding dependency graph includes: first, representing each version of the intent encoding mapping table as a node in the graph; second, determining the "previous" relationship between nodes by analyzing vector clocks and adding corresponding directed edges; then, determining the dependency type and strength based on the type of update operation (e.g., addition, deletion, modification); and finally, determining the optimal order of encoding updates using graph algorithms (e.g., topological sorting). Therefore, constructing the encoding dependency graph not only supports system consistency maintenance but also provides visualization and analysis tools for the evolution of intent encoding.
[0088] In the process node transition phase, this embodiment introduces state dependency and causal consistency mechanisms. First, when determining the target process node, the state information of the current process node is obtained. This state information is a data set describing the current running state of the process node, including node ID, execution stage, context variables, input / output parameters, etc. This information collectively constitutes a complete state description of the node, which is the foundation for continuous process execution and state recovery. Next, this embodiment determines the corresponding state dependency chain for each process instance. A process instance refers to a running instance of a specific process being executed in a particular user session; each instance has a unique identifier and an independent execution state. The state dependency chain is an ordered list or chain structure used to describe the state dependencies between nodes in a process instance. Dependencies are typically derived from data flow and control flow analysis: if node B uses data generated by node A, or if the execution conditions of node B depend on the execution results of node A, then node B is considered dependent on node A. Through the state dependency chain, the propagation path of node states can be understood, providing a basis for consistency maintenance and fault recovery.
[0089] Furthermore, based on the state information of the current process node, the state dependency chain of the process instance, the vector clock, and the encoded dependency graph, causal identifiers are generated and marked on the target process node. These causal identifiers are special metadata tags used to represent the causal relationship between the target node and its dependent nodes. They typically include the current vector clock, a list of dependent nodes, and state summary information, enabling verification of causal consistency during subsequent execution and ensuring that nodes are executed in the correct causal order. The generation process of causal identifiers comprehensively considers the direct dependencies in the state dependency chain and the indirect dependencies in the encoded dependency graph, forming a complete causal description.
[0090] To efficiently manage node states and causal relationships, this embodiment defines a multi-level causal caching structure. A multi-level causal caching architecture is a hierarchical caching architecture used to store and manage state information and causal relationship data of process nodes. This caching architecture comprises three layers: local cache, service cache, and global cache. The local cache resides within a single service instance, uses memory storage, and provides the fastest access speed but has limited capacity. The service cache is shared among multiple instances of the same service, typically implemented using distributed memory caching such as Redis, providing relatively fast access speed and moderate capacity. The global cache is shared across all services in the entire system, typically implemented based on a distributed cache cluster or database, providing the largest capacity but relatively slower access speed.
[0091] Therefore, this embodiment employs a multi-level caching structure, adopting a design concept similar to CPU caching in computer architecture. By having different levels of cache work together, it balances access speed, capacity, and consistency maintenance costs. When accessing the state of a node is required, the local cache is checked first; if a cache miss occurs, the service cache and global cache are queried sequentially. Write operations use write-through or write-back strategies to ensure consistency across different cache levels. Based on the causal dependencies of cached items in the multi-level causal caching structure, a causal dependency directed graph is formed. A causal dependency directed graph is a special graph structure used to represent the causal dependencies between cached items. In the graph, nodes represent cached data items (usually process node states), and edges represent causal dependencies between data items, enabling the tracking of dependency chains and supporting consistency maintenance and failure propagation.
[0092] Specifically, the process of constructing a causal dependency directed graph includes: first, representing each cached data item as a node in the graph; second, analyzing the dependency relationships between data items based on the state dependency chain and the encoded dependency graph, and adding corresponding directed edges; then, assigning weights to the edges to represent the dependency strength or update frequency; and finally, optimizing the graph structure through graph algorithms, removing redundant edges or merging similar nodes to improve the efficiency of subsequent operations.
[0093] Furthermore, based on the causal dependency directed graph, a cache invalidation strategy is determined. A cache invalidation strategy defines a set of rules for identifying and handling other affected data items when a data item changes. In traditional caching systems, invalidation strategies are typically based on time (e.g., TTL) or capacity (e.g., LRU, LFU); however, in systems with complex causal dependencies, the invalidation strategy needs to consider the dependencies between data items to ensure consistency.
[0094] Specifically, the cache invalidation strategy adopted in this embodiment is based on the analysis of causal dependency directed graphs, and mainly includes the following mechanisms: First, a cascading invalidation mechanism is employed. When a data item changes, all data directly or indirectly dependent on that item are identified through a causal dependency directed graph and marked as invalid. This ensures consistency across the dependency chain but can lead to large-scale invalidations, increasing system load. Second, a priority-based invalidation mechanism is introduced. This embodiment allocates priorities based on the importance, access frequency, and dependency strength of data items, prioritizing the consistency of high-priority data under resource constraints. This differentiated strategy balances consistency and performance, making it suitable for large-scale distributed systems. Finally, a lazy validation mechanism is implemented. This embodiment does not immediately delete or update all affected cached items but adds validation flags to them. When these items are accessed again, it checks whether their dependent data has changed, and only performs actual updates if necessary. This on-demand validation mechanism significantly reduces unnecessary computation and network transmission, improving system efficiency.
[0095] To further optimize storage efficiency, this embodiment converts the state information of process nodes into a highly compressed bitmap representation. Bitmap representation is a technique that encodes complex data structures into binary bit sequences, significantly reducing storage space requirements. In this embodiment, bitmap representation is mainly used to encode the state information of process nodes, including execution phases, input / output parameters, and context variables. The conversion process typically includes the following steps: First, defining a state encoding map to determine the position and encoding rules of various types of state information in the bitmap; second, converting the state information into a binary sequence according to predefined rules; then, applying bit compression algorithms (such as run-length encoding, Huffman coding, etc.) to further reduce data volume; finally, adding check bits to ensure data integrity. This bitmap representation not only reduces storage space but also improves serialization and transmission efficiency, making it particularly suitable for state management in large-scale distributed systems.
[0096] Furthermore, based on a multi-level causal caching structure and causal dependencies, this embodiment performs state sharding storage on the bitmap representation based on process nodes and their corresponding time windows. State sharding is a technique that decomposes large state data into multiple smaller fragments for independent storage, improving parallel processing capabilities and fault isolation. A time window refers to a set of state data within a specific time range, typically divided based on the time dimension of process execution. Specifically, the implementation of state sharding storage includes the following mechanisms: First, a sharding strategy is determined based on the node ID and time window, dividing the state data into multiple logical shards; second, storage locations are allocated to each shard, potentially distributed across different cache levels or physical nodes; third, a sharding index table is maintained to record the mapping relationship between shards and storage locations; finally, shard access and aggregation logic is implemented, supporting cross-shard state query and update operations.
[0097] Optionally, by introducing time windows, time-dimensional state management can be achieved, such as retaining 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 that change over time), and session windows (dynamic intervals based on activity intervals). This embodiment can select an appropriate window strategy based on business needs and resource conditions to balance storage costs and query performance.
[0098] Therefore, state management based on bitmap representation and sharded storage offers several technical advantages: First, bitmap representation significantly reduces storage space requirements, with actual measurements showing a reduction of over 70% compared to JSON format; second, sharded storage improves parallel processing capabilities, enabling the simultaneous processing of state data from multiple shards; third, time-window-based management supports historical state access and point-in-time recovery, enhancing reliability and maintainability; and finally, the combination with multi-level caching and causal dependency management ensures the consistency and availability of state data in a distributed environment.
[0099] 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 financial services platform deployed across regions, this embodiment may handle the dialogue processes of millions of users simultaneously, each with its own independent state and execution path. Through the aforementioned technical means, this embodiment can provide a high-performance, highly available service experience while ensuring state consistency, maintaining basic functionality even in the event of network partitions or node failures, significantly improving the robustness and reliability of the system.
[0100] Therefore, this embodiment supports complex multi-turn dialogues and contextual understanding through state management. In intelligent customer service scenarios, user interactions with the system typically span multiple rounds, requiring accurate understanding and maintenance of the dialogue context. Through precise modeling of causal dependencies and efficient state management, contextual coherence can be maintained throughout extended dialogues, accurately understanding the evolution of user intent and providing a coherent and natural interactive experience. Practice has shown that this mechanism can improve the accuracy of contextual understanding in complex multi-turn dialogues by more than 15%, significantly outperforming traditional dialogue management methods based on simple state machines.
[0101] In some embodiments, this embodiment further provides an automatic encoding optimization mechanism based on static analysis and Monte Carlo tree search. The step of assigning an encoding to each intent in a preset intent category set by a power of a specified cardinality, and generating an intent encoding mapping table, further 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.
[0102] In this embodiment, an intent association graph is constructed based on business processes and historical interaction data. This intent association graph is a special type of weighted directed graph used to represent the relevance and mutual exclusion between different intents. In the graph, nodes represent intent categories, edges represent relationships between intents, and edge weights represent the strength of those relationships. Relevance refers to the tendency for two intents to co-occur in the same session or adjacent nodes, typically quantified using indicators such as conditional probability or mutual information. Mutual exclusion refers to the degree to which two intents are unlikely to be simultaneously valid in the same context, typically determined through exclusiveness analysis or identification of opposing intents.
[0103] Specifically, the process of constructing an intent association graph includes: First, extracting intent transformation sequences from historical interaction data and recording the frequency of intent A being immediately followed by intent B; second, calculating the conditional probability and mutual information between intent pairs through statistical analysis; then, analyzing the logical relationships between intents based on the business process diagram, such as mutual exclusion or mutual dependence; finally, constructing a complete association graph by integrating the above information, where the edge weights comprehensively consider statistical relevance and logical relationships. For example, "affirmative" and "negative" intents are logically mutually exclusive, even if they may appear simultaneously statistically (e.g., both affirmative and negative expressions in user speech), this embodiment will mark them as mutually exclusive based on logical relationships.
[0104] Subsequently, based on the constructed intent association graph, intent feature vectors and conflict identification results are generated. The intent feature vector is a multi-dimensional numerical representation describing the position and characteristics of an intent in the association network, typically including indicators such as centrality (measuring the importance of the intent), clustering coefficient (measuring the strength of association with adjacent intents), and transition probability (measuring the tendency to transition to other intents). The conflict identification result is a list of intent conflicts derived by analyzing the mutual exclusion relationships in the intent association graph, recording which intents should avoid using the same bits during encoding allocation. Specifically, this embodiment calculates the structural features of each intent node using network analysis algorithms (such as PageRank, centrality analysis, etc.) to form a feature vector; simultaneously, it identifies mutually exclusive intent pairs using graph coloring or conflict detection algorithms to generate a conflict matrix. These analyses not only consider statistical correlations but also integrate business rules and domain knowledge to ensure that the results meet practical application requirements.
[0105] Furthermore, based on the intent feature vector and conflict identification results, an intent conflict set is formed. This intent conflict set is a data structure used to record the set of intents that need to avoid sharing the same code bit during the encoding allocation process. It is typically represented as a set of intent pairs, each pair representing two intents that should not use the same code bit. The construction of the conflict set is based not only on mutual exclusion analysis but also on encoding efficiency and performance requirements, aiming to balance encoding space utilization and conflict risk. In addition, based on the intent conflict set, this embodiment groups the preset global intent pool according to conflict relationships, forming relatively independent encoding domains. The global intent pool is the set of all possible supported intents, typically containing dozens to hundreds of intent categories. An encoding domain is a subset of intents that are relatively independent in encoding allocation; intents within a domain may share code bits, but intents between different domains typically use different code bit segments. Therefore, by employing a domain-based strategy, the key to solving the large-scale intent encoding allocation problem is decomposed into multiple local optimization problems, significantly reducing computational complexity.
[0106] It should be noted that the grouping process typically employs graph segmentation algorithms, such as spectral clustering or community detection, to divide the intent association graph into multiple subgraphs, each corresponding to a coding domain. The goal of segmentation is to minimize the sum of edge weights between domains, i.e., to group strongly related or mutually exclusive intents into the same domain as much as possible, reducing cross-domain conflicts. The number and size of domains are usually determined based on the bit width of the integer space and the characteristics of the business. For example, for a 32-bit integer, it may be divided into 4-8 domains, each using 4-8 bits of coding space.
[0107] Furthermore, constructing and traversing the search space for encoding assignment is a core step in encoding optimization. The search space refers to the set of all possible encoding assignment schemes, and its size grows exponentially with the number of graphs. To efficiently explore this vast space, this embodiment employs the 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 problems, and 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, during the selection phase, the algorithm starts from the root node (initial state) and selects the most promising search path based on the Upper Confidence Bound (UCB) or its variants; during the expansion phase, the algorithm adds new child nodes to the selected nodes, representing new encoding assignment decisions; during the simulation phase, the algorithm randomly simulates from the new nodes until the final state, evaluating the quality of the encoding scheme; during the backpropagation phase, the algorithm propagates the evaluation results back along the search path, updating the node value estimates and visit counts.
[0108] When applying MCTS for encoding allocation search, this embodiment combines the search process with the encoding domain, prioritizing the encoding allocation of intents within a domain, and then coordinating the allocation relationships between domains. The search objective is to minimize conflicts and maximize encoding efficiency. Conflict minimization refers to avoiding mutually exclusive intents sharing encoding bits as much as possible, reducing ambiguity and misidentification caused by intent conflicts; maximizing encoding efficiency refers to pursuing a more compact encoding space and more efficient bit operations, typically achieved by reducing the number of bits used and optimizing bit distribution. It should be noted that a key advantage of MCTS is its ability to balance exploration and utilization: it can explore unknown solution spaces while utilizing known high-value regions, making it very suitable for encoding allocation problems with large search spaces but obvious local patterns. This embodiment iterates through multiple runs of MCTS, continuously optimizing the encoding allocation scheme until a preset termination condition is reached (such as an upper limit on the number of iterations, a convergence threshold, or a computation time limit).
[0109] After the search is completed, this embodiment obtains the current encoding allocation scheme, which specifies the encoding assigned to each intent by a power of a radix. Specifically, each intent is assigned an integer value equal to 2 to the power of n (where n is a specific integer), ensuring that only one bit is 1 in the binary representation, thereby supporting efficient bitwise operations.
[0110] To further optimize the encoding structure, this embodiment divides the 32-bit or 64-bit integer space according to business domains, forming a multi-layer encoding structure. A multi-layer encoding structure is an organization method that divides the integer space hierarchically, with different levels corresponding to different semantic dimensions. For example, in the 32-bit integer space, a possible division is: bits 0-15 for basic intent encoding, bits 16-23 for business domain identification, and bits 24-31 for control flags. This hierarchical design allows the encoding to not only represent the intent itself but also carry meta-information such as business domains and priorities, enhancing the expressive power and scalability of the encoding.
[0111] Furthermore, based on the multi-layered encoding structure, the current encoding allocation scheme is optimized into an encoding mapping scheme. Specifically, the encoding positions are adjusted to meet the hierarchical requirements; dedicated bit segments are allocated to different business domains; necessary control bits and metadata bits are added; and frequently used intents are ensured to receive more favorable encoding positions (such as low bits or special bit segments). Therefore, by optimizing the encoding allocation scheme into an encoding mapping scheme, not only the static encoding structure is considered, but also runtime performance requirements, such as bit operation efficiency under specific hardware architectures and cache line alignment.
[0112] Finally, this embodiment optimizes the encoding scheme through a continuous learning mechanism. Specifically, it obtains the usage frequency and hit rate of the encoding for each intent in the current actual usage process. Usage frequency refers to the proportion of times a specific intent is recognized or processed during operation out of the total number of intent processing times; hit rate refers to the accurate matching rate of the intent encoding in the bitwise operation matching process, reflecting the effectiveness of the encoding design. This runtime data, collected through log analysis, performance monitoring, and user feedback, forms the empirical basis for encoding optimization.
[0113] In this implementation, based on collected usage frequency and hit rate data, a coding efficiency prediction model is trained. This model is a machine learning model designed to predict system performance and matching efficiency under different coding allocation schemes. It typically employs supervised learning methods, taking coding features (such as position, bit depth, and distribution pattern) as input and performance metrics (such as average matching time, memory usage, and accuracy) as output, learning the mapping relationship between them. Common model types include regression models, decision trees, or neural networks, depending on the data scale and complexity. After training, the current coding allocation scheme is optimized based on the coding efficiency prediction model. The optimization process may include: adjusting the coding positions of high-frequency intents to obtain more favorable hardware processing characteristics; reallocating high-conflict-rate intent codes to reduce false matches; dynamically adjusting the size and boundaries of the coding domain to adapt to business changes; and even completely reconstructing the coding mapping table to achieve global optimization. This optimization based on actual usage data forms a closed-loop feedback mechanism that can continuously evolve with business development and changes in usage patterns, maintaining optimal performance.
[0114] It is important to note that code optimization is typically not a one-time operation, but an ongoing process. This implementation regularly (e.g., weekly or monthly) executes the optimization process described above, adjusting the coding scheme based on new usage data and business needs. To ensure stability, code changes usually follow strict version management and smooth transition strategies, such as retaining compatibility handling of old code, phased rollout of new code, and setting up rollback mechanisms.
[0115] Therefore, this embodiment, through its encoding optimization mechanism based on intent association analysis and advanced search algorithms, has several technical advantages: First, it can customize encoding schemes according to actual business needs and usage patterns, avoiding the inefficiency of general encoding; second, the multi-layer encoding structure and domain partitioning strategy significantly improve the utilization of the encoding space, supporting efficient processing of more intent categories; third, advanced algorithms such as Monte Carlo tree search can find near-optimal solutions in a vast search space, balancing computational complexity and solution quality; finally, the continuous optimization mechanism based on actual usage data enables the encoding system to be adaptive, continuously improving with business development.
[0116] In practical applications, this optimization mechanism is particularly important for large-scale enterprise-level dialogue systems. For example, in a bank's integrated business platform, it may be necessary to support hundreds of different intent categories, spanning more than a dozen business domains, with significant differences in the frequency and importance of each intent. The optimization mechanism in this embodiment can assign optimal encoding to high-frequency core intents, significantly improving overall performance; simultaneously, through a multi-layered encoding structure, it enables cross-business domain intent collaborative processing, supporting complex hybrid domain dialogue scenarios. Practice has shown that this optimization mechanism can increase intent matching throughput by more than 40% while reducing CPU and memory consumption by 30%, which is of significant value for high-concurrency enterprise-level applications.
[0117] Based on the above embodiments, in some embodiments, the step of constructing a search space for encoding allocation, traversing the search space, and combining 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 to obtain the current encoding allocation scheme 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.
[0118] In this embodiment, the state tree is constructed based on two key concepts: action space and state transition rules. The action space refers to the set of all possible code allocation actions that can be executed in a specific state. In the code allocation problem, an action is typically represented as "assign code X to intent A". The action space dynamically changes as the allocation process progresses: as more intents are assigned codes, the available code bits and the number of unassigned intents decrease, correspondingly shrinking the action space. State transition rules define how the system state changes after executing a specific action. In code allocation, after executing an allocation action, the new state will contain an updated intent-code mapping table, and the set of available codes and the set of unassigned intents will also be updated accordingly.
[0119] Subsequently, based on the action space and state transition rules indicated by the encoding and allocation state tree, a Monte Carlo Tree Search (MCTS) model is established. It should be noted that MCTS is a sampling-based heuristic search algorithm, particularly suitable for handling decision problems with large state spaces that cannot be fully traversed. By selectively expanding the search tree and using stochastic simulation to evaluate the value of decision paths, a balance is struck between computational resources and search performance. The core idea of MCTS is "explore where possible, utilize where known advantages exist," a characteristic that makes it particularly suitable for problems like encoding and allocation that require finding approximate optimal solutions in a large solution space. Therefore, in the constructed MCTS model, the root node of the search tree represents the initial state, i.e., an empty state where all intentions are unassigned. Starting from the root node, the algorithm repeatedly executes four key steps: selection, expansion, simulation, and backpropagation, continuously expanding the search tree and optimizing the decision path.
[0120] The first stage is the selection phase. In this phase, based on the current encoding state and the preset UCB1 selection strategy, this embodiment traverses the search tree downwards from the current node until it reaches a node that has not yet been fully expanded (i.e., there are still untried actions). The UCB1 (Upper Confidence Bound 1) selection strategy is a commonly used node selection algorithm in MCTS, which aims to balance the trade-off between exploration and exploitation. The UCB1 formula considers two factors: the average benefit of a node (exploiting known high-value paths) and the uncertainty of node access (exploring insufficiently evaluated paths). The UCB1 selection strategy ensures that the algorithm can both deeply explore known high-value paths and appropriately try new paths that have not been fully explored, avoiding getting trapped in local optima.
[0121] Specifically, in the encoding allocation problem, UCB1 calculates the "upper bound of value" for each possible encoding allocation action, comprehensively considering the historical average return of the action and the degree of underexploration. This embodiment selects the action with the highest UCB1 value; this action either has a good historical performance or has not yet been fully explored, possessing potentially high value. An action is only considered when its encoding allocation evaluation value reaches a preset evaluation threshold. The evaluation threshold is a minimum value standard preset by the system, used to filter out obviously poor allocation actions and improve search efficiency.
[0122] Once an action is selected, this embodiment enters the expansion phase. In this phase, the system expands the selected code assignment action, generating a new node in the MCTS model. Expansion refers to implementing the selected action, creating a new tree node representing the new state after executing the action. The expansion process follows state transition rules, updating the intent-code mapping table, the set of available codes, and the set of unassigned intents. For example, if the selected action is "assign code 2^3 (i.e., binary 00001000) to the intent 'query balance'", the new node will represent a state where "query balance" has been mapped to this code, and this code has been removed from the set of available codes.
[0123] After generating new nodes, this embodiment enters the simulation phase. For the newly generated nodes, this embodiment simulates the complete encoding allocation process using a preset random strategy and calculates the evaluation score of the simulated encoding allocation scheme. Simulation is the core component of MCTS. It executes actions randomly (or according to simple heuristics) starting from the current state until a termination state is reached (i.e., all intentions have been encoded or no further allocation is possible), and then evaluates the value of the final state.
[0124] In the coding assignment problem, random strategies typically employ controlled randomization: in this embodiment, a randomized intent is selected from the unassigned intents, and then a matching code is selected from the available codes (considering code domain partitioning and conflict constraints). This process is repeated until all intents are assigned codes or the constraints cannot be satisfied. The design of a randomized strategy requires a balance between pure randomness (ensuring broad exploration) and problem-specific heuristics (improving solution quality). For example, this embodiment might prioritize assigning better code bits to high-frequency intents or core business intents, or avoid known assignment patterns that could lead to conflicts.
[0125] After the simulation is completed, this embodiment calculates the evaluation score of the complete coding allocation scheme obtained from the simulation. The evaluation score is a comprehensive indicator to measure the quality of the coding scheme, and usually considers multiple factors: conflict minimization (the degree to which mutually exclusive intentions do not share coding bits), coding efficiency (the degree of optimization of the number of bits used and their distribution), business priority (the degree to which high-priority intentions obtain high-quality coding), etc. This embodiment may use a weighted sum or multi-objective evaluation function to combine these factors and generate a single score value.
[0126] After obtaining the evaluation scores, this embodiment enters the backpropagation phase. Based on the evaluation scores, this embodiment propagates upwards along the search path of the MCTS model, updating the visit count and average reward of each node, completing the backpropagation update. Backpropagation is the final step of MCTS; it transmits the simulation results (evaluation scores) from the leaf nodes back to the root node, updating the statistics of all nodes on the path. Specifically, for each node on the path, its visit count is increased, and its average reward is updated (the current average reward is combined with the new simulation results according to weights). These updated statistics will affect the calculation of UCB1 in the next iteration, thereby adjusting the search strategy. It should be noted that the essence of backpropagation is information transmission and value updating: by transmitting the evaluation results of the leaf nodes back to the ancestor nodes, the entire search tree can "learn" which decision paths are more valuable. This mechanism allows MCTS to gradually concentrate search resources on more promising regions as the number of iterations increases, improving algorithm efficiency.
[0127] After completing one round of selection, expansion, simulation, and backpropagation, this embodiment repeats these four steps to continuously explore the coding allocation space and optimize the allocation scheme. This repetitive process continues until a preset termination condition is met, such as a preset number of iterations (a fixed computational resource limit), a computation time limit, or a convergence threshold (where the optimal solution changes very little across multiple iterations). In this embodiment, a preset number of iterations is used as the termination condition, a simple and effective resource control method. After the iterations are complete, this embodiment needs to select the final coding allocation scheme from the search tree. There are typically two selection criteria: the maximum number of visits or the maximum average return. The node with the highest number of visits represents the path most frequently explored during the search process, which usually indicates that the path has high potential value; the node with the highest average return directly represents the best-performing path in historical simulations. Both criteria have their advantages: the number of visits focuses more on the sufficiency of exploration, while the average return more directly reflects the quality of the scheme. This embodiment can choose one of them or consider both comprehensively based on the specific characteristics of the problem.
[0128] In the coding assignment problem, if the search space is particularly large or complex, the number of visits may be a more reliable indicator because it mitigates the impact of simulation randomness. If the simulation strategy is well-designed and the evaluation function is accurate, the average return may more directly reflect the quality of the solution. In practice, this embodiment may set a minimum number of visits threshold, and then select the node with the highest average return among those nodes that meet the threshold. This ensures both thorough exploration and priority is given to high-quality solutions.
[0129] After selecting the final node, this embodiment extracts the encoding allocation action sequence corresponding to that node and applies these actions to obtain a complete encoding allocation scheme. The encoding allocation scheme is a mapping table that specifies the encoding value (a power of the cardinality) corresponding to each intent. This scheme will be used for subsequent intent recognition and flow control, and is also the basis for multi-layer encoding structure optimization.
[0130] 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 assignments within the domain 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 weights, adjusting the focus of subsequent assignments based on the characteristics of the assigned intentions; finally, parallel MCTS can utilize multi-core processing capabilities to explore multiple search paths simultaneously, significantly improving algorithm efficiency.
[0131] This MCTS-based encoding allocation method has several technical advantages: First, it can effectively handle a large search space, finding near-optimal solutions even with a large number of intentions (e.g., hundreds); second, the algorithm's exploration-balancing mechanism allows it to avoid local optima and discover innovative allocation patterns; third, the scalability of MCTS allows the system to adjust the search depth and breadth according to available computing resources, finding a balance between performance and quality; finally, this method is easily combined with other optimization techniques (such as coding domain partitioning and multi-layer coding structures) to form a comprehensive optimization solution.
[0132] In practical deployments, MCTS-based coding allocation systems typically run as offline or near-real-time components, updating the coding scheme periodically (e.g., weekly or monthly) based on the latest intent usage data and business requirements. This embodiment compares the newly generated scheme with the currently running scheme to assess the degree of improvement, and only replaces the scheme after confirming a significant improvement, ensuring stability. To support a smooth transition, this embodiment typically implements a dual-version operation mechanism, allowing the old and new coding schemes to be used in parallel for a period of time until the stability and superiority of the new scheme are confirmed.
[0133] Therefore, this embodiment, through its encoding allocation optimization mechanism, can maintain high bitwise operation performance and accurate branch matching while supporting diverse intents, providing a strong technical foundation for intelligent dialogue systems. Practice has proven that compared to traditional manual encoding or simple heuristic methods, the MCTS-based method can improve encoding efficiency by 15-25%, significantly reduce computational resource consumption, and improve system scalability and maintainability, making it particularly suitable for the development and optimization of complex enterprise-level dialogue systems.
[0134] like Figure 2 As shown, this embodiment provides a process branch matching system based on power-value encoding and bitwise operation judgment, including: The intent encoding module 201 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 202 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 the at least one target code found, generate a node mask value, 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 value. The user intent recognition module 203 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 204 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 205 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.
[0135] Therefore, this application solves the efficiency bottleneck and maintenance difficulties in traditional process branch judgment by combining power-value encoding and bitwise operations. It is suitable for scenarios requiring efficient branch judgment, such as intelligent dialogue systems and business process engines. This application can provide flexible branch condition combination capabilities while maintaining time complexity, significantly improving system performance and development and maintenance efficiency.
[0136] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
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 the at least one target code found, generate a node mask value, 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 value. 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
Business process processing method and device and computer readable storage medium
CN112099768A
User data query method, device and system
CN112182021A
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
Business process arrangement method, device, computer equipment and storage medium
CN119781760A