Intelligent early warning implementation method based on SQL (Structured Query Language) dynamic configuration and text similarity
By using SQL-based dynamic configuration and text similarity methods, the reported events in the city are classified and their similarity is calculated, which solves the timeliness problem of the early warning system when the environment changes, and improves the timeliness and flexibility of intelligent early warning.
Patent Information
- Application Number
- CN202510841345.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2025-10-24
AI Technical Summary
In existing technologies, early warning systems struggle to respond promptly to changes in environmental scenarios, resulting in low timeliness of early warning responses and missed opportunities for optimal early warning.
By using SQL-based dynamic configuration and text similarity methods, the reported event information from cities is classified, the similarity between event text and region is calculated, an event similarity threshold is configured, and an early warning operation is executed when the overall similarity reaches the preset threshold. The system combines pre-configured indicator rules and early warning rules for matching to achieve intelligent early warning.
It has improved the timeliness and efficiency of early warning, enhanced the real-time nature and flexibility of early warning, and improved the accuracy and efficiency of early warning.
Smart Images

Figure CN120833666A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of intelligent early warning, and particularly relates to an intelligent early warning implementation method based on SQL dynamic configuration and text similarity. BACKGROUND
[0002] Intelligent early warning is a system for monitoring, analyzing and issuing early warnings on potential risks in real time. It combines dynamic configuration of early warning index rules, early warning conditions and early warning thresholds with big data analysis technology to achieve the effect of intelligent proactive early warning and has high application in city governance.
[0003] In the prior art, early warning rules and early warning thresholds are often configured separately for specific scenarios. When the environmental scenario changes, it is difficult to meet the governance needs of environmental scenario changes, resulting in low timeliness of early warning response and thus missing the best early warning opportunity. SUMMARY
[0004] The application provides an intelligent early warning implementation method based on SQL dynamic configuration and text similarity, which can improve the timeliness and efficiency of intelligent early warning.
[0005] To achieve the above-mentioned purpose, the application provides an intelligent early warning implementation method based on SQL dynamic configuration and text similarity, which comprises:
[0006] Obtain city reported event information and classify the city reported event information into multi-person same complaint events and single-person multi-complaint events;
[0007] When the city reported event information is classified as a multi-person same complaint event, configure an event similarity threshold;
[0008] Extract event attributes of the multi-person same complaint event, and calculate event text similarity and event regional similarity according to the event attributes;
[0009] Calculate comprehensive similarity using the event text similarity and the event regional similarity, and perform an event early warning operation and save early warning data when the comprehensive similarity reaches a preset event similarity early warning threshold;
[0010] When the city reported event information is classified as a single-person multi-complaint event, obtain single-person multi-complaint event content according to a pre-configured index rule;
[0011] Perform early warning matching on the single-person multi-complaint event content according to a pre-constructed early warning rule, and perform an event early warning operation and save early warning data on the single-person multi-complaint event when the early warning matching condition is met.
[0012] Optionally, the calculation of the event text similarity according to the event attributes comprises:
[0013] extract one or more event attributes of the multi-party same complaint event, splice the one or more event attributes to obtain spliced attributes, convert the spliced attributes into text, and obtain multi-party same complaint event text;
[0014] split single characters from the multi-party same complaint event text and form a corresponding character set, and convert the character set corresponding to the multi-party same complaint event text into an event character vector;
[0015] calculate the similarity of the event character vectors of any two multi-party same complaint event texts by using a preset similarity calculation formula, and obtain event text similarity.
[0016] Optionally, the conversion of the character set corresponding to the multi-party same complaint event text into the event character vector comprises:
[0017] integrate the character sets corresponding to all multi-party same complaint event texts to obtain an event character union set;
[0018] count the number of occurrences of each character in the multi-party same complaint event text in the event character union set;
[0019] convert the multi-party same complaint event text into an event character vector according to the number of occurrences of the characters in the multi-party same complaint event text.
[0020] Optionally, the preset similarity calculation formula is:
[0021]
[0022] wherein, A is an event character vector of event A, B is an event character vector of event B, n is the number of vector dimensions of the event character vector, i is the i-th vector dimension of the event character vector, and × is the inner product of the vector.
[0023] Optionally, the obtaining of the single-person multi-complaint event content according to the preconfigured index rule comprises:
[0024] The index rule editing module sets the index rule by using an SQL statement;
[0025] The index rule execution module executes the SQL statement in the index rule to obtain an index value, and obtains the single-person multi-complaint event content according to the index value.
[0026] Optionally, the pre-warning matching of the single-person multi-complaint event content according to the preconfigured pre-warning rule comprises:
[0027] The pre-warning rule is configured by using a logical expression, and the single-person multi-complaint event content is matched by using the pre-warning rule;
[0028] After the matching is completed, a pre-warning result is output according to the pre-warning rule.
[0029] To solve the above problems, the application further provides an intelligent early warning implementation device based on SQL dynamic configuration and text similarity, the device comprises:
[0030] An event classification module is configured to acquire city-reported event information and classify the city-reported event information into multi-person same complaint events and single-person multiple complaint events.
[0031] A multi-person same complaint event processing module is configured to configure an event similarity threshold when the city-reported event information is classified as a multi-person same complaint event, extract event attributes of the multi-person same complaint event, calculate event text similarity and event regional similarity according to the event attributes, calculate comprehensive similarity using the event text similarity and the event regional similarity, and perform an event early warning operation and save early warning data when the comprehensive similarity reaches a preset event similarity early warning threshold.
[0032] A single-person multiple complaint event processing module is configured to acquire single-person multiple complaint event content according to a pre-configured index rule when the city-reported event information is classified as a single-person multiple complaint event, perform early warning matching on the single-person multiple complaint event content according to a pre-constructed early warning rule, and perform an event early warning operation on the single-person multiple complaint event and save early warning data when the early warning matching condition is met.
[0033] To solve the above problems, the application further provides an electronic device, the electronic device comprises:
[0034] At least one processor; and,
[0035] A memory connected in communication with the at least one processor; wherein,
[0036] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the intelligent early warning implementation method based on SQL dynamic configuration and text similarity.
[0037] To solve the above problems, the application further provides a computer readable storage medium, the computer readable storage medium stores at least one computer program, and the at least one computer program is executed by a processor in an electronic device to implement the intelligent early warning implementation method based on SQL dynamic configuration and text similarity.
[0038] The application classifies the city reported event information into multi-person same complaint events and single-person multi-complaint events, can preliminarily classify the city reported events, improves the accuracy of subsequent early warning, in addition, calculates the comprehensive similarity by using the event text similarity and the event region similarity, and when the comprehensive similarity reaches the preset event similarity early warning threshold, executes the event early warning operation and saves the early warning data, can intelligently trigger the early warning, and further enhances the real-time and timeliness of the early warning, in addition, the single-person multi-complaint event content is matched according to the pre-constructed early warning rule, the efficient early warning matching can be realized through the pre-configured rule engine, and the flexibility and efficiency of the early warning are improved. BRIEF DESCRIPTION OF DRAWINGS
[0039] Figure 1 A flowchart of an intelligent early warning implementation method based on SQL dynamic configuration and text similarity provided by an embodiment of the application is shown in the figure.
[0040] Figure 2 A functional module diagram of an intelligent early warning implementation device based on SQL dynamic configuration and text similarity provided by an embodiment of the application is shown in the figure.
[0041] Figure 3 A structural diagram of an electronic device for implementing the intelligent early warning implementation method based on SQL dynamic configuration and text similarity provided by an embodiment of the application is shown in the figure.
[0042] The implementation of the application, the functional features and the advantages will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0043] It should be understood that the specific embodiments described herein are only used to explain the application, and are not used to limit the application.
[0044] The embodiment of the application provides an intelligent early warning implementation method based on SQL dynamic configuration and text similarity. The execution subject of the intelligent early warning implementation method based on SQL dynamic configuration and text similarity includes but is not limited to at least one of electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the application. In other words, the intelligent early warning implementation method based on SQL dynamic configuration and text similarity can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be a stand-alone server, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
[0045] Referring to Figure 1 FIG. 1 is a flowchart of an intelligent early warning implementation method based on SQL dynamic configuration and text similarity provided by an embodiment of the application. In this embodiment, the intelligent early warning implementation method based on SQL dynamic configuration and text similarity includes the following steps.
[0046] S1, acquiring city reported event information and classifying the city reported event information into multi-person same complaint events and single-person multiple complaint events.
[0047] In the embodiment of the application, the city reported event information refers to real-time data of various city operation problems, safety hazards, livelihood demands and the like actively reported by multi-subjects such as grassroots grid members, citizens and management departments or automatically identified by a system in the process of city governance, and is a basic data source of the early warning system.
[0048] In the embodiment of the application, the multi-person same complaint event refers to a reported event generated by multiple reports of the same type of event.
[0049] In the embodiment of the application, the single-person multiple complaint event refers to a reported event generated by multiple reports of the same type and same location of event.
[0050] S2, configuring an event similarity threshold when the city reported event information is classified into multi-person same complaint events.
[0051] In the embodiment of the application, the event similarity threshold refers to a similarity threshold for early warning of the similarity of two events.
[0052] S3, extracting event attributes of the multi-person same complaint event, and calculating event text similarity and event regional similarity according to the event attributes.
[0053] In the embodiment of the present application, the event attribute refers to the basic attributes of the event name, event content, event location and event time of the event.
[0054] According to an embodiment of the present application, the event text similarity is calculated according to the event attribute, comprising:
[0055] More than one event attribute of the multi-person same complaint event is extracted, the more than one event attribute is spliced to obtain a spliced attribute, the spliced attribute is converted into text, and the multi-person same complaint event text is obtained;
[0056] The single character is split from the multi-person same complaint event text and composed into a corresponding character set, and the character set corresponding to the multi-person same complaint event text is converted into an event character vector;
[0057] The similarity of the event character vectors of any two multi-person same complaint event texts is calculated by using a preset similarity calculation formula, and the event text similarity is obtained.
[0058] Further, the character set corresponding to the multi-person same complaint event text is converted into an event character vector, comprising:
[0059] The character sets corresponding to all multi-person same complaint event texts are integrated to obtain an event character union set;
[0060] The occurrence frequency of each character in the multi-person same complaint event text is counted in the event character union set;
[0061] The multi-person same complaint event text is converted into an event character vector according to the occurrence frequency of the character in the multi-person same complaint event text.
[0062] Further, the preset similarity calculation formula is:
[0063]
[0064] Wherein, A is the event character vector of event A, B is the event character vector of event B, n is the number of vector dimensions of the event character vector, i is the i-th vector dimension of the event character vector, and × is the inner product of the vector.
[0065] In the embodiment of the present application, the preset similarity formula can adopt the cosine similarity formula.
[0066] S4, the comprehensive similarity is calculated by using the event text similarity and the event region similarity, and when the comprehensive similarity reaches a preset event similarity early warning threshold, an event early warning operation is performed and early warning data is saved.
[0067] In the embodiment of the present application, the process of calculating the event region similarity is the same as the step of calculating the event text similarity, which will not be repeated here.
[0068] The embodiment of the present application calculates the comprehensive similarity R through the following calculation formula:
[0069] R=W content *sim content +W area *sim area
[0070] Wherein, W content is the event text content effective rate, W area is the event region text content effective rate, sim content is the event text similarity, and sim area is the event region similarity.
[0071] As an embodiment of the present application, before the event warning operation is performed, the following steps are further included: configuring a warning message notification object, a notification mode and a notification frequency.
[0072] In the embodiment of the present application, the notification object refers to a management department or a management center of city management.
[0073] In the embodiment of the present application, the notification mode includes but is not limited to short message, email and office communication software.
[0074] In the embodiment of the present application, the notification frequency can be configured according to the business scene, for example, an illegal phishing event can be warned once every half an hour.
[0075] S5, when the city reported event information is classified as a single person multi-suit event, the single person multi-suit event content is obtained according to the pre-configured index rule.
[0076] As an embodiment of the present application, the single person multi-suit event content is obtained according to the pre-configured index rule, including:
[0077] The index rule editing module sets the index rule by using a SQL statement;
[0078] The index rule execution module executes the SQL statement in the index rule to obtain an index value, and obtains the single person multi-suit event content according to the index value.
[0079] In the embodiment of the present application, the index rule editing module refers to a module for configuring the index rule by using a SQL statement.
[0080] In the embodiment of the present application, the index rule execution module refers to a module for executing a SQL statement.
[0081] S6, the single person multi-suit event content is matched according to the pre-built warning rule, and the event warning operation is performed on the single person multi-suit event and the warning data is saved after the warning matching condition is met.
[0082] As an embodiment of the present application, the pre-warning matching of the single-person multi-complaint event content according to the pre-constructed pre-warning rule comprises:
[0083] The pre-warning rule is configured by using a logical expression, and the single-person multi-complaint event content is matched by using the pre-warning rule.
[0084] After the matching is completed, the pre-warning result is output according to the pre-warning rule.
[0085] The present application classifies the city reported event information into multi-person same complaint events and single-person multi-complaint events, can preliminarily classify the city reported events, improves the accuracy of subsequent pre-warning, in addition, calculates the comprehensive similarity by using the event text similarity and the event region similarity, and when the comprehensive similarity reaches the preset event similarity pre-warning threshold, executes the event pre-warning operation and saves the pre-warning data, can intelligently trigger the pre-warning, and further enhances the real-time and timeliness of the pre-warning, in addition, the pre-warning matching of the single-person multi-complaint event content according to the pre-constructed pre-warning rule can realize efficient pre-warning matching through the pre-configured rule engine, thereby improving the flexibility and efficiency of the pre-warning.
[0086] As shown in Figure 2 FIG. 1 is a functional module diagram of an intelligent pre-warning implementation device based on SQL dynamic configuration and text similarity according to an embodiment of the present application.
[0087] The intelligent pre-warning implementation device 100 based on SQL dynamic configuration and text similarity can be installed in an electronic device. According to the implemented functions, the intelligent pre-warning implementation device 100 based on SQL dynamic configuration and text similarity can include an event classification module 101, a multi-person same complaint event processing module 102, and a single-person multi-complaint event processing module 103.
[0088] The module of the present application can also be referred to as a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete a fixed function, and is stored in the memory of the electronic device.
[0089] In the present embodiment, the functions of each module / unit are as follows:
[0090] The event classification module 101 is used to obtain city reported event information, and classify the city reported event information into multi-person same complaint events and single-person multi-complaint events.
[0091] In the embodiment of the present application, the city reported event information refers to real-time data of various city operation problems, safety hazards, livelihood complaints, etc. that are actively reported by multi-subjects such as grass-roots grid staff, citizens, and management departments or automatically identified by the system in the process of city governance, and is the basic data source of the pre-warning system.
[0092] In the embodiment of the present application, the multi-person same complaint event refers to a reported event generated by multiple reports on the same type of event.
[0093] In the embodiment of the present application, the single-person multiple complaint event refers to a reported event generated by multiple reports on the same type of event at the same location.
[0094] The multi-person same complaint event processing module 102 is configured to configure an event similarity threshold when the city reported event information is classified as a multi-person same complaint event, extract event attributes of the multi-person same complaint event, and calculate event text similarity and event regional similarity according to the event attributes; calculate the comprehensive similarity by using the event text similarity and the event regional similarity, and perform an event warning operation and save the warning data when the comprehensive similarity reaches a preset event similarity warning threshold.
[0095] In the embodiment of the present application, the event similarity threshold refers to a similarity threshold for warning the similarity of two events.
[0096] In the embodiment of the present application, the event attribute refers to basic attributes of the event, such as the event name, the event content, the occurrence location, and the occurrence time.
[0097] As an embodiment of the present application, the event text similarity is calculated according to the event attributes, including:
[0098] More than one event attribute of the multi-person same complaint event is extracted, more than one event attribute is spliced to obtain spliced attributes, the spliced attributes are converted into text, and the multi-person same complaint event text is obtained;
[0099] Single characters are split from the multi-person same complaint event text and composed into a corresponding character set, and the character set corresponding to the multi-person same complaint event text is converted into an event character vector.
[0100] The similarity of the event character vectors of any two multi-person same complaint event texts is calculated by using a preset similarity calculation formula, and the event text similarity is obtained.
[0101] Further, the character set corresponding to the multi-person same complaint event text is converted into an event character vector, including:
[0102] The character sets corresponding to all multi-person same complaint event texts are integrated to obtain an event character union set;
[0103] The occurrence frequency of each character in the multi-person same complaint event text is counted in the event character union set.
[0104] The multi-person same complaint event text is converted into an event character vector according to the occurrence frequency of the character in the multi-person same complaint event text.
[0105] Further, the preset similarity calculation formula is:
[0106]
[0107] Where A is the event text vector of event A, B is the event text vector of event B, n is the number of vector dimensions of the event text vector, i is the i-th vector dimension of the event text vector, and × is the vector inner product.
[0108] In the embodiment of the present invention, the preset similarity formula may be a cosine similarity formula.
[0109] In the embodiment of the present invention, the process of calculating the event region similarity is the same as the step of calculating the event text similarity, which will not be repeated here.
[0110] The embodiment of the present invention calculates the comprehensive similarity R using the following calculation formula:
[0111] R=W content *sim content +W area *sim area
[0112] Among them, W content For event text content efficiency, W area For event area text content efficiency, sim content is the event text similarity, sim area is the geographical similarity of events.
[0113] As an embodiment of the present invention, before executing the event warning operation, the method further includes: configuring the warning message notification object, notification method, and notification frequency.
[0114] In the embodiment of the present invention, the notification object refers to the governance department, governance center, etc. of urban governance.
[0115] In the embodiment of the present invention, notification methods include but are not limited to text messages, emails, and office communication software.
[0116] In an embodiment of the present invention, the notification frequency can be configured according to the business scenario, such as an illegal fishing incident can be warned once every half hour.
[0117] The single-person multiple-complaint event processing module 103 is used to obtain the content of the single-person multiple-complaint event according to pre-configured indicator rules when the city's reported event information is classified as a single-person multiple-complaint event; perform warning matching on the content of the single-person multiple-complaint event according to pre-built warning rules, and execute event warning operations on the single-person multiple-complaint event and save warning data after the warning matching conditions are met.
[0118] As an embodiment of the present invention, the content of a single-person multiple-complaint event is obtained according to preconfigured indicator rules, including:
[0119] The indicator rule editing module uses SQL statements to set indicator rules;
[0120] The indicator rule execution module executes the SQL statement in the indicator rule to obtain the indicator value, and obtains the content of the single-person multiple-complaint event based on the indicator value.
[0121] In the embodiment of the present invention, the indicator rule editing module refers to a module that configures indicator rules using SQL statements.
[0122] In the embodiment of the present invention, the indicator rule execution module refers to a module that executes SQL statements.
[0123] S6. Perform warning matching on the content of the single-person multiple-complaint event according to the pre-built warning rules. After the warning matching conditions are met, perform event warning operations on the single-person multiple-complaint event and save the warning data.
[0124] As an embodiment of the present invention, the pre-established warning rules are used to match the content of a single-person multiple-complaint incident with warnings, including:
[0125] Use logical expressions to configure warning rules, and use warning rules to match the content of single-person multiple-complaint events;
[0126] After the matching is completed, the warning results are output according to the warning rules.
[0127] The present invention classifies the city's reported event information into multi-person joint complaint events and single-person multiple complaint events, which can perform preliminary classification of city-reported events and improve the accuracy of subsequent warnings. In addition, the comprehensive similarity is calculated using event text similarity and event regional similarity, and when the comprehensive similarity reaches a preset event similarity warning threshold, the event warning operation is executed and the warning data is saved, which can intelligently trigger the warning, thereby enhancing the real-time and timeliness of the warning. In addition, according to the pre-built warning rules, the content of the single-person multiple complaint event is matched with the warning, and efficient warning matching can be achieved through the pre-configured rule engine, thereby improving the flexibility and efficiency of the warning.
[0128] like Figure 3 , which is a structural diagram of an electronic device for implementing an intelligent early warning method based on SQL dynamic configuration and text similarity provided by an embodiment of the present invention.
[0129] The electronic device may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as an intelligent early warning implementation method program based on SQL dynamic configuration and text similarity.
[0130] The processor 10 may, in some embodiments, be composed of integrated circuits, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits of the same or different functions, including one or more combinations of central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device, connects various components of the electronic device through various interfaces and lines, executes programs or modules stored in the memory 11 (for example, an intelligent early warning implementation method program based on SQL dynamic configuration and text similarity), and calls data stored in the memory 11 to perform various functions and process data of the electronic device.
[0131] The memory 11 includes at least one type of readable storage medium, including flash memories, mobile hard disks, multimedia cards, card-type memories (for example, SD or DX memories, etc.), magnetic memories, magnetic disks, optical disks, etc. The memory 11 may, in some embodiments, be an internal storage unit of the electronic device, for example, a mobile hard disk of the electronic device. The memory 11 may, in other embodiments, also be an external storage device of the electronic device, for example, a plug-in mobile hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 11 may include both an internal storage unit and an external storage device of the electronic device. The memory 11 can be used not only to store application software and various data installed in the electronic device, for example, the code of an intelligent early warning implementation method program based on SQL dynamic configuration and text similarity, but also to temporarily store data that has been or will be output.
[0132] The communication bus 12 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize the connection and communication between the memory 11 and at least one processor 10, etc.
[0133] The communication interface 13 is used for communication between the electronic device and other devices, including a network interface and a user interface. Optionally, the network interface can include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used to establish a communication connection between the electronic device and other electronic devices. The user interface can be a display, an input unit (such as a keyboard), and optionally, the user interface can also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display can be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, etc. Among them, the display can also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visualized user interface.
[0134] Figure 3 Only the electronic device with components is shown, and those skilled in the art can understand that, Figure 3 The structure shown does not constitute a limitation on the electronic device, and can include fewer or more components than shown, or combine certain components, or different component arrangements.
[0135] For example, although not shown, the electronic device can also include a power supply (such as a battery) for powering each component. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, so that functions such as charge management, discharge management, and power consumption management can be realized through the power management device. The power supply can also include one or more direct current or alternating current power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components. The electronic device can also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which are not described here.
[0136] It should be understood that the embodiments are only for illustration and are not limited in the scope of the patent application by this structure.
[0137] The program of the intelligent early warning implementation method based on SQL dynamic configuration and text similarity stored in the memory 11 in the electronic device is a combination of multiple instructions, which, when running in the processor 10, can realize:
[0138] Obtain city-reported event information, and classify the city-reported event information into multi-person same complaint events and single-person multi-complaint events;
[0139] When the city-reported event information is classified as a multi-person same complaint event, configure an event similarity threshold;
[0140] Extract the event attributes of the multi-person same complaint event, and calculate the event text similarity and event region similarity according to the event attributes;
[0141] Calculate the comprehensive similarity by using the event text similarity and the event region similarity, and perform an event warning operation and save the warning data when the comprehensive similarity reaches a preset event similarity warning threshold;
[0142] When the city reported event information is classified as a single-person multi-complaint event, the single-person multi-complaint event content is obtained according to the pre-configured index rule;
[0143] According to the pre-constructed warning rule, the single-person multi-complaint event content is matched, and the event warning operation is performed on the single-person multi-complaint event and the warning data is saved when the warning matching condition is met.
[0144] Specifically, the specific implementation method of the processor 10 to the above instructions can refer to the description of the related steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.
[0145] Further, the modules / units integrated in the electronic device 1, if realized in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. The computer readable storage medium can be volatile or non-volatile. For example, the computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory).
[0146] The application also provides a computer readable storage medium, the readable storage medium stores a computer program, the computer program can realize the following when being executed by the processor of the electronic device:
[0147] Obtain city reported event information, and classify the city reported event information into a multi-person same complaint event and a single-person multi-complaint event;
[0148] When the city reported event information is classified as a multi-person same complaint event, an event similarity threshold is configured;
[0149] Extract the event attributes of the multi-person same complaint event, and calculate the event text similarity and event region similarity according to the event attributes;
[0150] Calculate the comprehensive similarity by using the event text similarity and the event region similarity, and perform an event warning operation and save the warning data when the comprehensive similarity reaches a preset event similarity warning threshold;
[0151] When the city reports the event information classification as a single-person multi-suit event, the single-person multi-suit event content is obtained according to the pre-configured index rule;
[0152] The single-person multi-suit event content is matched according to the pre-constructed early warning rule, and the event early warning operation is performed on the single-person multi-suit event and the early warning data is saved after the early warning matching condition is met.
[0153] In several embodiments provided by the present application, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other manners. For example, the above-described device embodiments are merely illustrative. For example, the division of the modules is merely logical function division. In actual implementation, other division manners can be used.
[0154] The modules illustrated as separated components can or can not be physically separated, and the components illustrated as modules can or can not be physical units. That is, they can be located in one place, or distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purposes of the embodiments.
[0155] In addition, each function module in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of hardware plus software function modules.
[0156] It is obvious for those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application.
[0157] Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting, and the scope of the present application is defined by the appended claims rather than the above description, and therefore all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present application. Any additional reference signs in the claims should not be considered as limiting the claims involved.
[0158] The blockchain referred to in the present application is a new application mode of distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm and other computer technologies. Blockchain, in essence, is a decentralized database, which is a series of data blocks associated using cryptographic methods, each data block containing information of a batch of network transactions, for verifying the validity (anti-fake) of the information and generating the next block. The blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer, etc.
[0159] The embodiments of the present application can acquire and process related data based on artificial intelligence technology. The artificial intelligence (AI) is to use a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use the knowledge to obtain the best results.
[0160] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. The plurality of units or devices stated in the system claims can also be implemented by one unit or device through software or hardware. The first, second, etc. words are used to indicate names, not any specific order.
[0161] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not limiting. Although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solutions of the present application can be modified or replaced equivalently without departing from the spirit and scope of the technical solutions of the present application.
Claims
1. An intelligent early warning implementation method based on SQL dynamic configuration and text similarity, characterized in that, The method comprises: acquiring city-reported event information and classifying the city-reported event information into multi-person same complaint events and single-person multiple complaint events; when the city-reported event information is classified as a multi-person same complaint event, configuring an event similarity threshold; extracting event attributes of the multi-person same complaint event and calculating event text similarity and event regional similarity according to the event attributes; calculating comprehensive similarity by using the event text similarity and the event regional similarity, and performing an event early warning operation and saving early warning data when the comprehensive similarity reaches a preset event similarity early warning threshold; when the city-reported event information is classified as a single-person multiple complaint event, obtaining single-person multiple complaint event content according to a preconfigured index rule; performing early warning matching on the single-person multiple complaint event content according to a prebuilt early warning rule, and performing an event early warning operation on the single-person multiple complaint event and saving early warning data when the early warning matching condition is met.
2. The intelligent early warning implementation method based on SQL dynamic configuration and text similarity according to claim 1, characterized in that, The method of calculating event text similarity according to event attributes comprises: extracting more than one event attribute of a multi-person same complaint event, splicing the more than one event attribute to obtain spliced attributes, converting the spliced attributes into text to obtain multi-person same complaint event text; splitting single characters from the multi-person same complaint event text and composing a corresponding character set, and converting the character set corresponding to the multi-person same complaint event text into an event character vector; calculating the similarity of event character vectors of any two multi-person same complaint event texts by using a preset similarity calculation formula to obtain event text similarity. 3.The SQL-based dynamic configuration and text similarity intelligent early warning implementation method of claim 2, wherein, The method of converting the character set corresponding to the multi-person same complaint event text into an event character vector comprises: integrating all character sets corresponding to multi-person same complaint event texts to obtain an event character union set; counting the number of times each character in the event character union set appears in the multi-person same complaint event text; converting the multi-person same complaint event text into an event character vector according to the number of times the character appears in the multi-person same complaint event text.
4. The intelligent early warning implementation method based on SQL dynamic configuration and text similarity according to claim 2, characterized in that, The preset similarity calculation formula is: wherein A is an event character vector of event A, B is an event character vector of event B, n is the number of vector dimensions of the event character vector, i is the i-th vector dimension of the event character vector, and × is the inner product of vectors.
5. The intelligent early warning implementation method based on SQL dynamic configuration and text similarity according to claim 1, characterized in that, The method of obtaining single-person multiple complaint event content according to a preconfigured index rule comprises: an index rule editing module sets an index rule by using an SQL statement; an index rule execution module executes the SQL statement in the index rule to obtain an index value, and obtains single-person multiple complaint event content according to the index value.
6. The intelligent early warning implementation method based on SQL dynamic configuration and text similarity according to claim 1, characterized in that, The method of performing early warning matching on single-person multiple complaint event content according to a prebuilt early warning rule comprises: configuring an early warning rule by using a logical expression, and matching single-person multiple complaint event content by using the early warning rule; outputting an early warning result according to the early warning rule after the matching is completed.
7. An intelligent early warning implementation device based on SQL dynamic configuration and text similarity, characterized in that, The device implements the intelligent early warning implementation method based on SQL dynamic configuration and text similarity according to any one of claims 1 to 6, and the device comprises: an event classification module configured to acquire city-reported event information and classify the city-reported event information into multi-person same complaint events and single-person multiple complaint events; The multi-person same complaint event processing module is configured with an event similarity threshold when the city reported event information is classified as a multi-person same complaint event; event attributes of the multi-person same complaint event are extracted, and event text similarity and event regional similarity are calculated according to the event attributes; a comprehensive similarity is calculated using the event text similarity and the event regional similarity, and when the comprehensive similarity reaches a preset event similarity early warning threshold, an event early warning operation is performed and early warning data is saved; The single-person multi-complaint event processing module is configured with an event similarity threshold when the city reported event information is classified as a single-person multi-complaint event; single-person multi-complaint event content is obtained according to a pre-configured index rule; early warning matching is performed on the single-person multi-complaint event content according to a pre-constructed early warning rule, and an event early warning operation is performed on the single-person multi-complaint event and early warning data is saved when the early warning matching condition is met.
8. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected to the at least one processor in communication; wherein The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the intelligent early warning implementation method based on SQL dynamic configuration and text similarity according to any one of claims 1 to 6.
9. A computer readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to implement the intelligent early warning implementation method based on SQL dynamic configuration and text similarity according to any one of claims 1 to 6.