A method for replying to a dialogue of a multiplex sub-process and a computer device

CN122885223APending Publication Date: 2026-10-09ZHUYI TECHNOLOGY (GUANGDONG HENGQIN GUANGDONG-MACAO DEEP COOP ZONE) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611260707.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-19
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0003]然而,在子流程的实际运行过程中,对话平台返回的流程标识通常指向最初发起调用的父流程,在进入子流程后该标识一般不会发生变化,因此难以单纯依据流程标识的切换来判断当前是否处于被复用的子流程内部

Benefits of technology

[0016]本申请提供的一种复用子流程的对话回复方法及计算机设备,首先通过获取当前轮次的对话结果,获得当前流程标识和当前节点的节点标识;随后根据节点标识,判断当前节点是否属于被复用的子流程节点;在此基础上,若当前节点属于被复用的子流程节点,则从当前节点对应的多个条件回复中选取与当前流程标识匹配的目标条件回复;进而根据目标条件回复和当前节点的默认配置,生成当前轮次的回复内容。通过使用这样的方法,使得同一个子流程节点在被不同父流程调用时,能够根据调用来源匹配对应的条件回复并生成差异化的回复内容,无需为每个父流程单独复制子流程,从而在实现差异化回复的同时大幅减少了流程配置的重复劳动和维护成本,提升了客服机器人流程复用的灵活性和运营效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122885223A_ABST
    Figure CN122885223A_ABST
Patent Text Reader

Abstract

The application provides a dialogue reply method of a multiplexed sub-process and a computer device, relates to the technical field of artificial intelligence, and comprises the following steps: obtaining a dialogue result of a current round; judging whether a current node belongs to a multiplexed sub-process node according to a node identifier; if the current node belongs to the multiplexed sub-process node, selecting a target conditional reply matching a current process identifier from a plurality of conditional replies corresponding to the current node; and generating reply content of the current round according to the target conditional reply and a default configuration of the current node. The application can improve the flexibility and operation efficiency of customer service robot process multiplexing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and more specifically, to a dialogue response method and computer device for reusing sub-processes. Background Technology

[0002] In task-oriented customer service robot scenarios, as the types of business increase, several identical processing steps often appear between different business processes. To reduce the repetitive work of process configuration, existing technologies typically extract the identical processing steps into independent sub-processes, which can be called and reused by multiple parent processes.

[0003] However, during the actual operation of a sub-process, the process identifier returned by the dialogue platform usually points to the parent process that initially initiated the call. This identifier generally doesn't change after entering the sub-process, making it difficult to determine whether the current process is within a reused sub-process simply based on the change in the process identifier. Furthermore, when the same sub-process node is called by different parent processes, since only the current node can be identified and the specific source of the call cannot be known, the node can only be configured with a fixed set of response content, making it difficult to output differentiated response scripts based on different calling scenarios. If operations personnel want to configure different responses for different sources, they can only copy the sub-process multiple times and modify them separately, leading to an increase in the number of processes and higher maintenance costs.

[0004] Therefore, how to enable the same node to adapt to different response content based on different call sources, while ensuring that sub-processes are reused, is a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0005] This application provides a dialogue response method and computer device for reusing sub-processes, which can improve the flexibility and operational efficiency of customer service robot process reuse.

[0006] In a first aspect, embodiments of this application provide a dialogue response method for reusing sub-processes, the method comprising: Obtain the dialogue result of the current round, wherein the dialogue result includes at least: the current process identifier and the node identifier of the current node; Based on the node identifier, determine whether the current node belongs to a reused sub-process node; If the current node is a reused sub-process node, select the target condition response that matches the current process identifier from the multiple condition responses corresponding to the current node; Based on the target condition response and the default configuration of the current node, the response content for the current round is generated.

[0007] Optionally, determining whether the current node belongs to a reused sub-process node based on the node identifier includes: Detect whether the node identifier contains a preset separator; If the node identifier contains the separator, then the current node is determined to be a reused sub-process node; If the node identifier does not contain the separator, then the current node is determined not to belong to the reused subprocess node.

[0008] Optionally, selecting the target condition response that matches the current process identifier from multiple condition responses corresponding to the current node includes: Push the current process identifier as the parent process source onto the source stack of the session cache; Based on each of the parent process sources in the source stack, a target condition response that matches any of the parent process sources is selected from a plurality of condition responses.

[0009] Optionally, pushing the current process identifier as the parent process source into the source stack of the session cache includes: Obtain the top record of the source stack; If the source stack is empty, or the record at the top of the stack is different from the current process identifier, then the current process identifier is pushed onto the top of the source stack as a new parent process source. If the record at the top of the stack is the same as the current process identifier, then the source stack remains unchanged.

[0010] Optionally, before pushing the current process identifier as the new parent process source onto the top of the source stack, the method further includes: Obtain the current depth of the source stack; the current depth is used to characterize the current stored capacity of the source stack; If the current depth is less than the preset maximum depth threshold, then the current process identifier is pushed onto the top of the source stack as a new parent process source, and the source identifier of this round is set to a valid state; If the current depth is greater than or equal to the maximum depth threshold, then the source stack remains unchanged, and the source identifier for this round is set to an invalid state.

[0011] Optionally, selecting a target condition response from the plurality of condition responses that matches any of the parent process sources includes: Obtain the conditional response list corresponding to the current node, where each conditional response in the list contains a sort value and a condition type; According to the sorting value in ascending order, traverse each conditional reply in the conditional reply list in turn; If the condition type of the current condition response is the parent process type, obtain the source identifier for this round; If the source identifier of this round is in a valid state, traverse each parent process source in the source stack. If there is any parent process source that belongs to the set of parent process sources corresponding to the conditional response, then the conditional response is determined as the target conditional response, and the traversal stops. If the source identifier for this round is invalid, then skip the conditional response currently being traversed.

[0012] Optionally, traversing each conditional response in the conditional response list further includes: If the condition type of the current conditional response is a tag type, then obtain the tag rule identifier corresponding to the conditional response; The tag rule corresponding to the tag rule identifier is read from the preset tag rule library. The tag rule includes at least one tag dimension and a set of allowed values ​​for each tag dimension. Obtain the current value corresponding to each of the aforementioned tag dimensions from the current session data; For each of the label dimensions, determine whether the current value belongs to the set of allowed values; If the current values ​​of all the label dimensions included in the label rule belong to their respective sets of allowed values, then the label rule is determined to be a hit; If the tag rule is matched, the conditional response is determined as the target conditional response, and the traversal stops; If the current value of any label dimension in a label rule does not belong to the corresponding set of allowed values, then the label rule is determined to be a miss, and the process continues to iterate through the next conditional response.

[0013] Optionally, generating the response content for the current round based on the target condition response and the default configuration of the current node includes: Obtain the default configuration of the current node, wherein the default configuration contains multiple configuration fields; The field existence set and sparse configuration in the target condition response are obtained. The field existence set is used to record the fields that have been configured in the target condition response, and the sparse configuration is used to store the field values ​​corresponding to each of the configured fields in the target condition response. For each configuration field in the default configuration, if the field exists in a set containing the configuration field, then the corresponding field value is obtained from the sparse configuration and filled into the configuration field; If the set does not contain the configuration field, then the value of the configuration field in the default configuration remains unchanged; The response content is generated based on the values ​​of each configuration field.

[0014] Optionally, before generating the response content based on the values ​​of each configuration field, the method further includes: Obtain the preset dependency relationship between each of the configuration fields, wherein the dependency relationship indicates that the validity of the first configuration field depends on the existence or value of the second configuration field; Verify whether the values ​​of each configuration field satisfy the preset dependency relationship; If the dependency relationship is not satisfied, the corresponding default value for the configuration field that does not satisfy the dependency relationship is obtained from the default configuration and filled into the configuration field, and the configuration field is re-validated according to the preset dependency relationship; If the re-verification still fails, then fill in the corresponding default values ​​for each of the configuration fields in the default configuration.

[0015] Secondly, embodiments of this application also provide a computer device, including: a processor, a memory, and a bus, wherein the memory stores program instructions executable by the processor, and when the computer device is running, the processor communicates with the memory via the bus, and the processor executes the program instructions to perform the dialogue response steps of the multiplexed subprocess as described in any of the first aspects.

[0016] This application provides a dialogue response method and computer device for reusing sub-processes. First, by obtaining the dialogue result of the current round, the current process identifier and the node identifier of the current node are obtained. Then, based on the node identifier, it is determined whether the current node belongs to a reused sub-process node. If the current node belongs to a reused sub-process node, a target conditional response matching the current process identifier is selected from multiple conditional responses corresponding to the current node. Finally, based on the target conditional response and the default configuration of the current node, the response content for the current round is generated. By using this method, when the same sub-process node is called by different parent processes, it can match the corresponding conditional response based on the calling source and generate differentiated response content, eliminating the need to copy the sub-process for each parent process. This significantly reduces repetitive work and maintenance costs in process configuration while achieving differentiated responses, improving the flexibility and operational efficiency of customer service robot process reuse. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart illustrating a dialogue response method for reusing sub-processes provided in an embodiment of this application; Figure 2A flowchart illustrating the determination of whether a node belongs to a reused subprocess node in a dialogue response method for reusing subprocesses provided in this application embodiment; Figure 3 A schematic diagram of the process for selecting target condition responses in a dialogue response method for reusing sub-processes provided in an embodiment of this application; Figure 4 A schematic diagram of the source stack maintenance in a dialogue response method for reusing sub-processes provided in an embodiment of this application; Figure 5 A schematic diagram of the deep verification and source status setting in a dialogue response method for reusing sub-processes provided in an embodiment of this application; Figure 6 A schematic diagram of the parent process type conditional response matching in a dialogue response method for reusing sub-processes provided in an embodiment of this application; Figure 7 A schematic diagram of the tag type conditional reply matching process in a dialogue reply method for reusing sub-processes provided in an embodiment of this application; Figure 8 A schematic diagram illustrating the configuration of merging in a dialogue response method for reusing sub-processes provided in an embodiment of this application; Figure 9 A flowchart illustrating the configuration of field dependency validation in a dialogue response method for reusing sub-processes provided in an embodiment of this application; Figure 10 A schematic diagram of a dialogue response device for reusing sub-processes provided in an embodiment of this application; Figure 11 This is a schematic diagram of a computer device provided in an embodiment of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0020] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0021] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0022] Before providing a detailed explanation of this application, let's first introduce its application scenarios.

[0023] Taking banking as an example, both the bank card loss reporting process and the password reset process require user identity verification first; in e-commerce platforms, the return and exchange processes often share the address verification step. To reduce repetitive work in process configuration, operations personnel usually extract these common steps into independent sub-processes for multiple parent processes to call and reuse. However, when the same sub-process node is called by different parent processes, since the specific calling source is unknown, the node can only be configured with a fixed set of response content, making it difficult to output differentiated response scripts based on different calling sources. If operations personnel want to configure different responses for different sources, they can only copy the sub-process multiple times and modify them separately, leading to an increase in the number of processes and maintenance costs.

[0024] Based on this, this application provides a dialogue response method and computer device for reusing sub-processes. First, by obtaining the dialogue result of the current round, the current process identifier and the node identifier of the current node are obtained. Then, based on the node identifier, it is determined whether the current node belongs to a reusable sub-process node. On this basis, if the current node belongs to a reusable sub-process node, a target condition response matching the current process identifier is selected from multiple condition responses corresponding to the current node. Then, based on the target condition response and the default configuration of the current node, the response content of the current round is generated. This significantly reduces the repetitive labor and maintenance cost of process configuration while achieving differentiated responses, and improves the flexibility and operational efficiency of customer service robot process reuse.

[0025] The following explanation, in conjunction with the accompanying drawings, uses several embodiments to illustrate the concepts.

[0026] The dialogue response method for reusing sub-processes provided in this application embodiment can be executed by a computer device that has a task-oriented dialogue engine and a session management module pre-installed. The computer device can be, for example, a server or a terminal, and the terminal can be a computer or smart terminal device used by customer service personnel.

[0027] Figure 1 A flowchart illustrating a dialogue response method for reusing sub-processes provided in this application embodiment is shown below. Figure 1 As shown, the dialogue response method for this reused sub-process includes: S101, obtain the dialogue result of the current round.

[0028] The dialogue result includes at least: the current process identifier and the node identifier of the current node.

[0029] The dialogue result for the current round is the execution result data returned by the task-oriented dialogue engine after processing the user's input for this round.

[0030] The current process identifier is used to indicate the main process currently being executed by the dialogue engine. When a subprocess is called, the value of the current process identifier points to the parent process that called the subprocess. The node identifier of the current node is used to indicate the specific node position where the user is currently standing.

[0031] Specifically, after a user completes a round of question-and-answer interaction with the customer service robot, the task-oriented dialogue engine determines which node to jump to based on the user's input, the current session state, and the node routing relationships defined in the flowchart, and returns the result of this round of dialogue. The computer device receives this dialogue result and extracts the current process identifier and the node identifier of the current node from the dialogue result.

[0032] S102, Based on the node identifier, determine whether the current node belongs to a reused sub-process node.

[0033] Among them, a reused subprocess node refers to a node within a subprocess that is configured to be invoked by multiple parent processes. If the current node is a reused subprocess node, it means that the current node is shared by at least two different parent processes, and it is necessary to further identify the source of the call to select the appropriate response content. If the current node is not a reused subprocess node, it means that the current node is located within a normal process, there is no scenario of multiple source calls, and the default configuration of the node can be used directly to generate a response without executing the subsequent conditional response matching process.

[0034] Specifically, the node identifier of the current node is parsed, and the metadata carried by the node identifier itself is used to determine whether the current node is a node within a reused subprocess.

[0035] In one possible implementation, each node is assigned a node type attribute during process definition. This attribute records the node's classification, including ordinary nodes, reused nodes, etc. During process configuration, each node is tagged with this attribute and stored in the node configuration's metadata field. At runtime, the computer reads the node type attribute of the current node. If the node type attribute indicates that the current node is a reused node, then the current node is determined to belong to a reused sub-process node; otherwise, it is determined not to belong to a reused sub-process node.

[0036] If the current node is determined to be a reused sub-process node, then conditional response matching will be performed subsequently; if the current node is determined not to be a reused sub-process node, then the default configuration of the node will be used to generate the response content and return it to the user directly, without executing the subsequent conditional response matching process. At the same time, it indicates that the current dialogue has exited the sub-process, and the computer device clears the source stack in the session cache.

[0037] In one embodiment, taking a banking scenario as an example, when a user moves from the "Bank Card Loss Reporting Process" to the "Identity Verification Sub-Process" and then to the "Identity Verification Complete Node," the computer device reads the type attribute of this node, which is marked as "Reused Node," and determines that the current node belongs to a reused sub-process node. However, when the user is in a regular node within the "Bank Card Loss Reporting Process," the computer device determines that the current node does not belong to a reused sub-process node and directly uses the node's default configuration to generate the response content.

[0038] S103, if the current node belongs to a reused sub-process node, select the target condition response that matches the current process identifier from the multiple condition responses corresponding to the current node.

[0039] The multiple conditional responses corresponding to the current node refer to the multiple alternative response contents configured for the current node, each corresponding to different call sources or different matching conditions. Each conditional response includes the applicable conditions and the corresponding response content.

[0040] Specifically, if the current node belongs to a reused sub-process node, a pre-configured list of conditional responses for that current node is retrieved, containing several conditional responses. Then, using the current process identifier as the matching criterion, the conditional responses matching the current process identifier are searched one by one from the list. If a matching conditional response is found, it is designated as the target conditional response; if no matching conditional response is found, it indicates that there is no specific conditional response configuration for the current call scenario, and the node's default configuration can be used directly to generate response content subsequently.

[0041] In one embodiment, taking a banking scenario as an example, the "identity verification completion node" is configured with three conditional responses: the first applies when the current process is identified as "bank card loss reporting process," the second applies when the current process is identified as "password reset process," and the third is the default conditional response. When a sub-process is invoked from the "bank card loss reporting process," the current process is identified as "bank card loss reporting process." The computer device compares this identifier with the three conditional responses one by one, matches the first conditional response, and determines it as the target conditional response.

[0042] S104: Generate the response content for the current round based on the target conditions and the default configuration of the current node.

[0043] The default configuration for the current node refers to the complete default settings configured for that node, including at least the default reply content, and may also include other configuration fields such as reply mode, answer polishing switch, custom prompts, secondary confirmation parameters, and information collection parameters. The target condition reply may include reply content used to override the default configuration and other configuration fields.

[0044] Specifically, after successfully matching a response based on the target condition, the system retrieves the default configuration of the current node and the configuration information from the target condition response. The configuration information in the target condition response is sparse, meaning it only contains fields that need to differ from the default configuration; fields not included retain their corresponding values ​​from the default configuration. Following the rule that fields configured in the target condition response overwrite the corresponding values ​​in the default configuration, and fields not configured in the target condition response retain their corresponding values ​​from the default configuration, the target condition response and the default configuration are merged to generate the valid configuration for the current round. Subsequently, content rendering is performed based on parameters such as the response content, response mode, and polishing switch in the valid configuration to generate the final response content presented to the user for the current round.

[0045] If no target condition response is matched, the default configuration of the current node is directly obtained, and the response content for the current round is generated based on the parameters in the default configuration, so that the behavior reverts to a state that is completely consistent with the state when no condition response is configured.

[0046] In one embodiment, the default configuration of the current node is: reply content "Identity verification completed", reply mode is precise mode, and answer polishing switch is off. A certain target condition reply is configured with the reply content "Identity verification completed, please continue with the loss reporting process" and the answer polishing switch is on, but the reply mode is not configured. After merging, the effective configuration is obtained: reply content "Identity verification completed, please continue with the loss reporting process", answer polishing switch is on, and the reply mode continues to use the precise mode in the default configuration. Based on this effective configuration, the final reply content "Identity verification completed, please continue with the loss reporting process" is rendered, and answer polishing is performed before being returned to the user.

[0047] After generating the response content, the updated source stack is saved back to the session cache, so that the data in the source stack can persist across conversation rounds and be used in subsequent rounds.

[0048] In this embodiment, when the same sub-process node is called by different parent processes, it can match the corresponding conditions and generate differentiated response content according to the source of the call. There is no need to copy the sub-process separately for each parent process. This significantly reduces the repetitive work and maintenance costs of process configuration while achieving differentiated responses, and improves the flexibility and operational efficiency of customer service robot process reuse.

[0049] In the above Figure 1 Based on the corresponding embodiments, in order to more clearly demonstrate the specific implementation process of determining whether the current node belongs to the reused sub-process node according to the node identifier, this application also provides a possible implementation of the dialogue response method for reusing sub-processes. Figure 2 This application provides a flowchart illustrating the process of determining whether a node belongs to a reused sub-process node in a dialogue response method for reusing sub-processes. Figure 2 As shown, in S102 above, determining whether the current node belongs to a reused sub-process node based on the node identifier includes: S210, Detect whether the node identifier contains a preset separator.

[0050] The preset separator is one or more special characters pre-defined by the system during the process definition phase, used to distinguish different components in node identifiers. This separator is configured not to appear in the identifiers of ordinary nodes, but only in the identifiers of nodes within reused subprocesses.

[0051] Specifically, the system first reads the preset delimiter definition. The delimiter can be set by default or customized by the operator when configuring the process. In one embodiment, the preset delimiter is the vertical bar character "|"; in another embodiment, the preset delimiter is the double colon "::".

[0052] Then, using the preset delimiter as the matching target, a string search is performed on the node identifier to determine whether there is a substring in the character sequence of the node identifier that matches the preset delimiter.

[0053] In one possible implementation, a string search function is called to iterate through the node identifier character by character and attempt to match it with a preset delimiter. If the preset delimiter is located in the node identifier, the detection result is "contains"; if the preset delimiter is not located after iterating through the entire node identifier, the detection result is "does not contain".

[0054] In one embodiment, the preset separator is "|". When "|" is located in the node identifier, the detection result is "containment".

[0055] S220, if the node identifier contains a separator, then the current node is determined to be a reused subprocess node.

[0056] The determination rule is as follows: if the node identifier contains a preset separator, then the current node belongs to the reused subprocess node; if the node identifier does not contain a preset separator, then the current node does not belong to the reused subprocess node.

[0057] Specifically, if the detection result is "contains", then the current node is determined to be a reused sub-process node, and the process is transferred to the matching of the conditional response.

[0058] S230, if the node identifier contains a separator, then the current node is determined to be a reused subprocess node.

[0059] If the detection result is "not included", it is determined that the current node does not belong to the reused sub-process node, and the process directly jumps to the branch that generates the response content using the default configuration of the current node, without executing the subsequent conditional response matching process.

[0060] In this embodiment, it is possible to accurately identify whether the current node belongs to a reused subprocess node based on whether the node identifier contains a preset separator, without depending on whether the process identifier has been switched, thus ensuring the reliability of the identification and reducing the computational overhead during runtime.

[0061] In the above Figure 1 Based on the corresponding embodiments, in order to more clearly demonstrate the process of selecting the target condition response that matches the current process identifier from multiple condition responses corresponding to the current node, this application also provides a possible implementation of a dialogue response method for reusing sub-processes. Figure 3 This is a flowchart illustrating the selection of target condition responses in a dialogue response method for reusing sub-processes provided in an embodiment of this application, as shown below. Figure 3 As shown, in S103 above, the target condition response that matches the current process identifier is selected from multiple condition responses corresponding to the current node, including: S310: Push the current process identifier as the parent process source onto the source stack of the session cache.

[0062] The source stack is a last-in-first-out (LIFO) data structure stored in the session cache, used to record the parent processes that called the current sub-process in hierarchical order. The session cache is a storage space bound to the current user session, and its data can persist across multiple rounds of conversation.

[0063] Before pushing the current process identifier as a parent process source onto the source stack, the validity of the current process identifier is first validated. If the current process identifier is empty or has an abnormal format that prevents it from being converted into a valid parent process source identifier, the source stack is not modified; only the exception information is recorded, and the source identifier for this round is set to an invalid state. At the same time, the previous process identifier is saved for state tracking. If the current process identifier is invalid, subsequent conditional responses of the parent process type will skip matching based on the source stack.

[0064] Specifically, if the current node belongs to a reused subprocess node, obtain the current process identifier, define the current process identifier as the parent process source that calls the current subprocess, and prepare to record the source in the source stack.

[0065] In one possible implementation, the source stack is first retrieved from the session cache. Each record in the source stack is a parent process source identifier, with the top element representing the call source during the most recent entry into the reused sub-process, and the bottom element representing the outermost source initiating the call. Then, the current process identifier is stored as the parent process source in the source stack. The source stack after being pushed onto the stack is used as the basis for judgment during subsequent conditional response matching. The specific method for storing the current process identifier into the source stack can include: if the source stack is currently empty, the current process identifier is directly stored; if the source stack is not empty, whether to push it onto the stack depends on the relationship between the current process identifier and the top record.

[0066] By maintaining the source stack, this application can completely record the call chain in multi-level nested call scenarios. For example, when parent process A calls child process B, and child process B calls child process C, A and B are recorded in sequence in the source stack, so that the innermost child process C can also trace its complete call source chain.

[0067] S320: Based on the parent process sources in the source stack, select the target condition response that matches any parent process source from multiple condition responses.

[0068] Multiple conditional responses refer to a set of alternative responses pre-configured for the current node, each corresponding to different matching conditions. Each conditional response contains a set of applicable parent process sources, which includes one or more parent process source identifiers, indicating that the conditional response will be matched as long as the call source belongs to any parent process in this set. The target conditional response is the one selected during the matching process and will be used to participate in the generation of subsequent response content.

[0069] Specifically, after pushing the current process identifier as the parent process source onto the source stack of the session cache, all conditional responses corresponding to the current node are obtained, and it is determined whether the set of parent process sources applicable to each conditional response intersects with each parent process source in the source stack. If there is an intersection, that is, if there is any parent process source in the source stack that belongs to the set of parent process sources applicable to the conditional response, then the conditional response is determined as the target conditional response, and subsequent matching stops; if the current conditional response does not match, the next conditional response is checked until a match is found or all conditional responses have been traversed.

[0070] In one embodiment, taking a banking scenario as an example, a node in the "identity verification sub-process" is configured with three conditional responses: the first applies to the source "bank card loss reporting process," the second applies to the source "password reset process," and the third applies to the source "account unfreezing process." If a user enters this sub-process from the "bank card loss reporting process," the "bank card loss reporting process" is pushed onto the source stack as the parent process source. The applicable sets of each conditional response are checked sequentially. It is found that the applicable set of the first conditional response includes the "bank card loss reporting process," which matches the parent process source in the source stack. Therefore, the first conditional response is determined as the target conditional response.

[0071] In this embodiment, the source stack in the session cache records the complete call source chain, so that the matching of conditional responses can be performed based on the entire call source hierarchy, which significantly improves the completeness of source identification and the accuracy of response matching in sub-process reuse scenarios.

[0072] In the above Figure 3 Based on the corresponding embodiments, in order to more clearly demonstrate the specific implementation of pushing the current process identifier as the parent process source into the source stack of the session cache, this application also provides a possible implementation of a dialogue response method for reusing sub-processes. Figure 4 This is a schematic diagram of the source stack maintenance in a dialogue response method for reusing sub-processes provided in an embodiment of this application, as shown below. Figure 4 As shown, in S310 above, the current process identifier is pushed onto the source stack of the session cache as the parent process source, including: S410, retrieve the top record of the source stack.

[0073] The source stack is a last-in-first-out (LIFO) data structure stored in the session cache. It records the parent process sources that called the current subprocess in hierarchical order. The top record is the highest record in the source stack, representing the most recently pushed parent process source identifier. When the source stack is empty, the top record does not exist.

[0074] Specifically, the source stack data structure is read from the session cache corresponding to the current user session, and the top of the stack is retrieved. If the source stack currently stores one or more parent process source records, the record at the top of the stack is retrieved as the top record; if the source stack is currently empty, that is, no parent process source is recorded, the operation of retrieving the top record returns null.

[0075] S420 If the source stack is empty, or the record at the top of the stack is different from the current process identifier, then the current process identifier is pushed onto the top of the source stack as the new parent process source.

[0076] Specifically, based on the obtained top record of the stack, the following judgment is made: if the source stack is empty, that is, there are no historical source records, the current process identifier is directly pushed onto the source stack as the parent process source, making it the first record in the stack; if the source stack is not empty and the value of the top record is different from that of the current process identifier, it means that the source of this call is different from the source of the most recent record, and the current process identifier is pushed onto the top of the source stack as the new parent process source, making it the latest top record.

[0077] In one embodiment, assuming the current source stack is [process A], and the top record of the stack is process A. If the current process identifier in the current round of dialogue is process B, since the top record of process A is different from the current process identifier process B, process B is pushed onto the top of the stack as the new parent process source, and the source stack is updated to [process A, process B].

[0078] S430: If the record at the top of the stack is the same as the current process identifier, then keep the source stack unchanged.

[0079] Specifically, based on the obtained top stack record, if it is determined that the source stack is not empty and the top stack record is the same as the current process identifier, it means that the source of this call is the same as the source of the most recent record, that is, the user repeatedly enters or passes through the same node of the sub-process in multiple consecutive dialogues within the same parent process. In this case, no modification is made to the source stack, and the existing content of the source stack is kept unchanged.

[0080] In one embodiment, assuming the current source stack is [process A, process B], and the top record of the stack is process B. If the current process identifier in this round of dialogue is also process B, it means that the user is still having a dialogue in the sub-process called by process B. The computer device determines that the top record of the stack is the same as the current process identifier, keeps the source stack unchanged, and the source stack is still [process A, process B].

[0081] In this embodiment, by performing the push operation only when the source stack is empty or the top record is different from the current process identifier, the data redundancy and source stack bloat caused by repeated pushes under the same parent process source are avoided, thus improving the accuracy of source identification.

[0082] In the above Figure 4 Based on the corresponding embodiments, in order to more clearly demonstrate the specific implementation of the depth verification before the source stack is pushed and the source valid state setting, this application also provides a possible implementation of the dialogue response method for reusing sub-processes. Figure 5 This is a flowchart illustrating the deep validation and source status setting in a dialogue response method for reusing sub-processes provided in an embodiment of this application, as shown below. Figure 5 As shown, before pushing the current process identifier as the new parent process source onto the top of the source stack in S420 above, the method further includes: S510, Get the current depth of the source stack.

[0083] The current depth is used to characterize the current stored capacity of the source stack, that is, the number of source levels that have been pushed into the source stack.

[0084] Specifically, after determining that the current process identifier needs to be pushed onto the source stack as a new parent process source, but before actually performing the push operation, the current depth value of the source stack is first obtained. Optionally, the current depth value can be obtained by reading the length attribute of the source stack data structure.

[0085] S520, if the current depth is less than the preset maximum depth threshold, then push the current process identifier as the new parent process source onto the top of the source stack, and set the source identifier of this round to the valid state.

[0086] The preset maximum depth threshold limits the maximum allowed depth of the source stack, preventing it from growing indefinitely and causing memory overflow. The current round source identifier is a state flag bound to the current round of dialogue, indicating whether the parent process source in the current round's source stack can be used for subsequent conditional response matching. A valid state indicates that the parent process source in the current round's source stack can be used for subsequent matching; an invalid state indicates that the parent process source in the current round's source stack cannot be used for subsequent matching.

[0087] Specifically, the current depth is compared with a preset maximum depth threshold. If the current depth is less than the maximum depth threshold, it means that the source stack still has remaining capacity, allowing a new parent process source record to be pushed onto the stack. In this case, the current process identifier is pushed onto the top of the source stack as the new parent process source. At the same time, the source identifier of this round is set to a valid state to indicate that the parent process source in the current source stack can be used to match condition responses in subsequent steps.

[0088] S530: If the current depth is greater than or equal to the maximum depth threshold, keep the source stack unchanged and set the source identifier for this round to an invalid state.

[0089] Keeping the source stack unchanged means not making any modifications to the source stack and not pushing new parent process source records onto it.

[0090] Specifically, if the current depth is greater than or equal to the maximum depth threshold, it indicates that the source stack is full and cannot accommodate any new parent process source records. In this case, no push operation is performed on the source stack, and the existing content of the source stack remains unchanged. This is because the source stack stores historical source records, and the actual call source in this round could not be pushed due to the stack being full. Continuing to use historical sources for matching might mistakenly identify old parent processes as the current call source, leading to incorrect response selection. Therefore, the source flag for this round is set to an invalid state to indicate that the parent process source in the current source stack cannot be used for subsequent conditional response matching.

[0091] By setting an invalid state, subsequent conditional response matching steps will skip matching based on the source stack when executing conditional judgments of the parent process type, thereby avoiding the problem of mismatching historical sources due to a full stack.

[0092] In this embodiment, a maximum depth threshold for the source stack is introduced to control the capacity of the source stack, preventing memory overflow caused by the unlimited growth of the source stack and ensuring stability and reliability during long-term operation. At the same time, by setting valid and invalid states in the source identifier of this round, the problem of old sources being incorrectly used for condition matching in the current round when the stack is full and new sources cannot be recorded is effectively prevented.

[0093] In the above Figure 3 Based on the corresponding embodiments, in order to more clearly demonstrate the specific implementation of selecting a target condition response that matches any parent process source from multiple condition responses, this application also provides a possible implementation of a dialogue response method for reusing sub-processes. Figure 6 This application provides a schematic diagram of the parent process type conditional response matching process in a dialogue response method for reusing sub-processes, as illustrated in the embodiments of this application. Figure 6 As shown, in S320 above, the target condition response that matches any parent process source is selected from multiple condition responses, including: S610, retrieve the list of conditional responses corresponding to the current node.

[0094] The conditional response list is a pre-configured dataset containing several conditional responses for the current node. Each conditional response in the list includes a sort value and a condition type. The sort value determines the priority of each conditional response during the matching process; a smaller sort value indicates higher priority and earlier it will be traversed and judged. The condition type refers to the matching method used for that conditional response, including two mutually exclusive enumeration branches: parent process type and tag type. The parent process type indicates that the conditional response is matched based on the parent process identifier of the calling source; the tag type indicates that the conditional response is matched based on the tag rules of the session data.

[0095] Specifically, if the current node belongs to a reused sub-process node, the conditional response list associated with that node is read using the node identifier of the current node as an index. The conditional response list is stored in the form of structured data, where each record contains at least a sort value field and a condition type field.

[0096] S620: Iterate through each conditional reply in the conditional reply list in ascending order of sorting value.

[0097] Specifically, the responses are sorted in ascending order according to their sorting values. Starting with the response with the smallest sorting value, each response is retrieved and the subsequent matching judgment is performed until a matching response is found and the traversal stops, or until all responses have been traversed without a match.

[0098] In one embodiment, the condition response list of a certain sub-process node contains three records: the first record has a sort value of 1 and the condition type is the parent process type; the second record has a sort value of 2 and the condition type is the tag type; the third record has a sort value of 3 and the condition type is the parent process type. The condition responses are traversed in the order of sort value 1→2→3.

[0099] S630, if the condition type of the current traversed condition response is the parent process type, obtain the source identifier of this round.

[0100] Specifically, when it is detected that the condition type of the condition response currently being traversed is the parent process type, the value of the source identifier of this round is read from the session state of the current round to determine whether the source stack of this round can be used for matching the parent process condition.

[0101] S640, if the source identifier in this round is in a valid state, traverse each parent process source in the source stack. If any parent process source belongs to the set of parent process sources corresponding to the conditional response, then determine the conditional response as the target conditional response and stop traversing.

[0102] Specifically, when the source identifier for this round is in a valid state, it means that the parent process source stored in the source stack can be used for subsequent matching. The set of parent process sources configured for the current conditional response is obtained, and then each parent process source in the source stack is traversed, checking one by one whether each parent process source exists in the set of parent process sources corresponding to that conditional response.

[0103] If any parent process source in the source stack belongs to the set of parent process sources of the current conditional response, then the conditional response is determined to be a hit, the conditional response is identified as the target conditional response, and the traversal of the conditional response list is stopped immediately, and subsequent conditional responses are no longer checked.

[0104] In one embodiment, the source stack is [bank card loss reporting process, password reset process], and the parent process source set of the current conditional response is {password reset process, account unfreezing process}. Traversing the source stack, if "password reset process" is found to exist in the parent process source set, a match is determined, and this conditional response is identified as the target conditional response, then the traversal stops.

[0105] In another embodiment, the source stack is [bank card loss reporting process], and the parent process source set of the current conditional response is {password reset process, account unfreezing process}. Traversing the source stack, it is found that "bank card loss reporting process" does not exist in the parent process source set, so it is determined that a match has not been found, and the process continues to traverse the next conditional response.

[0106] S650, if the source identifier in this round is invalid, skip the conditional response currently being traversed.

[0107] Specifically, when the current source identifier is invalid, it means that the source stack stores historical source records. In this case, if we continue to use historical sources in the source stack for matching, we may mistakenly identify the old parent process as the current call source, leading to an incorrect response selection. Therefore, when the current source identifier is invalid, we do not match and judge the conditional response of the currently traversed parent process type, but directly skip the conditional response and continue to traverse the next conditional response in the conditional response list.

[0108] In this embodiment, a complete matching process based on the parent process type conditional response of the source stack is implemented, which ensures the determinism of the matching result when multiple conditional responses meet the matching conditions at the same time, avoids the problem of unstable response selection due to overlapping conditions, and significantly improves the flexibility of source identification in complex nested scenarios.

[0109] In the above Figure 6 Based on the corresponding embodiments, in order to more clearly demonstrate the specific implementation of matching conditional replies of tag type during the traversal of the conditional reply list, this application also provides a possible implementation of a dialogue reply method that reuses sub-processes. Figure 7 This is a schematic diagram of the tag type conditional reply matching process in a dialogue reply method for reusing sub-processes provided in an embodiment of this application, as shown below. Figure 7 As shown, in S620 above, traversing each conditional response in the conditional response list also includes: S710, if the condition type of the currently traversed conditional response is a tag type, obtain the tag rule identifier corresponding to the currently traversed conditional response.

[0110] The tag rule identifier is the identification information of the tag rule. A tag rule is a pre-configured set of conditional judgment logic used to classify users or sessions based on the current session data.

[0111] Specifically, during the process of traversing the list of conditional responses, when it is detected that the condition type of the currently traversed conditional response is a tag type, the corresponding tag rule identifier field is read from the configuration data of that conditional response.

[0112] S720 reads the tag rule corresponding to the tag rule identifier from the preset tag rule library.

[0113] The label rules include at least one label dimension and a set of allowed values ​​for each label dimension.

[0114] A tag dimension refers to a category used to describe a certain attribute, such as access channel, user level, membership type, device type, etc.; the allowed value set refers to the set of values ​​allowed under that tag dimension. For example, the allowed value set for the access channel dimension could be {APP, WEB}, and the allowed value set for the user level dimension could be {VIP, SVIP}. A tag rule is considered to have been hit only when the values ​​of the session data in each dimension fall into their respective allowed value sets.

[0115] Specifically, the corresponding tag rule is read from a pre-defined tag rule library using the tag rule identifier as an index. The tag rule contains all the tag dimensions involved in the rule and the set of allowed values ​​for each tag dimension, stored in the tag rule library as structured data. In one possible implementation, the tag rules are organized as a mapping structure of "tag dimension identifier - set of allowed values," and this mapping structure is read through the tag rule identifier.

[0116] S730 retrieves the current values ​​corresponding to each tag dimension from the current session data.

[0117] The current session data refers to the set of contextual information associated with the current user session. Session data can come from various sources, including but not limited to user extended information, access channel identifiers, operating system types, screen modes, user tags, and task-type process pass-through parameters. Each piece of session data can be organized into a key-value pair mapping of "tag dimension identifier - current value", where there is a preset correspondence between tag dimension identifiers.

[0118] Specifically, based on the tag dimension identifiers included in the tag rules, and using each tag dimension identifier as a key, the current value corresponding to each tag dimension is searched and extracted one by one from the current session data. If a tag dimension identifier does not have a corresponding key-value pair in the session data, the current value of that dimension is marked as missing. If a dimension has a corresponding key-value pair but the value is empty, the current value is marked as null.

[0119] S740, for each label dimension, determine whether the current value belongs to the set of allowed values.

[0120] Specifically, each label dimension in the label rules is traversed, and the current value corresponding to that dimension is compared with the set of allowed values ​​for that dimension to determine whether the current value is one of the elements in the set of allowed values. If the current value belongs to the set of allowed values, then the dimension is determined to meet the condition; if the current value does not belong to the set of allowed values, or the current value is missing or empty, then the dimension is determined to not meet the condition.

[0121] In one possible implementation, when multiple allowed values ​​are configured within the same label dimension, the current value matching any one of the allowed values ​​is considered to satisfy the condition for that dimension. That is, multiple allowed values ​​within the same dimension are related by "OR" logic.

[0122] S750, if the current values ​​of all label dimensions included in the label rule belong to their respective allowed value sets, then the label rule is determined to be a hit.

[0123] Specifically, the judgment results for each label dimension are summarized. If all label dimensions in a label rule are determined to meet the conditions, that is, the current value of each dimension falls within its corresponding set of allowed values, then the entire label rule is considered to have hit. Different label dimensions are related by "AND" logic, meaning that all dimensions must be satisfied simultaneously for the label rule to be considered to have hit.

[0124] S760, if the tag rule is matched, the conditional response is determined as the target conditional response, and the traversal stops.

[0125] Specifically, once a label rule is determined to be matched, the currently traversed conditional response is identified as the target conditional response, and the traversal of the conditional response list is immediately stopped.

[0126] S770, if the current value of any label dimension of the label rule does not belong to the corresponding set of allowed values, then the label rule is determined to be a miss, and the next conditional response is traversed.

[0127] Specifically, if a label rule has a current value that does not belong to the corresponding set of allowed values, or if the current value is missing or empty, then the label rule is determined to be a mismatch, and the system continues to traverse the next conditional response in the conditional response list and re-executes the matching judgment for the next conditional response.

[0128] If all conditional replies in the conditional reply list have been traversed and none have been matched, then no target conditional reply has been successfully matched in this round, and subsequent reply content can be generated directly using the default configuration of the current node.

[0129] In this embodiment, by setting multiple label dimensions and the set of allowed values ​​corresponding to each dimension in the label rules, and extracting the actual values ​​of each dimension from the current session data for dimension-by-dimensional comparison, it is possible to flexibly make conditional judgments based on multi-dimensional attributes, ensuring the stability of the matching process and ensuring the reliability of the generated response.

[0130] In the above Figure 1 Based on the corresponding embodiments, in order to more clearly demonstrate the specific implementation of generating the current round's response content according to the target conditions and the default configuration of the current node, this application also provides a possible implementation of a dialogue response method that reuses sub-processes. Figure 8 This application provides a schematic diagram of a dialog response method for reusing sub-processes, illustrating the configuration of a merged process. Figure 8 As shown, in S104 above, the response content for the current round, generated based on the target condition response and the default configuration of the current node, includes: S810, retrieves the default configuration of the current node.

[0131] The default configuration includes several configuration fields.

[0132] The default configuration refers to the complete set of default settings pre-configured for the current node. The default configuration includes multiple configuration fields, covering various configurable parameters that control the node's response behavior. Configuration fields may include, but are not limited to: a response content field, specifying the node's default response text; a response mode field, specifying the response generation method; an answer polishing switch field, controlling whether to polish the response content; a custom prompt word field, specifying the custom prompt words used when generating the response; a secondary confirmation parameter field, controlling whether to enable secondary confirmation and confirmation mode; and an information collection parameter field, controlling the information collection behavior and response configuration during the super-rotation. As the node's basic configuration, the default configuration provides fallback values ​​for fields when no conditional response matches or when conditional responses do not cover certain fields.

[0133] Specifically, upon successfully matching a response to the target condition, the default configuration of that node is read using its node identifier as an index. The default configuration is stored in structured data, with each configuration field stored in its corresponding field.

[0134] In one embodiment, the default configuration of the "identity verification completed node" includes: the reply content is "identity verification completed", the reply mode is the precise mode, the answer polishing switch is off, there are no custom prompt words, the secondary confirmation parameter is on, the information collection parameter is the super wheel switch and the super wheel reply content is "please provide relevant information again".

[0135] S820, retrieve the fields in the response to the target condition, including their set and sparse configuration.

[0136] The field set is used to record the fields configured in the target condition response. The sparse configuration is used to store the field values ​​corresponding to each configured field in the target condition response.

[0137] The field collection stores the names of configured fields, even if the value is false, 0, or an empty string. Sparse configuration refers to the collection of configuration fields and their corresponding values ​​actually carried in the target condition response. Sparse configuration uses a sparse storage method, containing only the configured fields and their values. The field collection records which fields have values, while the sparse configuration stores the specific values ​​of these fields.

[0138] Specifically, the target condition response is obtained, and two components are extracted from its configuration data: a set of fields and sparse configuration. The set of fields records the names of all fields configured by operations personnel in the target condition response; the sparse configuration stores the specific values ​​corresponding to these fields.

[0139] In one embodiment, a target condition reply is configured with the reply content "Identity verification completed, please continue with the loss reporting process," the answer polishing switch is enabled, the reply mode is precise mode, and the custom prompt word is "Please polish the above reply." Then, the set of fields for this target condition reply is {reply content, answer polishing switch, reply mode, custom prompt word}, ​​and the sparse configuration includes the specific values ​​corresponding to these four fields.

[0140] S830: For each configuration field in the default configuration, if the field exists in a set containing the configuration field, the corresponding field value is obtained from the sparse configuration and filled into the configuration field.

[0141] Specifically, using the configuration fields in the default configuration as the traversal objects, for each configuration field in the default configuration, check whether the field name is contained in the field existence set. If the field existence set contains the configuration field, it means that the target condition response has configured the value of the field. Find the corresponding field value from the sparse configuration with the field name as the key, and fill the corresponding field position in the default configuration with the value, overwriting the original value in the default configuration.

[0142] In this way, any type of field value, including boolean value false, numerical value 0, empty string, etc., as long as its field name exists in the field existence set, is regarded as a valid configuration value and is correctly filled in, and will not be misjudged as not configured due to the "empty" nature of the value itself.

[0143] In one embodiment, the default configuration includes six configuration fields: reply content, reply mode, answer polishing switch, custom prompt, secondary confirmation parameter, and information collection parameter. The set of fields is {reply content, answer polishing switch, reply mode, custom prompt}. The six fields of the default configuration are iterated as follows: For reply content, if the field exists in the set, "Identity verification complete, please continue processing the loss report" is retrieved from the sparse configuration and entered; for answer polishing switch, if the field exists in the set, "true" is retrieved from the sparse configuration and entered; for custom prompt, if the field exists in the set, "Please polish the above reply" is retrieved from the sparse configuration and entered; for reply mode, if the field exists in the set, "precise mode" is retrieved from the sparse configuration and entered; for secondary confirmation parameter and information collection parameter, if the field exists in the set, these two fields are not present, and their values ​​remain unchanged from the default configuration. In the merged effective configuration, reply content, answer polishing switch, reply mode, and custom prompt use the values ​​from the target condition reply, while secondary confirmation parameter and information collection parameter continue to use the values ​​from the node's default configuration.

[0144] S840: If a field exists in the set but is not included in the configuration field, then the value of the configuration field in the default configuration remains unchanged.

[0145] Specifically, for each configuration field in the default configuration, if the field name is not included in the set, it means that the target condition response has not configured that field. In this case, no modification operation is performed on that field, and its existing value in the default configuration remains unchanged.

[0146] In one embodiment, for the secondary confirmation parameter field and the information collection parameter, the field existence set does not include these two fields, and the corresponding content in the default configuration remains unchanged.

[0147] S850 generates response content based on the values ​​of each configuration field.

[0148] The response content refers to the final dialogue response text presented to the user and its related control parameters. The generation of the response content is based on the merged valid configuration, which contains the final values ​​of each configuration field after being merged by S830 and S840.

[0149] Specifically, after merging each configuration field in the default configuration, some fields in each configuration field are overwritten by the values ​​in the target condition response, while the remaining fields retain their default values. The response content field from each configuration field is extracted as the base response text, and corresponding post-processing is performed based on the values ​​of configuration fields such as response mode, answer polishing switch, and custom prompts. This includes, but is not limited to: selecting a response generation strategy according to the response mode, determining whether to polish the response content based on the answer polishing switch, adjusting the style or content of the generated response based on custom prompts, determining whether to trigger a secondary confirmation process based on secondary confirmation parameters, and determining whether to start an information collection process based on information collection parameters. After the above processing, the final response content output to the user in the current round is generated.

[0150] In one embodiment, in the merged effective configuration, the response content is "Identity verification completed, please continue with the loss reporting process," the answer polishing switch is enabled, the custom prompt is "Please polish the above response," the secondary confirmation parameter is enabled, the response mode is precise mode, and the information collection parameter is that the superwheel switch is enabled and the superwheel response content is "Please provide the relevant information again." First, based on the response content as the base text, the text is polished according to the custom prompt to generate the polished response content. Then, the secondary confirmation process is initiated according to the secondary confirmation parameter, and the information collection superwheel processing is started according to the information collection parameter. The polished response content, along with the secondary confirmation prompt, is returned to the user.

[0151] In this embodiment, by introducing a combination of field existence set and sparse configuration, the target condition response and the node default configuration are merged. This allows the merging process to fill the field values ​​configured in the target condition response into the corresponding field positions in the default configuration, while fields not recorded in the field existence set continue to use the node's default values. This effectively avoids the problem of node default settings becoming invalid due to incomplete condition response configuration.

[0152] In the above Figure 8 Based on the corresponding embodiments, in order to more clearly demonstrate the specific implementation method of performing dependency verification and restoration on the merged configuration fields before generating the response content, this application also provides a possible implementation method of a dialogue response method that reuses sub-processes. Figure 9 This is a flowchart illustrating the configuration of field dependency validation in a dialogue response method for reusing sub-processes provided in an embodiment of this application, as shown below. Figure 9 As shown, in the above S850, before generating the response content based on the values ​​of each configuration field, the following steps are also included: S910 retrieves the preset dependencies between various configuration fields.

[0153] The dependency relationship indicates that the validity of the first configuration field depends on the existence or value of the second configuration field.

[0154] The preset dependency relationship refers to the predefined logical dependency constraint rules between configuration fields. The dependency relationship indicates that the validity of the first configuration field depends on the existence or value of the second configuration field. That is, when the first configuration field is configured to a specific state or has a specific value, the second configuration field must exist and have a valid value; otherwise, the configuration combination is considered invalid. Dependencies are stored in the form of rules, and each dependency rule contains at least a dependent field, a dependent field, and a dependency condition. Configuration fields include, but are not limited to: answer polishing switch field, custom prompt word field, reply mode field, secondary confirmation switch field, confirmation mode field, information collection superwheel switch field, and superwheel reply type field.

[0155] Specifically, before generating the response content, a pre-defined dependency list is read. Each rule in the dependency list defines the dependency constraints between specific configuration fields. For example, when the "Answer Polishing" switch field is enabled, it depends on the existence of the corresponding custom prompt word field; when the "Secondary Confirmation" switch field is enabled, it depends on the existence of the confirmation mode field and that the value is valid; when the "Information Collection Super Wheel" switch field is enabled, it depends on the existence of the super wheel response type field.

[0156] S920 verifies whether the values ​​of each configuration field meet the preset dependency relationships.

[0157] Specifically, the current values ​​of each merged configuration field are compared with the preset dependencies one by one. For each dependency rule, it is checked whether the current value of the dependent field triggers the dependency condition. If the dependency condition is triggered, it is further checked whether the dependent field exists in the current valid configuration and has a valid value. If all dependency rules are satisfied, the verification passes, indicating that each configuration field in the current valid configuration meets all preset dependency constraints and can be directly used for subsequent response content generation, and the process proceeds to S850; if at least one dependency rule is not satisfied, the verification fails, and subsequent recovery processing needs to be performed.

[0158] In one possible implementation, the dependency rule is triggered when the value of the dependent field equals a specific value, such as triggering a dependency on a custom prompt when the answer polishing switch is true. The process checks if the current value of the answer polishing switch field is true. If it is, it checks if the corresponding custom prompt exists and is not empty. If the custom prompt exists and is not empty, the dependency is satisfied; otherwise, it is not satisfied. If the current value of the answer polishing switch field is false, the dependency condition is not triggered, and the dependency is automatically considered satisfied.

[0159] S930 If the dependency relationship is not satisfied, the default value corresponding to the configuration field that does not satisfy the dependency relationship is obtained from the default configuration and filled into the configuration field, and the dependency relationship is re-validated according to the preset dependency relationship.

[0160] The default configuration refers to the original default configuration of the current node, which stores the initial default values ​​of each configuration field when it is not overwritten by any conditional response.

[0161] Specifically, when the validation result is unsatisfactory, all configuration fields that fail to meet dependencies are identified. For these configuration fields, the original default configuration is retrieved, and the default values ​​corresponding to these fields are read from the original default configuration and filled into the corresponding field positions in the current configuration. After the field values ​​are restored, the validation operation is re-executed using the restored valid configuration as the object to determine whether the restored configuration satisfies all preset dependencies.

[0162] S940 If the re-verification still fails, the default values ​​will be filled into each configuration field in the default configuration.

[0163] Specifically, if the re-validation result still indicates a failure, it means that even restoring the fields that do not satisfy the dependency relationship to their default values ​​still cannot meet the dependency constraints. Since the difference between the current configuration and the default configuration cannot be resolved by restoring local fields, a global rollback is performed: all fields in the currently valid configuration are restored to their values ​​in the original default configuration. After the global rollback, all field values ​​in the default configuration are restored to their original default values. Because the node's default configuration was designed to satisfy all dependencies, the dependency validation will inevitably pass. Subsequently, the rolled-back default configuration is used as the valid configuration for the current round to generate the response content.

[0164] In this embodiment, by introducing a verification and recovery mechanism for configuration field dependencies before generating response content, the functional integrity of the effective configuration after being overridden by the conditional response is ensured. This allows for the timely detection of field dependency missing issues caused by partial configuration in the conditional response, thus ensuring the stability and reliability of the dialogue process.

[0165] The following describes a dialog response device and computer equipment for reusing subprocesses provided in this application, which are used to execute the application. The specific implementation process and technical effects are described above and will not be repeated below.

[0166] Figure 10 A schematic diagram of a dialogue response device for reusing sub-processes provided in an embodiment of this application is shown below. Figure 10 As shown, the dialogue response device for the reused sub-process includes: The acquisition module 1000 is used to acquire the dialogue result of the current round. The dialogue result includes at least the current process identifier and the node identifier of the current node.

[0167] The reuse module 2000 is used to determine whether the current node belongs to the sub-process node to be reused based on the node identifier.

[0168] Select module 3000, which is used to select the target condition response that matches the current process identifier from multiple condition responses corresponding to the current node if the current node belongs to a reused sub-process node.

[0169] The generation module 4000 is used to generate the response content for the current round based on the target conditions and the default configuration of the current node.

[0170] Optionally, the reuse module 2000 is specifically used to detect whether the node identifier contains a preset separator; if the node identifier contains a separator, it is determined that the current node belongs to the reused sub-process node; if the node identifier does not contain a separator, it is determined that the current node does not belong to the reused sub-process node.

[0171] Optionally, the dialogue response device for reusing sub-processes further includes a push module 4000 for pushing the current process identifier as the parent process source into the source stack of the session cache.

[0172] Optionally, module 3000 is selected, specifically for selecting a target condition response that matches any parent process source from multiple condition responses based on each parent process source in the source stack.

[0173] Optionally, module 1000 can also be used to obtain the top record of the source stack.

[0174] Optionally, the push module 4000 is specifically used to push the current process identifier as the new parent process source onto the top of the source stack if the source stack is empty or the record at the top of the stack is different from the current process identifier; if the record at the top of the stack is the same as the current process identifier, the source stack remains unchanged.

[0175] Optionally, the acquisition module 1000 is also used to acquire the current depth of the source stack; the current depth is used to characterize the current stored capacity of the source stack.

[0176] Optionally, the push module 4000 is also used to push the current process identifier as the new parent process source onto the top of the source stack and set the source identifier of this round to a valid state if the current depth is less than the preset maximum depth threshold; if the current depth is greater than or equal to the maximum depth threshold, the source stack is kept unchanged and the source identifier of this round is set to an invalid state.

[0177] Optionally, the acquisition module 1000 is also used to acquire the conditional response list corresponding to the current node, where each conditional response contains a sorting value and a condition type.

[0178] Optionally, module 3000 is selected, specifically used to traverse each conditional reply in the conditional reply list in ascending order of sorting value; if the conditional type of the currently traversed conditional reply is the parent process type, obtain the source identifier of this round; if the source identifier of this round is valid, traverse each parent process source in the source stack; if any parent process source belongs to the set of parent process sources corresponding to the conditional reply, then determine the conditional reply as the target conditional reply and stop traversing; if the source identifier of this round is invalid, skip the currently traversed conditional reply.

[0179] Optionally, module 3000 is selected, specifically used to: if the condition type of the currently traversed conditional response is a tag type, obtain the tag rule identifier corresponding to the conditional response; read the tag rule corresponding to the tag rule identifier from the preset tag rule library, wherein the tag rule contains at least one tag dimension and the set of allowed values ​​corresponding to each tag dimension; obtain the current value corresponding to each tag dimension from the current session data; for each tag dimension, determine whether the current value belongs to the set of allowed values; if the current values ​​of all tag dimensions contained in the tag rule belong to their respective set of allowed values, then the tag rule is determined to be hit; if the tag rule is hit, then the conditional response is determined to be the target conditional response and the traversal stops; if the current value of any tag dimension of the tag rule does not belong to the corresponding set of allowed values, then the tag rule is determined to be hit and the traversal continues to the next conditional response.

[0180] Optionally, the acquisition module 1000 is also used to acquire the default configuration of the current node, which includes multiple configuration fields; acquire the field existence set and sparse configuration in the target condition response, the field existence set is used to record the fields that have been configured in the target condition response, and the sparse configuration is used to store the field values ​​corresponding to each configured field in the target condition response.

[0181] Optionally, the generation module 4000 is specifically used to, for each configuration field in the default configuration, if the field exists in the set containing the configuration field, then obtain the corresponding field value from the sparse configuration and fill it into the configuration field; if the field exists in the set not containing the configuration field, then keep the value of the configuration field in the default configuration unchanged; and generate the response content based on the value of each configuration field.

[0182] Optionally, the acquisition module 1000 is also used to acquire the preset dependency relationship between each configuration field, wherein the dependency relationship indicates that the validity of the first configuration field depends on the existence or value of the second configuration field.

[0183] Optionally, the dialogue response device for the reused subprocess further includes a verification module 5000, which verifies whether the values ​​of each configuration field meet the preset dependency relationship; if the dependency relationship is not met, the corresponding default value is obtained from the default configuration and filled into the configuration field for the configuration field that does not meet the dependency relationship, and the verification is re-verified according to the preset dependency relationship; if the re-verification still fails, the corresponding default value is filled into each configuration field in the default configuration.

[0184] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more digital signal processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a system-on-a-chip (SOC).

[0185] Figure 11 This is a schematic diagram of a computer device provided in an embodiment of this application.

[0186] The computer device 10 includes a processor 11, a storage medium 12, and a bus 13. The storage medium 12 stores program instructions executable by the processor 11. When the computer device 10 is executed, the processor 11 communicates with the storage medium 12 via the bus 13, and the processor 11 executes the program instructions to perform the above-described method embodiment. The specific implementation and technical effects are similar and will not be described in detail here.

[0187] Optionally, this application also provides a program product, such as a computer-readable storage medium, including a program that, when executed by a processor, performs the above-described method embodiments.

[0188] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0189] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0190] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.

[0191] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0192] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A dialogue response method for reusing sub-processes, characterized in that, The method includes: Obtain the dialogue result of the current round, wherein the dialogue result includes at least: the current process identifier and the node identifier of the current node; Based on the node identifier, determine whether the current node belongs to a reused sub-process node; If the current node is a reused sub-process node, select the target condition response that matches the current process identifier from the multiple condition responses corresponding to the current node; Based on the target condition response and the default configuration of the current node, the response content for the current round is generated.

2. The dialogue response method according to claim 1, characterized in that, The step of determining whether the current node belongs to a reused sub-process node based on the node identifier includes: Detect whether the node identifier contains a preset separator; If the node identifier contains the separator, then the current node is determined to be a reused sub-process node; If the node identifier does not contain the separator, then the current node is determined not to belong to the reused subprocess node.

3. The dialogue response method according to claim 1, characterized in that, The step of selecting the target condition response that matches the current process identifier from multiple condition responses corresponding to the current node includes: Push the current process identifier as the parent process source onto the source stack of the session cache; Based on each of the parent process sources in the source stack, a target condition response that matches any of the parent process sources is selected from a plurality of condition responses.

4. The dialogue response method according to claim 3, characterized in that, The step of pushing the current process identifier as the parent process source into the source stack of the session cache includes: Obtain the top record of the source stack; If the source stack is empty, or the record at the top of the stack is different from the current process identifier, then the current process identifier is pushed onto the top of the source stack as a new parent process source. If the record at the top of the stack is the same as the current process identifier, then the source stack remains unchanged.

5. The dialogue response method according to claim 4, characterized in that, Before pushing the current process identifier as the new parent process source onto the top of the source stack, the method further includes: Obtain the current depth of the source stack; the current depth is used to characterize the current stored capacity of the source stack; If the current depth is less than the preset maximum depth threshold, then the current process identifier is pushed onto the top of the source stack as a new parent process source, and the source identifier of this round is set to a valid state; If the current depth is greater than or equal to the maximum depth threshold, then the source stack remains unchanged, and the source identifier for this round is set to an invalid state.

6. The dialogue response method according to claim 3, characterized in that, Selecting a target condition response from among the plurality of condition responses that matches any of the parent process sources includes: Obtain the conditional response list corresponding to the current node, where each conditional response in the list contains a sort value and a condition type; According to the sorting value in ascending order, traverse each conditional reply in the conditional reply list in turn; If the condition type of the current condition response is the parent process type, obtain the source identifier for this round; If the source identifier of this round is in a valid state, traverse each parent process source in the source stack. If there is any parent process source that belongs to the set of parent process sources corresponding to the conditional response, then the conditional response is determined as the target conditional response, and the traversal stops. If the source identifier for this round is invalid, then skip the conditional response currently being traversed.

7. The dialogue response method according to claim 6, characterized in that, The step of traversing each conditional response in the conditional response list also includes: If the condition type of the current conditional response is a tag type, then obtain the tag rule identifier corresponding to the conditional response; The tag rule corresponding to the tag rule identifier is read from the preset tag rule library. The tag rule includes at least one tag dimension and a set of allowed values ​​for each tag dimension. Obtain the current value corresponding to each of the aforementioned tag dimensions from the current session data; For each of the label dimensions, determine whether the current value belongs to the set of allowed values; If the current values ​​of all the label dimensions included in the label rule belong to their respective sets of allowed values, then the label rule is determined to be a hit; If the tag rule is matched, the conditional response is determined as the target conditional response, and the traversal stops; If the current value of any label dimension in a label rule does not belong to the corresponding set of allowed values, then the label rule is determined to be a miss, and the process continues to iterate through the next conditional response.

8. The dialogue response method according to claim 1, characterized in that, The step of generating the response content for the current round based on the target conditions and the default configuration of the current node includes: Obtain the default configuration of the current node, wherein the default configuration contains multiple configuration fields; The field existence set and sparse configuration in the target condition response are obtained. The field existence set is used to record the fields that have been configured in the target condition response, and the sparse configuration is used to store the field values ​​corresponding to each of the configured fields in the target condition response. For each configuration field in the default configuration, if the field exists in a set containing the configuration field, then the corresponding field value is obtained from the sparse configuration and filled into the configuration field; If the set does not contain the configuration field, then the value of the configuration field in the default configuration remains unchanged; The response content is generated based on the values ​​of each configuration field.

9. The dialogue response method according to claim 8, characterized in that, Before generating the response content based on the values ​​of each configuration field, the method further includes: Obtain the preset dependency relationship between each of the configuration fields, wherein the dependency relationship indicates that the validity of the first configuration field depends on the existence or value of the second configuration field; Verify whether the values ​​of each configuration field satisfy the preset dependency relationship; If the dependency relationship is not satisfied, for the configuration field that does not satisfy the dependency relationship, the corresponding default value is obtained from the default configuration and filled into the configuration field, and the default relationship is re-validated according to the preset dependency relationship; If the re-verification still fails, then fill in the corresponding default values ​​for each of the configuration fields in the default configuration.

10. A computer device, characterized in that, include: The computer device includes a processor, a memory, and a bus. The memory stores program instructions executable by the processor. When the computer device is running, the processor communicates with the memory via the bus. The processor executes the program instructions to perform the steps of the dialog response method for reusing subprocesses as described in any one of claims 1 to 9.