Urban fiber sensing event policy edge computing method based on rule engine

CN123011541APending Publication Date: 2026-10-30NANJING TOWNGAS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611519680.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-29
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0003]针对现有城市光纤传感事件策略边缘计算中规则逐条遍历匹配、规则更新时处理一致性不足以及结果批次汇聚不完善的问题,提供一种基于规则引擎的城市光纤传感事件策略边缘计算方法,通过光路通道标识映射策略槽位号,从本地规则库取出含条件槽、动作位和槽间依赖的边缘规则包,按槽间依赖传递槽值并生成动作触发位图,在规则包版本变化时通过版本随槽值向量传递和旧版本条件槽副本继续参与处理,并将动作触发位图与光纤传感事件片段绑定后写入边缘结果队列

Benefits of technology

通过光路通道标识映射策略槽位号,从本地规则库取出含条件槽、动作位和槽间依赖的边缘规则包,光纤传感事件片段的开始时刻、结束时刻、通道跨度和命中计数等时序特征写入条件槽,形成槽值向量,源条件槽的槽值按槽间依赖触发目标条件槽更新,目标条件槽关联的动作位写入位图缓存,沿依赖方向逐层传递后生成动作触发位图。该方式将规则条件组织为条件槽索引,动作项绑定至动作位,条件槽之间的依赖关系确定匹配状态传递路径,替代对规则条目的逐条遍历匹配,动作触发位图在一次传递过程中同时表示多个动作触发状态,减少边缘节点在光路通道数量增加时的匹配计算量,缩短事件到达至动作调用之间的延迟,并保留传递路径标识,使动作触发结果与匹配路径保持对应。规则包版本随槽值向量传递,本地规则库更新边缘规则包时生成新规则包版本和旧规则包版本,槽值向量进入条件槽时将携带的版本号与版本字段比对,版本号不同则将槽值向量绑定至旧规则包版本对应的条件槽副本,条件槽副本继续参与槽间依赖传递,并将新规则包版本写入事件策略结果。该方式使规则更新期间已经进入处理流程的事件继续使用旧版本条件槽集合完成匹配,避免规则切换造成条件判断前后不一致和动作触发错误,规则版本信息随事件策略结果输出。动作触发位图与光纤传感事件片段的事件片段标识绑定,按节点编号写入边缘结果队列,达到批量阈值时按批次号合并为边缘策略批次包,降低结果回传和汇聚开销,可按规则版本和批次号追踪事件策略结果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123011541A_ABST
    Figure CN123011541A_ABST
Patent Text Reader

Abstract

The application discloses a city optical fiber sensing event policy edge computing method based on a rule engine and belongs to the technical field of optical fiber sensing event policy edge computing. An edge node receives an optical fiber sensing event fragment and an optical path channel identifier, maps the optical path channel identifier into a policy slot number, takes an edge rule package containing a condition slot, an action bit and slot interdependence from a local rule library, writes time sequence characteristics of the optical fiber sensing event fragment into the condition slot to obtain a slot value vector, generates an action trigger bitmap according to slot value transmission of the slot interdependence, calls the edge action according to the action trigger bitmap and outputs an event policy result, and the version of the edge rule package is transmitted with the slot value vector, and the action trigger bitmap is written into an edge result queue after being bound with the optical fiber sensing event fragment. Slot transmission and version consistency of edge side rule matching are realized, and rule matching cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of edge computing technology for fiber optic sensing event strategies, specifically to an edge computing method for urban fiber optic sensing event strategies based on a rule engine. Background Technology

[0002] In edge computing for urban fiber optic sensing events, edge nodes need to determine the corresponding policy and execute actions based on the optical path channel identifier carried by the fiber optic sensing event fragment. Existing technologies typically configure rule lists or rule trees at the edge nodes. After a fiber optic sensing event arrives, the rules are traversed one by one according to the event conditions, and the action is invoked only after a successful match. The correspondence between the optical path channel identifier and the policy is generally configured centrally or distributed through static entries, while rule conditions and action items are often stored as independent entries. As the number of urban optical paths and channels increases, the number of rules that need to be compared for a single event rises, increasing the matching latency of the edge nodes and decreasing processing throughput. When rules are updated, existing methods often involve replacing the entire rule set or reloading the rule engine. Events being processed may use a mix of old and new rule conditions during version switching, leading to inconsistent action triggering results. When results are returned, the action triggering results lack binding with the event fragment identifier and rule version, making it difficult to distinguish the event source, rule version, and batch during batch aggregation. Existing technologies do not provide a slotted structure for quickly locating rule conditions based on optical path channel identifiers, nor do they provide a mechanism for passing matching states under condition slot dependencies. When rule package versions change, it is difficult to maintain a consistent set of conditions for the events being processed, and action trigger results are not bound to event fragment identifiers and aggregated in batches. An edge computing method is needed to quickly locate rule conditions at the edge based on optical path channel identifiers, pass matching states under condition slot dependencies, maintain a consistent set of conditions for current event processing when rule package versions change, and aggregate action trigger results in batches after binding them to event fragments. Summary of the Invention

[0003] To address the issues of rule-by-rule traversal matching, insufficient consistency in rule updates, and incomplete batch aggregation in existing edge computing methods for urban fiber optic sensing events, this paper proposes a rule engine-based edge computing method for urban fiber optic sensing events. This method maps policy slot numbers using optical path channel identifiers, retrieves edge rule packages containing condition slots, action bits, and inter-slot dependencies from the local rule base, passes slot values ​​according to inter-slot dependencies, and generates an action trigger bitmap. When the rule package version changes, it continues to participate in processing through version passing along with slot value vectors and old version condition slot copies. Finally, the action trigger bitmap is bound to fiber optic sensing event fragments and written to the edge result queue.

[0004] To achieve the above objectives, the present invention provides the following technical solution: an edge computing method for urban fiber optic sensing event policies based on a rule engine, comprising: The edge node receives fiber optic sensing event fragments and optical path channel identifiers, and maps the optical path channel identifiers to policy slot numbers; Retrieve edge rule packages containing condition slots, action bits, and inter-slot dependencies from the local rule base using the strategy slot number; The temporal characteristics of the fiber optic sensing event segment are written into the condition slot to obtain the slot value vector; Generate an action trigger bitmap by passing slot values ​​according to the inter-slot dependency; The action triggers the bitmap to invoke edge actions, and the event strategy result is output. The version of the edge rule package is passed along with the slot value vector, and the action trigger bitmap is bound to the fiber optic sensing event fragment and written into the edge result queue.

[0005] Preferably, mapping the optical path channel identifier to a strategy slot number includes: The optical path number, channel number, and node number in the optical path channel identifier are analyzed. Search the edge node slot table according to the node number; The optical path number and the channel number are used to locate continuous slot segments in the edge node slot table; The first slot number of the continuous slot segment is used as the strategy slot number, and the strategy slot number and the optical path channel identifier are written into the same slot mapping record; The slot mapping record is entered into the local rule base along with the fiber optic sensing event fragment in the packet retrieval step.

[0006] Preferably, the edge rule package containing condition slots, action bits, and inter-slot dependencies is retrieved from the local rule base using the strategy slot number, and generated as follows: Retrieve the condition items, action items, and policy identifiers from the edge policy entries; The condition item is placed into the corresponding condition slot according to the strategy slot number to obtain the condition slot index; Bind the action item to the action bit, and establish the inter-slot dependency between the condition slot index and the action bit according to the strategy identifier; Package the condition slot index, the action bit, and the inter-slot dependency into the edge rule package, and assign a rule package version to the edge rule package; The rule package version is written into the local rule base along with the edge rule package.

[0007] Preferably, the step of writing the temporal characteristics of the fiber optic sensing event segment into the condition slot to obtain the slot value vector includes: Extract the start time, end time, channel span, and hit count from the fiber optic sensing event segment; Align the start time and the end time according to the edge time base to obtain the time window index; The channel span is mapped to the slot length, and the hit count is written into the count value field of the condition slot; The condition slots are arranged according to the time window index and the slot segment length to obtain the slot value vector.

[0008] Preferably, the step of generating an action trigger bitmap by passing slot values ​​according to the inter-slot dependency includes: Read the source condition slot and target condition slot from the inter-slot dependency; The slot value of the target condition slot is updated based on the slot value of the source condition slot; After the target condition slot is updated, the action bit associated with the target condition slot is written to the bitmap cache; The action bits are passed layer by layer according to the direction of the inter-slot dependency until no new action bits are written. The bitmap cache is used as the action trigger bitmap, and the transmission path identifier between the source condition slot and the target condition slot is retained.

[0009] Preferably, the step of triggering the bitmap to invoke edge actions and outputting the event strategy result includes: Read the action bit that is set in the action trigger bitmap; The action bit is used to query the edge action table to obtain the action entry and result field templates; Execute the edge action according to the action entry point, and read the action parameters from the slot value vector; Fill the action parameters into the result field template to generate the event strategy result; The event policy result is bound to the version of the edge rule package and then sent to the output channel.

[0010] Preferably, the step of passing the version of the edge rule package along with the slot value vector includes: When the edge rule package is updated in the local rule base, a new rule package version and an old rule package version are generated; Write the new rule package version into the version field of the edge rule package; When the slot value vector enters the condition slot, the version number carried by the slot value vector is compared with the version field; If the version number is different from the version field, then the slot value vector is bound to the condition slot copy corresponding to the old rule package version; The condition slot copy continues to participate in the transmission of inter-slot dependencies and writes the new rule package version into the event strategy result.

[0011] Preferably, the step of binding the action trigger bitmap with the fiber optic sensing event fragment and writing it into the edge result queue includes: The node number, optical path number, channel number, and batch number are read from the fiber optic sensing event segment to form an event segment identifier; Write the event fragment identifier into the header field of the action trigger bitmap; Select the edge result queue according to the node number in the header field; The action trigger bitmap with the header field is appended to the tail of the edge results queue; When the edge result queue reaches the batch threshold, multiple action trigger bitmaps are merged into an edge policy batch package according to the batch number.

[0012] Preferably, the fiber optic sensing event segment is formed in the following manner: The edge acquisition interface reads the raw frame from the fiber optic sensing device and divides the raw frame into channel frames according to the optical path channel identifier; Mark the frame arrival time and frame sequence number on the channel frame; Channel frames with consecutive frame numbers under the same optical path channel identifier and whose frame arrival times fall into the same time window are aggregated into candidate segments; Extract the amplitude variation range and duration from the candidate segments; Candidate segments whose amplitude variation range and duration satisfy the event triggering conditions are taken as the fiber optic sensing event segments. The fiber optic sensing event fragment carries the optical path channel identifier into the edge node.

[0013] Preferably, the edge node receives fiber optic sensing event fragments and optical path channel identifiers, including: Set up a rule engine container and a shared memory area at the edge node; The rule engine container listens to the edge acquisition interface and requests a slot in the shared memory area when it receives the fiber optic sensing event fragment. Write the fiber optic sensing event fragment into the data segment of the shared memory area, and write the optical path channel identifier into the index segment of the shared memory area; The steps of reading the optical path channel identifier from the index segment and sending it to the mapping of the strategy slot number; The data segment is associated with the index segment via a slot number, and the slot is released after the event strategy result is output.

[0014] The technical effects and advantages provided by the present invention in the above technical solution are as follows: By mapping strategy slot numbers to optical path channel identifiers, edge rule packets containing condition slots, action bits, and inter-slot dependencies are retrieved from the local rule base. Timing characteristics such as the start and end times, channel span, and hit count of fiber optic sensing event segments are written into the condition slots to form a slot value vector. The slot value of the source condition slot triggers the update of the target condition slot according to inter-slot dependencies. The action bits associated with the target condition slot are written into a bitmap cache. After being passed layer by layer along the dependency direction, an action trigger bitmap is generated. This method organizes rule conditions into condition slot indices, binds action items to action bits, and determines the matching state transmission path based on the dependencies between condition slots, replacing the traversal and matching of each rule entry. The action trigger bitmap simultaneously represents multiple action trigger states in a single transmission process, reducing the matching computation load of edge nodes as the number of optical path channels increases, shortening the delay between event arrival and action invocation, and preserving the transmission path identifier to ensure that the action trigger result corresponds to the matching path. The rule package version is passed along with the slot value vector. When the local rule base updates the edge rule package, it generates a new rule package version and an old rule package version. When the slot value vector enters the condition slot, it compares the version number it carries with the version field. If the version numbers are different, the slot value vector is bound to the condition slot copy corresponding to the old rule package version. The condition slot copy continues to participate in the inter-slot dependency propagation, and the new rule package version is written into the event policy result. This method allows events that have already entered the processing flow during the rule update to continue to use the old version of the condition slot set to complete the matching, avoiding inconsistencies in condition judgments and incorrect action triggering caused by rule switching. The rule version information is output along with the event policy result. The action trigger bitmap is bound to the event segment identifier of the fiber optic sensing event segment and written to the edge result queue by node number. When the batch threshold is reached, they are merged into edge policy batch packages by batch number, reducing the overhead of result backhaul and aggregation. Event policy results can be tracked by rule version and batch number. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0016] Figure 1 This is a flowchart of an edge computing method for urban fiber optic sensing event strategies based on a rule engine. Figure 2 This is a flowchart of edge rule package generation and slot value vector writing. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] See Figure 1 This invention provides an edge computing method for urban fiber optic sensing event policies based on a rule engine. The method includes: an edge node receiving a fiber optic sensing event fragment and an optical path channel identifier, mapping the optical path channel identifier to a policy slot number; retrieving an edge rule package containing condition slots, action bits, and inter-slot dependencies from the local rule base using the policy slot number; writing the temporal characteristics of the fiber optic sensing event fragment into the condition slot to obtain a slot value vector; passing the slot values ​​according to the inter-slot dependencies to generate an action trigger bitmap; calling edge actions using the action trigger bitmap and outputting the event policy result; passing the version of the edge rule package along with the slot value vector, and binding the action trigger bitmap with the fiber optic sensing event fragment and writing it into the edge result queue.

[0019] In implementation, edge nodes deploy rule engine containers and shared memory areas. The rule engine container listens to the edge acquisition interface. The edge acquisition interface sends fiber optic sensor event fragments and optical path channel identifiers to the rule engine container. Upon receiving a fiber optic sensor event fragment, the rule engine container requests a slot in the shared memory area. The shared memory area is divided into data segments and index segments. The data segment contains multiple data storage locations, and the index segment contains multiple index storage locations; the data storage locations and index storage locations correspond one-to-one through slot numbers. The rule engine container writes the fiber optic sensor event fragment into the data segment of the shared memory area, corresponding to the data storage location of the requested slot. The rule engine container writes the optical path channel identifier into the index segment of the shared memory area, corresponding to the index storage location of the same slot. The data segment and index segment are associated through slot numbers. The rule engine container reads the optical path channel identifier from the index segment and sends it to the policy slot number mapping step. After the event policy result is output, the rule engine container releases the requested slot, allowing the corresponding storage locations in the data segment and index segment to be requested again.

[0020] In the process of mapping optical path channel identifiers to policy slot numbers, the rule engine container parses the optical path number, channel number, and node number from the optical path channel identifier. The optical path channel identifier consists of the optical path number, channel number, and node number. The rule engine container looks up the edge node slot table by node number. The edge node slot table stores the correspondence between node numbers and consecutive slot segments. The rule engine container locates the consecutive slot segment in the edge node slot table using the optical path number and channel number. A consecutive slot segment consists of multiple slots, each with a slot number. The rule engine container uses the first slot number of the consecutive slot segment as the policy slot number. The rule engine container writes the policy slot number and the optical path channel identifier into the same slot mapping record. The slot mapping record is then used in the packet retrieval step of the local rule base along with the fiber optic sensing event fragment.

[0021] In specific implementation, please refer to Figure 2 The edge rule package, containing condition slots, action bits, and inter-slot dependencies, is retrieved from the local rule base using the policy slot number. The edge rule package is generated as follows: Condition items, action items, and policy identifiers are obtained from edge policy entries. These items are stored in edge nodes. Condition items are assigned to their corresponding condition slots according to their policy slot numbers, resulting in a condition slot index. Condition items correspond to policy slot numbers; after an item is assigned to a slot, the slot obtains its index. The condition slot index is the identifier of the condition slot within the edge rule package. Action items are bound to action bits, and inter-slot dependencies are established between the condition slot index and the action bit according to the policy identifier. After an action item is bound to an action bit, the action bit represents an executable action. Inter-slot dependencies are established between the condition slot index and the action bit according to the policy identifier. These dependencies represent the triggering relationship between the condition slot index and the action bit; that is, the action bit is triggered when the condition slot corresponding to the condition slot index meets the condition. The condition slot index, action bits, and inter-slot dependencies are packaged into an edge rule package, and a rule package version is assigned to each edge rule package. An edge rule package contains condition slot indexes, action bits, and inter-slot dependencies. The rule package version identifies different versions of the edge rule package. The rule package version is written to the local rule repository along with the edge rule package. The local rule repository stores edge rule packages and their versions.

[0022] In some embodiments, the temporal characteristics of fiber optic sensing event segments are written into condition slots to obtain a slot value vector. The start time, end time, channel span, and hit count are extracted from the fiber optic sensing event segments. The start time and end time represent the time range of the fiber optic sensing event segment. The channel span represents the number of channels covered by the fiber optic sensing event segment. The hit count represents the number of hits in the fiber optic sensing event segment. The start time and end time are aligned according to the edge time base to obtain a time window index. The edge time base is the time reference of the edge node. Alignment according to the edge time base means converting the start time and end time to the time window number under the edge time base; the time window number forms the time window index. The channel span is mapped to the slot segment length, which is the number of consecutive slots occupied by the condition slot. The hit count is written into the count value field of the condition slot. The count value field is the data area in the condition slot used to store the hit count. The condition slots are arranged according to the time window index and the slot segment length to obtain a slot value vector. The arrangement position of the condition slots in the slot value vector is determined by the time window index, and the arrangement length of the condition slots is determined by the slot segment length.

[0023] In practice, when generating the action trigger bitmap by passing slot values ​​based on inter-slot dependencies, the inter-slot dependency list is read from the edge rule package. The inter-slot dependency list contains multiple inter-slot dependencies, each containing a source condition slot identifier and a target condition slot identifier. The source condition slot in the inter-slot dependency is determined based on the source condition slot identifier, and the target condition slot in the inter-slot dependency is determined based on the target condition slot identifier. The slot value corresponding to the source condition slot is read, with the read position being the condition slot pointed to by the source condition slot identifier in the slot value vector. The slot value of the source condition slot is used to trigger the slot value update of the target condition slot.

[0024] In some embodiments, the determination of whether the slot value of the source condition slot triggers the slot value update of the target condition slot is made by the following formula: in, Indicates the set state of the action bit associated with the target condition slot. A value of 1 indicates that the action bit associated with the target condition slot is set. A value of 0 indicates that the action bit associated with the target condition slot is not set; This represents the slot value of the source condition slot, which is read from the slot value vector. This indicates the trigger threshold of the source condition slot. The trigger threshold of the source condition slot is a preset parameter of the condition slot in the edge rule package, which is specified by the condition item in the edge policy entry. The specific value of the trigger threshold of the source condition slot is determined by the policy configuration.

[0025] When the slot value of the source condition slot meets the setting condition in the above formula, the slot value of the target condition slot is updated according to the update method configured in the inter-slot dependency item in the edge rule package. The update method includes writing the slot value of the source condition slot into the slot value field of the target condition slot, or performing an accumulation calculation on the slot value field of the target condition slot. After the target condition slot is updated, the action bit associated with the target condition slot is written to the bitmap cache. The bitmap cache is a contiguous bit storage area allocated in the memory of the edge node, and each bit in the bitmap cache corresponds to an action bit. When writing an action bit, the bit corresponding to the action bit in the bitmap cache is set to 1. The inter-slot dependency is passed layer by layer in the direction of the inter-slot dependency, which is from the source condition slot identifier in the edge rule package to the target condition slot identifier. When passing layer by layer, the current target condition slot is used as the source condition slot for the next layer, and the next layer target condition slot is read and the slot value is updated and the action bit is written, until no new action bits are written to the bitmap cache. The bitmap cache is used as the action trigger bitmap, which is a bitmap containing the bit state of the action position. The propagation path identifiers of the source condition slot and the target condition slot are preserved. The propagation path identifiers record the order of the source condition slot identifiers and the target condition slot identifiers during each propagation. The propagation path identifiers are written into the extended field of the action trigger bitmap.

[0026] In some embodiments, when an edge action is invoked to output an event strategy result using an action trigger bitmap, the action bits that are set in the action trigger bitmap are read. The set action bits are the action bits corresponding to bits with a value of 1 in the action trigger bitmap. The edge action table is queried using the action bits. The edge action table stores the correspondence between action bit identifiers and action entry points and result field templates. When querying the edge action table, the action entry point and result field template are located in the edge action table based on the action bit identifier. The action entry point is the execution entry address or execution function identifier of the edge action. The result field template defines the data field structure of the event strategy result. The edge action is executed according to the action entry point, and action parameters are read from the slot value vector. The slot values ​​of the condition slots in the slot value vector are used as action parameters, and the reading order of the action parameters is defined by the edge action table or the result field template. The action parameters are filled into the result field template to generate the event strategy result. The event strategy result includes the fields in the result field template and the action parameter values. The event strategy result is bound to the version of the edge rule package and sent to the output channel. The output channel sends the event strategy result bound to the version of the edge rule package to a message queue or storage module outside the edge node.

[0027] In practice, the version of the edge rule package is passed along with the slot value vector. When an edge node updates its edge rule package in its local rule base, it generates both a new rule package version and an old rule package version. The new rule package version identifies the updated edge rule package, and the old rule package version identifies the edge rule package before the update. The new rule package version is written to the version field of the edge rule package, which is located in the package header and stores the currently effective version identifier of the edge rule package. When the slot value vector is written to a condition slot, it carries a version number, which comes from the version field of the edge rule package read when the slot value vector is generated.

[0028] In some embodiments, when a slot value vector enters a condition slot, the version number carried by the slot value vector is compared with the version field of the edge rule package. The comparison result is determined by the following formula: in, Indicates the condition slot copy binding flag, A value of 1 indicates that the slot value vector is bound to the condition slot copy corresponding to the old rule package version. A value of 0 indicates that the slot value vector uses the condition slot corresponding to the current version field; This indicates the version number carried by the slot value vector, which is read from the version field of the edge rule package when the slot value vector is generated; This indicates the version number currently stored in the version field of the edge rule package. The version number currently stored in the version field will be replaced with the new rule package version when the edge rule package is updated.

[0029] If the version number carried by the slot value vector in the comparison result differs from the version field, the slot value vector is bound to the condition slot copy corresponding to the old rule package version. The condition slot copy is the reserved data area of ​​the condition slot corresponding to the old rule package version in the local rule base. The condition slot copy continues to participate in the inter-slot dependency propagation, and the inter-slot dependency propagation method is consistent with the inter-slot dependency propagation method in the current edge rule package. After the condition slot copy has participated in the propagation, the new rule package version is written to the event policy result, and the version information in the event policy result adopts the new rule package version.

[0030] In some embodiments, the action trigger bitmap is bound to the fiber optic sensing event segment and then written to the edge result queue. The node number, optical path number, channel number, and batch number are read from the fiber optic sensing event segment to form the event segment identifier. The node number is the edge node identifier from which the fiber optic sensing event segment originates; the optical path number is the optical path identifier to which the fiber optic sensing event segment belongs; the channel number is the channel identifier to which the fiber optic sensing event segment belongs; and the batch number is the acquisition batch identifier of the fiber optic sensing event segment. The event segment identifier is written to the header field of the action trigger bitmap. The header field, located at the beginning of the action trigger bitmap, contains four subfields: node number, optical path number, channel number, and batch number. The edge result queue is selected according to the node number in the header field. The edge result queue corresponds one-to-one with the node number, and the local edge result queue of each edge node is used to store the action trigger bitmap generated by that node. The action trigger bitmap with the header field is appended to the tail of the edge result queue; the writing method is to append the action trigger bitmap data block to the tail of the edge result queue.

[0031] When the edge result queue reaches the batch threshold, multiple action trigger bitmaps are merged into an edge policy batch package by batch number. Reaching the batch threshold means that the number of action trigger bitmaps stored in the edge result queue reaches the threshold value. The batch threshold is a configuration parameter of the edge result queue, set by the edge node management plane, and its value ranges from 1 to 1000. When merging by batch number, action trigger bitmaps with the same batch number are extracted from the edge result queue and merged into a single edge policy batch package. The edge policy batch package contains multiple action trigger bitmaps and their header fields.

[0032] In practice, fiber optic sensing event segments are formed as follows: The edge acquisition interface reads the raw frame from the fiber optic sensing device. The raw frame is the raw data frame output by the fiber optic sensing device, containing data from multiple optical path channels. The edge acquisition interface segments the raw frame into channel frames according to the optical path channel identifier. The optical path channel identifier includes the optical path number and the channel number. During segmentation, the edge acquisition interface extracts the data portion corresponding to the optical path channel from the raw frame based on the optical path channel identifier, and uses the extracted data portion as a channel frame. Each channel frame corresponds one-to-one with an optical path channel identifier, and each channel frame carries the optical path channel identifier.

[0033] In some embodiments, the edge acquisition interface marks the frame arrival time and frame sequence number on the channel frame. The frame arrival time is the time when the edge acquisition interface receives the channel frame, and the frame arrival time is read from the local clock of the edge acquisition interface. The frame sequence number is the sequential number of the channel frame in its optical path channel, and the frame sequence number is assigned by the edge acquisition interface according to the arrival order of the channel frames. The edge acquisition interface writes the frame arrival time and frame sequence number into the frame header field of the channel frame.

[0034] In some embodiments, the edge acquisition interface aggregates channel frames with consecutive frame numbers under the same optical path channel identifier and whose arrival times fall within the same time window into candidate segments. The same optical path channel identifier is a set of channel frames with the same optical path number and channel number. Consecutive frame numbers are sequences of channel frames whose frame numbers differ by 1. Frame arrival times falling within the same time window means that the arrival times of channel frames belong to the same time window number. The time window number is calculated by the edge acquisition interface based on the time window length and a reference time. The time window length is a configuration parameter of the edge acquisition interface and is set by the edge node management plane. The edge acquisition interface sequentially places channel frames that meet the above conditions into candidate segments, and each candidate segment contains a sequence of channel frames.

[0035] In some embodiments, the edge acquisition interface extracts the amplitude variation range and duration from the candidate segment. The amplitude variation range is the difference between the maximum and minimum amplitude values ​​of all channel frames within the candidate segment. The amplitude of a channel frame is read from the data portion of the channel frame, and the amplitude is the amplitude value of the sampled point in the channel frame. The duration is calculated from the difference between the arrival time of the last channel frame and the arrival time of the first channel frame within the candidate segment.

[0036] In some embodiments, the edge acquisition interface determines whether a candidate segment meets the event triggering condition using the following formula: in, Indicates the event trigger flag, A value of 1 indicates that the candidate segment meets the event triggering condition, and the candidate segment is used as an optical fiber sensing event segment. A value of 0 indicates that the candidate fragment does not meet the event triggering condition; This represents the range of amplitude changes extracted from the candidate segments. The method for obtaining it is to calculate the difference between the maximum and minimum amplitude values ​​of all channel frames within the candidate segment; Indicates the threshold of the amplitude variation range. The configuration parameters of the edge acquisition interface are set. Used to determine whether the range of amplitude change meets the event triggering condition; This represents the duration extracted from the candidate fragment. The method of obtaining the data is to calculate the difference between the arrival time of the last channel frame and the arrival time of the first channel frame within the candidate segment. Indicates the duration threshold. The configuration parameters of the edge acquisition interface are set. Used to determine whether the duration has reached the event trigger condition.

[0037] The edge acquisition interface uses candidate segments marked as 1 for event triggering as fiber optic sensing event segments. These event segments, carrying optical path channel identifiers, are sent to the edge node. Upon receiving the fiber optic sensing event segments and the optical path channel identifiers, the edge node performs policy slot number mapping and subsequent processing.

[0038] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A rule-based edge computing method for urban fiber optic sensing event strategies, characterized in that: include: The edge node receives fiber optic sensing event fragments and optical path channel identifiers, and maps the optical path channel identifiers to policy slot numbers; Retrieve edge rule packages containing condition slots, action bits, and inter-slot dependencies from the local rule base using the strategy slot number; The temporal characteristics of the fiber optic sensing event segment are written into the condition slot to obtain the slot value vector; Generate an action trigger bitmap by passing slot values ​​according to the inter-slot dependency; The action triggers the bitmap to invoke edge actions, and the event strategy result is output. The version of the edge rule package is passed along with the slot value vector, and the action trigger bitmap is bound to the fiber optic sensing event fragment and written into the edge result queue.

2. The edge computing method for urban fiber optic sensing event strategy based on a rule engine according to claim 1, characterized in that, The step of mapping the optical path channel identifier to a strategy slot number includes: Parse the optical path number, channel number, and node number in the optical path channel identifier; Search the edge node slot table according to the node number; The optical path number and the channel number are used to locate continuous slot segments in the edge node slot table; The first slot number of the continuous slot segment is used as the strategy slot number, and the strategy slot number and the optical path channel identifier are written into the same slot mapping record; The slot mapping record is entered into the local rule base along with the fiber optic sensing event fragment in the packet retrieval step.

3. The edge computing method for urban fiber optic sensing event strategies based on a rule engine according to claim 1, characterized in that, Using the policy slot number, retrieve the edge rule package containing condition slots, action bits, and inter-slot dependencies from the local rule base, and generate it as follows: Retrieve the condition items, action items, and policy identifiers from the edge policy entries; The condition item is placed into the corresponding condition slot according to the strategy slot number to obtain the condition slot index; Bind the action item to the action bit, and establish the inter-slot dependency between the condition slot index and the action bit according to the strategy identifier; Package the condition slot index, the action bit, and the inter-slot dependency into the edge rule package, and assign a rule package version to the edge rule package; The rule package version is written into the local rule base along with the edge rule package.

4. The edge computing method for urban fiber optic sensing event strategies based on a rule engine according to claim 1, characterized in that, The step of writing the temporal characteristics of the fiber optic sensing event segment into the condition slot to obtain the slot value vector includes: Extract the start time, end time, channel span, and hit count from the fiber optic sensing event segment; Align the start time and the end time according to the edge time base to obtain the time window index; The channel span is mapped to the slot length, and the hit count is written into the count value field of the condition slot; The condition slots are arranged according to the time window index and the slot segment length to obtain the slot value vector.

5. The edge computing method for urban fiber optic sensing event strategies based on a rule engine according to claim 1, characterized in that, The step of generating an action trigger bitmap by passing slot values ​​according to the inter-slot dependency includes: Read the source condition slot and target condition slot from the inter-slot dependency; The slot value of the target condition slot is updated based on the slot value of the source condition slot; After the target condition slot is updated, the action bit associated with the target condition slot is written to the bitmap cache; The action bits are passed layer by layer according to the direction of the inter-slot dependency until no new action bits are written. The bitmap cache is used as the action trigger bitmap, and the transmission path identifier between the source condition slot and the target condition slot is retained.

6. The edge computing method for urban fiber optic sensing event strategies based on a rule engine according to claim 1, characterized in that, The step of triggering the bitmap to invoke edge actions and outputting the event strategy result includes: Read the action bit that is set in the action trigger bitmap; The action bit is used to query the edge action table to obtain the action entry and result field templates; Execute the edge action according to the action entry point, and read the action parameters from the slot value vector; Fill the action parameters into the result field template to generate the event strategy result; The event policy result is bound to the version of the edge rule package and then sent to the output channel.

7. The edge computing method for urban fiber optic sensing event strategies based on a rule engine according to claim 1, characterized in that, The step of passing the version of the edge rule package along with the slot value vector includes: When the edge rule package is updated in the local rule base, a new rule package version and an old rule package version are generated; Write the new rule package version into the version field of the edge rule package; When the slot value vector enters the condition slot, the version number carried by the slot value vector is compared with the version field; If the version number is different from the version field, then the slot value vector is bound to the condition slot copy corresponding to the old rule package version; The condition slot copy continues to participate in the transmission of inter-slot dependencies and writes the new rule package version into the event strategy result.

8. The edge computing method for urban fiber optic sensing event strategy based on a rule engine according to claim 1, characterized in that, The step of binding the action trigger bitmap with the fiber optic sensing event fragment and writing it into the edge result queue includes: The node number, optical path number, channel number, and batch number are read from the fiber optic sensing event segment to form an event segment identifier; Write the event fragment identifier into the header field of the action trigger bitmap; Select the edge result queue according to the node number in the header field; The action trigger bitmap with the header field is appended to the tail of the edge results queue; When the edge result queue reaches the batch threshold, multiple action trigger bitmaps are merged into an edge policy batch package according to the batch number.

9. The edge computing method for urban fiber optic sensing event strategy based on a rule engine according to claim 1, characterized in that, The fiber optic sensing event segment is formed as follows: The edge acquisition interface reads the raw frame from the fiber optic sensing device and divides the raw frame into channel frames according to the optical path channel identifier; Mark the frame arrival time and frame sequence number on the channel frame; Channel frames with consecutive frame numbers under the same optical path channel identifier and whose frame arrival times fall into the same time window are aggregated into candidate segments; Extract the amplitude variation range and duration from the candidate segments; Candidate segments whose amplitude variation range and duration satisfy the event triggering conditions are taken as the fiber optic sensing event segments. The fiber optic sensing event fragment carries the optical path channel identifier into the edge node.

10. The edge computing method for urban fiber optic sensing event strategies based on a rule engine according to claim 1, characterized in that, The edge node receives fiber optic sensing event fragments and optical path channel identifiers, including: Set up a rule engine container and a shared memory area at the edge node; The rule engine container listens to the edge acquisition interface and requests a slot in the shared memory area when it receives the fiber optic sensing event fragment. Write the fiber optic sensing event fragment into the data segment of the shared memory area, and write the optical path channel identifier into the index segment of the shared memory area; The steps of reading the optical path channel identifier from the index segment and sending it to the mapping of the strategy slot number; The data segment is associated with the index segment via a slot number, and the slot is released after the event strategy result is output.