CN114610404B - Component calling method and device based on application framework and computer equipment - Google Patents

Component calling method and device based on application framework and computer equipment Download PDF

Info

Publication number
CN114610404B
CN114610404B CN202210162072.0A CN202210162072A CN114610404B CN 114610404 B CN114610404 B CN 114610404B CN 202210162072 A CN202210162072 A CN 202210162072A CN 114610404 B CN114610404 B CN 114610404B
Authority
CN
China
Prior art keywords
component
target
application framework
service
calling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210162072.0A
Other languages
Chinese (zh)
Other versions
CN114610404A (en
Inventor
曹雁灵
方庆林
杨辉鱼
陈利鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Zhuiyi Technology Co Ltd
Original Assignee
Shenzhen Zhuiyi Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Zhuiyi Technology Co Ltd filed Critical Shenzhen Zhuiyi Technology Co Ltd
Priority to CN202210162072.0A priority Critical patent/CN114610404B/en
Publication of CN114610404A publication Critical patent/CN114610404A/en
Application granted granted Critical
Publication of CN114610404B publication Critical patent/CN114610404B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/544Remote

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Artificial Intelligence (AREA)
  • Human Computer Interaction (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to a component calling method and device based on an application framework and computer equipment. The method comprises the following steps: based on a communication component provided by an application framework, receiving a service request sent by an external terminal to a target service; the target service is a service for enabling the conversation robot to realize intelligent conversation; determining a target component mapped with a communication component in the target service based on a component mapping calling relation configured for the component in the target service in advance; based on the interface registration information of the target component on the application framework, the application framework invokes a data processing interface of the target component to trigger the target component to perform corresponding processing based on the request data in the service request, and a conversation result output by the conversation robot is determined; and returning a dialogue result to the external terminal based on the communication component. The method can improve flexibility.

Description

Component calling method and device based on application framework and computer equipment
Technical Field
The present application relates to the field of software technologies, and in particular, to a component calling method and apparatus based on an application framework, and a computer device.
Background
As artificial intelligence technology has evolved, conversation robots, which are programs for simulating human conversations, chat, or performing some specific task, have evolved.
In a traditional chat conversation robot-based system (namely a Bot system), a middle platform (namely a central control platform) is tightly coupled with an algorithm logic, a call flow of an algorithm service is realized in the middle platform, and when the call flow of an algorithm component needs to be modified, the middle platform needs to be modified, so that modification is not flexible enough. Moreover, the algorithm service does not have the capability of external interaction and needs to rely on a middle platform for transfer. Therefore, in the conventional method, the middle platform (i.e. the central control platform) and the algorithm logic are tightly coupled, so that the use is not flexible enough.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an application framework-based component calling method, apparatus, computer device, storage medium, and computer program product that can improve flexibility.
In a first aspect, the present application provides a component invocation method based on an application framework, the application framework providing a communication component for communicating with an external terminal; the external terminal is a user terminal that performs a conversation with the conversation robot. The method comprises the following steps:
Receiving a service request sent by the external terminal to a target service based on the communication component provided by the application framework; the target service is a service for enabling the conversation robot to realize intelligent conversation;
Determining a target component mapped with the communication component in the target service based on a component mapping calling relation configured for the component in the target service in advance;
based on the interface registration information of the target component on the application framework, invoking a data processing interface of the target component by the application framework to trigger the target component to perform corresponding processing based on the request data in the service request, and determining a conversation result output by the conversation robot;
And returning the dialogue result to the external terminal based on the communication component.
In a second aspect, the present application also provides a component calling device based on an application framework, where the application framework provides a communication component for communicating with an external terminal; the external terminal is a user terminal that performs a conversation with the conversation robot. The device comprises:
The receiving module is used for receiving a service request sent by the external terminal to a target service based on the communication component provided by the application framework; the target service is a service for enabling the conversation robot to realize intelligent conversation;
the confirming module is used for confirming a target component mapped with the communication component in the target service based on a component mapping calling relation configured for the component in the target service in advance;
The generation module is used for calling a data processing interface of the target component by the application framework based on the interface registration information of the target component on the application framework so as to trigger the target component to perform corresponding processing based on the request data in the service request and determine a conversation result output by the conversation robot;
and the sending module is used for returning the dialogue result to the external terminal based on the communication component.
In one embodiment, the application framework is implemented based on a single process and multi-threaded model.
In one embodiment, the target service includes a master process and at least one component process; the component process is a subprocess pulled up by the main control process according to the configuration information;
The receiving module is further configured to load the communication component based on a docking component process in the at least one component process, and receive a service request sent by the external terminal to the target service.
In one embodiment, the at least one component process further includes a target component process; the confirmation module is further used for determining a target component which is mapped with the communication component in the target service and runs in the target component process through the docking component process based on the component mapping calling relation.
In one embodiment, the component mapping call relationship is derived based on a component profile on the application framework; the component mapping calling relationship comprises a calling relationship between a component in the target service and an upstream component defined in the component configuration file; the confirmation module is further configured to take the component as a target component if it is determined that the corresponding upstream component is the communication component based on the call relationship.
In one embodiment, the component profile further includes an interface definition of the component; the interface registration information is obtained from an interface realization file corresponding to the target component; the interface realization file is obtained by carrying out relevant development processing of interface realization based on the compiling result file; the compiling result file is obtained by compiling the component configuration file comprising the interface definition based on the application framework.
In one embodiment, the component mapping call relationship includes a call relationship between the target component and a downstream component; the generating module is further used for calling a data processing interface of the target component by the application framework to trigger the target component to perform session management based on the request data in the service request, and then calling a downstream component to perform intention ordering algorithm processing to obtain a conversation result output by the conversation robot.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor executing the steps of the above-described application framework based component invocation method.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium has stored thereon a computer program for execution by a processor of the steps of the above application framework based component invocation method.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which is executed by a processor to perform the steps of the above-described application framework based component invocation method.
The method, the device, the computer equipment and the storage medium for calling the components based on the application framework are characterized in that the application framework provides a communication component for communicating with an external terminal; the external terminal is a user terminal that performs a conversation with the conversation robot, and the target service is a service that causes the conversation robot to implement an intelligent conversation. Based on the communication component provided by the application framework, a service request sent by the external terminal to the target service is received. And determining the target component mapped with the communication component in the target service based on the component mapping calling relation configured for the component in the target service in advance. Based on the interface registration information of the target component on the application framework, the application framework invokes the data processing interface of the target component to trigger the target component to perform corresponding processing based on the request data in the service request, and a conversation result output by the conversation robot is determined. And returning a dialogue result to the external terminal based on the communication component. Therefore, by combining the application framework and based on the communication component provided by the application framework, the target service can conveniently have the capability of external interaction without depending on a central control platform. Secondly, the application framework also uses the component mapping calling relation of the component configuration to confirm the target component of the target service, so that the target component can be simply and flexibly docked with the application framework. And based on the interface registration information on the application framework, the data processing interface of the target component can be called to trigger the target component to process the request data and return the dialogue result, thereby realizing the management of the call flow by the target component. Therefore, decoupling with the central control platform is realized, and flexibility is improved.
Drawings
FIG. 1 is an application environment diagram of an application framework-based component invocation method in one embodiment;
FIG. 2 is a flow diagram of a component invocation method based on an application framework in one embodiment;
FIG. 3 is a schematic diagram of the process of a target service in one embodiment;
FIG. 4 is a block diagram of a component invocation apparatus based on an application framework in one embodiment;
FIG. 5 is a block diagram of the structure of a generation module in one embodiment;
fig. 6 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The component call development method based on the application framework provided by the application can be applied to the application environment shown in the figure 1. Wherein the terminal 110 communicates with the server 120 through a network. The terminal 110 may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the server 120 may be implemented as a stand-alone server or a server cluster composed of a plurality of servers.
The terminal 110 may send a service request to a target service; the server 120 receives a service request sent by the terminal 110 to a target service based on a communication component provided by the application framework; the target service is a service for causing the conversation robot to implement an intelligent conversation. The server 120 determines a target component in the target service that maps with the communication component based on a component mapping call relationship configured in advance for the component in the target service. The server 120 invokes a data processing interface of the target component by the application framework based on the interface registration information of the target component on the application framework, so as to trigger the target component to perform corresponding processing based on the request data in the service request, and determine a conversation result output by the conversation robot. The server 120 returns a dialogue result to the terminal 110 based on the communication component.
In one embodiment, as shown in fig. 2, a component calling method based on an application framework is provided, and this embodiment is illustrated by applying the method to a server, where it is understood that the method may also be applied to a terminal, and may also be applied to a system including the terminal and the server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the steps of:
S202, receiving a service request sent by an external terminal to a target service based on a communication component provided by an application framework; the target service is a service for causing the conversation robot to implement an intelligent conversation.
The application framework is used for providing and realizing the most basic software architecture and system, and the components are packages of data and methods and can have own properties and methods; the communication component is a component for network communication. A service is an application implemented based on an application framework.
In one embodiment, the application framework may be a framework developed based on C++ (an object-oriented programming language).
In one embodiment, the application framework may be a framework developed on the principle of control inversion (a design principle in object-oriented programming that can be used to reduce the degree of coupling between computer code).
In one embodiment, the application framework may be a framework developed with the idea of programming in a tangential plane programming (Aspect Oriented Programming, a technique that enables unified maintenance of program functions through precompiled means and dynamic agents during run-time).
In one embodiment, the target service includes a master process and at least one component process, the master process pulling up the plurality of component processes according to the configuration information.
In one embodiment, the master process monitors all component processes for exception handling, such as restarting or sending alarms, etc.
In one embodiment, the component processes of the target service include a docking component process that can load the communication component.
In one embodiment, the target service is a service for the conversation robot to implement an intelligent conversation, and an answer to a question in the intelligent conversation can be obtained according to the question.
In one embodiment, the communication component may be a remote procedure call component that provides a method with parameters and return types that can be invoked remotely.
In another embodiment, the communication component may be a hypertext transfer protocol component (HTTP component).
In one embodiment, the communication component may support at least one of a service (server) mode and a client (client) mode.
Specifically, the terminal sends a service request to the target service, which receives the service request using the base component provided by the application framework.
S204, determining the target components mapped with the communication components in the target service based on the component mapping calling relation configured for the components in the target service in advance.
The component mapping calling relationship is used for representing the calling relationship between the calling component and the called component.
In one embodiment, the component map call relationship is generated by configuration.
In one embodiment, the component mapping call relationship comprises a call relationship between a component of the target service and an upstream component. Wherein the upstream component is a calling component and the component of the target service is a called component.
In one embodiment, the upstream component may be a component provided by an application framework.
In one embodiment, the upstream component may be a communication component of an application framework.
In another embodiment, the upstream component may be a service request component of the application framework that further encapsulates the communication component, providing a unified standard interface.
In one embodiment, the target component mapped with the communication component is a pointer to target service, the communication component acts as a calling component, and the corresponding called component acts as the target component.
In one embodiment, the component processes of the target service include target component processes in which target components run.
In one embodiment, the server determines the target component mapped with the communication component by the component mapping call relationship in the docking component process.
In one embodiment, the application framework is implemented based on a single process and multi-threaded model.
Specifically, a developer configures a component aiming at a target service, and a server generates and stores a component mapping calling relation according to a component configuration result. After receiving the service request, the server acquires the component mapping calling relation, and confirms the target component mapped with the communication component through the calling component and the called component information in the component mapping calling relation.
S206, based on the interface registration information of the target component on the application framework, the application framework invokes the data processing interface of the target component to trigger the target component to perform corresponding processing based on the request data in the service request, and a conversation result output by the conversation robot is determined.
The interface registration means that a developer develops on a unified interface designated by an application framework to call an interface of the target component through the unified interface so as to achieve the purpose of registration. The interface registration information is information generated by interface registration. The data processing interface is an interface for the target component to process the requested data in the service request.
In one embodiment, the component mapping call relationship includes a call relationship between the target component and the downstream component. After the data processing interface of the target component is called, the downstream component is called by the target component to process the request data based on the calling relationship between the target component and the downstream component.
Specifically, according to the specification of the application framework, the target component performs interface registration to generate interface registration information on the application framework. And the application framework calls a data processing interface of the target component based on the interface registration information so as to trigger the target component to perform corresponding processing based on the request data in the service request, and the result determines a conversation result output by the conversation robot.
And S208, returning a dialogue result to the external terminal based on the communication component.
Specifically, after the server obtains the dialogue result, the communication component provided by the application framework is used to return the dialogue result to the external terminal.
In one embodiment, the target service uses a protocol conversion component provided by the application framework to generate a reply message according with a protocol specification required by the communication component for the dialogue result, and then uses the communication component to send the reply message, so that the external terminal receives the dialogue result in the reply message.
The component calling method based on the application framework, wherein the application framework provides a communication component for communicating with an external terminal; the external terminal is a user terminal that performs a conversation with the conversation robot, and the target service is a service that causes the conversation robot to implement an intelligent conversation. Based on the communication component provided by the application framework, a service request sent by the external terminal to the target service is received. And determining the target component mapped with the communication component in the target service based on the component mapping calling relation configured for the component in the target service in advance. Based on the interface registration information of the target component on the application framework, the application framework invokes the data processing interface of the target component to trigger the target component to perform corresponding processing based on the request data in the service request, and a conversation result output by the conversation robot is determined. And returning a dialogue result to the external terminal based on the communication component. Therefore, by combining the application framework and based on the communication component provided by the application framework, the target service can conveniently have the capability of external interaction without depending on a central control platform. Secondly, the application framework also uses the component mapping calling relation of the component configuration to confirm the target component of the target service, so that the target component can be simply and flexibly docked with the application framework. And based on the interface registration information on the application framework, the data processing interface of the target component can be called to trigger the target component to process the request data and return the dialogue result, thereby realizing the management of the call flow by the target component. Therefore, decoupling with the central control platform is realized, and flexibility is improved.
In one embodiment, the application framework is implemented based on a single process and multi-threaded model.
Specifically, a single process of the application framework is used to launch services carried by the application framework.
In one embodiment, the application framework supports configuration of multiple configuration items, including log configuration items, service configuration items, component configuration items, and component build runtime thread configuration items.
Specifically, the server adopts a single-process multithreading mode to directly load configuration information of each configuration item into the memory.
In this embodiment, the application framework is implemented based on a single process and multithreading mode, so that the configuration information can be directly loaded into the memory, or other shared data can be directly loaded into the memory. Compared with an application framework of a multi-process mode, the method has the advantages that a shared memory is not needed, the computer resource overhead of inter-process communication is avoided, the synchronization problem generated when configuration items are modified in the multi-process mode is avoided, and the high concurrency abnormal problem caused by frequent reading and writing of the shared memory under the high concurrency condition is avoided.
In one embodiment, the target service includes a master process and at least one component process; the component process is a subprocess pulled up by the main control process according to the configuration information; based on the communication component provided by the application framework, the receiving the service request sent by the external terminal to the target service comprises: and loading the communication component based on a docking component process in at least one component process, and receiving a service request sent by an external terminal to the target service.
Specifically, after the main control process of the target service is started, a plurality of component processes, namely sub-processes of the main control process, are pulled up according to the configuration information. The component processes of the target service comprise a docking component process, and the docking component process loads the communication component so as to receive a service request sent by the external terminal.
In one embodiment, the docking component process loading the communication component provides a remote procedure call service to the outside to transceive other network communication data in addition to the application framework.
In the embodiment, the communication component is loaded through the butt joint component process of the target service, and the service request sent by the external terminal to the target service is received, so that the target service has the capability of external interaction conveniently, and is not dependent on the central control platform any more, decoupling with the central control platform is realized, and flexibility is improved.
In one embodiment, the at least one component process further comprises a target component process; based on a component mapping calling relation configured for components in a target service in advance, determining the target components mapped with the communication components in the target service comprises: and determining the target component which is mapped with the communication component in the target service and runs in the target component process based on the component mapping calling relation through the interfacing component process.
Wherein the target component process is a process running the target component.
In one embodiment, the docking component process may be used to dock the communication component between the target component of the target service and the application framework, for unified management.
In one embodiment, the component mapping call relationship is generated based on component configuration for the target service.
In one embodiment, the target component may be a component that processes the request data in the service request.
In one embodiment, the target component may also be used for session management.
In another embodiment, the target component may also invoke a third party knowledge-graph service.
In one embodiment, the docking component process may load the remote procedure call component and determine a target component in the target service that maps to the remote procedure call component and runs in the target component process.
In another embodiment, the docking component process may also load the HTTP component and determine a target component in the target service that maps to the HTTP component and runs in the target component process.
Specifically, the target service runs the docking component process, and after the communication component loaded by the docking component process receives the service request, the component mapping calling relation is obtained, and the target component mapped with the communication component is confirmed and runs in the target component process.
In this embodiment, by interfacing the component processes, a target component mapped to the communication component in the target service and running in the target component process is determined based on the component mapping call relationship. In this way, the target component can be simply and flexibly docked with the communication component of the application framework.
In one embodiment, the component mapping call relationship is derived based on a component profile on the application framework; the component mapping calling relationship comprises a calling relationship between a component in a target service defined in a component configuration file and an upstream component; based on a component mapping calling relation configured for components in a target service in advance, determining the target components mapped with the communication components in the target service comprises: and if the corresponding upstream component is determined to be the communication component based on the calling relation, taking the component as a target component.
The component configuration file is a configuration file which can be identified by the application framework and is used for configuring the components.
In one embodiment, the component configuration file may customize the external interface of the component and the data structure used.
In one embodiment, the component configuration file may configure the service to which the component belongs.
In one embodiment, the component configuration file may configure call relationships between components in the target service and upstream components.
In one embodiment, the component configuration file may configure call relationships between components in the target service and downstream components.
In one embodiment, the component mapping call relationship is derived based on a component profile on the application framework.
In one embodiment, the server acknowledges the target service that handled the service request based on the service request. For example, the server may identify the target service that handled the service request based on the service identification in the service request. For example, the server may identify the target service that handled the service request based on the port used by the communication component to receive the service request.
Specifically, a developer configures a component on a component configuration file on an application framework, including configuring a call relationship between a target service to which the component belongs, the component, and an upstream component. And the server processes the component configuration file to obtain a component mapping calling relation. The server confirms the target service corresponding to the service request, and confirms that the component is the target component when the upstream component of the target service is determined to be the communication component through the calling relation between the component in the component mapping calling relation and the upstream component.
In this embodiment, a component mapping calling relationship is obtained through a component configuration file on an application framework; and the component mapping call relationship includes a call relationship between a component in the target service and an upstream component. When the service request is received, and the corresponding upstream component is determined to be the communication component, the component can be confirmed to be the target component. In this way, in the case that different services use different communication components or target components, the types of the communication components or the target components are flexibly modified based on the modification of the component configuration file, and the application framework can simply and flexibly bear different services.
In one embodiment, the component configuration file further includes interface definitions for the components; the interface registration information is obtained from an interface realization file corresponding to the target component; the interface realization file is obtained by carrying out relevant development processing of interface realization based on the compiling result file; the compiling result file is obtained by compiling the component configuration file comprising the interface definition based on the application framework.
In one embodiment, the component profile includes interface definitions, which may define the external interfaces of the component.
Specifically, after the interface is defined by the component configuration file corresponding to the target component, the developer compiles the component configuration file based on the application framework to obtain a compiling result file. And carrying out relevant development of the interface realization on the compiling result file to obtain an interface realization file corresponding to the target component. And the server obtains the interface registration information according to the interface realization file.
In this embodiment, the server compiles the component configuration file, the developer develops the compiling result file generated by compiling, and the server obtains the interface registration information from the interface implementation file generated by developing. Therefore, the server provides normalized and simplified development flow for the developer, reduces the development workload of the developer and reduces the error probability, thereby reducing the cost of computer resources.
In one embodiment, the component mapping call relationship includes a call relationship between the target component and the downstream component; the application framework invokes the data processing interface of the target component to trigger the target component to perform corresponding processing based on the request data in the service request, and determining the dialogue result output by the dialogue robot comprises the following steps: and calling a data processing interface of the target component by the application framework to trigger the target component to perform session management based on the request data in the service request, and then calling a downstream component to perform intention ordering algorithm processing to obtain a conversation result output by the conversation robot.
When the target component is used as a calling component, the component called by the target component is a downstream component.
In one embodiment, the component mapping call relationship includes a call relationship between the target component and the downstream component.
In one embodiment, the server may perform session management on the request data of the service request when the request data in the service request is session content. Such as controlling the number of sessions, obtaining the above session information related to the request data of the service request, and external terminal whitelist management, etc.
In one embodiment, when the request data in the service request is dialogue content, the server may perform intent analysis on the request data in the service request to obtain a plurality of intents, and rank the plurality of intents according to a matching score between the intents and the dialogue content.
Specifically, the application framework invokes a data processing interface of the target component, triggers the target component to perform session management on request data in the service request, invokes the downstream component to perform intention analysis on the request data when the session management is completed and meets the preset requirement, generates a plurality of intentions, sorts the plurality of intentions, selects a plurality of matched intentions according to the sorting result, and obtains a dialogue result output by the dialogue robot based on the plurality of matched intentions.
In one embodiment, the server may obtain a plurality of answers for a plurality of matched intents, respectively.
In one embodiment, the downstream component may invoke the downstream component to trigger the downstream component to fine-rank and answer fusion of the plurality of answers.
In another embodiment, the downstream component may invoke a third party service to trigger the third party service to fine-rank and answer fusion of the plurality of answers.
In one embodiment, only local access can be supported among self components of the application framework, and performance loss caused by a network can be effectively avoided under the condition of multi-machine deployment.
In one embodiment, the target service may obtain data related to the business to which the target service belongs based on a communication component provided by the application framework.
In this embodiment, the component mapping call relationship includes a call relationship between the target component and the downstream component. When the application framework calls the data processing interface, the target component is triggered to call the downstream component to obtain a conversation result output by the conversation robot. In this way, the target service can predefine the call relationship between the target component and the downstream component, and when processing the service request data, the target service calls the downstream component, thereby having the capability of external interaction without depending on the central control platform, and realizing the management call flow of the target component.
In one embodiment, as shown in the process diagram of FIG. 3, the relationship between the processes of the target service is illustrated. Specifically, the master control process of the target service pulls up a plurality of sub-processes, namely a plurality of component processes, including a docking component process, a target component process and a downstream component process according to the configuration information. The master process monitors the plurality of component processes. The docking assembly process loads a communication assembly provided by the application framework and receives a service request sent by an external terminal to the target service. The application framework is realized based on a mode of single process and multithreading, and the target service is a service for enabling the conversation robot to realize intelligent conversation. And obtaining a component mapping relation according to the component configuration file on the application framework, wherein the component mapping relation comprises a calling relation between a component in the target service and an upstream component defined in the component configuration file. When the upstream component is a communication component, determining a target component mapped with the communication component in the target service based on a pre-component mapping calling relation. The target component is running in a target component process. The interface registration information is obtained from an interface implementation file obtained based on the component configuration file. Based on the interface registration information of the target component on the application framework, the application framework invokes a data processing interface of the target component to trigger the target component to perform corresponding processing based on the request data in the service request, and a conversation result output by the conversation robot is determined; and returning a dialogue result to the external terminal based on the communication component. The component mapping call relationship also comprises a call relationship between the target component and the downstream component, and in the process of carrying out corresponding processing on the request data, further processing, such as intention ordering algorithm processing, can be carried out on the basis of the downstream component in the downstream component process so as to generate a dialogue result.
It should be understood that, although the steps in the flowcharts in some embodiments of the present application are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least a portion of the steps in the flowcharts may include a plurality of steps or stages that are not necessarily performed at the same time, but may be performed at different times, and the order of execution of the steps or stages is not necessarily sequential, but may be performed in rotation or alternately with at least a portion of the steps or stages in other steps or other steps.
Based on the same inventive concept, the embodiment of the application also provides an application frame-based component calling device for realizing the above related application frame-based component calling method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiments of the application framework-based component calling device provided below may refer to the limitation of the application framework-based component calling method hereinabove, and will not be repeated herein.
In one embodiment, as shown in fig. 4, there is provided an application framework-based component invocation apparatus 400, comprising: a receiving module 402, a confirming module 404, a generating module 406, and a transmitting module 408, wherein:
A receiving module 402, configured to receive, based on a communication component provided by an application framework, a service request sent by an external terminal to a target service; the target service is a service for causing the conversation robot to implement an intelligent conversation.
A confirmation module 404, configured to determine, based on a component mapping calling relationship configured in advance for components in the target service, a target component mapped with the communication component in the target service.
The generating module 406 is configured to invoke, by the application framework, a data processing interface of the target component based on the interface registration information of the target component on the application framework, so as to trigger the target component to perform corresponding processing based on the request data in the service request, and determine a dialog result output by the dialog robot.
And a sending module 408, configured to return a dialogue result to the external terminal based on the communication component.
In one embodiment, the application framework is implemented based on a single process and multi-threaded model.
In one embodiment, the target service includes a master process and at least one component process; the component process is a subprocess pulled up by the main control process according to the configuration information; the receiving module 402 is further configured to load the communication component based on a docking component process in the at least one component process, and receive a service request sent by the external terminal to the target service.
In one embodiment, the at least one component process further includes a target component process; the confirmation module 404 is further configured to determine, by the interfacing component process, a target component that is mapped to the communication component in the target service and that is running in the target component process based on the component mapping call relationship.
In one embodiment, the component mapping call relationship is derived based on a component profile on the application framework; the component mapping calling relationship comprises a calling relationship between a component in the target service and an upstream component defined in the component configuration file; the validation module 404 is further configured to take the component as a target component if it is determined that the corresponding upstream component is the communication component based on the call relationship.
In one embodiment, the component profile further includes an interface definition of the component; the interface registration information is obtained from an interface realization file corresponding to the target component; the interface realization file is obtained by carrying out relevant development processing of interface realization based on the compiling result file; the compiling result file is obtained by compiling the component configuration file comprising the interface definition based on the application framework.
In one embodiment, the component mapping call relationship includes a call relationship between the target component and a downstream component; as shown in fig. 5, the generating module 406 further includes: a session management module 406a and an intention ordering 406b, wherein:
the session management module 406a is configured to invoke, by the application framework, a data processing interface of the target component to trigger the target component to perform session management based on the request data in the service request.
And the intention ordering 406b is used for calling a downstream component to perform intention ordering algorithm processing to obtain a dialogue result output by the dialogue robot.
The component calling device based on the application framework provides a communication component for communicating with an external terminal; the external terminal is a user terminal that performs a conversation with the conversation robot, and the target service is a service that causes the conversation robot to implement an intelligent conversation. Based on the communication component provided by the application framework, a service request sent by the external terminal to the target service is received. And determining the target component mapped with the communication component in the target service based on the component mapping calling relation configured for the component in the target service in advance. Based on the interface registration information of the target component on the application framework, the application framework invokes the data processing interface of the target component to trigger the target component to perform corresponding processing based on the request data in the service request, and a conversation result output by the conversation robot is determined. And returning a dialogue result to the external terminal based on the communication component. Therefore, by combining the application framework and based on the communication component provided by the application framework, the target service can conveniently have the capability of external interaction without depending on a central control platform. Secondly, the application framework also uses the component mapping calling relation of the component configuration to confirm the target component of the target service, so that the target component can be simply and flexibly docked with the application framework. And based on the interface registration information on the application framework, the data processing interface of the target component can be called to trigger the target component to process the request data and return the dialogue result, thereby realizing the management of the call flow by the target component. Therefore, decoupling with the central control platform is realized, and flexibility is improved.
For specific limitation of the component calling device based on the application framework, reference may be made to the limitation of the component calling method based on the application framework, which is not described herein. The various modules in the application framework-based component invocation apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing configuration item data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a component invocation method based on an application framework.
It will be appreciated by those skilled in the art that the structure shown in FIG. 6 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In an embodiment, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (10)

1. An application framework-based component calling method is characterized in that the application framework provides a communication component for communicating with an external terminal; the external terminal is a user terminal for performing dialogue with the dialogue robot; the method comprises the following steps:
Receiving a service request sent by the external terminal to a target service based on the communication component provided by the application framework; the target service is a service for enabling the conversation robot to realize intelligent conversation;
Determining a target component mapped with the communication component in the target service based on a component mapping calling relation configured for the component in the target service in advance;
based on the interface registration information of the target component on the application framework, invoking a data processing interface of the target component by the application framework to trigger the target component to perform corresponding processing based on the request data in the service request, and determining a conversation result output by the conversation robot;
And returning the dialogue result to the external terminal based on the communication component.
2. The method of claim 1, wherein the application framework is implemented based on a single process and multithreading scheme.
3. The method of claim 2, wherein the target service comprises a master process and at least one component process; the component process is a subprocess pulled up by the main control process according to the configuration information;
The receiving, based on the communication component provided by the application framework, a service request sent by an external terminal to a target service includes:
And loading the communication component based on a docking component process in the at least one component process, and receiving a service request sent by an external terminal to a target service.
4. The method of claim 3, wherein the at least one component process further comprises a target component process; the determining, based on a component mapping calling relationship configured in advance for components in the target service, a target component mapped with the communication component in the target service includes:
And determining a target component which is mapped with the communication component in the target service and runs in the target component process based on the component mapping calling relation through the docking component process.
5. The method of claim 1, wherein the component mapping call relationship is derived based on a component profile on the application framework; the component mapping calling relationship comprises a calling relationship between a component in the target service and an upstream component defined in the component configuration file;
The determining, based on a component mapping calling relationship configured in advance for components in the target service, a target component mapped with the communication component in the target service includes:
And if the corresponding upstream component is determined to be the communication component based on the calling relation, the component is taken as a target component.
6. The method of claim 5, wherein the component profile further comprises an interface definition of a component; the interface registration information is obtained from an interface realization file corresponding to the target component; the interface realization file is obtained by carrying out relevant development processing of interface realization based on the compiling result file; the compiling result file is obtained by compiling the component configuration file comprising the interface definition based on the application framework.
7. The method of claim 1, wherein the component mapping call relationship comprises a call relationship between the target component and a downstream component;
The application framework invokes the data processing interface of the target component to trigger the target component to perform corresponding processing based on the request data in the service request, and determining the dialog result output by the dialog robot includes:
And calling a data processing interface of the target component by the application framework to trigger the target component to perform session management based on the request data in the service request, and then calling a downstream component to perform intention ordering algorithm processing to obtain a conversation result output by the conversation robot.
8. An application framework-based component calling device, wherein the application framework provides a communication component for communicating with an external terminal; the external terminal is a user terminal for performing dialogue with the dialogue robot; the device comprises:
The receiving module is used for receiving a service request sent by the external terminal to a target service based on the communication component provided by the application framework; the target service is a service for enabling the conversation robot to realize intelligent conversation;
the confirming module is used for confirming a target component mapped with the communication component in the target service based on a component mapping calling relation configured for the component in the target service in advance;
The generation module is used for calling a data processing interface of the target component by the application framework based on the interface registration information of the target component on the application framework so as to trigger the target component to perform corresponding processing based on the request data in the service request and determine a conversation result output by the conversation robot;
and the sending module is used for returning the dialogue result to the external terminal based on the communication component.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202210162072.0A 2022-02-22 2022-02-22 Component calling method and device based on application framework and computer equipment Active CN114610404B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210162072.0A CN114610404B (en) 2022-02-22 2022-02-22 Component calling method and device based on application framework and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210162072.0A CN114610404B (en) 2022-02-22 2022-02-22 Component calling method and device based on application framework and computer equipment

Publications (2)

Publication Number Publication Date
CN114610404A CN114610404A (en) 2022-06-10
CN114610404B true CN114610404B (en) 2024-06-14

Family

ID=81859936

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210162072.0A Active CN114610404B (en) 2022-02-22 2022-02-22 Component calling method and device based on application framework and computer equipment

Country Status (1)

Country Link
CN (1) CN114610404B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114936098B (en) * 2022-07-22 2022-11-04 浙江中控技术股份有限公司 Data transfer method, device, back-end equipment and storage medium
CN115396492B (en) * 2022-08-03 2023-11-17 深圳前海环融联易信息科技服务有限公司 Service request method, device, computer equipment and program product
CN117075887A (en) * 2022-11-02 2023-11-17 Tcl移动通信科技(宁波)有限公司 Service component calling method and device, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110421575A (en) * 2019-08-06 2019-11-08 南京奥拓电子科技有限公司 A kind of control system of the peripheral component of banking machine people
CN112866177A (en) * 2019-11-26 2021-05-28 浙江大搜车软件技术有限公司 Method, device, storage medium and computer equipment for processing service call request

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113630309B (en) * 2021-08-12 2022-11-01 深圳追一科技有限公司 Robot conversation system, method, device, computer equipment and storage medium
CN113934832A (en) * 2021-10-22 2022-01-14 腾讯科技(深圳)有限公司 Interactive processing method, device, equipment, medium and program product based on session

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110421575A (en) * 2019-08-06 2019-11-08 南京奥拓电子科技有限公司 A kind of control system of the peripheral component of banking machine people
CN112866177A (en) * 2019-11-26 2021-05-28 浙江大搜车软件技术有限公司 Method, device, storage medium and computer equipment for processing service call request

Also Published As

Publication number Publication date
CN114610404A (en) 2022-06-10

Similar Documents

Publication Publication Date Title
CN114610404B (en) Component calling method and device based on application framework and computer equipment
CN101262498B (en) A distributed message call method and device
CN109815025B (en) Service model calling method, device and storage medium
WO2021057925A1 (en) Intelligent device control method and apparatus, intelligent device and storage medium
CN112787999B (en) Cross-chain calling method, device, system and computer readable storage medium
CN116541497A (en) Task type dialogue processing method, device, equipment and storage medium
CN106648875A (en) Application switching method and device
WO2023185044A1 (en) Data processing method and apparatus, and electronic device and storage medium
CN114546648A (en) Task processing method and task processing platform
CN115600676A (en) Deep learning model reasoning method, device, equipment and storage medium
CN114398179B (en) Method and device for acquiring tracking identifier, server and storage medium
WO2019117767A1 (en) Method, function manager and arrangement for handling function calls
CN116204307A (en) Federal learning method and federal learning system compatible with different computing frameworks
US9229980B2 (en) Composition model for cloud-hosted serving applications
CN111447136B (en) Message pushing method and device, computer equipment and storage medium
CN112328410B (en) Method, device, equipment and storage medium for realizing remote procedure call
CN113191889A (en) Wind control configuration method, configuration system, electronic device and readable storage medium
CN115167985A (en) Virtualized computing power providing method and system
US20220210248A1 (en) Information interaction methods, apparatuses, devices, and systems and storage media
CN112235411B (en) Server communication method, device, equipment and medium of RPA flow control terminal based on AI
CN110908665B (en) jenkins construction plug-in development optimization method and system
CN114610413A (en) Method, device, equipment and storage medium for executing synchronous and asynchronous tasks based on Java
CN113849287A (en) Processing method and device of algorithm service, electronic equipment and storage medium
CN109669793B (en) Object calling method in middleware process
Ayres et al. Stage: Python with actors

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant