A video storage method, device, equipment, medium and product

CN123020720APending Publication Date: 2026-10-30SHANGHAI ZHIWEI ROBOT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611216998.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-12
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]本发明提供了一种视频存储方法、装置、设备、介质及产品,以解决现有技术中家庭视频存储依赖固定时长或物理运动触发切分,无法实现语义级事件切分的问题

Benefits of technology

[0010]本发明实施例的技术方案,通过获取外部设备发送的语义事件边界信号,解析语义事件边界信号得到事件记录,若触发信号类型为开始信号,创建与事件标识关联的挂起记录,并将摄像头标识对应的原始视频帧缓存至挂起记录对应的临时缓冲区,直至接收到目标信号,根据时间戳确定原始视频帧的起始帧和结束帧,根据起始帧和结束帧在临时缓冲区中截取目标帧序列,将目标帧序列作为事件片段,生成事件片段对应的事件片段元数据,实现视频按照事件切分;将事件片段元数据存储至预设家庭语义事件数据库,建立事件片段与原始视频数据之间的双向映射索引,根据预设家庭语义事件数据库和双向映射索引更新预设家庭知识图谱,实现语义事件与视频证据的双向精准溯源,提高视频存储的合理性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123020720A_ABST
    Figure CN123020720A_ABST
Patent Text Reader

Abstract

The application discloses a video storage method, device, equipment, medium and product, and relates to the technical field of data processing. The method comprises the following steps: acquiring a semantic event boundary signal sent by an external device, and analyzing the semantic event boundary signal to obtain an event record; if the trigger signal type is a start signal, a suspension record associated with an event identifier is created, and original video frames corresponding to a camera identifier are cached to a temporary buffer area corresponding to the suspension record until a target signal is received, and the start frame and the end frame of the original video frames are determined according to timestamps; a target frame sequence is intercepted in the temporary buffer area according to the start frame and the end frame, the target frame sequence is taken as an event segment, and event segment metadata corresponding to the event segment is generated; the event segment metadata is stored in a preset home semantic event database, a bidirectional mapping index between the event segment and original video data is established, and the preset home knowledge graph is updated according to the preset home semantic event database and the bidirectional mapping index.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a video storage method, apparatus, device, medium, and product. Background Technology

[0002] With the continuous development of smart home sensing systems, smart home cameras are widely used in scenarios such as home security, elderly care, and infant monitoring. The continuous acquisition and storage of video streams by cameras is a fundamental step in achieving event retrieval and scene perception.

[0003] Currently, mainstream home video storage solutions mainly fall into three categories: continuous recording storage, motion-triggered recording, and cloud-based event recording. However, all of these solutions have inherent limitations and are difficult to adapt to the advanced application needs of home intelligent sensing and knowledge graph construction. Existing home video storage solutions only complete video file saving and basic playback functions, lacking a video stream segmentation mechanism for semantic events, and event segments cannot be deeply integrated with the home intelligent sensing system. Therefore, how to achieve independent storage of event segments has become an urgent problem to be solved. Summary of the Invention

[0004] This invention provides a video storage method, apparatus, device, medium, and product to solve the problem that existing home video storage relies on fixed duration or physical motion-triggered segmentation, which cannot achieve semantic-level event segmentation.

[0005] According to one aspect of the present invention, a video storage method is provided, wherein the method includes: Acquire semantic event boundary signals sent by external devices, and parse the semantic event boundary signals to obtain event records; wherein, the event records include at least an event identifier, a trigger signal type, entity information, a timestamp, and a camera identifier; If the trigger signal type is a start signal, a suspension record associated with the event identifier is created, and the original video frame corresponding to the camera identifier is cached in the temporary buffer corresponding to the suspension record until the target signal is received. The start frame and end frame of the original video frame are determined according to the timestamp. Based on the start frame and the end frame, a target frame sequence is extracted from the temporary buffer, and the target frame sequence is used as an event fragment to generate event fragment metadata corresponding to the event fragment. The event fragment metadata is stored in a preset family semantic event database, a bidirectional mapping index is established between the event fragment and the original video data, and the preset family knowledge graph is updated according to the preset family semantic event database and the bidirectional mapping index.

[0006] According to another aspect of the present invention, a video storage device is provided, wherein the device comprises: The data parsing module is used to acquire semantic event boundary signals sent by external devices and parse the semantic event boundary signals to obtain event records; wherein, the event records include at least an event identifier, a trigger signal type, entity information, a timestamp, and a camera identifier; The video caching module is used to create a suspension record associated with the event identifier if the trigger signal type is a start signal, and cache the original video frame corresponding to the camera identifier to the temporary buffer corresponding to the suspension record until the target signal is received, and determine the start frame and end frame of the original video frame according to the timestamp. The metadata determination module is used to extract a target frame sequence from the temporary buffer based on the start frame and the end frame, use the target frame sequence as an event fragment, and generate event fragment metadata corresponding to the event fragment. The video storage module is used to store the event segment metadata into a preset family semantic event database, establish a bidirectional mapping index between the event segment and the original video data, and update a preset family knowledge graph based on the preset family semantic event database and the bidirectional mapping index.

[0007] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the video storage method according to any embodiment of the present invention.

[0008] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the video storage method according to any embodiment of the present invention.

[0009] According to another aspect of the present invention, embodiments of the present invention also provide a computer program product, the computer program product including a computer program, which, when executed by a processor, implements the video storage method of any embodiment of the present invention.

[0010] The technical solution of this invention obtains semantic event boundary signals sent by external devices, parses the semantic event boundary signals to obtain event records, and if the trigger signal type is a start signal, creates a suspended record associated with the event identifier and caches the original video frame corresponding to the camera identifier in the temporary buffer corresponding to the suspended record until the target signal is received. The start frame and end frame of the original video frame are determined according to the timestamp, and the target frame sequence is extracted from the temporary buffer according to the start frame and end frame. The target frame sequence is used as an event fragment, and event fragment metadata corresponding to the event fragment is generated to realize video segmentation according to events. The event fragment metadata is stored in a preset family semantic event database, and a bidirectional mapping index between event fragments and original video data is established. The preset family knowledge graph is updated according to the preset family semantic event database and the bidirectional mapping index to realize bidirectional accurate tracing of semantic events and video evidence, and improve the rationality of video storage.

[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a flowchart of a video storage method provided according to Embodiment 1 of the present invention; Figure 2 This is a flowchart of a video storage method provided according to Embodiment 2 of the present invention; Figure 3 This is a flowchart of a video storage method provided according to Embodiment 3 of the present invention; Figure 4 This is a flowchart of another video storage method provided according to Embodiment 3 of the present invention; Figure 5 This is a flowchart of a bidirectional mapping index query provided in Embodiment 3 of the present invention; Figure 6 This is a schematic diagram of the structure of a video storage device according to Embodiment 4 of the present invention; Figure 7 This is a schematic diagram of the structure of an electronic device that implements the video storage method of this invention. Detailed Implementation

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

[0015] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0016] Example 1 Figure 1 This is a flowchart of a video storage method according to Embodiment 1 of the present invention. This embodiment is applicable to the segmentation and storage of home videos into events. The method can be executed by a video storage device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes: S110. Obtain the semantic event boundary signal sent by the external device, and parse the semantic event boundary signal to obtain the event record.

[0017] The semantic event boundary signal refers to the event control signal output by an external device, used to mark the start and end of a home semantic event, and contains complete event semantic information. The external device refers to a front-end sensing device deployed in a home environment that possesses intelligent semantic event perception capabilities. For example, external devices may include, but are not limited to, sensing cameras, home smart gateways, and human body sensors. The event record is structured data obtained after parsing the semantic event boundary signal. In one embodiment, the event record includes at least an event identifier, trigger signal type, entity information, timestamp, and camera identifier. The event identifier is a unique number for a single semantic event; the trigger signal type distinguishes between the event start and end signals; the entity information is the sensing object entity corresponding to the event, including personnel entities, object entities, and home space area entities; the timestamp is the precise time information of the event trigger; and the camera identifier uniquely distinguishes multiple home monitoring and acquisition devices. In one embodiment, the event record may also include information such as event type, confidence level, and event source.

[0018] In this embodiment, a signal channel with an external device can be pre-established to monitor semantic event boundary signals pushed by the external device in real time. During actual operation, after recognizing a family semantic event, the external device can generate a corresponding semantic event boundary signal in real time and push it to the local storage system. In one embodiment, family semantic events may include, but are not limited to, people entering and leaving, changes in objects, elderly activities, and infants being alone. Upon receiving the semantic event boundary signal, it can be decoded, and information such as the semantic event boundary signal can be extracted as an event record.

[0019] S120. If the trigger signal type is a start signal, create a suspension record associated with the event identifier, and cache the original video frame corresponding to the camera identifier to the temporary buffer corresponding to the suspension record until the target signal is received. Determine the start frame and end frame of the original video frame based on the timestamp.

[0020] The suspend record can be understood as a temporary cache management record created by the system after detecting an event start signal. The suspend record can be bound to an event identifier to manage the video caching process for a single complete event. The temporary buffer is a temporary storage area bound to the suspend record, used to cache the original video frames corresponding to currently unfinished events in real time. Generally, the temporary buffer is only effective within the event processing cycle and is not persistently stored.

[0021] In this embodiment, the type of the parsed trigger signal can be determined. If the trigger signal type is an event start signal, a suspended record is created based on the event record. In actual operation, a suspended record can be created according to the event identifier, camera identifier, and trigger timestamp in the event record. The created record can be associated with the event identifier. A temporary buffer is then allocated for the suspended record, bound to the corresponding camera identifier, and the original video frames captured by the camera corresponding to the camera identifier are retrieved in real time and cached frame by frame into the temporary buffer. The caching process continues, and the system monitors subsequent semantic event boundary signals in real time until a target signal is received, at which point the caching is terminated. In one embodiment, the target signal includes a semantic event boundary signal whose trigger signal type is an end signal, or a semantic event boundary signal that is the same as the camera identifier and whose trigger signal type is a start signal. That is, when a semantic event boundary signal whose trigger signal type is an end signal is received, the current event can be considered terminated. When a semantic event boundary signal that is the same as the camera identifier and whose trigger signal type is a start signal is received, a new event can be considered generated, and the previous event is passively terminated. Then, based on the timestamp in the event record, candidate original video frames with matching times are selected from all the original video frames cached in the temporary buffer. Event feature recognition is performed on candidate original video frames to extract event semantic features from the images. The first video frame that fully contains event features is determined as the start frame, and the last video frame that contains event features is determined as the end frame.

[0022] S130. Extract the target frame sequence from the temporary buffer based on the start frame and end frame, use the target frame sequence as an event fragment, and generate the event fragment metadata corresponding to the event fragment.

[0023] The target frame sequence refers to the continuous video frame sequence from the start frame to the end frame, selected from the temporary buffer. An event segment refers to a complete video segment obtained by encapsulating the target frame sequence in its original frame order. Event segment metadata is structured data that fully describes the attributes of the event segment. Generally, event segment metadata may include information such as the preset storage path, event duration, start frame, end frame, and event log.

[0024] In this embodiment, all consecutive video frames from the start frame to the end frame are read from a temporary buffer and integrated to obtain a complete target frame sequence. Following the original captured frame order of the target frame sequence, all video frames are encapsulated to form event segments. Preset encoding parameters are used to uniformly encode and compress the event segments, generating standardized event segment files. The encoded event segment files are written to a preset storage path for persistent storage of the event video. The overall duration of the event segment is calculated, and the preset storage path, event duration, start frame number, end frame number, and complete event record are combined to generate event segment metadata, thus binding and associating video file information with event semantic information.

[0025] S140. Store the event segment metadata in the preset family semantic event database, establish a bidirectional mapping index between the event segment and the original video data, and update the preset family knowledge graph according to the preset family semantic event database and the bidirectional mapping index.

[0026] The bidirectional mapping index is a bidirectional associative index structure containing forward and reverse mapping indexes. It is used to determine the relationship between events and original video data, enabling bidirectional retrieval capabilities for event-based video lookup and video-based event tracing. The preset family semantic event database is a structured database used to store family semantic event data. In actual operation, the preset family semantic event database includes a main event table and related tables. The main event table stores complete metadata of event segments, and the related tables store the relationships between entities and event segments. The preset family knowledge graph is a structured knowledge network comprising family scene entities, events, and spatiotemporal relationships. It can consist of event entities, device entities, spatial entities, and their interrelationships, and is used for intelligent analysis of family scenes, event reasoning, and semantic retrieval.

[0027] In this embodiment, event fragment metadata can be written into a preset family semantic event database. In actual operation, the basic attributes and video parameters of each event can be uniformly stored in the event master table. Entity information such as people, items, and spaces can be extracted from the event records to determine the association between various entities and the current event fragment. This relationship information is then written separately into the database's association table. A forward mapping index pointing to the original video data and a reverse mapping index pointing to the event fragment are established to form a bidirectional mapping index between the event fragment and the original video data. Based on the event basic data in the event master table and the entity relationship data in the association table, combined with the forward and reverse mapping indexes, event nodes are assembled. By adding entities, supplementing associations, and attaching video traceability attributes, incremental updates to the preset family knowledge graph are completed, enabling the video storage data to directly serve family intelligent sensing, semantic retrieval, and scene reasoning.

[0028] In this embodiment of the invention, by acquiring semantic event boundary signals sent by external devices, and parsing the semantic event boundary signals to obtain event records, if the trigger signal type is a start signal, a suspended record associated with the event identifier is created, and the original video frame corresponding to the camera identifier is cached in the temporary buffer corresponding to the suspended record until the target signal is received. The start frame and end frame of the original video frame are determined according to the timestamp, and the target frame sequence is extracted from the temporary buffer according to the start frame and end frame. The target frame sequence is used as an event fragment, and event fragment metadata corresponding to the event fragment is generated, realizing video segmentation according to events. The event fragment metadata is stored in a preset family semantic event database, and a bidirectional mapping index between event fragments and original video data is established. The preset family knowledge graph is updated according to the preset family semantic event database and the bidirectional mapping index, realizing bidirectional accurate tracing of semantic events and video evidence, and improving the rationality of video storage.

[0029] In one embodiment, after extracting the target frame sequence from a temporary buffer based on the start and end frames, using the target frame sequence as an event fragment, and generating event fragment metadata corresponding to the event fragment, the method further includes: Destroy the suspended record and release the temporary buffer bound to it.

[0030] In this embodiment, after extracting the target frame sequence from the temporary buffer based on the start frame and end frame, using the target frame sequence as an event fragment, and generating the event fragment metadata corresponding to the event fragment, the suspended record corresponding to the current event can be automatically destroyed, releasing the bound temporary buffer memory resources, avoiding memory occupation and data residue, and ensuring the long-term stable operation of the system.

[0031] Example 2 Figure 2 This is a flowchart of a video storage method according to Embodiment 2 of the present invention. This embodiment is a further optimization and extension based on the above embodiments, and can be combined with various optional technical solutions in the above embodiments. Figure 2 As shown, the method includes: S201. Establish a signal channel with external devices, receive semantic event boundary signals sent by external devices through the signal channel, and parse the semantic event boundary signals to obtain event records.

[0032] In this embodiment, a signal channel can be established with external devices. When the external devices detect the start or end of a home semantic event, they can actively push semantic event boundary signals to the signal channel. The system continuously monitors the signal channel, performs message verification, noise reduction, and decoding on the received semantic event boundary signals, filters out invalid interference signals, and then parses out the entire record.

[0033] S202. If the trigger signal type is a start signal, create a suspension record according to the event identifier, camera identifier, and timestamp.

[0034] In this embodiment, the trigger signal type can be determined. When the trigger signal type is identified as an event start signal, it is determined that a new home semantic event has occurred. A suspension record can be created using event identifier, camera identifier, and timestamp as field information. The suspension record is bound one-to-one with the home semantic event. In actual operation, the suspension record can serve as a control identifier for event video caching, frame capture, and data processing, effectively distinguishing concurrent events from multiple cameras and time periods, and preventing data from different events from becoming mixed and disordered.

[0035] S203. Determine the temporary buffer bound to the suspended record, and cache the original video frame corresponding to the camera identifier to the temporary buffer until the target signal is received.

[0036] The target signal includes a semantic event boundary signal whose trigger signal type is an end signal, or a semantic event boundary signal that is the same as the camera identifier and whose trigger signal type is a start signal.

[0037] In this embodiment, a temporary buffer can be allocated for suspended records. After binding is complete, the system retrieves the real-time raw video frames corresponding to the camera identifier in real time, and caches them frame by frame into a dedicated temporary buffer to preserve the original video timing and image information. At the same time, the system monitors the semantic event boundary signals of subsequent inputs in real time until the target signal is received to terminate the caching.

[0038] S204. Based on the timestamp, candidate original video frames are obtained by filtering in the temporary buffer, the event features of the candidate original video frames are identified, the first video frame containing the event features is determined as the start frame, and the last video frame containing the event features is determined as the end frame.

[0039] Among them, event features refer to the visual and semantic features of events contained in the candidate original video frames. For example, event features may include people's posture, people's behavior, object status, and spatial location relationships.

[0040] In this embodiment, since the timestamps output by external devices are at the second level of precision, they cannot match the requirements for video frame-level segmentation. The system can, based on the timestamps of the event records, filter all video frames with matching time dimensions from all cached video frames in the temporary buffer as candidate original video frames, thus narrowing down the range of valid frames. Event feature recognition is performed frame by frame on the candidate original video frames, extracting event features such as people, objects, behaviors, and spaces in the scene. The first video frame in the entire candidate original video frame segment that fully carries event features is defined as the start frame, and the last video frame that carries event features is defined as the end frame.

[0041] S205. Read all video frames from the start frame to the end frame from the temporary buffer as the target frame sequence.

[0042] In this embodiment, all consecutive video frames whose frame numbers fall within the closed interval between the start and end frames in the temporary buffer can be read and traversed as the target frame sequence.

[0043] S206. According to the original frame order of the target frame sequence, encapsulate the target frame sequence into event fragments.

[0044] In this embodiment, the target frame sequence can be encapsulated into event fragments by performing time-series encapsulation, frame alignment, and frame group packaging according to the original frame order of the target frame sequence.

[0045] S207. Encode and compress the event fragments using preset encoding parameters to obtain an event fragment file, and write the event fragment file to a preset storage path.

[0046] The preset encoding parameters refer to the system's pre-defined standardized video encoding configuration, including parameters such as bitrate, resolution, frame rate, and encoding format. The preset storage path refers to a fixed storage directory, either locally or in the cloud, used to uniformly store encoded event segment files.

[0047] In this embodiment, preset encoding parameters can be invoked to uniformly encode and compress the encapsulated event fragments, generating standardized event fragment files. After encoding, the generated event fragment files are written to a preset storage path.

[0048] S208. Determine the duration of the event segment, and combine the preset storage path, duration, start frame, end frame, and event record to form event segment metadata.

[0049] In this embodiment, the time corresponding to the start frame and the time corresponding to the end frame can be determined, the duration of the event segment can be calculated, and the preset storage path, duration, start frame, end frame, and event record can be concatenated and structurally encapsulated as event segment metadata.

[0050] S209. Store the event fragment metadata in the event master table of the preset family semantic event database.

[0051] In this embodiment, event fragment metadata can be written in batches to the event master table of a preset family semantic event database. Generally, the event master table is used to store all basic attributes and video attribute data of a single event. In actual operation, the event identifier can be used as the primary key to record field information such as event type, start frame, end frame, duration, confidence level, camera identifier, location tag, original video path, and preset storage path.

[0052] S210. Determine the relationship between entity information and event fragments in the event record, and store the relationship information in the association table of the preset family semantic event database.

[0053] In this embodiment, entity information can be extracted from event records, and the relationships between each entity and event fragments can be analyzed to form entity-event relationship information. This relationship information is then independently stored in a relational table in the database, achieving hierarchical decoupled storage of event basic attributes and entity relationships.

[0054] S211. Using the event identifier in the event log as the key, establish a forward mapping index from event segments to original video data, and using the storage path of the original video data as the key, establish a reverse mapping index from original video data to event segments.

[0055] The forward mapping index is an index structure with the event identifier as the unique key, used to trace the video source from the event. The reverse mapping index is an index structure with the preset storage path of the video as the unique key, used to trace the event back from the video.

[0056] In this embodiment, an index can be established by using the event identifier in the event log as the index key to create a forward mapping index pointing from the event segment to the original video data, which supports quick retrieval of corresponding video evidence through semantic events; and an index can be established by using the preset storage path of the original video data as the index key to create a reverse mapping index pointing from the original video data to the corresponding event segment.

[0057] S212. Using the forward mapping index and the reverse mapping index as bidirectional mapping indexes, update the preset family knowledge graph according to the event master table, the association table, and the bidirectional mapping indexes.

[0058] In this embodiment, the forward mapping index and the reverse mapping index can be used as bidirectional mapping indexes. The graph event entity nodes are constructed based on the event basic metadata stored in the event master table. The graph triplet association relationship is generated based on the entity relationship data stored in the association table. Based on the forward mapping index and the reverse mapping index, the corresponding video tracing attributes and multimedia evidence resources are attached to the graph event entities to realize real-time incremental iteration of the family knowledge graph.

[0059] In this embodiment of the invention, a signal channel is established with an external device. The signal channel receives semantic event boundary signals sent by the external device. If the trigger signal type is a start signal, a suspension record is created according to the event identifier, camera identifier, and timestamp. A temporary buffer bound to the suspension record is determined, and the original video frame corresponding to the camera identifier is cached in the temporary buffer until the target signal is received. Based on the timestamp, candidate original video frames are selected from the temporary buffer. The event features of the candidate original video frames are identified, and the first video frame containing event features is determined as the start frame, and the last video frame containing event features is determined as the end frame. All video frames from the start frame to the end frame are read from the temporary buffer as the target frame sequence. According to the original frame order of the target frame sequence, the target frame sequence is encapsulated into event fragments. The event fragments are encoded and compressed using preset encoding parameters to obtain an event fragment file. The event fragment file is then written to a preset... The storage path determines the duration of event segments. Preset storage paths, durations, start frames, end frames, and event records are combined to form event segment metadata, enabling video frame segmentation based on events. This is achieved by storing the event segment metadata in the main event table of a preset family semantic event database. The relationship between entity information in event records and event segments is determined, and this relationship information is stored in the association table of the preset family semantic event database. A forward mapping index from event segments to original video data is established using the event identifier in the event record as the key, and a reverse mapping index from original video data to event segments is established using the storage path of the original video data as the key. These forward and reverse mapping indexes are used as bidirectional mapping indexes. The preset family knowledge graph is updated according to the main event table, association table, and bidirectional mapping indexes. A layered database storage architecture is adopted to decouple event attributes from entity relationships, establishing a bidirectional traceability channel between semantic events and video evidence.

[0060] Example 3 Figure 3 This is a flowchart of a video storage method according to Embodiment 3 of the present invention. This embodiment uses an external home sensing smart module as an external device, an internal event log as an event recorder, and a storage layer executing the video storage method as an example to further illustrate a video storage method. Figure 3As shown, the storage layer includes an external event signal receiving module, used to receive semantic event boundary signals pushed in real time by the external home sensing intelligence module, and parse them to obtain internal event records. These internal event records are then input to the event segmentation module. The event segmentation module is used for video frame extraction and encapsulation, outputting the extracted video frame sequence (target video frame) to the home semantic event database, and outputting event segment files and event segment metadata to the bidirectional mapping index module. The home semantic event database and the bidirectional mapping index module perform bidirectional query linkage to build an index. The home semantic event database sends time nodes to the graph event node output module, pushes structured event nodes to the downstream home knowledge graph construction module, and incorporates the event nodes into the home knowledge graph.

[0061] The external event signal receiving module is used to establish a standardized signal channel with the home sensing intelligent module, and to receive and parse the semantic event boundary signals sent by it in real time. The input is the semantic event boundary signal sent by the external home sensing intelligent module according to a preset protocol, which includes an event identifier (globally unique), an event type (taken from the set of home semantic event types supported by this invention), a trigger signal type (value is start or end), a timestamp (second-level precision, with time zone), a camera identifier (taken from the set of registered cameras in the home), a confidence level (a decimal in the range of 0-1), and a source module (a list of internal sub-modules of the home sensing intelligent module that generated the semantic event boundary signal).

[0062] The external event signal receiving module verifies the legality of the signal according to the preset protocol (unique event identifier, type within the supported set, camera identifier registered, and confidence level within the legal range). If the verification is successful, the semantic event boundary signal is parsed into an internal event record. If the verification fails, the signal is discarded and an alarm is recorded. An internal event record (containing all fields of the signal and the timestamp of entry into the database) is generated and pushed to the event segmentation module.

[0063] The event segmentation module is used to create suspended event segment records and cache the corresponding camera video frames when the event recording begins, and to locate and capture the start and end frames of the segment when the event recording ends.

[0064] The event segmentation module takes into account internal event logs and continuously input raw video frames (with frame-level timestamps) from the camera. Upon receiving a start signal, the module creates a pending record for the event (containing the event identifier, camera identifier, and planned start timestamp) and begins caching the corresponding camera's raw video frames to a temporary buffer. Upon receiving an end signal or detecting a new start signal of the same type (considered as the automatic end of the preceding event), boundary frame localization is performed. This involves comparing the signal timestamp with the raw video frame timestamps, locating the earliest frame containing event characteristics as the actual start frame, and the latest frame containing event characteristics as the actual end frame. After localization, the corresponding frame sequence is extracted from the temporary buffer, encapsulated into an independent event segment file, and encoded using high-quality encoding parameters. This generates the event segment file (an independent file, high-quality encoded) and event segment metadata (containing information such as the event identifier, actual start frame number, actual end frame number, segment file path, and keyframe list).

[0065] The family semantic event database uses a relational database as its carrier to persistently store core data such as the event master table, event-person association table, event-object association table, event tag table, and clip-original video bidirectional index table. Input information includes event clip metadata and relational data derived from the event clip metadata (involving people, objects, and tags, etc.).

[0066] The family semantic event database uses the main event table as its core table, with the event identifier as the primary key. It records core fields such as event type, start and end time, duration, confidence level, camera identifier, location tag, associated original video path, segment path, and whether pre-recorded buffers are included. The event-person association table, event-object association table, and event tag table each use the event identifier as a foreign key, recording extended fields such as the person's role, person's entry / exit frame number, object name, object action type, object bounding box, and tag value. Indexes are created for frequently queried fields such as time, type, camera, person, object, location, and tag. The database generates search results that support multiple dimensions, including time interval, event type, camera, person, object, location, and tag.

[0067] The bidirectional mapping index module is used to maintain a bidirectional index between event segments and the original video stream, supporting backtracking from segments to the original video, and also supporting the location of all related segments from the original video.

[0068] The input information consists of event segment metadata and metadata from the original video archive (submitted periodically by the continuous stream storage module). When an event segment is written, the bidirectional mapping index module records the segment identifier in the bidirectional index table, recording the forward mapping of the original video path, start frame, and end frame. When the original video is archived, it scans all segments written within the corresponding time period of the original video, recording the original video path and time period as a reverse mapping of the segment identifier set. Both mappings are maintained in the database through the association between the event identifier and the original video path. Generating a given segment identifier returns the original video path and start and end frame numbers; generating a given original video path and time period returns all segment identifiers within that time period.

[0069] The event node output module is used to push the event, in the form of structured event nodes, to the family knowledge graph construction module after the event fragment and its metadata have been fully written to the database, serving as the data source for the graph nodes. The input information is the complete event record merged from the main event table and all associated tables. The event node data is assembled according to the graph node protocol, including the event identifier (as the graph node identifier), event type (as the node type), time interval (as the node's time attribute), camera identifier and location tag (as the node's spatial attribute), involved personnel roles and object names (as input for the node's association attributes), and associated original video path (as the node's backtracking attribute). The event node is then sent to the graph construction module through a preset push channel, generating structured event nodes and recording the push result (including success or failure status; in case of failure, a retry or alarm is recorded).

[0070] In one embodiment, Figure 4 This is a flowchart of another video storage method provided according to Embodiment 3 of the present invention, as follows: Figure 4 As shown, the method includes: Step 1, Signal Reception: The external home sensing smart module pushes semantic event boundary signals (start signal or end signal) to the external event signal receiving module. After verifying the legality of the signal, the signal receiving module parses it into an internal event record and pushes it to the event segmentation module.

[0071] Step 2, Segment Creation: After receiving the start signal, the event segmentation module creates a pending event segment record for the event and begins caching the corresponding camera's video frames to a temporary buffer.

[0072] Step 3, Frame Buffering: Continuously input video frames (with frame-level timestamps) from the camera are continuously written to a temporary buffer and associated with the suspended event log. This step may take several seconds to several minutes, continuously accumulating frame data during the event period.

[0073] Step 4, Boundary Frame Location: After receiving the end signal (a new start signal of the same event type is considered an implicit end), the event segmentation module compares the signal timestamp with the original video frame timestamp, and takes the earliest frame containing the event features in the original video stream as the actual start frame and the latest frame containing the event features as the actual end frame.

[0074] Step 5, Fragment Encapsulation: Based on the located start and end frames, extract the corresponding frame sequence from the temporary buffer, encapsulate it into an independent event fragment file, and encode it with high-quality encoding parameters; synchronously generate event fragment metadata, including the actual start frame number, the actual end frame number, the keyframe list, and the fragment file path.

[0075] Step 6: Metadata storage: Event fragment metadata and derived relational data are written into the main event table and related tables of the family semantic event database; forward mapping (fragment identifier to original video path and start and end frame numbers) is registered in the bidirectional mapping index module simultaneously.

[0076] In one embodiment, Figure 5 This is a flowchart of a bidirectional mapping index query provided in Embodiment 3 of the present invention, as follows: Figure 5 As shown, a query request can include a segment identifier or the original video path plus a search time period. Two search paths are distinguished based on the parameters carried in the query request: when the input parameter is a segment identifier, it is determined to be a forward mapping query; when the input parameter is the original video path plus a time period, it is determined to be a reverse mapping query. When it is a forward mapping query, the statement " This means that based on the forward index table `forward_index`, a query is performed using the event identifier `event_id` as the search condition. This allows for the retrieval of video-related information corresponding to the event based on the event identifier, completing the forward tracing from the semantic event to the video segment and obtaining the original video path, start frame number, and end frame number. When performing a reverse mapping query, the statement " "" means that based on the reverse index table reverse_index, the original video path raw_path and timestamp range are used as joint search conditions to perform a query. The corresponding event identifier information is found according to the video path and time period, and the reverse tracing from video segment to semantic event is completed, returning the set of all time segment identifiers within the time period.

[0077] Step 7, Graph Node Output: The graph event node output module reads complete event records from the database, assembles them into structured event nodes according to the graph node protocol, and pushes them to the family knowledge graph construction module; after successful push, the process ends.

[0078] In one embodiment, taking a scenario with a single camera (CAM-LIVING) deployed in the living room, and a user entering the living room at 15:30:00 as an example, the video storage method is further explained as follows: The input information includes a continuously input video stream (30fps, with frame-level timestamps) from the CAM-LIVING camera, and a semantic event boundary signal (event ID: EVT-2026-0515-001; event type: person_enter; trigger signal type: start; timestamp: 2026-05-15T15:30:05+08:00) pushed by the home sensing smart module at 15:32:30, with the following characteristics: Event ID: EVT-2026-0515-001; event type: person_enter; trigger signal type: end; timestamp: 2026-05-15T15:32:30+08:00. The home sensing smart module also pushes a semantic event boundary signal (event ID: EVT-2026-0515-001; event type: person_enter; trigger signal type: end; timestamp: 2026-05-15T15:32:30+08:00).

[0079] Step 1: Signal Reception. The external event signal receiving module receives two signals, both of which pass the validity check and are parsed as internal event records.

[0080] Step 2, Segment Creation. After receiving the start signal, the event segmentation module creates a suspension record for EVT-2026-0515-001 and begins caching CAM-LIVING video frames to a temporary buffer.

[0081] Step 3, Frame Buffering. Between 15:30:05 and 15:32:30, CAM-LIVING continuously inputs video frames (4350 frames in total) and writes them to a temporary buffer.

[0082] Step 4, Boundary Frame Location. After receiving the end signal, the segmentation module compares the signal timestamp 15:30:05 with the original video frame timestamp and searches for event features (personnel entry) in the neighborhood: Frame 120 (15:30:04.000) is located as the actual start frame, and Frame 4350 (15:32:30.000) is located as the actual end frame.

[0083] Step 5: Segment Encapsulation. The segmentation module extracts the frame sequence from Frame120 to Frame4350 from the temporary buffer, encapsulates it into an independent segment file / storage / segments / CAM-LIVING / 2026-05 / EVT-2026-0515-001.lv, encodes it with high-quality encoding parameters, and generates metadata (including start frame number 120, end frame number 4350, and a list of keyframes [120, 60×30+120, ..., 4350]).

[0084] Step 6: Metadata Input. The Family Semantic Event Database receives metadata and writes it to the main event table (EVT-2026-0515-001, person_enter, person, start 15:30:04, end 15:32:30, duration 145 seconds, confidence level 0.92, camera CAM-LIVING, location living_room, associated raw video / storage / raw / CAM-LIVING / 2026-05 / 2026-05-15.lv, segment path / storage / segments / CAM-LIVING). G / 2026-05 / EVT-2026-0515-001.lv, pre-recording buffer flag true) and event-person association table (event EVT-2026-0515-001, person P001, role adult, entry frame 120, exit frame 4350); synchronously register the forward mapping in the bidirectional mapping index module (segment EVT-2026-0515-001 to original video / storage / raw / CAM-LIVING / 2026-05 / 2026-05-15.lv + start frame 120 + end frame 4350).

[0085] Step 7: Graph Node Output. The graph event node output module reads complete event records from the database, assembles them into structured event nodes (node ​​identifier EVT-2026-0515-001, node type person_enter, time attribute 2026-05-15T15:30:04+08:00 to 2026-05-15T15:32:30+08:00, spatial attribute CAM-LIVINGliving_room, involved person P001adult, tag morning_entryfamily_member, retrospective attribute / storage / raw / CAM-LIVING / 2026-05 / 2026-05-15.lv), and pushes it to the family knowledge graph construction module.

[0086] Output: Independent event fragment file: / storage / segments / CAM-LIVING / 2026-05 / EVT-2026-0515-001.lv. Database records: 1 main event table + 1 event-person association + 1 bidirectional index; 1 structured event node pushed to the family knowledge graph construction module.

[0087] In one embodiment, two cameras are deployed within a home (CAM-LIVING in the living room and CAM-BEDROOM in the bedroom). An elderly person (P002, role elder) stands up from the sofa in the living room and walks to sit down in the bedroom. Assuming the event spans both cameras, the input information includes a continuously input video stream (30fps) from both cameras (CAM-LIVING and CAM-BEDROOM). The home sensing smart module pushed four signals: Signal 1 (15:45:10, start): Event ID EVT-2026-0515-002, Event type person_move, Camera CAM-LIVING, Confidence 0.88; Signal 2 (15:45:35, end): Event ID EVT-2026-0515-002, Event type person_move, Camera CAM-LIVING, Confidence 0.88; Signal 3 (15:45:36, start): Event ID EVT-2026-0515-002, Event type person_move, Camera CAM-BEDROOM, Confidence 0.85; Signal 4 (15:46:20, end): Event ID EVT-2026-0515-002, Event type person_move, Camera CAM-BEDROOM, Confidence 0.85.

[0088] Step 1, Signal Reception. The external event signal receiving module receives 4 signals, all of which pass the validity check and are parsed as internal event records (sharing the same event identifier EVT-2026-0515-002, but with different camera dimensions).

[0089] Step 2, Segment Creation. Signal 1 triggers the creation of a suspend record for CAM-LIVING (denoted as suspend segment L); signal 2 triggers the end of suspend segment L; signal 3 triggers the creation of a suspend record for CAM-BEDROOM (denoted as suspend segment B); signal 4 triggers the end of suspend segment B.

[0090] Step 3, Frame Buffering. During Suspension Segment L, 750 frames of CAM-LIVING are buffered; during Suspension Segment B, 1320 frames of CAM-BEDROOM are buffered.

[0091] Step 4: Boundary Frame Location. Suspended Segment L Boundary Location: Within the CAM-LIVING neighborhood, Frame 50 (15:45:09.667) is the starting frame, and Frame 800 (15:45:35.667) is the ending frame. Suspended Segment B Boundary Location: Within the CAM-BEDROOM neighborhood, Frame 30 (15:45:36.000) is the starting frame, and Frame 1350 (15:46:20.000) is the ending frame.

[0092] Step 5: Segment Encapsulation. Two independent segment files are generated: Suspended segment L: / storage / segments / CAM-LIVING / 2026-05 / EVT-2026-0515-002.lv (Frame 50—800); Suspended segment B: / storage / segments / CAM-BEDROOM / 2026-05 / EVT-2026-0515-002.lv (Frame 30—1350).

[0093] Step 6: Data Storage. Write one record to the main event table (shared event identifier EVT-2026-0515-002, event type person_move, start time 15:45:09.667, end time 15:46:20.000, duration approximately 70 seconds, involving 2 cameras); write one record to the event-person association table (involving person P002, role elder, entry frame 50 in the living room segment, exit frame 800, entry frame 30 in the bedroom segment, exit frame 1350); register two forward mappings in the bidirectional mapping index module (associated to the CAM-LIVING original video and the CAM-BEDROOM original video respectively).

[0094] Step 7: Graph Node Output. The graph event node output module assembles one event node (node ​​identifier EVT-2026-0515-002, node type person_move, time attribute 2026-05-15T15:45:09.667+08:00 to 2026-05-15T15:46:20.000+08:00, spatial attribute CAM-LIVINGliving_room associated with CAM-BEDROOMbedroom, involving person P002elder), and pushes it to the family knowledge graph construction module.

[0095] Output: 2 independent event fragment files (1 each for CAM-LIVING and CAM-BEDROOM, sharing the same event identifier); 1 main event table + 1 event-person association (shared by multiple cameras) + 2 bidirectional indexes; 1 structured event node pushed to the family knowledge graph construction module (cross-camera events are treated as 1 graph node).

[0096] Example 4 Figure 6 This is a schematic diagram of the structure of a video storage device according to Embodiment 4 of the present invention. Figure 6 As shown, the device includes: a data parsing module 61, a video caching module 62, a metadata determination module 63, and a video storage module 64.

[0097] The data parsing module 61 is used to acquire semantic event boundary signals sent by external devices and parse the semantic event boundary signals to obtain event records. The event records include at least an event identifier, a trigger signal type, entity information, a timestamp, and a camera identifier.

[0098] The video caching module 62 is used to create a suspended record associated with the event identifier if the trigger signal type is a start signal, and cache the original video frame corresponding to the camera identifier to the temporary buffer corresponding to the suspended record until the target signal is received, and determine the start frame and end frame of the original video frame according to the timestamp.

[0099] The metadata determination module 63 is used to extract the target frame sequence from the temporary buffer based on the start frame and the end frame, use the target frame sequence as an event fragment, and generate the event fragment metadata corresponding to the event fragment.

[0100] The video storage module 64 is used to store event segment metadata into a preset family semantic event database, establish a bidirectional mapping index between event segments and original video data, and update the preset family knowledge graph based on the preset family semantic event database and the bidirectional mapping index.

[0101] The technical solution of this invention involves obtaining semantic event boundary signals sent by external devices through a data parsing module, parsing the semantic event boundary signals to obtain event records, and creating a suspended record associated with the event identifier if the trigger signal type is a start signal. The original video frame corresponding to the camera identifier is then cached in a temporary buffer corresponding to the suspended record until the target signal is received. The start and end frames of the original video frame are determined based on the timestamp. The metadata determination module extracts the target frame sequence from the temporary buffer based on the start and end frames. The video storage module uses the target frame sequence as an event fragment, generates event fragment metadata corresponding to the event fragment, and achieves video segmentation according to events. The event fragment metadata is stored in a preset family semantic event database, establishing a bidirectional mapping index between event fragments and original video data. The preset family knowledge graph is updated based on the preset family semantic event database and the bidirectional mapping index, achieving bidirectional and accurate tracing of semantic events and video evidence, and improving the rationality of video storage.

[0102] In one embodiment, the data parsing module 61 includes: The signal receiving unit is used to establish a signal channel with external devices and receive semantic event boundary signals sent by external devices through the signal channel.

[0103] In one embodiment, the video caching module 62 includes: The record creation unit is used to create a suspended record based on the event identifier, camera identifier, and timestamp if the trigger signal type is a start signal. The video buffer unit is used to determine the temporary buffer bound to the suspended record, and to buffer the original video frame corresponding to the camera identifier into the temporary buffer until the target signal is received; wherein, the target signal includes a semantic event boundary signal with the trigger signal type of end signal, or a semantic event boundary signal with the same trigger signal type as the camera identifier and the trigger signal type of start signal; The frame number determination unit is used to filter candidate original video frames in a temporary buffer based on timestamps, identify event features of the candidate original video frames, determine the first video frame containing event features as the start frame, and determine the last video frame containing event features as the end frame.

[0104] In one embodiment, the metadata determination module 63 includes: Read all video frames from the start frame to the end frame from the temporary buffer as the target frame sequence; The fragment encapsulation unit is used to encapsulate the target frame sequence into event fragments according to the original frame order of the target frame sequence; The path storage unit is used to encode and compress event fragments using preset encoding parameters to obtain event fragment files, and write the event fragment files to the preset storage path; Metadata units are used to determine the duration of a specific event fragment. They combine the preset storage path, duration, start frame, end frame, and event record to form the event fragment metadata.

[0105] In one embodiment, the video storage module 64 includes: The main table storage unit is used to store event fragment metadata into the event main table of the preset family semantic event database; The association table storage unit is used to determine the relationship information between entity information and event fragments in the event record and store the relationship information in the association table of the preset family semantic event database; The index creation unit is used to create a forward mapping index from event segments to original video data using the event identifier in the event record as the key, and to create a reverse mapping index from original video data to event segments using the storage path of the original video data as the key. The image update unit is used to update the preset family knowledge graph by using the forward mapping index and the reverse mapping index as bidirectional mapping indexes, according to the event master table, the related table, and the bidirectional mapping indexes.

[0106] In one embodiment, the video storage device further includes: The destruction module is used to destroy suspended records and release the temporary buffers bound to the suspended records.

[0107] The video storage device provided in the embodiments of the present invention can execute the video storage method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.

[0108] Example 5 Figure 7 This is a schematic diagram of the structure of an electronic device implementing the video storage method of an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0109] like Figure 7 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0110] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0111] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as video storage methods.

[0112] In some embodiments, the video storage method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the video storage method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the video storage method by any other suitable means (e.g., by means of firmware).

[0113] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0114] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0115] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0116] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0117] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0118] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0119] In one embodiment, the present invention further includes a computer program product, which includes a computer program that, when executed by a processor, implements the video storage method of any embodiment of the present invention.

[0120] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof. Programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0121] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0122] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A video storage method, characterized in that, include: Acquire semantic event boundary signals sent by external devices, and parse the semantic event boundary signals to obtain event records; wherein, the event records include at least an event identifier, a trigger signal type, entity information, a timestamp, and a camera identifier; If the trigger signal type is a start signal, a suspension record associated with the event identifier is created, and the original video frame corresponding to the camera identifier is cached in the temporary buffer corresponding to the suspension record until the target signal is received. The start frame and end frame of the original video frame are determined according to the timestamp. Based on the start frame and the end frame, a target frame sequence is extracted from the temporary buffer, and the target frame sequence is used as an event fragment to generate event fragment metadata corresponding to the event fragment. The event fragment metadata is stored in a preset family semantic event database, a bidirectional mapping index is established between the event fragment and the original video data, and the preset family knowledge graph is updated according to the preset family semantic event database and the bidirectional mapping index.

2. The method according to claim 1, characterized in that, The acquisition of semantic event boundary signals sent by external devices includes: Establish a signal channel with the external device, and receive semantic event boundary signals sent by the external device through the signal channel.

3. The method according to claim 1, characterized in that, If the trigger signal type is a start signal, a suspension record associated with the event identifier is created, and the original video frame corresponding to the camera identifier is cached in the temporary buffer corresponding to the suspension record until the target signal is received. The start and end frames of the original video frame are determined according to the timestamp, including: If the trigger signal type is a start signal, a suspension record is created according to the event identifier, the camera identifier, and the timestamp; A temporary buffer bound to the suspended record is determined, and the original video frame corresponding to the camera identifier is cached in the temporary buffer until the target signal is received; wherein, the target signal includes a semantic event boundary signal with the trigger signal type of an end signal, or a semantic event boundary signal with the same trigger signal type as the camera identifier and the trigger signal type of a start signal; Based on the timestamp, candidate original video frames are obtained by filtering in a temporary buffer, the event features of the candidate original video frames are identified, the first video frame containing the event features is determined as the start frame, and the last video frame containing the event features is determined as the end frame.

4. The method according to claim 1, characterized in that, The step of extracting a target frame sequence from the temporary buffer based on the start frame and the end frame, using the target frame sequence as an event fragment, and generating event fragment metadata corresponding to the event fragment includes: Read all video frames from the start frame to the end frame from the temporary buffer as the target frame sequence; According to the original frame order of the target frame sequence, the target frame sequence is encapsulated into event fragments; The event fragment is encoded and compressed using preset encoding parameters to obtain an event fragment file, and the event fragment file is written to a preset storage path; The duration of the event segment is determined, and the preset storage path, the duration, the start frame, the end frame, and the event record are combined to form event segment metadata.

5. The method according to claim 1, characterized in that, The step of storing the event segment metadata in a preset family semantic event database, establishing a bidirectional mapping index between the event segment and the original video data, and updating the preset family knowledge graph according to the preset family semantic event database and the bidirectional mapping index includes: The event fragment metadata is stored in the event master table of the preset family semantic event database; Determine the relationship information between the entity information in the event record and the event fragment, and store the relationship information in the association table of the preset family semantic event database; Using the event identifier in the event record as the key, a forward mapping index from the event segment to the original video data is established; using the storage path of the original video data as the key, a reverse mapping index from the original video data to the event segment is established. The forward mapping index and the reverse mapping index are used as bidirectional mapping indexes, and the preset family knowledge graph is updated according to the event master table, the association table, and the bidirectional mapping indexes.

6. The method according to claim 1, characterized in that, After extracting the target frame sequence from the temporary buffer based on the start frame and the end frame, using the target frame sequence as an event fragment, and generating event fragment metadata corresponding to the event fragment, the method further includes: Destroy the suspended record and release the temporary buffer bound to the suspended record.

7. A video storage device, characterized in that, include: The data parsing module is used to acquire semantic event boundary signals sent by external devices and parse the semantic event boundary signals to obtain event records; wherein, the event records include at least an event identifier, a trigger signal type, entity information, a timestamp, and a camera identifier; The video caching module is used to create a suspension record associated with the event identifier if the trigger signal type is a start signal, and cache the original video frame corresponding to the camera identifier to the temporary buffer corresponding to the suspension record until the target signal is received, and determine the start frame and end frame of the original video frame according to the timestamp. The metadata determination module is used to extract a target frame sequence from the temporary buffer based on the start frame and the end frame, use the target frame sequence as an event fragment, and generate event fragment metadata corresponding to the event fragment. The video storage module is used to store the event segment metadata into a preset family semantic event database, establish a bidirectional mapping index between the event segment and the original video data, and update a preset family knowledge graph based on the preset family semantic event database and the bidirectional mapping index.

8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the video storage method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the video storage method according to any one of claims 1-6.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the video storage method according to any one of claims 1-6.