Campus event reasoning method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202610966697.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]本申请实施例提供了一种校园事件推理方法,旨在解决现有方案存在无法捕捉校园环境中区域、时段、事件与动作之间复杂关联的校园动态规律,导致事件处置规则覆盖不全、适应性差、难以应对动态变化的校园场景的问题
[0046]本发明实施例中,获取目标校园的多维知识图谱以及实时数据流,多维知识图谱的本体结构至少包括区域节点、时段节点、事件节点以及动作节点;基于多维知识图谱以及实时数据流,通过大语言模型生成校园事件推理规则,校园事件推理规则包括目标区域、目标时段、目标事件以及与目标事件对应的目标动作;根据校园事件推理规则,控制目标区域内的物理设备在目标时段触发目标动作,以加载并执行与目标事件对应的处置算法。本发明通过大语言模型根据目标校园的多维知识图谱以及实时数据流,生成校园事件推理规则,并根据校园事件推理规则,控制目标区域内的物理设备在目标时段触发目标动作,以加载并执行与目标事件对应的处置算法,解决了现有方案存在无法捕捉校园环境中区域、时段、事件与动作之间复杂关联的校园动态规律,导致事件处置规则覆盖不全、适应性差、难以应对动态变化的校园场景的问题。
Smart Images

Figure CN123014154A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data processing technology, and in particular relates to a campus event reasoning method, device, electronic device and storage medium. Background Technology
[0002] With the continuous development of smart campus construction, the timely detection and efficient handling of various campus incidents, such as fire alarms, equipment failures, security threats, and emergency evacuations, has become a crucial issue in campus management. Currently, data preprocessing and topology modeling in existing campus incident handling solutions are based on communication network topology models of physical device connections, which are static device-related modeling methods. However, incident identification in campus scenarios heavily relies on peak student traffic during evening self-study periods, low traffic in computer labs on weekends, specific spatiotemporal coordination patterns between library visitor flow and campus network load, and periodic changes in network load due to differences in class times in different teaching buildings. Therefore, there is an urgent need for a campus incident reasoning method that can capture dynamic patterns on campus and possess adaptive reasoning capabilities. This would address the problem that existing solutions fail to capture the complex relationships between regions, time periods, events, and actions within the campus environment, resulting in incomplete coverage of incident handling rules, poor adaptability, and difficulty in responding to dynamically changing campus scenarios. Summary of the Invention
[0003] This application provides a campus event reasoning method to address the problem that existing solutions fail to capture the complex relationships between regions, time periods, events, and actions within the campus environment, resulting in incomplete event handling rules, poor adaptability, and difficulty in responding to dynamically changing campus scenarios. By using a large language model based on the multidimensional knowledge graph of the target campus and real-time data streams, campus event reasoning rules are generated. Based on these rules, physical devices within the target area are controlled to trigger target actions during target time periods, thereby loading and executing the corresponding handling algorithm. This solves the problem that existing solutions fail to capture the complex relationships between regions, time periods, events, and actions within the campus environment, leading to incomplete event handling rules, poor adaptability, and difficulty in responding to dynamically changing campus scenarios.
[0004] In a first aspect, embodiments of the present invention provide a campus event reasoning method, the method comprising the following steps:
[0005] Acquire a multidimensional knowledge graph and real-time data stream of the target campus. The ontology structure of the multidimensional knowledge graph includes at least region nodes, time period nodes, event nodes, and action nodes.
[0006] Based on the multidimensional knowledge graph and the real-time data stream, campus event reasoning rules are generated through a large language model. The campus event reasoning rules include target area, target time period, target event, and target action corresponding to the target event.
[0007] According to the campus event reasoning rules, the physical devices in the target area are controlled to trigger the target action during the target time period, so as to load and execute the handling algorithm corresponding to the target event.
[0008] Optionally, obtaining the multidimensional knowledge graph of the target campus includes:
[0009] Obtain the spatial GIS model and equipment topology file of the target campus, and construct the regional nodes based on the spatial GIS model and the equipment topology file;
[0010] Based on the operating cycle of the target campus, the continuous timeline is divided into discrete time slices to construct the time period nodes;
[0011] Cluster historical alarm records and campus management business logic, extract the event types that need to be monitored, and construct the event nodes;
[0012] Obtain the set of software and hardware execution capabilities and available algorithms supported by the physical device, generate the corresponding device instruction set, and construct the action node;
[0013] A mapping edge with feature weights is established between the region node, the time period node, the event node, and the action node to generate the multidimensional knowledge graph.
[0014] Optionally, the step of establishing mapping edges with feature weights among the region nodes, the time period nodes, the event nodes, and the action nodes to generate the multidimensional knowledge graph includes:
[0015] Obtain the historical equipment scheduling logs and event handling records of the target campus;
[0016] The closed-loop data chain of successfully executed collaborative scheduling is extracted from the historical device scheduling log and the event handling record, and the closed-loop data chain is parsed into a business quadruple containing the historical occurrence area, historical occurrence time period, historical triggering event and historical execution action;
[0017] The co-occurrence frequency of each of the aforementioned business quadruples within a preset period is calculated, and the task success rate of the corresponding physical device when executing the historical execution action is extracted.
[0018] The spatial co-occurrence confidence is calculated jointly based on the co-occurrence frequency and the task success rate, and the spatial co-occurrence confidence is used as the feature weight.
[0019] Based on the association structure within the business quadruple, connection lines are instantiated between the corresponding region nodes, time period nodes, event nodes, and action nodes in the multidimensional knowledge graph, and the feature weights are assigned to the corresponding connection lines to generate the multidimensional knowledge graph.
[0020] Optionally, the step of matching and extracting the closed-loop data chain of successfully executed collaborative scheduling from the historical device scheduling log and the event handling record includes:
[0021] Based on timestamps and spatial identifiers, the historical device scheduling logs and the event handling records are spatiotemporally aligned.
[0022] In the aligned data sequence, the initial trigger record of the feature event is identified, and within the preset response time window immediately following the initial trigger record, the corresponding device action command issuance record is retrieved;
[0023] Obtain the physical device execution feedback status corresponding to the device action command issuance record, and after confirming that the physical device has executed successfully, extract the scene index monitoring value of the feature event within a preset evaluation time window;
[0024] If the monitored value of the scenario indicator meets the preset event elimination threshold or steady-state recovery condition within the preset evaluation time window, it is determined that the collaborative scheduling is successful, and the initial trigger record and the device action command issuance record that have time sequence correlation, together with the corresponding occurrence area and time period, are extracted as the closed-loop data chain of the successful execution of collaborative scheduling.
[0025] Optionally, the step of jointly calculating the spatial cooperation confidence based on the co-occurrence frequency and the task success rate includes:
[0026] Aggregate all business logs containing the same historical occurrence area, the same historical occurrence time period, and the same historical triggering event within the preset period, and calculate the total frequency of environmental triggers.
[0027] Calculate the ratio of the co-occurrence frequency of the business quadruple to the total frequency of environmental triggers to obtain the conditional invocation probability of the historical execution action under the corresponding spatiotemporal event;
[0028] For the historical execution actions in the business quadruple, the number of effective responses from the corresponding physical device after the instruction is issued is counted, and the ratio of the number of effective responses to the total number of instruction issuances is calculated to obtain the task success rate.
[0029] The product or weighted sum of the conditional call probability and the task success rate is calculated using a preset weighted fusion strategy, and the result of the fusion calculation is mapped to a preset confidence interval using a normalization function to obtain the spatial collaborative confidence degree corresponding to the business quadruple.
[0030] Optionally, the step of generating campus event reasoning rules based on the multidimensional knowledge graph and the real-time data stream using a large language model includes:
[0031] The real-time data stream is parsed, real-time scene indicators of the current triggered event are extracted, and the matching current region node, current time period node and current event node are mapped and activated in the multi-dimensional knowledge graph.
[0032] Starting from the activated current region node, the current time period node, and the current event node, the system traverses the connected mapping edges in descending order of feature weights to extract candidate action nodes within a preset number of hops, thereby generating a dynamic association subgraph containing the context of the real-time scene indicators.
[0033] The topological structure and node-level attribute information within the dynamic associated subgraph are serialized into graph structure description text, and the graph structure description text is concatenated and encapsulated with the real-time data stream into a large language model structured prompt word.
[0034] The structured prompt words of the large language model are input into the large language model. The large language model performs logical inference based on the weight distribution in the graph structure describing the text, and outputs the target action with the highest matching degree and its corresponding device execution parameters to generate the campus event reasoning rule.
[0035] Optionally, after controlling the physical devices within the target area to trigger the target action during the target time period according to the campus event inference rule, so as to load and execute the handling algorithm corresponding to the target event, the method further includes:
[0036] By using IoT sensors deployed in the target area, a continuous sequence of environmental monitoring values is collected from the physical devices after the processing algorithm is executed.
[0037] Determine whether the fluctuation curve of the continuous environmental monitoring value sequence within a preset observation period converges to the calming threshold of the target event;
[0038] If the convergence does not reach the calming threshold, the current inference rule is determined to be inapplicable, and the feature weights of the corresponding mapping edges between the current region node, the current time period node, the current event node and the target action node are reduced in the multidimensional knowledge graph according to the decay penalty coefficient.
[0039] If the convergence is reached at the settling threshold, the current inference rule is determined to be valid. In the multidimensional knowledge graph, the feature weights of the corresponding mapping edges are increased according to the positive reinforcement coefficient to achieve adaptive iterative updates of the inference base for the large language model.
[0040] Secondly, embodiments of the present invention also provide a campus event reasoning device, the campus event reasoning device comprising:
[0041] The acquisition module is used to acquire the multidimensional knowledge graph of the target campus and the real-time data stream. The ontology structure of the multidimensional knowledge graph includes at least region nodes, time period nodes, event nodes and action nodes.
[0042] The generation module is used to generate campus event reasoning rules based on the multidimensional knowledge graph and the real-time data stream through a large language model. The campus event reasoning rules include target area, target time period, target event, and target action corresponding to the target event.
[0043] The execution module is used to control the physical devices in the target area to trigger the target action during the target time period according to the campus event reasoning rules, so as to load and execute the handling algorithm corresponding to the target event.
[0044] Thirdly, embodiments of the present invention provide an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the campus event reasoning method provided in embodiments of the present invention.
[0045] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the campus event reasoning method provided in the embodiments of the present invention.
[0046] In this embodiment of the invention, a multidimensional knowledge graph and real-time data stream of the target campus are acquired. The ontology structure of the multidimensional knowledge graph includes at least region nodes, time period nodes, event nodes, and action nodes. Based on the multidimensional knowledge graph and real-time data stream, campus event reasoning rules are generated through a large language model. The campus event reasoning rules include target region, target time period, target event, and target action corresponding to the target event. According to the campus event reasoning rules, physical devices within the target region are controlled to trigger target actions during the target time period to load and execute the handling algorithm corresponding to the target event. This invention generates campus event reasoning rules based on the multidimensional knowledge graph and real-time data stream of the target campus using a large language model, and controls physical devices within the target region to trigger target actions during the target time period to load and execute the handling algorithm corresponding to the target event. This solves the problem that existing solutions cannot capture the complex relationships between regions, time periods, events, and actions in the campus environment, resulting in incomplete coverage of event handling rules, poor adaptability, and difficulty in coping with dynamically changing campus scenarios.
[0047] Other beneficial effects of this application will be described in detail in the following detailed description section. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 A flowchart illustrating a campus event reasoning method provided in one embodiment of this application;
[0050] Figure 2 A schematic diagram of the structure of a campus event reasoning device provided in an embodiment of this application;
[0051] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0052] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0053] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0054] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0055] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0056] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0057] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0058] like Figure 1 As shown, Figure 1 This is a flowchart of a campus event reasoning method provided by an embodiment of the present invention. The campus event reasoning method includes the following steps:
[0059] 101. Obtain the multidimensional knowledge graph and real-time data stream of the target campus.
[0060] In this embodiment of the invention, the aforementioned campus event reasoning method can be applied to an event reasoning platform. The event reasoning platform can be built on a server-based or distributed system. The platform includes a data interface (for sensors or users to upload data), a knowledge database, and a knowledge database construction program. The data interface can be used to acquire a multi-dimensional knowledge graph and real-time data stream of the target campus. The knowledge database construction program can be used to construct the knowledge database, which is specifically designed to provide additional relational information for the identified data entities, thereby enhancing the data recognition system's understanding of the content.
[0061] The target campus mentioned above can be a campus where campus event reasoning is required.
[0062] The aforementioned multidimensional knowledge graph can be a campus knowledge graph organized in a graph structure and containing multiple semantic dimensions, used to describe various entities in the campus environment and the relationships between them.
[0063] The ontology structure of the aforementioned multidimensional knowledge graph includes at least region nodes, time period nodes, event nodes, and action nodes. The region nodes represent physical spatial units within the campus, such as teaching buildings, canteens, dormitories, playgrounds, corridors, and classrooms. The time period nodes represent discretized slices of time, such as morning rush hour (7:00-8:30), lunch break (12:00-13:30), evening self-study (19:00-21:00), and holidays. The event nodes represent types of campus events that require monitoring or handling, such as gatherings of people, unauthorized intrusions, equipment malfunctions, and excessive noise. The action nodes represent executable hardware and software instructions or sequences of operations by physical devices, such as broadcasting evacuation messages, sending alarm notifications, and opening access control systems.
[0064] The aforementioned real-time data stream can be a continuous stream of information collected from data sources such as IoT sensors, monitoring systems, access control systems, and equipment status monitoring modules deployed throughout the campus. The real-time data stream includes environmental parameters, personnel flow, equipment operating status, alarm signals, etc.
[0065] It should be noted that by using a multidimensional knowledge graph, data collected from different devices can be mapped to a unified node type. Through the established edges between nodes, structured knowledge is provided for campus event reasoning, avoiding the semantic loss problem caused by data collected from different devices.
[0066] 102. Based on multidimensional knowledge graphs and real-time data streams, generate campus event reasoning rules through a large language model.
[0067] In this embodiment of the invention, the aforementioned large language model can be a large language model built based on deep learning or machine learning, such as GNN, DGNN, etc. The core idea of GNN (Graph Neural Network) is to allow nodes to aggregate neighbor information through a message passing mechanism, thereby learning feature representations that include their own attributes and topological structure. DGNN (Dynamic Graph Neural Network) aims to solve the problem of graph structure evolution over time. The aforementioned large language model possesses natural language understanding and generation capabilities. Through self-supervised pre-training on massive amounts of general text corpora and domain knowledge corpora, the large language model learns the ability to encode, understand, and infer natural language semantics, contextual logical relationships, and complex instructions.
[0068] The aforementioned campus incident reasoning rules include target area, target time period, target event, and target action corresponding to the target event. The target area can be the physical area of the campus where the incident occurs or where a response action is required; the target time period can be the time range to which the campus incident reasoning rules apply; the target event can be the identified type of campus incident; and the target action can be the response action that should be performed on the target event.
[0069] It should be noted that the context learning and reasoning capabilities of large language models can be utilized to dynamically output reasoning rules for target campus events based on the input multidimensional knowledge graph and real-time data stream.
[0070] 103. Based on the campus event reasoning rules, control the physical devices in the target area to trigger the target action during the target time period, so as to load and execute the handling algorithm corresponding to the target event.
[0071] In this embodiment of the invention, the physical device can be a hardware facility within the target area capable of receiving and executing external instructions, such as a broadcast terminal, a smoke exhaust fan, an access control controller, etc.
[0072] Furthermore, after obtaining the campus event reasoning rules, the campus event reasoning rules can be parsed into device control instructions within the target area. During the target time period, trigger target actions are sent to the corresponding physical devices within the target area so that the corresponding physical devices can execute the target actions.
[0073] The aforementioned processing algorithms can be pre-set sets of logical programs corresponding to the target event, used to guide the equipment to complete orderly handling steps. Different target events correspond to different processing algorithms. For example, fire alarm handling algorithms include a sequence of steps such as initiating smoke extraction, evacuation broadcasting, and notifying the fire department; personnel gathering handling algorithms include area flow control, broadcast reminders, and adjusting access control directions.
[0074] It should be noted that, based on the target area in the campus event reasoning rules, the corresponding physical devices deployed within the target area can be located and determined, the effective time window for triggering actions can be determined based on the target time period, the type of campus event can be identified based on the target event, and the corresponding handling algorithm for the target event can be generated based on the target action.
[0075] Specifically, when physical devices within the target area trigger a target action during a target time period, the corresponding handling algorithm for the target event can be loaded and executed simultaneously, enabling automated and intelligent handling of campus events.
[0076] In this embodiment of the invention, the invention generates campus event reasoning rules based on the multidimensional knowledge graph of the target campus and real-time data stream using a large language model. Based on these rules, it controls physical devices within the target area to trigger target actions during target time periods, thereby loading and executing the corresponding handling algorithm. This solves the problem that existing solutions fail to capture the complex relationships between areas, time periods, events, and actions within the campus environment, resulting in incomplete event handling rules, poor adaptability, and difficulty in responding to dynamically changing campus scenarios.
[0077] In this embodiment of the invention, a multidimensional knowledge graph and real-time data stream of the target campus are acquired. The ontology structure of the multidimensional knowledge graph includes at least region nodes, time period nodes, event nodes, and action nodes. Based on the multidimensional knowledge graph and real-time data stream, campus event reasoning rules are generated through a large language model. The campus event reasoning rules include target region, target time period, target event, and target action corresponding to the target event. According to the campus event reasoning rules, physical devices within the target region are controlled to trigger target actions during the target time period to load and execute the handling algorithm corresponding to the target event. This invention generates campus event reasoning rules based on the multidimensional knowledge graph and real-time data stream of the target campus using a large language model, and controls physical devices within the target region to trigger target actions during the target time period to load and execute the handling algorithm corresponding to the target event. This solves the problem that existing solutions cannot capture the complex relationships between regions, time periods, events, and actions in the campus environment, resulting in incomplete coverage of event handling rules, poor adaptability, and difficulty in coping with dynamically changing campus scenarios.
[0078] It is understood that in the specific implementation of this application, data such as graph data, data stream data, and inference data are involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required. Furthermore, the collection, use, and processing of related data, as well as the training, deployment, and invocation of algorithm models, must comply with the relevant laws, regulations, and standards of the relevant countries and regions.
[0079] Optionally, in the step of obtaining the multidimensional knowledge graph of the target campus, the following steps can be taken: obtain the spatial GIS model and equipment topology file of the target campus, and construct regional nodes based on the spatial GIS model and equipment topology file; divide the continuous timeline into discrete time slices based on the operating cycle of the target campus to construct time period nodes; cluster historical alarm records and campus management business logic to extract the event types that need to be monitored and construct event nodes; obtain the software and hardware execution capabilities and available algorithm sets supported by physical equipment, generate the corresponding equipment instruction sets, and construct action nodes; establish mapping edges with feature weights between regional nodes, time period nodes, event nodes, and action nodes to generate a multidimensional knowledge graph.
[0080] In this embodiment of the invention, the above-mentioned spatial GIS model can be a geographic information system model of the target campus. The spatial GIS model includes the spatial location, outline boundary, floor division and internal room distribution of various entities such as buildings, roads, squares, and green spaces within the campus.
[0081] The aforementioned device topology file can be a structured data file that records the installation location, network connection relationship, device type, communication protocol, and hierarchical relationship between various physical devices within the target campus.
[0082] The aforementioned regional nodes can be constructed based on spatial GIS models and equipment topology files, including teaching buildings, canteens, dormitories, playgrounds, corridors, classrooms, etc.
[0083] Furthermore, by constructing regional nodes using spatial GIS models and equipment topology files, campus physical space and equipment deployment information can be modeled in a unified manner within the same knowledge framework. Regional nodes carry geospatial information and are associated with all physical devices deployed within the corresponding area, providing accurate spatial positioning and device addressing, and avoiding regional ambiguity and miscontrol of equipment caused by the separation of spatial information and equipment information.
[0084] The aforementioned operating cycle can be the regular time pattern of the target campus in daily life, such as the daily schedule based on a day, a week, or a semester. The schedule includes get out of class start and end times, meal times, morning and evening self-study times, holiday arrangements, etc.
[0085] The aforementioned discrete time slices can be created by dividing a continuous timeline into several non-overlapping time intervals with semantic meaning, based on the operating cycle of the target campus. Discrete time slices could include periods such as the first class from 8:00 to 8:45, lunch break from 12:00 to 13:30, and evening self-study from 19:00 to 21:00.
[0086] The aforementioned time slots can be constructed by dividing the continuous timeline into discrete time slices based on the operating cycle of the target campus. For example, the first class is from 8:00 to 8:45, the lunch break is from 12:00 to 13:30, and the evening self-study period is from 19:00 to 21:00.
[0087] Understandably, there are significant differences in personnel density, activity types, and equipment usage status on campus at different times. By dividing the continuous timeline into discrete time slices based on the target campus's operational cycle, and constructing time-segment nodes, a temporal context constraint is introduced into event reasoning. This allows the large language model to perceive the current time context during reasoning, generate reasoning rules adapted to the time segments, and improve the adaptability of the reasoning results to the actual rhythm of campus operations.
[0088] The aforementioned historical alarm records can be logs of abnormal events reported by various physical devices or manually on the target campus in the past. Each record should contain at least the time of the event, the area where the event occurred, and the corresponding event type.
[0089] The aforementioned campus management business logic can include the various rules and regulations, emergency response plans, and daily management processes formulated by the target campus during the management process.
[0090] The above event types can be classification labels defined for various event conditions. Event types include personnel gathering type, abnormal intrusion type, equipment failure type, etc.
[0091] The aforementioned event nodes can be constructed by extracting the event types that need to be monitored based on clustered historical alarm records and campus management business logic, thus identifying the types of campus events that require monitoring and handling. Constructing event nodes through clustered historical alarm records and campus management business logic achieves dual event type coverage through both data-driven and rule-driven approaches, avoiding new event blind spots caused by relying solely on historical data.
[0092] The hardware and software execution capabilities supported by the aforementioned physical devices can be the physical operations that each physical device on campus can perform at the hardware level, as well as the functional modules that can be called at the software level. Physical operations include turning on, turning off, adjusting, and playing.
[0093] The aforementioned collection of available algorithms may be a library of processing algorithms that are mounted on various physical devices or can be accessed via the network. Different physical devices may support different types and numbers of processing algorithms depending on their hardware configuration and software environment.
[0094] The aforementioned device instruction set can be a set of control instructions that can be recognized and executed by the device by converting the hardware and software execution capabilities and available algorithms supported by the physical device.
[0095] The aforementioned action nodes can represent actions that physical equipment can perform, such as activating the sprinkler system in Zone B or triggering a building-wide emergency broadcast. Specifically, action nodes are constructed using the hardware and software capabilities of the physical equipment and a set of available algorithms, ensuring that each action node has clear executability.
[0096] The aforementioned feature weights can be numerical measures used to quantify the strength of the association between two nodes.
[0097] The aforementioned mapping edge can be a graph data structure edge used to connect two nodes of different categories.
[0098] The aforementioned multidimensional knowledge graph can be generated by establishing mapping edges with feature weights between region nodes, time period nodes, event nodes, and action nodes.
[0099] It should be noted that by establishing mapping edges with feature weights between regional nodes, time period nodes, event nodes, and action nodes, the scattered handling experiences on campus are transformed into a quantifiable multidimensional knowledge graph. Feature weights can make the collaborative effectiveness between different nodes numerically represent, and can provide priority judgment and confidence assessment when generating rules, thereby improving the interpretability and accuracy of the subsequent reasoning process.
[0100] Optionally, in the step of establishing mapping edges with feature weights between region nodes, time period nodes, event nodes, and action nodes to generate a multidimensional knowledge graph, historical equipment scheduling logs and event handling records of the target campus can be obtained; from the historical equipment scheduling logs and event handling records, closed-loop data chains of successfully executed collaborative scheduling are extracted and parsed into business quadruplets containing historical occurrence area, historical occurrence time period, historical triggering event, and historical execution action; the co-occurrence frequency of each business quadruplet within a preset period is counted, and the task success rate of the corresponding physical device when executing historical execution actions is extracted; the spatial collaboration confidence is jointly calculated based on the co-occurrence frequency and task success rate, and the spatial collaboration confidence is used as the feature weight; according to the association structure within the business quadruplets, connection lines are instantiated between the corresponding region nodes, time period nodes, event nodes, and action nodes in the multidimensional knowledge graph, and feature weights are assigned to the corresponding connection lines to generate a multidimensional knowledge graph.
[0101] In this embodiment of the invention, the aforementioned historical device scheduling log can be a complete log file recorded by the campus management system during the past operation of the target campus regarding the invocation and execution of operations of various physical devices. Each log entry includes at least the instruction issuance time, target device identifier, target area identifier, the content of the executed action instruction, and feedback status information after the device execution.
[0102] The aforementioned incident handling records can be a complete archive of the handling of every campus incident recorded by the campus management system during the past operation of the target campus. Each record must include at least the following fields: incident time, incident type, location of occurrence, alarm level, description of the handling process, handling result, and handling completion time.
[0103] The aforementioned closed-loop data chain for successful collaborative scheduling can be a complete data chain starting from the initial triggering of an event, through the system or manual issuance of equipment action commands, to the successful execution of the corresponding commands by the physical equipment, and finally to the restoration of event scenario indicators to the safety threshold. The closed-loop data chain for successful collaborative scheduling fully records the entire process of event triggering, action issuance, equipment execution, and event resolution.
[0104] The aforementioned business quadruple can be a structured knowledge group extracted from a closed-loop data chain of successfully executed collaborative scheduling, containing historical occurrence regions, historical occurrence time periods, historical triggering events, and historical execution actions. Each business quadruple represents a complete collaborative experience of a historically successful event occurring in a specific region, during a specific time period, and with the execution of a specific action.
[0105] The aforementioned preset period can be a pre-set statistical time window, such as the past 30 days, the past semester, or the past year. The preset period can also be a time window range used to perform co-occurrence frequency statistics and task success rate calculations for historical business quadruples. Furthermore, the preset period can be a time boundary condition for filtering historical device scheduling logs and event handling records, or it can be used for statistical calculations of closed-loop data chains generated within the preset period.
[0106] The co-occurrence frequency mentioned above can be the total number of times each business quadruple is observed in the historical records of successful collaborative scheduling within a preset period. The co-occurrence frequency reflects how frequently the business quadruple is adopted and verified in actual operation. The higher the co-occurrence frequency, the more common the applicable scenarios of the corresponding business quadruple and the more times it is verified.
[0107] The task success rate mentioned above can be defined as the proportion of times the corresponding physical device successfully completes the action and returns a valid success status feedback after issuing the instruction, out of the total number of times the corresponding action instruction is issued, when executing historical actions in each business quadruple. The task success rate reflects the reliability and robustness of the corresponding action at the physical execution level. The higher the task success rate, the lower the failure rate and the more reliable the device is when executing the corresponding action.
[0108] The aforementioned spatial collaboration confidence score can be a numerical indicator calculated jointly by co-occurrence frequency and task success rate. Spatial collaboration confidence score is used to characterize the spatial and logical credibility of the collaboration relationship represented by the corresponding quadruple. The higher the spatial collaboration confidence score, the more frequently and successfully the collaboration relationship represented by the corresponding quadruple has been verified in history, and the higher the reliability of the physical device execution.
[0109] The aforementioned feature weights can be spatial collaborative confidence calculated by combining co-occurrence frequency and task success rate. The feature weights are used to characterize the collaborative reliability between the nodes connected by the mapping edge.
[0110] The aforementioned association structure can be a mapping relationship between historical occurrence areas, historical occurrence periods, historical triggering events, and historical execution actions in the business quadruple.
[0111] The instantiated connection lines mentioned above can be directed or undirected graph edges actually created between the corresponding region nodes, time period nodes, event nodes, and action nodes based on the association structure of the business quadruple.
[0112] It should be noted that by matching and extracting the closed-loop data chain of successfully executed collaborative scheduling from historical device scheduling logs and event handling records, it is ensured that feature weights are calculated only based on successful collaborative scheduling samples, avoiding contamination of statistical results by failed samples. Spatial collaborative confidence is calculated jointly by co-occurrence frequency and task success rate, and used as a feature weight. Spatial collaborative confidence reflects both availability and effectiveness, providing a more comprehensive and accurate assessment than a single-dimensional evaluation.
[0113] Optionally, in the step of matching and extracting the closed-loop data chain of successfully executed collaborative scheduling from historical device scheduling logs and event handling records, the historical device scheduling logs and event handling records can be spatiotemporally aligned based on timestamps and spatial identifiers; in the aligned data sequence, the initial trigger record of the feature event is identified, and the corresponding device action command issuance record is retrieved within the preset response time window immediately following the initial trigger record; the physical device execution feedback status corresponding to the device action command issuance record is obtained, and after confirming that the physical device has executed successfully, the scene indicator monitoring value of the feature event within the preset evaluation time window is extracted; if the scene indicator monitoring value meets the preset event elimination threshold or steady-state recovery condition within the preset evaluation time window, the collaborative scheduling is determined to be successful, and the initial trigger record and device action command issuance record with temporal correlation, together with the corresponding occurrence area and time period, are extracted as the closed-loop data chain of successfully executed collaborative scheduling.
[0114] In this embodiment of the invention, the timestamp can be the time stamp information contained in each historical device scheduling log or event handling record. The timestamp is used to record the specific time when each log or record was generated.
[0115] The aforementioned spatial identifier can be spatial location marker information contained in each historical equipment scheduling log or event handling record. The spatial identifier is used to identify the physical area of the campus associated with each record.
[0116] The aforementioned spatiotemporal alignment process can be a standardized process for historical device scheduling logs and event handling records from different devices, applied uniformly in both time and spatial dimensions. The time dimension alignment includes standardizing timestamp formats, precision, and time zone references; the spatial dimension alignment includes mapping different region identifiers to a unified region space. Through spatiotemporal alignment, historical device scheduling logs and event handling records from different devices can be correlated and matched within the same spatiotemporal reference system.
[0117] The aligned data sequence can be a data sequence arranged in chronological order under a unified time base and a unified spatial reference system, obtained by performing spatiotemporal alignment processing on historical equipment scheduling logs and event handling records based on timestamps and spatial coordinates.
[0118] The aforementioned initial trigger record can be a log record in the aligned data sequence where the feature event is first identified and recorded in the database. The initial trigger record is used to record the starting point when the feature event transitions from a state of never occurring to a state of occurring.
[0119] The aforementioned preset response time window can be a pre-set response time window, which can be the maximum allowed time interval between the initial triggering of a feature event and the issuance of the corresponding device action command.
[0120] The aforementioned equipment action command issuance records can be log records generated manually by the campus control system or administrators in the equipment scheduling log, indicating the issuance of control commands to physical devices. These records include the target device identifier, command type, command parameters, and issuance time.
[0121] The aforementioned physical device execution feedback status can be a feedback signal returned to the system by the physical device after receiving an action command, indicating the execution result. Physical device execution feedback statuses include: execution successful, execution failed, device offline, and timeout without response.
[0122] The aforementioned preset evaluation time window can be a pre-set evaluation time window. The evaluation time window can be the allowed time range from when the physical equipment confirms successful execution to when the final evaluation of the event resolution effect is carried out.
[0123] The aforementioned scenario indicator monitoring values can be monitoring data reflecting the campus environmental status continuously collected and reported by environmental sensors deployed in various areas of the campus during operation. Scenario indicator monitoring values include temperature, smoke concentration, noise levels (decibels), vibration intensity, and harmful gas concentration. Environmental sensors include temperature sensors, smoke sensors, and noise sensors.
[0124] The aforementioned event elimination threshold can be a preset event elimination threshold. It is understood that when the monitored value of the scene indicator drops below the event elimination threshold, it indicates that the corresponding event has been effectively controlled or eliminated.
[0125] The aforementioned steady-state recovery condition can be that the monitored value of the scenario indicator remains stable below the event elimination threshold for a continuous period of time within a preset evaluation time window, without any rebound or fluctuation.
[0126] The aforementioned closed-loop data chain can be the complete data chain of successful collaborative scheduling extracted from the initial trigger record and equipment action command issuance record that have time sequence correlation, along with the corresponding occurrence area and time period, when the collaborative scheduling is determined to be successful.
[0127] It should be noted that performing spatiotemporal alignment processing on historical device scheduling logs and event handling records based on timestamps and spatial identifiers allows for comparison and correlation of historical device scheduling logs and event handling records in different formats under a unified time and space reference framework, avoiding spatiotemporal inconsistencies. Within a preset response time window following the initial trigger record, the corresponding device action command issuance record is retrieved, and the successful execution of the device is confirmed by obtaining the physical device execution feedback status, effectively eliminating irrelevant interference commands and invalid commands that were not actually executed after issuance. When the scene indicator monitoring value meets the preset event elimination threshold or steady-state recovery condition within the preset evaluation time window, the collaborative scheduling is determined to be successful. The initial trigger record and device action command issuance record with temporal correlation, along with the corresponding occurrence area and time period, are extracted into a closed-loop data chain for successful collaborative scheduling. This ensures that each extracted closed-loop data chain has clear evidence of handling effect, guaranteeing the reliability of the closed-loop data chain.
[0128] Optionally, in the step of jointly calculating the spatial collaboration confidence based on co-occurrence frequency and task success rate, all business logs containing the same historical occurrence area, the same historical occurrence time period, and the same historical triggering event within a preset period can be aggregated to obtain the total frequency of environmental triggers; the ratio of the co-occurrence frequency of the business quadruple to the total frequency of environmental triggers can be calculated to obtain the conditional call probability of the historical execution action under the corresponding spatiotemporal event; for the historical execution actions in the business quadruple, the number of effective responses of the corresponding physical device after the instruction is issued can be counted, and the ratio of the number of effective responses to the total number of instruction issuances can be calculated to obtain the task success rate; the product or weighted sum of the conditional call probability and the task success rate can be calculated through a preset weighted fusion strategy, and the result of the fusion calculation can be mapped to a preset confidence interval using a normalization function to obtain the spatial collaboration confidence corresponding to the business quadruple.
[0129] In this embodiment of the invention, the preset period can be a pre-set statistical time window, such as the past 30 days, the past semester, or the past year.
[0130] The aforementioned business logs can be log records of the same historical occurrence area, the same historical occurrence time period, and the same historical triggering event recorded within a preset period.
[0131] The total frequency of the aforementioned environment triggers can be obtained by aggregating all business logs containing the same historical occurrence area, the same historical occurrence time period, and the same historical triggering event within a preset period, and then calculating the total number of environment triggers.
[0132] The aforementioned conditional invocation probability can be the conditional probability value of a historical execution action being invoked and issued under the condition that the historical occurrence area, historical occurrence time period, and historical triggering event all occur simultaneously.
[0133] The aforementioned number of valid responses can be the number of times the physical device successfully completes the action operation after issuing a command, within a preset period, for historically executed actions.
[0134] The total number of commands issued can be the total number of times control commands are issued to the corresponding physical devices for historical actions within a preset period.
[0135] The task success rate mentioned above can be the percentage of historical actions that were successfully executed within a preset period. This success rate can be obtained by calculating the ratio of valid responses to the total number of commands issued. The task success rate is used to quantify the reliability of the physical device corresponding to the action when performing the corresponding operation.
[0136] The aforementioned preset weighted fusion strategy can be a pre-defined weighted fusion strategy. The weighted fusion strategy is used to multiply or sum the conditional call probability and the task success rate. The weighted fusion strategy can be a product operation, a weighted sum operation, etc.
[0137] The above-mentioned product can be an operation that directly multiplies the conditional call probability and the task success rate. The above-mentioned weighted sum can be an operation that multiplies the conditional call probability and the task success rate by their respective weight coefficients and then adds them together.
[0138] The above normalization function is used to map any input real number or positive real number value to a standard numerical range, so as to eliminate the numerical scale differences caused by different calculation methods or different data distributions.
[0139] The aforementioned preset confidence interval can be a pre-set confidence interval. The confidence interval can be [0, 1], [0, 100], etc.
[0140] It should be noted that by calculating the ratio of the co-occurrence frequency of business quadruples to the total frequency of environmental triggers, the conditional invocation probability of historical execution actions under corresponding spatiotemporal events is obtained, effectively avoiding the interference of event occurrence frequency on co-occurrence frequency. Furthermore, by using a weighted fusion algorithm, the confidence calculation method is configurable and adjustable, enhancing the adaptability of this invention in different campus deployment environments. By mapping the fusion calculation results to a preset confidence interval using a normalization function, the spatial collaborative confidence of all business quadruples is made uniform, avoiding inference bias caused by scale differences.
[0141] Optionally, in the step of generating campus event reasoning rules based on a multidimensional knowledge graph and real-time data stream using a large language model, the real-time data stream can be parsed to extract real-time scene indicators of the currently triggered event, and the matching current region node, current time period node, and current event node can be mapped and activated in the multidimensional knowledge graph. Taking the activated current region node, current time period node, and current event node as the addressing starting point, the nodes are traversed in descending order of the feature weights of the connected mapping edges to extract candidate action nodes within a preset number of hops, thereby generating a dynamic association subgraph containing the context of real-time scene indicators. The topology and node-level attribute information within the dynamic association subgraph are serialized into graph structure description text, and the graph structure description text is concatenated and encapsulated with the real-time data stream to form a structured prompt word for the large language model. The structured prompt word for the large language model is input into the large language model, and the large language model performs logical inference based on the weight distribution in the graph structure description text, outputting the target action with the highest matching degree and its corresponding device execution parameters to generate campus event reasoning rules.
[0142] In this embodiment of the invention, the aforementioned real-time scene indicators can be monitoring values of the real-time environmental state extracted from the real-time data stream. Real-time scene indicators can include real-time temperature values, real-time smoke concentration values, real-time noise decibel values, real-time personnel density values, etc.
[0143] The aforementioned current region node can be a region node in a multidimensional knowledge graph that matches the spatial location information of the real-time data stream. The current region node can also be the physical space where the current event occurred.
[0144] The aforementioned current time period node can be a time period node in the multidimensional knowledge graph that matches the discrete time slice corresponding to the current system time. The current time period node can be the time interval in which the current event occurred.
[0145] The aforementioned current event node can refer to an event node in the multidimensional knowledge graph that matches the triggering event type indicated by the real-time data stream. The current event node can be the currently corresponding event type.
[0146] The aforementioned addressing starting point can be a node in the multidimensional knowledge graph, with the currently activated current region node, current time period node, and current event node as the starting position for traversal and search.
[0147] The preset number of hops can be a pre-set number of hops. The number of hops can be the number of steps taken to expand outwards along the mapping edge from the addressing starting point. The preset number of hops can be 2 hops, 3 hops, etc.
[0148] The aforementioned candidate action nodes can be selected from action nodes within a preset hop range extracted by traversing the connected mapping edges from the addressing starting point in descending order of feature weights. Candidate action nodes can be candidate actions to be executed under the current spatiotemporal event conditions.
[0149] The aforementioned dynamic association subgraph can be a subset of graph structures containing real-time scene indicator context, formed by candidate action nodes within a preset hop count range.
[0150] The graph structure description text mentioned above can be obtained by converting the topological structure and node-level attribute information within the dynamically associated subgraph into structured language text using a serialization format. This graph structure description text is used to enable large language models to receive and understand graph structure information in text form.
[0151] The structured prompt words of the aforementioned large language model can be a sequence of prompt words with clear semantic segmentation and task instruction constraints, formed by splicing and encapsulating graph structure description text with real-time data stream.
[0152] The above logical inference can be a process of performing analysis based on the weight distribution in the text described by the large language model according to the graph structure.
[0153] The aforementioned device execution parameters can be parameter values used to guide the physical device in performing operations. Device execution parameters can include the target device address, execution action intensity parameters, duration, execution mode, etc.
[0154] The aforementioned campus event reasoning rules can be implemented by using a large language model to perform logical inference based on the weight distribution in the graph structure description text, and outputting the target action with the highest matching degree and its corresponding device execution parameters.
[0155] In this embodiment of the invention, by extracting real-time scene indicators of the currently triggered event from the real-time data stream and mapping and activating matching current region nodes, current time period nodes, and current event nodes in the multi-dimensional knowledge graph, the static knowledge of the knowledge graph can be dynamically activated as the real-time data changes. Dynamically associated subgraphs are generated in real-time according to the current scene, ensuring that the large language model does not experience truncation or information loss due to excessively long context during processing. By concatenating graph structure description text with the real-time data stream to encapsulate it into structured prompts for the large language model, the graph structure description text enables the large language model to clearly understand the connection relationships between nodes, weight ranking, and attribute information of candidate actions, avoiding model comprehension errors caused by the format difference between graph structure data and unstructured natural language.
[0156] Optionally, after controlling the physical devices in the target area to trigger target actions during the target time period according to the campus event inference rules, so as to load and execute the handling algorithm corresponding to the target event, the continuous environmental monitoring value sequence of the physical devices after executing the handling algorithm can be collected by IoT sensors deployed in the target area; it can be determined whether the fluctuation curve of the continuous environmental monitoring value sequence within the preset observation period converges to the calming threshold of the target event; if it does not converge to the calming threshold, it is determined that the current inference rule is not applicable, and the feature weights of the corresponding mapping edges between the current region node, the current time period node, the current event node and the target action node are reduced in the multidimensional knowledge graph according to the decay penalty coefficient; if it converges to the calming threshold, it is determined that the current inference rule is valid, and the feature weights of the corresponding mapping edges are increased in the multidimensional knowledge graph according to the positive reinforcement coefficient, so as to realize the adaptive iterative update of the inference base of the large language model.
[0157] In this embodiment of the invention, the aforementioned preset observation period can be a pre-set observation period, which specifies the duration for which environmental monitoring value sequences need to be continuously collected and observed. The length of the preset observation period can be set according to the differences in environmental response characteristics of different event types.
[0158] The pacing threshold for the aforementioned target event can be a pre-set pacing threshold corresponding to the target event. The pacing threshold is used to determine whether the campus environment has returned to normal and safe status.
[0159] The above fluctuation curves reflect the changing trends of environmental indicators over time after the execution of the disposal algorithm.
[0160] The aforementioned attenuation penalty coefficient can be a positive number less than 1, such as 0.9, 0.89, etc.
[0161] The aforementioned positive reinforcement coefficient can be a positive number greater than 1, such as 1.05, 1.1, etc.
[0162] It should be noted that IoT sensors deployed in the target area can collect continuous environmental monitoring value sequences after the physical devices execute the processing algorithm. The system can then determine whether the fluctuation curve of the continuous environmental monitoring value sequence within a preset observation period converges to the calming threshold of the target event. If it does not converge to the calming threshold, the current inference rule is deemed inapplicable, and the feature weights of the corresponding mapping edges between the current region node, current time period node, current event node, and target action node are reduced in the multidimensional knowledge graph according to the decay penalty coefficient. If it converges to the calming threshold, the current inference rule is deemed valid, and the feature weights of the corresponding mapping edges are increased in the multidimensional knowledge graph according to the positive reinforcement coefficient. This enables adaptive iterative updates of the large language model inference base, allowing it to adapt to the rapidly changing dynamic environment of campus operations.
[0163] like Figure 2 As shown, an embodiment of the present invention provides a campus event reasoning device, which includes:
[0164] The acquisition module 201 is used to acquire the multidimensional knowledge graph of the target campus and the real-time data stream. The ontology structure of the multidimensional knowledge graph includes at least region nodes, time period nodes, event nodes and action nodes.
[0165] The generation module 202 is used to generate campus event reasoning rules based on the multidimensional knowledge graph and the real-time data stream through a large language model. The campus event reasoning rules include target area, target time period, target event, and target action corresponding to the target event.
[0166] The execution module 203 is used to control the physical devices in the target area to trigger the target action during the target time period according to the campus event reasoning rules, so as to load and execute the handling algorithm corresponding to the target event.
[0167] Optionally, the acquisition module 201 acquires the spatial GIS model and equipment topology file of the target campus, and constructs the regional nodes based on the spatial GIS model and the equipment topology file; based on the operating cycle of the target campus, it divides the continuous timeline into discrete time slices to construct the time period nodes; it clusters historical alarm records and campus management business logic, extracts the event types that need to be monitored, and constructs the event nodes; it acquires the software and hardware execution capabilities and available algorithm set supported by the physical equipment, generates the corresponding equipment instruction set, and constructs the action nodes; it establishes mapping edges with feature weights between the regional nodes, the time period nodes, the event nodes, and the action nodes to generate the multidimensional knowledge graph.
[0168] Optionally, the acquisition module 201 is further configured to acquire historical equipment scheduling logs and event handling records of the target campus; extract closed-loop data chains of successfully executed collaborative scheduling from the historical equipment scheduling logs and event handling records, and parse the closed-loop data chains into business quadruples containing historical occurrence area, historical occurrence time period, historical triggering event, and historical execution action; count the co-occurrence frequency of each business quadruple within a preset period, and extract the task success rate of the corresponding physical device when executing the historical execution action; calculate the spatial collaboration confidence based on the co-occurrence frequency and the task success rate, and use the spatial collaboration confidence as the feature weight; instantiate connection lines between the corresponding area nodes, time period nodes, event nodes, and action nodes in the multidimensional knowledge graph according to the association structure within the business quadruples, and assign the feature weights to the corresponding connection lines to generate the multidimensional knowledge graph.
[0169] Optionally, the acquisition module 201 is further configured to perform spatiotemporal alignment processing on the historical device scheduling log and the event handling record based on timestamps and spatial identifiers; in the aligned data sequence, identify the initial trigger record of the feature event, and retrieve the corresponding device action command issuance record within a preset response time window immediately following the initial trigger record; obtain the physical device execution feedback status corresponding to the device action command issuance record, and after confirming that the physical device has executed successfully, extract the scene index monitoring value of the feature event within a preset evaluation time window; if the scene index monitoring value meets a preset event elimination threshold or steady-state recovery condition within the preset evaluation time window, it is determined that the collaborative scheduling is successful, and the initial trigger record and the device action command issuance record with temporal correlation, together with the corresponding occurrence area and time period, are extracted as the closed-loop data chain of the successful execution of collaborative scheduling.
[0170] Optionally, the acquisition module 201 is further configured to aggregate all business logs containing the same historical occurrence area, the same historical occurrence time period, and the same historical triggering event within the preset period, and statistically obtain the total frequency of environmental triggers; calculate the ratio of the co-occurrence frequency of the business quadruple to the total frequency of environmental triggers to obtain the conditional call probability of the historical execution action under the corresponding spatiotemporal event; for the historical execution action in the business quadruple, statistically analyze the number of effective responses of the corresponding physical device after the instruction is issued, and calculate the ratio of the number of effective responses to the total number of instruction issuances to obtain the task success rate; calculate the product or weighted sum of the conditional call probability and the task success rate through a preset weighted fusion strategy, and use a normalization function to map the result of the fusion calculation to a preset confidence interval to obtain the spatial collaborative confidence degree corresponding to the business quadruple.
[0171] Optionally, the generation module 202 is further configured to parse the real-time data stream, extract the real-time scene indicators of the currently triggered event, and map and activate matching current region nodes, current time period nodes, and current event nodes in the multi-dimensional knowledge graph; using the activated current region nodes, current time period nodes, and current event nodes as addressing starting points, traverse the connected mapping edges in descending order of feature weights to extract candidate action nodes within a preset number of hops, thereby generating a dynamic association subgraph containing the context of the real-time scene indicators; serialize the topology and node-level attribute information within the dynamic association subgraph into graph structure description text, and concatenate the graph structure description text with the real-time data stream to encapsulate it into a large language model structured prompt; input the large language model structured prompt into the large language model, and perform logical inference based on the weight distribution in the graph structure description text through the large language model, outputting the target action with the highest matching degree and its corresponding device execution parameters to generate the campus event inference rule.
[0172] Optionally, the device is further configured to collect a continuous environmental monitoring value sequence of the physical device after executing the processing algorithm by using IoT sensors deployed in the target area; determine whether the fluctuation curve of the continuous environmental monitoring value sequence within a preset observation period converges to the calming threshold of the target event; if it does not converge to the calming threshold, it is determined that the current inference rule is not applicable, and the feature weights of the corresponding mapping edges between the current region node, the current time period node, the current event node and the target action node are reduced in the multidimensional knowledge graph according to the decay penalty coefficient; if it converges to the calming threshold, it is determined that the current inference rule is valid, and the feature weights of the corresponding mapping edges are increased in the multidimensional knowledge graph according to the positive reinforcement coefficient, so as to realize the adaptive iterative update of the inference base of the large language model.
[0173] like Figure 3 As shown, this embodiment of the invention also provides an electronic device, including a processor, which can execute any of the above-described campus event reasoning methods.
[0174] Specifically, it includes a processor 301 and a memory 302, as well as a computer program stored in the memory 302 and capable of running on the processor 301 to execute campus event reasoning methods, wherein:
[0175] The processor 301 executes the calculator program containing the campus event reasoning method stored in memory 302, performing the following steps:
[0176] Acquire a multidimensional knowledge graph and real-time data stream of the target campus. The ontology structure of the multidimensional knowledge graph includes at least region nodes, time period nodes, event nodes, and action nodes.
[0177] Based on the multidimensional knowledge graph and the real-time data stream, campus event reasoning rules are generated through a large language model. The campus event reasoning rules include target area, target time period, target event, and target action corresponding to the target event.
[0178] According to the campus event reasoning rules, the physical devices in the target area are controlled to trigger the target action during the target time period, so as to load and execute the handling algorithm corresponding to the target event.
[0179] Optionally, the process of obtaining the multidimensional knowledge graph of the target campus executed by processor 301 includes:
[0180] Obtain the spatial GIS model and equipment topology file of the target campus, and construct the regional nodes based on the spatial GIS model and the equipment topology file;
[0181] Based on the operating cycle of the target campus, the continuous timeline is divided into discrete time slices to construct the time period nodes;
[0182] Cluster historical alarm records and campus management business logic, extract the event types that need to be monitored, and construct the event nodes;
[0183] Obtain the set of software and hardware execution capabilities and available algorithms supported by the physical device, generate the corresponding device instruction set, and construct the action node;
[0184] A mapping edge with feature weights is established between the region node, the time period node, the event node, and the action node to generate the multidimensional knowledge graph.
[0185] Optionally, the processor 301 executes the step of establishing a mapping edge with feature weights between the region node, the time period node, the event node, and the action node to generate the multidimensional knowledge graph, including:
[0186] Obtain the historical equipment scheduling logs and event handling records of the target campus;
[0187] The closed-loop data chain of successfully executed collaborative scheduling is extracted from the historical device scheduling log and the event handling record, and the closed-loop data chain is parsed into a business quadruple containing the historical occurrence area, historical occurrence time period, historical triggering event and historical execution action;
[0188] The co-occurrence frequency of each of the aforementioned business quadruples within a preset period is calculated, and the task success rate of the corresponding physical device when executing the historical execution action is extracted.
[0189] The spatial co-occurrence confidence is calculated jointly based on the co-occurrence frequency and the task success rate, and the spatial co-occurrence confidence is used as the feature weight.
[0190] Based on the association structure within the business quadruple, connection lines are instantiated between the corresponding region nodes, time period nodes, event nodes, and action nodes in the multidimensional knowledge graph, and the feature weights are assigned to the corresponding connection lines to generate the multidimensional knowledge graph.
[0191] Optionally, the step of processor 301 executing the step of matching and extracting the closed-loop data chain of successfully executed collaborative scheduling from the historical device scheduling log and the event handling record includes:
[0192] Based on timestamps and spatial identifiers, the historical device scheduling logs and the event handling records are spatiotemporally aligned.
[0193] In the aligned data sequence, the initial trigger record of the feature event is identified, and within the preset response time window immediately following the initial trigger record, the corresponding device action command issuance record is retrieved;
[0194] Obtain the physical device execution feedback status corresponding to the device action command issuance record, and after confirming that the physical device has executed successfully, extract the scene index monitoring value of the feature event within a preset evaluation time window;
[0195] If the monitored value of the scenario indicator meets the preset event elimination threshold or steady-state recovery condition within the preset evaluation time window, it is determined that the collaborative scheduling is successful, and the initial trigger record and the device action command issuance record that have time sequence correlation, together with the corresponding occurrence area and time period, are extracted as the closed-loop data chain of the successful execution of collaborative scheduling.
[0196] Optionally, the process of calculating the spatial cooperative confidence based on the co-occurrence frequency and the task success rate, executed by processor 301, includes:
[0197] Aggregate all business logs containing the same historical occurrence area, the same historical occurrence time period, and the same historical triggering event within the preset period, and calculate the total frequency of environmental triggers.
[0198] Calculate the ratio of the co-occurrence frequency of the business quadruple to the total frequency of environmental triggers to obtain the conditional invocation probability of the historical execution action under the corresponding spatiotemporal event;
[0199] For the historical execution actions in the business quadruple, the number of effective responses from the corresponding physical device after the instruction is issued is counted, and the ratio of the number of effective responses to the total number of instruction issuances is calculated to obtain the task success rate.
[0200] The product or weighted sum of the conditional call probability and the task success rate is calculated using a preset weighted fusion strategy, and the result of the fusion calculation is mapped to a preset confidence interval using a normalization function to obtain the spatial collaborative confidence degree corresponding to the business quadruple.
[0201] Optionally, the processor 301 executes the generation of campus event reasoning rules based on the multidimensional knowledge graph and the real-time data stream through a large language model, including:
[0202] The real-time data stream is parsed, real-time scene indicators of the current triggered event are extracted, and the matching current region node, current time period node and current event node are mapped and activated in the multi-dimensional knowledge graph.
[0203] Starting from the activated current region node, the current time period node, and the current event node, the system traverses the connected mapping edges in descending order of feature weights to extract candidate action nodes within a preset number of hops, thereby generating a dynamic association subgraph containing the context of the real-time scene indicators.
[0204] The topological structure and node-level attribute information within the dynamic associated subgraph are serialized into graph structure description text, and the graph structure description text is concatenated and encapsulated with the real-time data stream into a large language model structured prompt word.
[0205] The structured prompt words of the large language model are input into the large language model. The large language model performs logical inference based on the weight distribution in the graph structure describing the text, and outputs the target action with the highest matching degree and its corresponding device execution parameters to generate the campus event reasoning rule.
[0206] Optionally, after controlling the physical devices within the target area to trigger the target action during the target time period according to the campus event inference rule, so as to load and execute the handling algorithm corresponding to the target event, the method executed by the processor 301 further includes:
[0207] By using IoT sensors deployed in the target area, a continuous sequence of environmental monitoring values is collected from the physical devices after the processing algorithm is executed.
[0208] Determine whether the fluctuation curve of the continuous environmental monitoring value sequence within a preset observation period converges to the calming threshold of the target event;
[0209] If the convergence does not reach the calming threshold, the current inference rule is determined to be inapplicable, and the feature weights of the corresponding mapping edges between the current region node, the current time period node, the current event node and the target action node are reduced in the multidimensional knowledge graph according to the decay penalty coefficient.
[0210] If the convergence is reached at the settling threshold, the current inference rule is determined to be valid. In the multidimensional knowledge graph, the feature weights of the corresponding mapping edges are increased according to the positive reinforcement coefficient to achieve adaptive iterative updates of the inference base for the large language model.
[0211] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the campus event reasoning method provided in this invention and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0212] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principles described in this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for reasoning about campus events, characterized in that, The method includes the following steps: Acquire a multidimensional knowledge graph and real-time data stream of the target campus. The ontology structure of the multidimensional knowledge graph includes at least region nodes, time period nodes, event nodes, and action nodes. Based on the multidimensional knowledge graph and the real-time data stream, campus event reasoning rules are generated through a large language model. The campus event reasoning rules include target area, target time period, target event, and target action corresponding to the target event. According to the campus event reasoning rules, the physical devices in the target area are controlled to trigger the target action during the target time period, so as to load and execute the handling algorithm corresponding to the target event.
2. The campus event reasoning method as described in claim 1, characterized in that, The acquisition of the multidimensional knowledge graph of the target campus includes: Obtain the spatial GIS model and equipment topology file of the target campus, and construct the regional nodes based on the spatial GIS model and the equipment topology file; Based on the operating cycle of the target campus, the continuous timeline is divided into discrete time slices to construct the time period nodes; Cluster historical alarm records and campus management business logic, extract the event types that need to be monitored, and construct the event nodes; Obtain the set of software and hardware execution capabilities and available algorithms supported by the physical device, generate the corresponding device instruction set, and construct the action node; A mapping edge with feature weights is established between the region node, the time period node, the event node, and the action node to generate the multidimensional knowledge graph.
3. The campus event reasoning method as described in claim 2, characterized in that, The step of establishing weighted mapping edges with features between the region nodes, the time period nodes, the event nodes, and the action nodes to generate the multidimensional knowledge graph includes: Obtain the historical equipment scheduling logs and event handling records of the target campus; The closed-loop data chain of successfully executed collaborative scheduling is extracted from the historical device scheduling log and the event handling record, and the closed-loop data chain is parsed into a business quadruple containing the historical occurrence area, historical occurrence time period, historical triggering event and historical execution action; The co-occurrence frequency of each of the aforementioned business quadruples within a preset period is calculated, and the task success rate of the corresponding physical device when executing the historical execution action is extracted. The spatial co-occurrence confidence is calculated based on the co-occurrence frequency and the task success rate, and the spatial co-occurrence confidence is used as the feature weight. Based on the association structure within the business quadruple, connection lines are instantiated between the corresponding region nodes, time period nodes, event nodes, and action nodes in the multidimensional knowledge graph, and the feature weights are assigned to the corresponding connection lines to generate the multidimensional knowledge graph.
4. The campus event reasoning method as described in claim 3, characterized in that, The step of matching and extracting the closed-loop data chain of successfully executed collaborative scheduling from the historical device scheduling log and the event handling record includes: Based on timestamps and spatial identifiers, the historical device scheduling logs and the event handling records are spatiotemporally aligned. In the aligned data sequence, the initial trigger record of the feature event is identified, and within the preset response time window immediately following the initial trigger record, the corresponding device action command issuance record is retrieved; Obtain the physical device execution feedback status corresponding to the device action command issuance record, and after confirming that the physical device has executed successfully, extract the scene index monitoring value of the feature event within a preset evaluation time window; If the monitored value of the scenario indicator meets the preset event elimination threshold or steady-state recovery condition within the preset evaluation time window, it is determined that the collaborative scheduling is successful, and the initial trigger record and the device action command issuance record that have time sequence correlation, together with the corresponding occurrence area and time period, are extracted as the closed-loop data chain of the successful execution of collaborative scheduling.
5. The campus event reasoning method as described in claim 3, characterized in that, The calculation of spatial cooperation confidence based on the co-occurrence frequency and the task success rate includes: Aggregate all business logs containing the same historical occurrence area, the same historical occurrence time period, and the same historical triggering event within the preset period, and calculate the total frequency of environmental triggers. Calculate the ratio of the co-occurrence frequency of the business quadruple to the total frequency of environmental triggers to obtain the conditional invocation probability of the historical execution action under the corresponding spatiotemporal event; For the historical execution actions in the business quadruple, the number of effective responses from the corresponding physical device after the instruction is issued is counted, and the ratio of the number of effective responses to the total number of instruction issuances is calculated to obtain the task success rate. The product or weighted sum of the conditional call probability and the task success rate is calculated using a preset weighted fusion strategy, and the result of the fusion calculation is mapped to a preset confidence interval using a normalization function to obtain the spatial collaborative confidence degree corresponding to the business quadruple.
6. The campus event reasoning method as described in any one of claims 1 to 5, characterized in that, The generation of campus event reasoning rules based on the multidimensional knowledge graph and the real-time data stream using a large language model includes: The real-time data stream is parsed, real-time scene indicators of the current triggered event are extracted, and the matching current region node, current time period node and current event node are mapped and activated in the multi-dimensional knowledge graph. Starting from the activated current region node, the current time period node, and the current event node, the system traverses the connected mapping edges in descending order of feature weights to extract candidate action nodes within a preset number of hops, thereby generating a dynamic association subgraph containing the context of the real-time scene indicators. The topological structure and node-level attribute information within the dynamic associated subgraph are serialized into graph structure description text, and the graph structure description text is concatenated and encapsulated with the real-time data stream into a large language model structured prompt word. The structured prompt words of the large language model are input into the large language model. The large language model performs logical inference based on the weight distribution in the graph structure describing the text, and outputs the target action with the highest matching degree and its corresponding device execution parameters to generate the campus event reasoning rule.
7. The campus event reasoning method as described in any one of claims 1 to 5, characterized in that, After controlling physical devices within the target area to trigger the target action during the target time period according to the campus event inference rule, so as to load and execute the handling algorithm corresponding to the target event, the method further includes: By using IoT sensors deployed in the target area, a continuous sequence of environmental monitoring values is collected from the physical devices after the processing algorithm is executed. Determine whether the fluctuation curve of the continuous environmental monitoring value sequence within a preset observation period converges to the calming threshold of the target event; If the convergence does not reach the calming threshold, the current inference rule is determined to be inapplicable, and the feature weights of the corresponding mapping edges between the current region node, the current time period node, the current event node and the target action node are reduced in the multidimensional knowledge graph according to the decay penalty coefficient. If the convergence is reached at the settling threshold, the current inference rule is determined to be valid. In the multidimensional knowledge graph, the feature weights of the corresponding mapping edges are increased according to the positive reinforcement coefficient to achieve adaptive iterative updates of the inference base for the large language model.
8. A campus event reasoning device, characterized in that, The campus event reasoning device includes: The acquisition module is used to acquire the multidimensional knowledge graph of the target campus and the real-time data stream. The ontology structure of the multidimensional knowledge graph includes at least region nodes, time period nodes, event nodes and action nodes. The generation module is used to generate campus event reasoning rules based on the multidimensional knowledge graph and the real-time data stream through a large language model. The campus event reasoning rules include target area, target time period, target event, and target action corresponding to the target event. The execution module is used to control the physical devices in the target area to trigger the target action during the target time period according to the campus event reasoning rules, so as to load and execute the handling algorithm corresponding to the target event.
9. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the campus event reasoning method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the campus event reasoning method as described in any one of claims 1 to 7.