CN117520292A - Rule matching method, storage medium and electronic device - Google Patents

Rule matching method, storage medium and electronic device Download PDF

Info

Publication number
CN117520292A
CN117520292A CN202210912001.8A CN202210912001A CN117520292A CN 117520292 A CN117520292 A CN 117520292A CN 202210912001 A CN202210912001 A CN 202210912001A CN 117520292 A CN117520292 A CN 117520292A
Authority
CN
China
Prior art keywords
rule
matching
data
general
matched
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
Application number
CN202210912001.8A
Other languages
Chinese (zh)
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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202210912001.8A priority Critical patent/CN117520292A/en
Publication of CN117520292A publication Critical patent/CN117520292A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a rule matching method, a storage medium and an electronic device, and relates to the technical field of intelligent home/smart home, wherein the method comprises the following steps: acquiring data to be matched; the data to be matched is sent to a general rule processing platform, so that the general rule processing platform carries out rule matching on the data to be matched based on a pre-stored general rule; receiving the universal matching data returned by the universal rule processing platform; and carrying out rule matching on the general matching data based on the special rule to obtain a rule matching result. The general rule and the special rule are divided, so that the matching of different types of rules can be realized on a more adaptive platform, the time consumption of rule matching is shortened, and the rule matching efficiency is improved. And the rule matching of the general rule is realized by the general rule processing platform, a technician does not need to write codes additionally, the development cost of the rule matching is reduced, and the development efficiency of the rule matching is improved.

Description

Rule matching method, storage medium and electronic device
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a rule matching method, a storage medium, and an electronic device.
Background
Under the man-machine interaction scene, the user is usually required to be matched with a conversation technology pushed to the user according to a preset rule, so that intelligent pushing according to different people is realized.
In the process, the rules needing to be matched are many and complex, and the time consumed in rule matching can cause time delay of human-computer interaction and influence the user experience. How to realize fast and efficient rule matching is still a technical problem to be solved in the field.
Disclosure of Invention
The application provides a rule matching method, a storage medium and an electronic device, which are used for solving the defect of low rule matching efficiency in the prior art.
The application provides a rule matching method, which comprises the following steps:
acquiring data to be matched;
the data to be matched is sent to a general rule processing platform, so that the general rule processing platform carries out rule matching on the data to be matched based on a pre-stored general rule, a general matching result is obtained, and the general rule is a rule for realizing rule matching through codes provided by the general rule processing platform;
receiving general matching data returned by the general rule processing platform, wherein the general matching data comprises a general matching result or comprises the general matching result and the data to be matched;
And carrying out rule matching on the general matching data based on a special rule to obtain a rule matching result, wherein the special rule is a rule except the general rule.
According to the rule matching method provided by the application, the sending the data to be matched to the universal rule processing platform further comprises:
and storing the universal rule into a first database, so that the universal rule processing platform synchronously stores the universal rule in the first database under the condition of monitoring the universal rule stored in the first database.
According to the rule matching method provided by the application, the first database is a relational database management system;
the storing the universal rule in the first database, so that the universal rule processing platform synchronously stores the universal rule in the first database under the condition of monitoring the universal rule stored in the first database, comprises the following steps:
and storing the general rule into the relational database management system so that the general rule processing platform synchronously stores the newly added general rule based on an incremental data acquisition source table in the relational database management system under the condition of monitoring the general rule stored in the relational database management system.
According to the rule matching method provided by the application, the rule matching is performed on the general matching data based on the special rule, so as to obtain a rule matching result, and the method further comprises the following steps:
the special rule is extracted from a second database, wherein the second database is used for caching the special rule.
According to the rule matching method provided by the application, the rule matching is performed on the general matching data based on the special rule to obtain a rule matching result, which comprises the following steps:
based on the special rule, matching the general matching result to obtain the rule matching result;
or, based on the special rule, matching the data to be matched to obtain a special matching result, and based on the general matching result and the special matching result, determining the rule matching result.
According to the rule matching method provided by the application, the obtaining of the data to be matched comprises the following steps:
acquiring user voice;
and determining data to be matched based on the user voice.
According to the rule matching method provided by the application, the determining data to be matched based on the user voice comprises the following steps:
Semantic extraction is carried out on the user voice to obtain semantic data;
voiceprint extraction is carried out on the user voice to obtain voiceprint data;
acquiring address data of equipment for acquiring the user voice;
and determining the data to be matched based on at least one of the semantic data, the voiceprint data and the address data.
According to the rule matching method provided by the application, the rule matching is performed on the general matching data based on the special rule to obtain a rule matching result, and then the rule matching method further comprises the following steps:
determining a target conversation corresponding to the rule matching result from all preset conversations;
based on the target speech, speech pushing is performed.
The application also provides a rule matching device, comprising:
the data acquisition unit is used for acquiring data to be matched;
the universal matching unit is used for sending the data to be matched to a universal rule processing platform so that the universal rule processing platform carries out rule matching on the data to be matched based on a prestored universal rule to obtain a universal matching result, wherein the universal rule is a rule for realizing rule matching through codes provided by the universal rule processing platform;
The universal receiving unit is used for receiving universal matching data returned by the universal rule processing platform, wherein the universal matching data comprises a universal matching result or comprises the universal matching result and the data to be matched;
and the special matching unit is used for carrying out rule matching on the general matching data based on special rules to obtain rule matching results, wherein the special rules are rules except the general rules.
The present application also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to implement a rule matching method as described in any of the above by execution of the computer program.
The present application also provides a computer-readable storage medium comprising a stored program, wherein the program when run performs a rule matching method according to any one of the above.
The present application also provides a computer program product comprising a computer program which when executed by a processor implements a rule matching method as described in any one of the above.
The rule matching method, the storage medium and the electronic device divide the rule to be matched into the general rule and the special rule, match the rule aiming at the general rule, and deliver the rule aiming at the special rule to the general rule processing platform, and match the rule aiming at the special rule to the terminal equipment. The rule division enables the matching of different types of rules to be realized on a more adaptive platform, so that the time consumption of rule matching is shortened, and the rule matching efficiency is improved. And the rule matching of the general rule is realized by the general rule processing platform, a technician does not need to write codes additionally, the development cost of the rule matching is reduced, and the development efficiency of the rule matching is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a hardware environment of a rule matching method according to an embodiment of the present application;
FIG. 2 is a flow chart of the rule matching method provided by the present application;
FIG. 3 is a schematic flow chart of a speaking pushing method provided in the present application;
FIG. 4 is a schematic structural diagram of the rule matching device provided in the present application;
fig. 5 is a schematic structural diagram of an electronic device provided in the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to one aspect of the embodiments of the present application, a rule matching method is provided. The rule matching method is widely applied to full-house intelligent digital control application scenes such as intelligent Home (Smart Home), intelligent Home equipment ecology, intelligent Home (Intelligence House) ecology and the like. Alternatively, in the present embodiment, the rule matching method described above may be applied to a hardware environment constituted by the terminal device 102 and the server 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to the terminal device 102 through a network, and may be used to provide services (such as application services and the like) for a terminal or a client installed on the terminal, a database may be set on the server or independent of the server, for providing data storage services for the server 104, and cloud computing and/or edge computing services may be configured on the server or independent of the server, for providing data computing services for the server 104.
The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: a wide area network, a metropolitan area network, a local area network, and the wireless network may include, but is not limited to, at least one of: WIFI (Wireless Fidelity ), bluetooth. The terminal device 102 may not be limited to a PC, a mobile phone, a tablet computer, an intelligent air conditioner, an intelligent smoke machine, an intelligent refrigerator, an intelligent oven, an intelligent cooking range, an intelligent washing machine, an intelligent water heater, an intelligent washing device, an intelligent dish washer, an intelligent projection device, an intelligent television, an intelligent clothes hanger, an intelligent curtain, an intelligent video, an intelligent socket, an intelligent sound box, an intelligent fresh air device, an intelligent kitchen and toilet device, an intelligent bathroom device, an intelligent sweeping robot, an intelligent window cleaning robot, an intelligent mopping robot, an intelligent air purifying device, an intelligent steam box, an intelligent microwave oven, an intelligent kitchen appliance, an intelligent purifier, an intelligent water dispenser, an intelligent door lock, and the like.
Fig. 2 is a flow chart of a rule matching method provided in the present application, as shown in fig. 2, the method includes:
step 210, obtaining data to be matched.
The data to be matched is the data which needs to be subjected to rule matching, and the data to be matched can be the data which is directly input by a user, can be the data which is directly acquired, and can also be the data which is extracted from the data input by the user. For example, in the process of man-machine interaction, the terminal device may collect user voice, and extract voiceprint data of the user as data to be matched based on the user voice; for another example, the terminal device may also extract semantic data as data to be matched based on the user voice; for another example, the terminal device may also determine the region where the user is located based on the positioning information of the terminal device, and use the region where the user is located as the data to be matched, which is not specifically limited in the embodiment of the present application.
And 220, sending the data to be matched to a universal rule processing platform, so that the universal rule processing platform performs rule matching on the data to be matched based on a pre-stored universal rule, and a universal matching result is obtained, wherein the universal rule is a rule for realizing rule matching through codes provided by the universal rule processing platform.
And 230, receiving the universal matching data returned by the universal rule processing platform, wherein the universal matching data comprises a universal matching result or comprises the universal matching result and the data to be matched.
Specifically, the general rule processing platform is a processing platform capable of implementing rule matching based on general rules, such as event stream processing (Event Stream Processing, ESP) and complex event processing (Complex Event Processing, CEP) engines Esper, complex event flow engines sidhi, open source business rule engines Drools, and the like. The general rule, namely the general rule processing platform, provides codes required by rule matching, partial rules for realizing rule matching can be directly called, and the general rule is a common comparison rule, such as character string comparison, numerical comparison and the like.
For the general rule which can be realized by the general rule processing platform in the rule matching process, the general rule can be stored in the general rule processing platform in advance. Under the condition that the data to be matched needs to be subjected to the matching of the general rule, the data to be matched can be directly sent to a general rule processing platform, after the data to be matched is received, the general rule processing platform can perform rule matching of the general rule on the data to be matched based on the code required by calling the locally stored rule matching, and general matching data is generated, wherein the general matching data comprises a matching result obtained based on the general rule matching, namely the general matching data comprises a general matching result.
After generating the universal matching data, the universal rule processing platform can return the universal matching data to the terminal equipment, and the terminal equipment receives the universal matching data containing the matching result obtained based on the universal rule matching.
Here, the general rule processing platform may return the general matching result as general matching data, or may return the general matching result and the data to be matched together as general matching data.
In the case that the general matching data includes both the general matching result and the data to be matched, the general matching result may be marked in the data to be matched in a form of a mark, or may be independent of the data to be matched, which is not specifically limited in the embodiment of the present application. And step 240, performing rule matching on the general matching data based on a special rule, so as to obtain a rule matching result, wherein the special rule is a rule except the general rule.
Specifically, the special rule is a rule different from the general rule, and different from the general rule, the special rule refers to a rule that cannot achieve rule matching through a code provided by the general rule processing platform. The special rule is typically a matching rule applied for a special scene, for example, a rule for comparing the sizes of character strings in a specific format, such as version numbers.
Aiming at the special rule which needs to be matched in the rule matching process, the developed codes needed by the special rule matching can be stored in the terminal equipment in advance. After the general matching data returned by the general rule processing platform is obtained, the codes required by the rule matching which are stored locally can be called, and the rule matching of the special rule is carried out on the general matching data, so that the final rule matching result is obtained.
It can be understood that, when rule matching of the special rule is performed, the secondary matching may be performed on the matching result obtained based on the general rule matching in the general matching data, or the special rule matching may be performed on the data which is not subjected to the general rule matching and is included in the general matching data, so as to obtain a final rule matching result. The rule matching result here is a result obtained by integrating the general rule matching and the special rule matching,
according to the method provided by the embodiment of the application, the rules to be matched are divided into the general rules and the special rules, the rule matching aiming at the general rules is realized by a general rule processing platform, and the rule matching aiming at the special rules is realized by the terminal equipment. The rule division enables the matching of different types of rules to be realized on a more adaptive platform, so that the time consumption of rule matching is shortened, and the rule matching efficiency is improved. And the rule matching of the general rule is realized by the general rule processing platform, a technician does not need to write codes additionally, the development cost of the rule matching is reduced, and the development efficiency of the rule matching is improved.
Based on the above embodiment, step 220 further includes:
and storing the universal rule into a first database, so that the universal rule processing platform synchronously stores the universal rule in the first database under the condition of monitoring the universal rule stored in the first database.
Specifically, in order to ensure that the universal rule processing platform performs rule matching can be consistent with the universal rule required by the actual application, the terminal device may store the updated universal rule into the first database after completing updating of the universal rule each time. The first database is a database under the monitoring of the universal rule processing platform, and the universal rule processing platform can acquire the universal rule required by the actual application through monitoring the change of the universal rule stored in the first database and store the universal rule into the local of the universal rule processing platform, so that the synchronization of the universal rule stored in the local of the universal rule processing platform and the universal rule required by the actual application is realized, and the universal rule matching realized based on the universal rule processing platform can meet the actual requirement.
Based on any of the above embodiments, the first database is a relational database management system;
The storing the universal rule in the first database, so that the universal rule processing platform synchronously stores the universal rule in the first database under the condition of monitoring the universal rule stored in the first database, comprises the following steps:
and storing the general rule into the relational database management system so that the general rule processing platform synchronously stores the newly added general rule based on an incremental data acquisition source table in the relational database management system under the condition of monitoring the general rule stored in the relational database management system.
In particular, the generic rule processing platform may be sidhi, which is a stream processing and complex event processing platform that can be used to build sophisticated event driven applications. The first database may be the relational database management system MySQL. Here, mySQL may store data in different tables, thereby improving read-write speed and read-write flexibility. The SQL language used by MySQL is the most commonly used standardized language for accessing databases, and has the advantages of small volume, high speed and low total possession cost.
The terminal device may store the general rule requiring the sidhi processing in MySQL, and the sidhi may monitor the change of the general rule stored in MySQL through a CDC (Change Data Capture, incremental data collection) source table of MySQL, so that the general rule of the change stored in MySQL may be updated in a cache of sidhi, thereby enabling the sidhi to perform rule matching based on the general rule updated synchronously.
Based on the above embodiment, step 240 further includes:
the special rule is extracted from a second database, wherein the second database is used for caching the special rule.
Specifically, the second database may be a database cached by the terminal device. By caching the private rule in the second database, the private rule to be applied can be extracted from the second database quickly when the terminal device needs to perform rule matching based on the private rule. The second database with the caching property can realize the quick reading of the special rule on the premise of low time delay, thereby improving the rule matching efficiency.
Further, the second database may be a remote dictionary service (Remote Dictionary Server, dis), where dis is used as a high-performance key-value database, so that the reading efficiency of the special rule can be effectively improved, and the overall implementation efficiency of rule matching is further improved.
Based on the above embodiment, step 240 includes:
based on the special rule, matching the general matching result to obtain the rule matching result;
or,
and matching the data to be matched or matching the general matching result and the data to be matched based on the special rule to obtain a special matching result, and determining the rule matching result based on the general matching result and the special matching result.
Specifically, for the case that the general matching data only contains a general matching result, the terminal device can apply a special rule to perform rule matching on the general matching result, so that a result obtained by performing special rule matching on the general matching result is directly used as a rule matching result;
aiming at the situation that the general matching data contains both general matching results and data to be matched, the terminal equipment can also apply special rules to perform rule matching on the data to be matched so as to obtain a result of special rule matching on the data to be matched, namely a special matching result, and on the basis, the general matching result and the special matching result can be integrated so as to obtain a rule matching result. Or, the terminal device may also apply a special rule to perform rule matching on the general matching result and the data to be matched together, so as to obtain a result of performing special rule matching on the data to be matched, that is, a special matching result, and on this basis, the general matching result and the special matching result may be integrated, so as to obtain a rule matching result.
It can be understood that the general rule matching is used as an execution action before the special rule matching, and the general matching result obtained by the general rule matching is used as an input of the special rule matching, namely, the rule to be matched is disassembled into the general rule and the special rule, thereby reducing the code implementation difficulty of the special rule.
Based on the above embodiment, step 210 includes:
acquiring user voice;
and determining data to be matched based on the user voice.
Specifically, rule matching can be applied to a voice interaction process, and specifically, data to be matched can be obtained through user voice. Here, the data to be matched determined based on the user voice may include data carried by the user voice itself, such as voice print data of the user, semantic data of the user voice, and the like, and may also include related data of the user voice, such as time and place of recording the user voice, and also such as a device model, a software version, and the like of recording the user voice.
Based on the above embodiment, in step 210, the determining the data to be matched based on the user voice includes:
semantic extraction is carried out on the user voice to obtain semantic data;
voiceprint extraction is carried out on the user voice to obtain voiceprint data;
acquiring address data of equipment for acquiring the user voice;
and determining the data to be matched based on at least one of the semantic data, the voiceprint data and the address data.
Specifically, the data to be matched may include at least one of semantic data, voiceprint data, and address data of the user's voice.
The semantic data are used for reflecting the semantics covered by the user voice, and can be obtained in a semantic extraction mode, specifically, the user voice is firstly subjected to voice transcription to obtain a transcription text, and then intention recognition and slot extraction are performed on the transcription text to obtain the semantic data; the voiceprint data are used for reflecting voiceprint characteristics of the user voice so as to reflect the identity information of the user, the voiceprint data can be obtained by carrying out voiceprint extraction on the user voice, and the voiceprint data can comprise the voiceprint characteristics and also can comprise the gender, age, name, account number and the like of the user obtained by analyzing the voiceprint characteristics; the address data is used for reflecting data related to an address where the user is located, the address data can be obtained by analyzing an IP address of a device for collecting the user voice, or can be obtained by positioning a device for collecting the user voice, and the address data can be city, province, specific street, etc., and the embodiment of the application is not limited in particular.
The data to be matched determined by at least one of semantic data, voiceprint data and address data can be used for voice operation pushing under man-machine interaction, so that the reliability of voice operation pushing is improved. And semantic data, voiceprint data, address data and the like can be flexibly combined according to rule matching requirements to construct data to be matched, so that rule matching can be ensured to adapt to various scenes, and the application range of rule matching is widened.
Based on the above embodiment, step 140 further includes:
determining a target conversation corresponding to the rule matching result from all preset conversations;
based on the target speech, speech pushing is performed.
Specifically, under the conversation pushing scene, various preset conversations can be preset for adapting to different rule matching results. Therefore, after the rule matching result is obtained, the conversation corresponding to the rule matching result can be selected from the preset conversations and used as the target conversation which can be pushed to the client, and the target conversation is applied to push the conversation, so that man-machine interaction is realized.
For example, three voice technologies are preset, the voice technologies correspond to children, adults and old people respectively, and under the condition that the rule matching result indicates that the user is a child, the voice technology corresponding to the child can be pushed as a target voice technology.
According to the method provided by the embodiment of the application, the conversation pushing is performed based on the rule matching result, so that the flexibility of the conversation pushing is guaranteed, the conversation pushing can be more fit with the actual requirements of users, and the man-machine interaction can be more intelligent.
Based on the above embodiments, fig. 3 is a flow chart of the speaking and pushing method provided in the present application, and as shown in fig. 3, speaking and matching may be implemented through rule matching in a human-computer interaction scenario.
The preconfigured rules for speaking pushing can be divided into general rules and special rules, wherein the general rules, namely the rules which can be matched by the general rule processing platform, can be stored in a first database MySQL; the special rules, i.e. the rules for which the general rule processing platform cannot perform rule matching, may be stored in the second database dis.
In the man-machine interaction process, user voice or user information such as text input by a user can be obtained, various analysis data such as voiceprint data and address data can be obtained by performing semantic extraction, voiceprint extraction and other operations on the user information, and the various analysis data can be used as data to be matched according to weather data obtained by inquiring the address data.
After the data to be matched is determined, the data to be matched may be sent to the universal rule processing platform Siddhi. The universal rule processing platform Siddhi herein may monitor changes to the universal rules stored by MySQL through the CDC source table of MySQL, thereby updating the universal rules of the changes stored by MySQL into the cache of Siddhi. After receiving the data to be matched, siddi can perform rule matching on the data to be matched based on the self-cached general rule, so that general matching data including general matching results are generated and returned.
After receiving the universal matching data returned by the universal rule processing platform Siddi, the special rule cached in the second database Redis can be called, and the pre-written code is applied to carry out special rule matching on the universal matching data, so that a rule matching result which is subjected to universal rule matching and special rule matching successively is obtained. The code herein may be written based on the Java language.
After the final rule matching result is obtained, the preset conversation corresponding to the rule matching result can be determined to be pushed.
According to the method provided by the embodiment of the application, the rules to be matched are divided into the general rules and the special rules, the rule matching aiming at the general rules is realized by a general rule processing platform, and the rule matching aiming at the special rules is realized by the terminal equipment. The rule division enables the matching of different types of rules to be realized on a more adaptive platform, so that the time consumption of rule matching is shortened, and the rule matching efficiency is improved. And based on the realization of the push of the voice operation, the push time consumption is reduced, and the push timeliness is improved.
In addition, in the method provided by the embodiment of the application, the characteristics of Siddi and Redis low time delay are fully utilized, so that the performance of rule matching and conversation pushing is further improved, the time consumption of the whole conversation pushing process in the rule matching process can be reduced to about 10ms, and the timeliness of man-machine interaction is greatly improved.
Based on the above embodiment, in rule matching in a man-machine interaction scene, when the general rule includes that the voiceprint data in the data to be matched is the preset voiceprint data, the user ID corresponding to the preset voiceprint data is output, that is, when the general rule processing platform performs general rule matching, whether the preset voiceprint data is consistent with the voiceprint data in the data to be matched needs to be compared, so that the generated general matching data can include the user ID corresponding to the preset voiceprint data consistent with the voiceprint data.
The special rule may include selecting the corresponding recommended content according to the user ID and the current version, so in the process of matching the special rule, the version number of the current version needs to be compared with the preset version number, so as to determine whether the version number of the current version is above the preset version number, that is, whether the current version supports functions that can be implemented by some high version party, for example, the version number of the current version is 2.0.5, the preset version number is 2.1.0, and the version number of the current version is below the preset version number. Therefore, the corresponding recommended content can be determined as a final rule matching result according to the user ID and the version number of the current version below or above the preset version number. It will be appreciated that the comparison of the sizes of the version numbers is generally related to the setting mode of the version numbers, and does not necessarily conform to the general processing logic of the general rule processing platform, so that the implementation of self-writing code is required.
It may be appreciated that, in the embodiments of the present application, the partitioning of the general rule and the specific rule may be implemented according to whether the execution logic of the rule is a general logic implementation, that is, whether the execution of rule matching is provided by the general rule processing platform itself, which can be directly implemented by means of the general rule processing platform.
The rule matching device provided by the application is described below, and the rule matching device described below and the rule matching method described above can be referred to correspondingly.
Fig. 4 is a schematic structural diagram of a rule matching device provided in the present application, as shown in fig. 4, the device includes:
a data acquisition unit 410, configured to acquire data to be matched;
the universal matching unit 420 is configured to send the data to be matched to a universal rule processing platform, so that the universal rule processing platform performs rule matching on the data to be matched based on a pre-stored universal rule, and a universal matching result is obtained, where the universal rule is a rule for implementing rule matching through a code provided by the universal rule processing platform;
a general receiving unit 430, configured to receive general matching data returned by the general rule processing platform, where the general matching data includes a general matching result, or includes the general matching result and the data to be matched;
And a special matching unit 440, configured to perform rule matching on the general matching data based on a special rule, where the special rule is a rule other than the general rule, to obtain a rule matching result.
The device provided by the embodiment of the application divides the rules to be matched into the general rules and the special rules, and the rules to be matched are matched aiming at the general rules and are delivered to the general rule processing platform, and the rules to be matched aiming at the special rules are delivered to the terminal equipment. The rule division enables the matching of different types of rules to be realized on a more adaptive platform, so that the time consumption of rule matching is shortened, and the rule matching efficiency is improved. And the rule matching of the general rule is realized by the general rule processing platform, a technician does not need to write codes additionally, the development cost of the rule matching is reduced, and the development efficiency of the rule matching is improved.
Based on the above embodiment, the apparatus further includes a general rule storage unit configured to:
and storing the universal rule into a first database, so that the universal rule processing platform synchronously stores the universal rule in the first database under the condition of monitoring the universal rule stored in the first database.
Based on the above embodiment, the first database is a relational database management system;
the general rule storage unit is specifically configured to:
and storing the general rule into the relational database management system so that the general rule processing platform synchronously stores the newly added general rule based on an incremental data acquisition source table in the relational database management system under the condition of monitoring the general rule stored in the relational database management system.
Based on the above embodiment, the apparatus further comprises a dedicated rule extraction unit configured to:
the special rule is extracted from a second database, wherein the second database is used for caching the special rule.
Based on the above embodiment, the dedicated matching unit 440 is configured to:
based on the special rule, matching the general matching result to obtain the rule matching result;
or,
and matching the data to be matched or matching the general matching result and the data to be matched based on the special rule to obtain a special matching result, and determining the rule matching result based on the general matching result and the special matching result.
Based on the above embodiment, the data acquisition unit 410 is configured to:
acquiring user voice;
and determining data to be matched based on the user voice.
Based on the above embodiment, the data acquisition unit 410 is configured to:
semantic extraction is carried out on the user voice to obtain semantic data;
voiceprint extraction is carried out on the user voice to obtain voiceprint data;
acquiring address data of equipment for acquiring the user voice;
and determining the data to be matched based on at least one of the semantic data, the voiceprint data and the address data.
Based on the above embodiment, the apparatus further includes a pushing unit, configured to:
determining a target conversation corresponding to the rule matching result from all preset conversations;
based on the target speech, speech pushing is performed.
Fig. 5 illustrates a physical schematic diagram of an electronic device, as shown in fig. 5, the electronic device may include: processor 510, communication interface (Communications Interface) 520, memory 530, and communication bus 540, wherein processor 510, communication interface 520, memory 530 complete communication with each other through communication bus 540. Processor 510 may invoke logic instructions in memory 530 to perform a rule matching method comprising: acquiring data to be matched; the data to be matched is sent to a general rule processing platform, so that the general rule processing platform carries out rule matching on the data to be matched based on a pre-stored general rule, a general matching result is obtained, and the general rule is a rule for realizing rule matching through codes provided by the general rule processing platform; receiving general matching data returned by the general rule processing platform, wherein the general matching data comprises a general matching result or comprises the general matching result and the data to be matched; and carrying out rule matching on the general matching data based on a special rule to obtain a rule matching result, wherein the special rule is a rule except the general rule.
Further, the logic instructions in the memory 530 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present application further provides a computer program product, where the computer program product includes a computer program, where the computer program can be stored on a computer readable storage medium, where the computer program when executed by a processor can perform a rule matching method provided by the above methods, and the method includes: acquiring data to be matched; the data to be matched is sent to a general rule processing platform, so that the general rule processing platform carries out rule matching on the data to be matched based on a pre-stored general rule, a general matching result is obtained, and the general rule is a rule for realizing rule matching through codes provided by the general rule processing platform; receiving general matching data returned by the general rule processing platform, wherein the general matching data comprises a general matching result or comprises the general matching result and the data to be matched; and carrying out rule matching on the general matching data based on a special rule to obtain a rule matching result, wherein the special rule is a rule except the general rule.
In still another aspect, the present application further provides a computer readable storage medium, where the computer readable storage medium includes a stored program, where the program executes a rule matching method provided by the above methods, and the method includes: acquiring data to be matched; the data to be matched is sent to a general rule processing platform, so that the general rule processing platform carries out rule matching on the data to be matched based on a pre-stored general rule, a general matching result is obtained, and the general rule is a rule for realizing rule matching through codes provided by the general rule processing platform; receiving general matching data returned by the general rule processing platform, wherein the general matching data comprises a general matching result or comprises the general matching result and the data to be matched; and carrying out rule matching on the general matching data based on a special rule to obtain a rule matching result, wherein the special rule is a rule except the general rule.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (10)

1. A rule matching method, comprising:
acquiring data to be matched;
the data to be matched is sent to a general rule processing platform, so that the general rule processing platform carries out rule matching on the data to be matched based on a pre-stored general rule, a general matching result is obtained, and the general rule is a rule for realizing rule matching through codes provided by the general rule processing platform;
receiving general matching data returned by the general rule processing platform, wherein the general matching data comprises a general matching result or comprises the general matching result and the data to be matched;
and carrying out rule matching on the general matching data based on a special rule to obtain a rule matching result, wherein the special rule is a rule except the general rule.
2. The rule matching method according to claim 1, wherein said sending the data to be matched to a general rule processing platform further comprises:
and storing the universal rule into a first database, so that the universal rule processing platform synchronously stores the universal rule in the first database under the condition of monitoring the universal rule stored in the first database.
3. The rule matching method of claim 2, wherein the first database is a relational database management system;
the storing the universal rule in the first database, so that the universal rule processing platform synchronously stores the universal rule in the first database under the condition of monitoring the universal rule stored in the first database, comprises the following steps:
and storing the general rule into the relational database management system so that the general rule processing platform synchronously stores the newly added general rule based on an incremental data acquisition source table in the relational database management system under the condition of monitoring the general rule stored in the relational database management system.
4. The rule matching method according to claim 1, wherein the rule matching is performed on the general matching data based on a specific rule to obtain a rule matching result, and further comprising:
the special rule is extracted from a second database, wherein the second database is used for caching the special rule.
5. The rule matching method according to any one of claims 1 to 4, wherein the rule matching the general matching data based on the application-specific rule to obtain a rule matching result comprises:
Based on the special rule, matching the general matching result to obtain the rule matching result;
or,
and matching the data to be matched or matching the general matching result and the data to be matched based on the special rule to obtain a special matching result, and determining the rule matching result based on the general matching result and the special matching result.
6. The rule matching method according to any one of claims 1 to 4, wherein the acquiring data to be matched includes:
acquiring user voice;
and determining data to be matched based on the user voice.
7. The rule matching method of claim 6, wherein said determining data to be matched based on said user speech comprises:
semantic extraction is carried out on the user voice to obtain semantic data;
voiceprint extraction is carried out on the user voice to obtain voiceprint data;
acquiring address data of equipment for acquiring the user voice;
and determining the data to be matched based on at least one of the semantic data, the voiceprint data and the address data.
8. The rule matching method according to any one of claims 1 to 4, wherein the rule matching is performed on the general matching data based on a specific rule, so as to obtain a rule matching result, and further comprising:
Determining a target conversation corresponding to the rule matching result from all preset conversations;
based on the target speech, speech pushing is performed.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein the program when run performs the method of any one of claims 1 to 8.
10. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, the processor being arranged to perform the method of any of claims 1 to 8 by means of the computer program.
CN202210912001.8A 2022-07-29 2022-07-29 Rule matching method, storage medium and electronic device Pending CN117520292A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210912001.8A CN117520292A (en) 2022-07-29 2022-07-29 Rule matching method, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210912001.8A CN117520292A (en) 2022-07-29 2022-07-29 Rule matching method, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN117520292A true CN117520292A (en) 2024-02-06

Family

ID=89765064

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210912001.8A Pending CN117520292A (en) 2022-07-29 2022-07-29 Rule matching method, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN117520292A (en)

Similar Documents

Publication Publication Date Title
CN104750705B (en) Information replying method and device
CN105095211B (en) The acquisition methods and device of multi-medium data
KR20200012933A (en) Shortened voice user interface for assistant applications
US20090063559A1 (en) Multiple database entity model generation using entity models
CN111008253B (en) Data model generation method, data warehouse generation method, data model generation device and electronic equipment
CN112154420A (en) Automatic intelligent cloud service testing tool
CN109800008A (en) Configure update method and Related product
CN105550361B (en) Log processing method and device and question and answer information processing method and device
CN104142831A (en) Application program searching method and device
CN106713011A (en) Method and system for obtaining test data
CN109727592A (en) O&M instruction executing method, medium and terminal based on natural language speech interaction
CN111104214A (en) Workflow application method and device
CN114911535B (en) Application program component configuration method, storage medium and electronic device
CN117520292A (en) Rule matching method, storage medium and electronic device
CN111400303A (en) Intelligent contract data extraction and synchronization method, system and platform
CN114861678A (en) Method and apparatus for determining time information, storage medium, and electronic apparatus
WO2022143349A1 (en) Method and device for determining user intent
CN111290805B (en) Method and system for quickly calling aggregation function
CN113741864A (en) Automatic design method and system of semantic service interface based on natural language processing
CN109524002A (en) Intelligent voice recognition method and device
Oladimeji et al. Forensic analysis of amazon alexa echo dot 4 th generation
CN106469086B (en) Event processing method and device
CN117689020B (en) Method and device for constructing intelligent home body based on large model and electronic equipment
CN117725908B (en) Time analysis method, device and equipment in natural language processing
CN116303535A (en) Data query method and device, storage medium and electronic device

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