CN118277502A - Data storage method, device, equipment and medium based on task type dialogue system - Google Patents
Data storage method, device, equipment and medium based on task type dialogue system Download PDFInfo
- Publication number
- CN118277502A CN118277502A CN202410472411.4A CN202410472411A CN118277502A CN 118277502 A CN118277502 A CN 118277502A CN 202410472411 A CN202410472411 A CN 202410472411A CN 118277502 A CN118277502 A CN 118277502A
- Authority
- CN
- China
- Prior art keywords
- data
- dialogue
- dialogue scene
- container
- configuration
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 238000013500 data storage Methods 0.000 title claims abstract description 45
- 238000012545 processing Methods 0.000 claims abstract description 22
- 230000006870 function Effects 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 12
- 230000004048 modification Effects 0.000 claims description 7
- 238000012986 modification Methods 0.000 claims description 7
- 238000010276 construction Methods 0.000 claims description 4
- 238000011161 development Methods 0.000 abstract description 15
- 238000013473 artificial intelligence Methods 0.000 abstract description 3
- 238000004891 communication Methods 0.000 description 12
- 230000003993 interaction Effects 0.000 description 8
- 238000010606 normalization Methods 0.000 description 7
- 238000007726 management method Methods 0.000 description 5
- 230000008859 change Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000005012 migration Effects 0.000 description 4
- 238000013508 migration Methods 0.000 description 4
- 230000006978 adaptation Effects 0.000 description 2
- 210000001072 colon Anatomy 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 125000006850 spacer group Chemical group 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to the field of artificial intelligence, is suitable for the financial field, and discloses a data storage method, a device, electronic equipment and a storage medium based on a task type dialogue system, which can be used for the scene data storage specification of the financial dialogue task system, wherein the method comprises the following steps: acquiring a data format of dialogue scene data from a task type dialogue system, and constructing a data container according to the dialogue scene data and the data format; creating a configuration text according to a preset data storage requirement, a preset service requirement and the data format, and reading the dialogue scene data into the data container according to the configuration text; classifying the dialogue scene data in the data container, and carrying out standardization processing on the classified dialogue scene data to obtain a standardized dialogue scene data set. The invention can reduce the development cost of the read-in and integrated data and improve the efficiency of the read-in and integrated data when the task type dialogue system is migrated to a new service.
Description
Technical Field
The invention relates to the field of artificial intelligence, is suitable for the field of finance, in particular to a data storage method, a data storage device, electronic equipment and a readable storage medium based on a task-based dialogue system.
Background
In the conventional task type dialogue system, in different scenes, the data format and content of entity data and intention data are very different, for example, the task type dialogue system for purchasing financial products, in a certain scene, a client inputs "i want to purchase financial products of name a", the entities and intention recognized by the dialogue system are "a products", "purchase", respectively, and related data may be provided in the form of text, while in another scene, the client inputs "i want to know financial products of name a", the entities and intention recognized by the dialogue system are "good or bad of a products", "know", respectively, and related data may be provided in the form of structure. These data may contain various concepts, but they are commingled, resulting in high development costs and inefficiency in reading in and integrating these data when it is necessary to migrate the system to a new service.
Disclosure of Invention
The invention provides a data storage method, a device, electronic equipment and a readable storage medium based on a task-type dialogue system, which can reduce the development cost of reading in and integrating data and improve the efficiency of reading in and integrating data when the task-type dialogue system is migrated to a new service.
In order to achieve the above object, the present invention provides a data storage method based on a task-based dialogue system, the method comprising:
acquiring a data format of dialogue scene data from a task type dialogue system, and determining a data container structure according to the dialogue scene data;
Defining a data container interface according to the data format, and constructing a data container according to the data container structure and the data container interface;
Determining configuration parameters according to preset data storage requirements, and selecting a configuration text format according to preset service requirements and the data format;
Creating a configuration text according to the configuration parameters and the configuration text format, and reading the dialogue scene data into the data container according to the configuration text;
Classifying the dialogue scene data in the data container, and carrying out standardization processing on the classified dialogue scene data to obtain a standardized dialogue scene data set.
Optionally, the constructing a data container according to the data container structure and the data container interface includes:
Acquiring the data volume of the dialogue scene data, and distributing a memory space according to the data volume;
creating a data instance according to the data container structure;
constructing an initial data container according to the data instance and the memory space;
and splicing the data container interface with the initial data container to obtain a data container.
Optionally, the creating a configuration text according to the configuration parameters and the configuration text format includes:
Creating an initial file, and writing configuration items in the initial file according to the configuration parameters and grammar rules in the configuration text format;
grouping the configuration items to obtain a grouping structure, filling the configuration parameters into the initial file to obtain a configuration file;
And modifying the file format of the configuration file according to the configuration text format to obtain a configuration text.
Optionally, the normalizing processing is performed on the classified dialogue scene data to obtain a normalized dialogue scene data set, including:
Respectively extracting entity data and intention data in the classified dialogue scene data;
Grouping the entity data and the intention data to obtain a grouping matching item;
Performing key value pair adding processing on the grouping matching items to obtain key value pair matching items;
and formatting the matching item of the key value pair to obtain a normalized dialogue scene data set.
Optionally, the acquiring the data format of the dialogue scene data includes:
Identifying a data type of the dialog scene data using a data type checking function;
identifying a data structure of the dialogue scene data according to the data type;
And confirming the data format of the dialogue scene data according to the data structure.
Optionally, after the normalized processing is performed on the classified dialog scene data to obtain a normalized dialog scene data set, the method further includes:
and carrying out naming modification on the normalized dialogue scene data set to obtain a unified naming dialogue scene data set.
In order to solve the above problems, the present invention also provides a data storage device based on a task-based dialogue system, the device comprising:
The data container construction module is used for acquiring the data format of the dialogue scene data, determining a data container structure according to the dialogue scene data, defining a data container interface according to the data format, and constructing a data container according to the data container structure and the data container interface;
The configuration file generation module is used for determining configuration parameters according to preset data storage requirements, selecting a configuration text format according to preset service requirements and the data format, creating a configuration text according to the configuration parameters and the configuration text format, and reading the dialogue scene data into the data container according to the configuration text;
And the dialogue scene data standardization module is used for classifying dialogue scene data in the data container and carrying out standardization processing on the classified dialogue scene data to obtain a standardized dialogue scene data set.
In order to solve the above-mentioned problems, the present invention also provides an electronic apparatus including:
A memory storing at least one computer program; and
And the processor executes the computer program stored in the memory to realize the data storage method based on the task type dialogue system.
In order to solve the above-mentioned problems, the present invention also provides a computer-readable storage medium having stored therein at least one computer program that is executed by a processor in an electronic device to implement the above-mentioned task-based dialog system data storage method.
According to the embodiment of the invention, the data container capable of storing the existing data format is constructed, and the dialogue scene data is stored in the data container by utilizing the configuration file, so that when a developer needs to modify the reading mode of the data, only the configuration file is needed to be modified, and the source code is not needed to be modified, the data reading efficiency is improved, the development cost of the data reading is reduced, secondly, the dialogue scene data in the data container is classified, so that the developer can conveniently modify and expand each part independently, the development cost is reduced, and finally, the dialogue scene data of the data in the data container is normalized, the data readability is enhanced, the communication cost among members of a development team is reduced, and the maintainability of the data in the data container is improved. Therefore, the data storage method, the device, the equipment and the storage medium based on the task type dialogue system can reduce the development cost of reading and integrating data and improve the efficiency of reading and integrating the data when the task type dialogue system is migrated to a new service.
Drawings
FIG. 1 is a flow chart of a data storage method based on a task-based dialogue system according to an embodiment of the invention;
FIGS. 2 and 3 are flowcharts illustrating one of the steps of a task-based dialog system data storage method according to an embodiment of the present invention;
FIG. 4 is a schematic block diagram of a data storage device based on a task-based dialog system according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an internal structure of an electronic device implementing a task-based dialog system data storage method according to an embodiment of the present invention;
the achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
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 invention.
The embodiment of the application provides a data storage method based on a task type dialogue system. The execution subject of the data storage method based on the task-based dialogue system includes, but is not limited to, at least one of a server, a terminal and the like, which can be configured to execute the method provided by the embodiment of the application. In other words, the data storage method based on the task-based dialog system may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The server may include an independent server, and may also include a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 1, a flow chart of a data storage method based on a task-based dialogue system according to an embodiment of the invention is provided, where in the embodiment of the invention, the data storage method based on the task-based dialogue system includes:
S1, acquiring a data format of dialogue scene data from a task type dialogue system, and determining a data container structure according to the dialogue scene data.
In the embodiment of the invention, the task type dialogue system can be an intelligent man-machine interaction system, such as a guiding robot in a financial service hall. The dialogue scene data may be entity data and intention data identified by the dialogue system in different dialogue scenes, for example, in a financial product purchase dialogue scene, the client a inputs "i want to purchase a financial product with name Z", the entity data and the intention data identified by the dialogue system are "Z product", "purchase", the client B inputs "i want to know a financial product with name Z", and the entity data and the intention data identified by the dialogue system are "good or bad of Z product", "know", respectively. The data format refers to a form in which the dialogue scene data is presented to a customer, for example, in a financial product purchase dialogue scene, when an entity and an intention are respectively "Z product", "purchase", related data may be presented to the customer for viewing in a text form, and when the entity and the intention are respectively "good or bad of Z product", "know", related data may be presented to the customer for viewing in a structured form. The data container structure refers to a structure of data inside the data container, for example, an array, a linked list, a stack, a queue, a hash table, and the like.
To ensure that the created data container can store all of the dialog scene data, before the data container is created, therefore, the embodiment of the present invention also needs to acquire the data format of the dialog scene data.
In detail, as an alternative embodiment of the present invention, referring to fig. 2, the data format of the acquired dialogue scene data includes:
s11, identifying the data type of the dialogue scene data by using a data type checking function;
s12, identifying the data structure of the dialogue scene data according to the data type;
s13, confirming the data format of the dialogue scene data according to the data structure.
In an embodiment of the present invention, the data type checking function may be a typeof operator, a type () function, or instanceof operators. The data type may be a characteristic characterizing the dialog scene data. The data structure refers to one or more specific relationships that exist between data.
Further, in order to ensure that the dialogue scene data can be matched with the data container to be constructed, the embodiment of the invention also needs to determine the structure of the data container according to the dialogue scene data, so that the dialogue scene data can be stored in the data container without causing the change of the data structure, thereby causing the change of the data.
In detail, in an alternative embodiment of the present invention, the data structure of the session scene data may be determined by a corresponding data structure acquisition function or method, and according to the data structure of the session scene data, a suitable data container structure is selected from known data container structures to be used as an internal data structure of the data container to be constructed, so as to ensure the fitness between the session scene data and the data container to be constructed, and ensure the security of the data.
S2, defining a data container interface according to the data format, and constructing a data container according to the data container structure and the data container interface.
In the embodiment of the invention, the data container interface refers to an interface for acquiring data by a data container.
Because of the variety of data formats of the dialog scene data, in order to ensure that the dialog scene data of each data format can be acquired by the data container to be constructed, in an alternative embodiment of the present invention, a data container interface capable of acquiring data of various data formats needs to be defined, for example, a generic parameter may be used in the data container interface, so that the data container to be constructed can support multiple data formats.
Further, after defining the data container interface, the embodiment of the invention can construct a data container according to the data container structure and the data container interface, thereby ensuring that the constructed data container can store dialogue scene data in any data format.
In detail, as an alternative embodiment of the present invention, referring to fig. 3, the constructing a data container according to the data container structure and the data container interface includes:
s21, acquiring the data volume of the dialogue scene data, and distributing a memory space according to the data volume;
s22, creating a data instance according to the data container structure;
s23, constructing an initial data container according to the data instance and the memory space;
and S24, splicing the data container interface with the initial data container to obtain a data container.
In order to ensure that the constructed content space of the data container is enough to store all the dialogue scene data, in an alternative embodiment of the invention, the memory space of the data container is allocated according to the data volume of the dialogue scene data, so that the situation that part of dialogue scene data cannot be stored is avoided.
S3, determining configuration parameters according to preset data storage requirements, and selecting a configuration text format according to preset service requirements and the data format.
In the embodiment of the present invention, the preset data storage requirement may be a read-in path, content and method for storing the dialogue scene data into the data container. The configuration parameters may be used to control the read-in path, content, and method of the dialog scene data. The preset service requirement may be a requirement of a technician on a configuration file, for example, a readability requirement, an expansibility requirement, an adaptation scene requirement, and the like. The configuration text format includes XML, JSON, YAML and other formats.
The embodiment of the invention realizes the control of the path, the content and the method for reading the dialogue scene data into the data container by setting the configuration parameters in the configuration file, on one hand, realizes the decoupling of the reading and the processing of the dialogue scene data, and on the other hand, only needs to modify the configuration file without modifying the source code when the reading mode of the dialogue scene data needs to be modified. This may improve flexibility and maintainability of the code.
Further, in order to ensure that a configuration file written in a programming language can meet the requirements of technicians, a configuration text format can be selected according to the requirements of characteristics such as readability and expansibility of the configuration file, in addition, in order to ensure that the configuration file can control a read-in path, contents, a method and the like of dialogue scene data in all data formats, the embodiment of the invention also needs to select the configuration text format according to the data formats, for example, in the configuration text format, XML and JSON support richer data types and structures, and the expansibility of YAML is relatively weak, so that the configuration text format can be selected in XML and JSON.
S4, creating a configuration text according to the configuration parameters and the configuration text format, and reading the dialogue scene data into the data container according to the configuration text.
According to the embodiment of the invention, the configuration text is created according to the configuration parameters and the configuration text format, so that the created configuration text can control the reading path, the content and the method of the dialogue scene data, and the dialogue scene data is read into the data container according to the configuration text.
In detail, as an optional embodiment of the present invention, the creating a configuration text according to the configuration parameters and the configuration text format includes:
Creating an initial file, and writing configuration items in the initial file according to the configuration parameters and grammar rules in the configuration text format;
grouping the configuration items to obtain a grouping structure, filling the configuration parameters into the initial file to obtain a configuration file;
And modifying the file format of the configuration file according to the configuration text format to obtain a configuration text.
In an alternative embodiment of the invention, configuration items are written in the created initial file according to the configuration parameters and the configuration text format, the configuration parameters are filled in, the configuration file format is modified to realize the creation of the configuration text, the created configuration text is ensured to meet the requirements of technicians, and the reading path, the content and the method of dialogue scene data can be controlled.
Further, the embodiment of the invention reads the dialogue scene data into the data container according to the configuration text, so that the dialogue scene data stored before can be quickly multiplexed when different dialogue scene tasks are processed, and the time and labor cost for searching the dialogue scene data combination again are saved.
S5, classifying the dialogue scene data in the data container, and normalizing the classified dialogue scene data to obtain a normalized dialogue scene data set.
According to the method and the device, the dialogue scene data in the data container are classified, so that Task, entities (entity) and interaction structures in the data container are separated, and the definition and maintainability of the dialogue scene data in the data container are improved.
In an alternative embodiment of the invention, the Task storage space, the Entities storage space and the interaction storage space can be obtained by creating the Task class, the Entities class and the interaction class, and then the dialogue scene data in the data container are classified by using the addTask, removeTask, getTasks and other operators, so that the classification of the dialogue scene data in the data container is realized, and the definition and maintainability of the dialogue scene data in the data container are improved.
Furthermore, the embodiment of the invention makes the dialogue scene data easy to understand and improves the readability of the dialogue scene data by normalizing the classified dialogue scene data.
In detail, as an optional embodiment of the present invention, the normalizing the categorized dialog scene data to obtain a normalized dialog scene data set includes:
Respectively extracting entity data and intention data in the classified dialogue scene data;
Grouping the entity data and the intention data to obtain a grouping matching item;
Performing key value pair adding processing on the grouping matching items to obtain key value pair matching items;
and formatting the matching item of the key value pair to obtain a normalized dialogue scene data set.
In the embodiment of the invention, the grouping matching items are obtained by combining each entity data with any intention data, and the key value pair adding processing is carried out on the grouping matching items by adopting equal numbers (=) or colon (), so that the key value pair matching items are obtained, and the readability of dialogue scene data is enhanced.
In an optional embodiment of the present invention, entity data such as "good and bad of a Z product", "Z product" and intention data such as "know" and "purchase" exist in a certain data container, and packet matching is performed to obtain packet matching items such as [ good and bad of a Z product, know good and bad of a Z product ] [ purchase of a Z product ] [ good and bad of a Z product, know of a Z product, purchase ] and the like, and further, by replacing a spacer in the packet matching items with a key value pair symbol, the good and bad of the [ Z product ] are obtained: understanding the merits of the ] [ Z product: purchase ] [ Z product: knowledge of the ] [ Z product: purchase ] etc. key value pair matches.
In order to ensure code normalization, in the alternative embodiment of the invention, a series of normalization codes such as naming modification are also needed to be processed on the normalized dialogue scene data set, so that dialogue scene data can be quickly migrated and applied to different scenes.
In detail, as an optional embodiment of the present invention, after the normalizing the classified dialog scene data to obtain a normalized dialog scene data set, the method further includes:
and carrying out naming modification on the normalized dialogue scene data set to obtain a unified naming dialogue scene data set.
In an alternative embodiment of the invention, the normalized dialogue scene data set is named and modified, so that code normalization in dialogue scene data migration scene is improved, and the complexity of code writing in migration scene is reduced.
According to the embodiment of the invention, the data container capable of storing the existing data format is constructed, and the dialogue scene data is stored in the data container by utilizing the configuration file, so that when a developer needs to modify the reading mode of the data, only the configuration file is needed to be modified, and the source code is not needed to be modified, the data reading efficiency is improved, the development cost of the data reading is reduced, secondly, the dialogue scene data in the data container is classified, so that the developer can conveniently modify and expand each part independently, the development cost is reduced, and finally, the dialogue scene data of the data in the data container is normalized, the data readability is enhanced, the communication cost among members of a development team is reduced, and the maintainability of the data in the data container is improved. Therefore, the data storage method based on the task type dialogue system can reduce the development cost of reading and integrating data and improve the efficiency of reading and integrating the data when the task type dialogue system is migrated to a new service.
As shown in fig. 4, a functional block diagram of a data storage device based on a task-based dialog system according to the present invention is shown.
The data storage device 100 based on the task-based dialog system according to the present invention may be installed in an electronic apparatus. Depending on the functions implemented, the task-based dialog system data storage device 100 may include a data container construction module 101, a configuration file generation module 102, and a dialog scene data specification module 103, which may also be referred to as a unit, refers to a series of computer program segments capable of being executed by a processor of an electronic device and performing fixed functions, which are stored in a memory of the electronic device.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the data container construction module 101 is configured to obtain a data format of dialogue scene data, determine a data container structure according to the dialogue scene data, define a data container interface according to the data format, and construct a data container according to the data container structure and the data container interface.
In the embodiment of the invention, the task type dialogue system can be an intelligent man-machine interaction system, such as a guiding robot in a financial service hall. The dialogue scene data may be entity data and intention data identified by the dialogue system in different dialogue scenes, for example, in a financial product purchase dialogue scene, the client a inputs "i want to purchase a financial product with name Z", the entity data and the intention data identified by the dialogue system are "Z product", "purchase", the client B inputs "i want to know a financial product with name Z", and the entity data and the intention data identified by the dialogue system are "good or bad of Z product", "know", respectively. The data format refers to a form in which the dialogue scene data is presented to a customer, for example, in a financial product purchase dialogue scene, when an entity and an intention are respectively "Z product", "purchase", related data may be presented to the customer for viewing in a text form, and when the entity and the intention are respectively "good or bad of Z product", "know", related data may be presented to the customer for viewing in a structured form. The data container structure refers to a structure of data inside the data container, for example, an array, a linked list, a stack, a queue, a hash table, and the like.
To ensure that the created data container can store all of the dialog scene data, before the data container is created, therefore, the embodiment of the present invention also needs to acquire the data format of the dialog scene data.
In detail, as an optional embodiment of the present invention, the acquiring a data format of the dialogue scene data includes:
Identifying a data type of the dialog scene data using a data type checking function;
identifying a data structure of the dialogue scene data according to the data type;
And confirming the data format of the dialogue scene data according to the data structure.
In an embodiment of the present invention, the data type checking function may be a typeof operator, a type () function, or instanceof operators. The data type may be a characteristic characterizing the dialog scene data. The data structure refers to one or more specific relationships that exist between data.
Further, in order to ensure that the dialogue scene data can be matched with the data container to be constructed, the embodiment of the invention also needs to determine the structure of the data container according to the dialogue scene data, so that the dialogue scene data can be stored in the data container without causing the change of the data structure, thereby causing the change of the data.
In detail, in an alternative embodiment of the present invention, the data structure of the session scene data may be determined by a corresponding data structure acquisition function or method, and according to the data structure of the session scene data, a suitable data container structure is selected from known data container structures to be used as an internal data structure of the data container to be constructed, so as to ensure the fitness between the session scene data and the data container to be constructed, and ensure the security of the data.
In the embodiment of the invention, the data container interface refers to an interface for acquiring data by a data container.
Because of the variety of data formats of the dialog scene data, in order to ensure that the dialog scene data of each data format can be acquired by the data container to be constructed, in an alternative embodiment of the present invention, a data container interface capable of acquiring data of various data formats needs to be defined, for example, a generic parameter may be used in the data container interface, so that the data container to be constructed can support multiple data formats.
Further, after defining the data container interface, the embodiment of the invention can construct a data container according to the data container structure and the data container interface, thereby ensuring that the constructed data container can store dialogue scene data in any data format.
In detail, as an optional embodiment of the present invention, the constructing a data container according to the data container structure and the data container interface includes:
Acquiring the data volume of the dialogue scene data, and distributing a memory space according to the data volume;
creating a data instance according to the data container structure;
constructing an initial data container according to the data instance and the memory space;
and splicing the data container interface with the initial data container to obtain a data container.
In order to ensure that the constructed content space of the data container is enough to store all the dialogue scene data, in an alternative embodiment of the invention, the memory space of the data container is allocated according to the data volume of the dialogue scene data, so that the situation that part of dialogue scene data cannot be stored is avoided.
The configuration file generating module 102 is configured to determine a configuration parameter according to a preset data storage requirement, select a configuration text format according to a preset service requirement and the data format, create a configuration text according to the configuration parameter and the configuration text format, and read the dialogue scene data into the data container according to the configuration text.
In the embodiment of the present invention, the preset data storage requirement may be a read-in path, content and method for storing the dialogue scene data into the data container. The configuration parameters may be used to control the read-in path, content, and method of the dialog scene data. The preset service requirement may be a requirement of a technician on a configuration file, for example, a readability requirement, an expansibility requirement, an adaptation scene requirement, and the like. The configuration text format includes XML, JSON, YAML and other formats.
The embodiment of the invention realizes the control of the path, the content and the method for reading the dialogue scene data into the data container by setting the configuration parameters in the configuration file, on one hand, realizes the decoupling of the reading and the processing of the dialogue scene data, and on the other hand, only needs to modify the configuration file without modifying the source code when the reading mode of the dialogue scene data needs to be modified. This may improve flexibility and maintainability of the code.
Further, in order to ensure that a configuration file written in a programming language can meet the requirements of technicians, a configuration text format can be selected according to the requirements of characteristics such as readability and expansibility of the configuration file, in addition, in order to ensure that the configuration file can control a read-in path, contents, a method and the like of dialogue scene data in all data formats, the embodiment of the invention also needs to select the configuration text format according to the data formats, for example, in the configuration text format, XML and JSON support richer data types and structures, and the expansibility of YAML is relatively weak, so that the configuration text format can be selected in XML and JSON.
According to the embodiment of the invention, the configuration text is created according to the configuration parameters and the configuration text format, so that the created configuration text can control the reading path, the content and the method of the dialogue scene data, and the dialogue scene data is read into the data container according to the configuration text.
In detail, as an optional embodiment of the present invention, the creating a configuration text according to the configuration parameters and the configuration text format includes:
Creating an initial file, and writing configuration items in the initial file according to the configuration parameters and grammar rules in the configuration text format;
grouping the configuration items to obtain a grouping structure, filling the configuration parameters into the initial file to obtain a configuration file;
And modifying the file format of the configuration file according to the configuration text format to obtain a configuration text.
In an alternative embodiment of the invention, configuration items are written in the created initial file according to the configuration parameters and the configuration text format, the configuration parameters are filled in, the configuration file format is modified to realize the creation of the configuration text, the created configuration text is ensured to meet the requirements of technicians, and the reading path, the content and the method of dialogue scene data can be controlled.
Further, the embodiment of the invention reads the dialogue scene data into the data container according to the configuration text, so that the dialogue scene data stored before can be quickly multiplexed when different dialogue scene tasks are processed, and the time and labor cost for searching the dialogue scene data combination again are saved.
The dialogue scene data normalization module 103 is configured to classify dialogue scene data in the data container, and normalize the classified dialogue scene data to obtain a normalized dialogue scene data set.
According to the method and the device, the dialogue scene data in the data container are classified, so that Task, entities (entity) and interaction structures in the data container are separated, and the definition and maintainability of the dialogue scene data in the data container are improved.
In an alternative embodiment of the invention, the Task storage space, the Entities storage space and the interaction storage space can be obtained by creating the Task class, the Entities class and the interaction class, and then the dialogue scene data in the data container are classified by using the addTask, removeTask, getTasks and other operators, so that the classification of the dialogue scene data in the data container is realized, and the definition and maintainability of the dialogue scene data in the data container are improved.
Furthermore, the embodiment of the invention makes the dialogue scene data easy to understand and improves the readability of the dialogue scene data by normalizing the classified dialogue scene data.
In detail, as an optional embodiment of the present invention, the normalizing the categorized dialog scene data to obtain a normalized dialog scene data set includes:
Respectively extracting entity data and intention data in the classified dialogue scene data;
Grouping the entity data and the intention data to obtain a grouping matching item;
Performing key value pair adding processing on the grouping matching items to obtain key value pair matching items;
and formatting the matching item of the key value pair to obtain a normalized dialogue scene data set.
In the embodiment of the invention, the grouping matching items are obtained by combining each entity data with any intention data, and the key value pair adding processing is carried out on the grouping matching items by adopting equal numbers (=) or colon (), so that the key value pair matching items are obtained, and the readability of dialogue scene data is enhanced.
In an optional embodiment of the present invention, entity data such as "good and bad of a Z product", "Z product" and intention data such as "know" and "purchase" exist in a certain data container, and packet matching is performed to obtain packet matching items such as [ good and bad of a Z product, know good and bad of a Z product ] [ purchase of a Z product ] [ good and bad of a Z product, know of a Z product, purchase ] and the like, and further, by replacing a spacer in the packet matching items with a key value pair symbol, the good and bad of the [ Z product ] are obtained: understanding the merits of the ] [ Z product: purchase ] [ Z product: knowledge of the ] [ Z product: purchase ] etc. key value pair matches.
In order to ensure code normalization, in the alternative embodiment of the invention, a series of normalization codes such as naming modification are also needed to be processed on the normalized dialogue scene data set, so that dialogue scene data can be quickly migrated and applied to different scenes.
In detail, as an optional embodiment of the present invention, after the normalizing the classified dialog scene data to obtain a normalized dialog scene data set, the method further includes:
and carrying out naming modification on the normalized dialogue scene data set to obtain a unified naming dialogue scene data set.
In an alternative embodiment of the invention, the normalized dialogue scene data set is named and modified, so that code normalization in dialogue scene data migration scene is improved, and the complexity of code writing in migration scene is reduced.
According to the embodiment of the invention, the data container capable of storing the existing data format is constructed, and the dialogue scene data is stored in the data container by utilizing the configuration file, so that when a developer needs to modify the reading mode of the data, only the configuration file is needed to be modified, and the source code is not needed to be modified, the data reading efficiency is improved, the development cost of the data reading is reduced, secondly, the dialogue scene data in the data container is classified, so that the developer can conveniently modify and expand each part independently, the development cost is reduced, and finally, the dialogue scene data of the data in the data container is normalized, the data readability is enhanced, the communication cost among members of a development team is reduced, and the maintainability of the data in the data container is improved. Therefore, the data storage device based on the task-type dialogue system can reduce the development cost of reading and integrating data and improve the efficiency of reading and integrating the data when the task-type dialogue system is migrated to a new service.
Fig. 5 is a schematic structural diagram of an electronic device implementing a data storage method based on a task-based dialogue system according to the present invention.
The electronic device may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program stored in the memory 11 and executable on the processor 10, such as a data storage program based on a task-based dialog system.
The memory 11 includes at least one type of readable storage medium, including flash memory, a mobile hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, such as a mobile hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only for storing application software installed in an electronic device and various types of data, such as codes of a data storage program based on a task-based dialogue system, but also for temporarily storing data that has been output or is to be output.
The processor 10 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing Unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects respective components of the entire electronic device using various interfaces and lines, executes programs or modules (for example, a data storage program based on a task-based dialog system, etc.) stored in the memory 11 by running or executing the programs or modules, and invokes data stored in the memory 11 to perform various functions of the electronic device and process the data.
The communication bus 12 may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The communication bus 12 is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
Fig. 5 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 5 is not limiting of the electronic device and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power source (such as a battery) for supplying power to the respective components, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device may further include various sensors, bluetooth modules, wi-Fi modules, etc., which are not described herein.
Optionally, the communication interface 13 may comprise a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the electronic device and other electronic devices.
Optionally, the communication interface 13 may further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The data storage program based on a task-based dialog system stored in the memory 11 in the electronic device is a combination of a plurality of computer programs, which, when run in the processor 10, can realize:
acquiring a data format of dialogue scene data from a task type dialogue system, and determining a data container structure according to the dialogue scene data;
Defining a data container interface according to the data format, and constructing a data container according to the data container structure and the data container interface;
Determining configuration parameters according to preset data storage requirements, and selecting a configuration text format according to preset service requirements and the data format;
Creating a configuration text according to the configuration parameters and the configuration text format, and reading the dialogue scene data into the data container according to the configuration text;
Classifying the dialogue scene data in the data container, and carrying out standardization processing on the classified dialogue scene data to obtain a standardized dialogue scene data set.
In particular, the specific implementation method of the processor 10 on the computer program may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
Further, the electronic device integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. The computer readable medium may be non-volatile or volatile. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
Embodiments of the present invention may also provide a computer readable storage medium storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring a data format of dialogue scene data from a task type dialogue system, and determining a data container structure according to the dialogue scene data;
Defining a data container interface according to the data format, and constructing a data container according to the data container structure and the data container interface;
Determining configuration parameters according to preset data storage requirements, and selecting a configuration text format according to preset service requirements and the data format;
Creating a configuration text according to the configuration parameters and the configuration text format, and reading the dialogue scene data into the data container according to the configuration text;
Classifying the dialogue scene data in the data container, and carrying out standardization processing on the classified dialogue scene data to obtain a standardized dialogue scene data set.
Further, the computer-usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
In the embodiments provided in the present invention, it should be understood that the disclosed electronic device, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The blockchain (Blockchain), essentially a de-centralized database, is a string of data blocks that are generated in association using cryptographic methods, each of which contains information from a batch of network transactions for verifying the validity (anti-counterfeit) of its information and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.
Claims (10)
1. A method for storing data based on a task-based dialog system, the method comprising:
acquiring a data format of dialogue scene data from a task type dialogue system, and determining a data container structure according to the dialogue scene data;
Defining a data container interface according to the data format, and constructing a data container according to the data container structure and the data container interface;
Determining configuration parameters according to preset data storage requirements, and selecting a configuration text format according to preset service requirements and the data format;
Creating a configuration text according to the configuration parameters and the configuration text format, and reading the dialogue scene data into the data container according to the configuration text;
Classifying the dialogue scene data in the data container, and carrying out standardization processing on the classified dialogue scene data to obtain a standardized dialogue scene data set.
2. The task-based dialog system data storage method of claim 1, wherein the constructing a data container from the data container structure and the data container interface comprises:
Acquiring the data volume of the dialogue scene data, and distributing a memory space according to the data volume;
creating a data instance according to the data container structure;
constructing an initial data container according to the data instance and the memory space;
and splicing the data container interface with the initial data container to obtain a data container.
3. The task-based dialog system data storage method of claim 1, wherein creating a configuration text based on the configuration parameters and the configuration text format comprises:
Creating an initial file, and writing configuration items in the initial file according to the configuration parameters and grammar rules in the configuration text format;
grouping the configuration items to obtain a grouping structure, filling the configuration parameters into the initial file to obtain a configuration file;
And modifying the file format of the configuration file according to the configuration text format to obtain a configuration text.
4. The method for storing data based on task-based dialog system according to claim 1, wherein the normalizing the categorized dialog scene data to obtain a normalized dialog scene data set includes:
Respectively extracting entity data and intention data in the classified dialogue scene data;
Grouping the entity data and the intention data to obtain a grouping matching item;
Performing key value pair adding processing on the grouping matching items to obtain key value pair matching items;
and formatting the matching item of the key value pair to obtain a normalized dialogue scene data set.
5. The data storage method based on the task type dialogue system as claimed in claim 1, wherein the acquiring the data format of dialogue scene data comprises:
Identifying a data type of the dialog scene data using a data type checking function;
identifying a data structure of the dialogue scene data according to the data type;
And confirming the data format of the dialogue scene data according to the data structure.
6. The method for storing data based on task-based dialog system according to claim 1, wherein after the normalized processing is performed on the classified dialog scene data to obtain a normalized dialog scene data set, further comprising:
and carrying out naming modification on the normalized dialogue scene data set to obtain a unified naming dialogue scene data set.
7. A data storage device based on a task-based dialog system, the device comprising:
The data container construction module is used for acquiring the data format of the dialogue scene data, determining a data container structure according to the dialogue scene data, defining a data container interface according to the data format, and constructing a data container according to the data container structure and the data container interface;
The configuration file generation module is used for determining configuration parameters according to preset data storage requirements, selecting a configuration text format according to preset service requirements and the data format, creating a configuration text according to the configuration parameters and the configuration text format, and reading the dialogue scene data into the data container according to the configuration text;
And the dialogue scene data standardization module is used for classifying dialogue scene data in the data container and carrying out standardization processing on the classified dialogue scene data to obtain a standardized dialogue scene data set.
8. The apparatus of claim 7, wherein said constructing a data container from said data container structure and said data container interface comprises:
Acquiring the data volume of the dialogue scene data, and distributing a memory space according to the data volume;
creating a data instance according to the data container structure;
constructing an initial data container according to the data instance and the memory space;
and splicing the data container interface with the initial data container to obtain a data container.
9. An electronic device, the electronic device comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the task-based dialog system data storage method of any of claims 1 to 7.
10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the task based dialog system data storage method of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410472411.4A CN118277502A (en) | 2024-04-18 | 2024-04-18 | Data storage method, device, equipment and medium based on task type dialogue system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410472411.4A CN118277502A (en) | 2024-04-18 | 2024-04-18 | Data storage method, device, equipment and medium based on task type dialogue system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118277502A true CN118277502A (en) | 2024-07-02 |
Family
ID=91648684
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410472411.4A Pending CN118277502A (en) | 2024-04-18 | 2024-04-18 | Data storage method, device, equipment and medium based on task type dialogue system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118277502A (en) |
-
2024
- 2024-04-18 CN CN202410472411.4A patent/CN118277502A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113704665B (en) | Dynamic service release method and device, electronic equipment and storage medium | |
CN113238929B (en) | Code testing method and device based on Mock data, electronic equipment and storage medium | |
CN107015794B (en) | Software-as-a-service reference flow extension verification framework | |
CN114881616A (en) | Business process execution method and device, electronic equipment and storage medium | |
CN115129753A (en) | Data blood relationship analysis method and device, electronic equipment and storage medium | |
CN114519084A (en) | Block chain-based medical data inspection method, device, equipment and medium | |
CN114356530A (en) | Task scheduling method and device, electronic equipment and storage medium | |
CN112541688B (en) | Service data verification method and device, electronic equipment and computer storage medium | |
CN112085611A (en) | Asynchronous data verification method and device, electronic equipment and storage medium | |
CN113687827B (en) | Data list generation method, device and equipment based on widget and storage medium | |
CN114896164A (en) | Interface optimization method and device, electronic equipment and storage medium | |
CN112328656B (en) | Service query method, device, equipment and storage medium based on middle platform architecture | |
CN118277502A (en) | Data storage method, device, equipment and medium based on task type dialogue system | |
CN114911479A (en) | Interface generation method, device, equipment and storage medium based on configuration | |
CN114356379A (en) | Backup-based service upgrading method, device, equipment and storage medium | |
CN112686759A (en) | Account checking monitoring method, device, equipment and medium | |
CN112527443A (en) | Prompt box display method and device, electronic equipment and computer readable storage medium | |
CN113051171A (en) | Interface test method, device, equipment and storage medium | |
CN116595963B (en) | Document generation method, device, equipment and medium based on template configuration | |
CN118193333B (en) | Android platform automobile diagnosis report generation method, equipment and medium | |
CN113778447B (en) | Service compatibility method and device of front-end system, electronic equipment and storage medium | |
CN115934576B (en) | Test case generation method, device, equipment and medium in transaction scene | |
CN114676124B (en) | Data field difference solving method, device, equipment and medium based on configuration | |
CN113032003B (en) | Development file export method, development file export device, electronic equipment and computer storage medium | |
CN115964307B (en) | Automatic test method, device, equipment and medium for transaction data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination |