CN-121979510-A - Component dynamic arrangement method and system based on voice instruction and rule engine
Abstract
The invention relates to a method and a system for dynamically arranging components based on voice instructions and a rule engine, which are characterized in that a business process is split into independent reusable standardized components according to the principles of high cohesion, low coupling and single responsibility, a component capability mapping table is constructed, the voice instructions are deeply analyzed by means of a pre-training semantic analysis model, structural intention information containing actions, targets, parameters and dependency relations is extracted, and then a component execution chain is dynamically constructed and driven by the rule engine, so that the complex business process can be flexibly scheduled by natural voice, the flexibility, response agility and maintainability of the process can be effectively improved, and the business change and expansion cost is reduced.
Inventors
- LI TIANHONG
- HONG FENG
- FENG JIANYONG
- LIU CHENGYI
- CHEN JIE
Assignees
- 中电智安科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251217
Claims (8)
- 1. A dynamic component arrangement method based on a voice command and a rule engine is characterized by comprising the following steps: 1) According to the core service scene, the service flow is disassembled into a plurality of independent reusable service components, and a standardized reusable component library is constructed by defining the capability description information of each service component and establishing a component capability mapping table; 2) Acquiring a voice instruction input by a user, translating the voice instruction, and obtaining a text instruction; 3) Carrying out semantic analysis on the text instruction, and obtaining structured intention information by using an intention extraction mechanism of a pre-training semantic analysis model; 4) Inquiring a component capacity mapping table according to the actions in the structured intention information obtained in the step 3) to obtain service components corresponding to the actions; 5) And dynamically constructing a component execution chain by using a preset rule engine according to the dependency relationship among actions in the structured intention information, calling and executing the service components obtained in the step 4) by using the rule engine according to the sequence of the component execution chain, and obtaining a returned execution result after completing service processing.
- 2. The method according to claim 1, wherein in step 1), the capability description information of the service component is defined by a configuration file, and the capability description information includes a component identifier, a component function, an input parameter, and an output result.
- 3. The method for dynamically arranging components according to claim 1, wherein the business process is disassembled into a plurality of independently reusable business components according to the principles of high cohesion, low coupling and single responsibility, and each business component transmits data and state through a unified context object without direct dependence.
- 4. A method for dynamically arranging components according to claim 3, wherein the context object is a custom data class, and the service component obtains data from the context object or writes the execution result into the context object through a preset interface.
- 5. The method for dynamically arranging components according to claim 1, wherein in step 3), the structured intention information is obtained, specifically comprising: 3-1) according to the text instruction and a preset system prompt word, utilizing a pre-training semantic analysis model to obtain model response data comprising main intention, sub intention, parameters and dependency relations; 3-2) extracting a structured text generated by the pre-training semantic analysis model according to the model response data, and secondarily analyzing the structured text into a structured data object which can be identified by a service side; 3-3) supplementing a dependency trigger field by utilizing a dependency analysis mechanism according to the execution sequence constraint of the structured data object and the complex instruction to obtain complete structured intention information, wherein the structured intention information comprises at least one action, a target and a parameter of a corresponding action, and the dependency relationship among the actions is also contained when a plurality of actions exist.
- 6. The method for dynamically arranging components according to claim 1, wherein in step 5), the execution chain of the components is dynamically constructed by using a preset rule engine and the business processing is completed, specifically comprising: 5-1) generating a component execution logic relationship represented by a preset intermediate data model by utilizing a dependency relationship conversion mechanism according to the dependency relationship among actions in the structured intention information, wherein nodes of the intermediate data model are matched service components, and the edges are the dependency relationship and the execution sequence among the service components; 5-2) executing a logic relationship according to the component, and generating an expression rule chain which can be identified by a rule engine by utilizing a preset dependency relationship-expression mapping rule; 5-3) calling a dynamic chain construction interface of a rule engine according to the expression rule chain obtained in the step 5-2), creating an executable business process chain instance, packaging parameters in the structural intention information into a unified context object, and binding with the business process chain instance to realize the hot loading of the business process chain; 5-4) utilizing a rule engine to drive an execution business process chain instance, collecting the execution state and the execution log of each business component, and feeding back the execution result to a user after structured arrangement.
- 7. The component dynamic orchestration method according to claim 6, wherein in step 5-1), the component execution logic relationship comprises at least one of sequential execution, conditional execution, parallel execution.
- 8. A dynamic component arrangement system based on voice instructions and a rule engine for the method of claim 1, comprising a component library module, a voice recognition module, an instruction understanding module, an arrangement scheduling module, a rule engine module and a feedback module; The component library module is used for storing service components and a component capacity mapping table; the voice recognition module is used for recognizing the collected voice command of the user and converting the voice command into a text command; the instruction understanding module is used for carrying out semantic analysis on the text instruction, extracting and outputting structural intention information; the component matching module is used for inquiring the component capability mapping table and matching the corresponding components; The rule engine module is used for constructing a component execution chain, receiving the context object, driving the execution service component and returning an execution result; And the feedback module is used for receiving the execution result output by the rule engine module and feeding back the execution result to the user.
Description
Component dynamic arrangement method and system based on voice instruction and rule engine Technical Field The invention relates to the technical field of computer processing, in particular to a method and a system for dynamically arranging components based on voice instructions and a rule engine, which are particularly suitable for scenes in which flexible scheduling of complex business processes is realized through natural interaction. Background In the digital transformation stage of information technology deep penetration in various industries, efficient processing of complex business logic has become a key support for building enterprise core competitiveness. The traditional software system generally adopts a waterfall flow development architecture and a hard coding service logic implementation mode, and the service flow and the execution code are deeply bound, so that each service rule is solidified in the system through the fixed code logic. However, this architecture and logic implementation gradually exposes a number of drawbacks in practical applications, as follows: ⑴ The system has extremely high coupling degree and high service change cost, namely, the service logic is not effectively isolated from the bottom code and each flow node, once the service logic is finely adjusted (such as discount rule adjustment in an e-commerce scene and approval flow optimization in an enterprise service scene), the bottom code is required to be modified, so that maintenance dilemma of pulling and sending and moving the whole body is extremely easy to cause, and the technical threshold and time cost of service change are greatly improved. ⑵ The flow flexibility is lost, and the dynamic requirements are difficult to adapt, namely, the business flow is completely fixed in the development stage and cannot respond to the business requirements of the enterprise which dynamically change. When an enterprise needs to push out a novel promotion (such as adding a compound type preferential rule such as step full reduction) or optimize a service flow (such as adjusting order checking nodes and authorities), the system needs to be globally modified, so that project periods are long, large-scale regression tests need to be carried out to avoid causing linkage faults, and the agility of enterprise business innovation is seriously restricted. ⑶ The maintenance cost and the risk are high, the stability of the system is reduced due to frequent change of a code layer, a comprehensive regression test is required to be executed for each update to avoid cascading failures, even the system is forced to stop updating due to the code dependency relationship, the maintenance cost and the operation interruption risk of enterprises are obviously increased, meanwhile, the readability and the maintainability of the hard coding logic are poor, a maintainer needs to spend a great amount of time to comb the association relationship of the codes, and the labor input cost is further increased. Meanwhile, voice is the most natural and convenient communication mode for human beings, has become a core entrance of man-machine interaction in the intelligent era, and the permeability in the fields of intelligent home, enterprise service and the like is continuously rising. However, the existing voice interaction system still belongs to a fixed flow trigger basically, and the voice command can only be used for starting a predefined static flow and cannot process a compound task with a dependency relationship (such as automatically sending a reminding short message to a branch pipe leader after sending a notification). Most importantly, in the prior art, the deep coupling exists between voice recognition and semantic understanding and the business logic module, the function expansion needs to synchronously reform a plurality of associated modules, and the system agility is seriously insufficient. For example, when the enterprise needs to newly increase the requirement of "notifying and synchronously copying the human resource department", the process script still needs to be updated by modifying the code, and the maintenance mode is not substantially different from that of the traditional system, so that the limitation of the traditional architecture cannot be broken through. Therefore, how to solve the defects of inconvenient interaction experience, stiff service flow, slow demand response speed, high maintenance cost and the like faced by the traditional service system is always a problem to be solved by the technicians in the field. Disclosure of Invention The invention aims to provide a method and a system for dynamically arranging components based on voice instructions and a rule engine, which aim at the corresponding defects of the prior art, the method and the system for dynamically arranging the components based on the voice instructions and the rule engine are used for constructing a component capability mapping table by splitting a service flow