File updating method and device, electronic equipment and storage medium
By using semantic segmentation and differential filtering driven by file attribute vectors, the problems of low transmission efficiency and storage expansion in version updates of large-capacity files are solved, achieving efficient and lightweight version management.
Patent Information
- Application Number
- CN202611358917.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-03
- Publication Date
- 2026-11-27
AI Technical Summary
In existing technologies, version updates of large-capacity multimedia files and design source files lead to low transmission efficiency and rapid expansion of warehouse storage space, making it difficult to meet the needs of efficient and lightweight version management.
By analyzing the file attribute vectors of the files to be managed, semantic segmentation is performed to generate semantic blocks. Based on the file attribute vectors and a preset version library, a set of differentiated semantic blocks is selected, and only the differentiated blocks are stored and updated.
It achieves efficient incremental storage and low-overhead transmission, significantly reducing warehouse size expansion and network transmission overhead, and lowering version management costs.
Smart Images

Figure CN123178356A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a file update method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, distributed version control systems have become the industry standard for collaborative management of text files, and are widely used in software development, document collaboration, and other scenarios. However, files undergo continuous version updates and iterations during use.
[0003] In related technologies, existing file update methods mainly adopt the method of directly replacing the entire file to achieve version updates, that is, replacing the old version file with the new version file. Although this method can complete the version replacement, when dealing with large files such as images, videos, and design files, the large size and complex structure of the files cause low network transmission efficiency due to direct replacement. At the same time, storing the entire file for each update can easily lead to the rapid expansion of the repository storage space with version iterations, making it difficult to meet the needs of efficient and lightweight version management.
[0004] The above statements are for the purpose of providing background information in relation to this application only and do not necessarily constitute prior art. Summary of the Invention
[0005] The purpose of this application is to provide a file update method, apparatus, electronic device, and storage medium to solve the technical problems in the prior art where full replacement updates for large multimedia files, design source files, and other unstructured data result in low transmission efficiency and rapid expansion of the version repository size due to full storage, failing to meet the requirements for efficient and lightweight version management. The specific technical solution is as follows: In a first aspect of this application, a file update method is provided, the method comprising: Upon receiving a file update instruction, the file to be managed is analyzed to determine the file attribute vector corresponding to the file to be managed; Based on the file attribute vector, the file to be managed is semantically segmented to obtain at least one semantic block; Based on the file attribute vector and the preset version library, each semantic block is filtered to determine a set of differentiated semantic blocks; The differentiated semantic block set is stored and version updated in response to the file update command.
[0006] In an optional implementation, the step of analyzing the file to be managed and determining the file attribute vector corresponding to the file to be managed includes: The format parsing engine is invoked to analyze the file to be managed, and to determine the file type and file format corresponding to the file to be managed; Based on the file type and the file format, determine the file attribute vector corresponding to the file to be managed.
[0007] In an optional implementation, the step of semantically segmenting the file to be managed into at least one semantic block based on the file attribute vector includes: From the preset semantic splitting relationships, determine the target block splitting rule corresponding to the file attribute vector; According to the target segmentation rules, the file to be managed is semantically segmented to obtain at least one semantic block.
[0008] In an optional implementation, the differentiated semantic block set includes at least one differentiated semantic block, and the step of filtering each semantic block according to the file attribute vector and a preset version library to determine the differentiated semantic block set includes: For any semantic block, determine the data feature vector corresponding to the semantic block; Generate a fingerprint vector corresponding to the semantic block based on the file attribute vector and the data feature vector corresponding to the semantic block; The fingerprint vector corresponding to the semantic block is compared with the fingerprint vector corresponding to each historical semantic block in the preset version library; If the fingerprint vector does not match the fingerprint vector corresponding to any historical semantic block in the preset version library, then the semantic block is taken as the differentiated semantic block.
[0009] In an optional implementation, determining the data feature vector corresponding to the semantic block includes: Extract the data stream corresponding to the semantic block and determine the attributes of the data stream; Feature extraction is performed on the data stream corresponding to the semantic block to obtain local content features; Based on the local content features and the attributes of the data stream, the data feature vector corresponding to the semantic block is determined.
[0010] In an optional implementation, generating the fingerprint vector corresponding to the semantic block based on the file attribute vector and the data feature vector corresponding to the semantic block includes: Obtain the weight vector corresponding to the file attribute vector; The file attribute vector is weighted based on the weight vector to obtain a weighted file attribute vector. Based on the weighted file attribute vector and the data feature vector corresponding to the semantic block, a fingerprint vector corresponding to the semantic block is generated; or, The file attribute vector and the data feature vector corresponding to the semantic block are concatenated to generate the fingerprint vector corresponding to the semantic block; or, The file attribute vector and the data feature vector corresponding to the semantic block are mapped according to a preset hash function to generate the fingerprint vector corresponding to the semantic block.
[0011] In an optional implementation, generating the fingerprint vector corresponding to the semantic block based on the weighted file attribute vector and the data feature vector corresponding to the semantic block includes: The weighted file attribute vector and the data feature vector corresponding to the semantic block are concatenated to generate the fingerprint vector corresponding to the semantic block; or, The weighted file attribute vector and the data feature vector corresponding to the semantic block are mapped according to a preset hash function to generate the fingerprint vector corresponding to the semantic block.
[0012] In an optional implementation, the storage and version update processing of the differentiated semantic block set in response to the file update instruction includes: For any differentiated semantic block in the differentiated semantic block set, the differentiated semantic block is uploaded to the block data storage area, and the storage address of the differentiated semantic block is recorded. Version update information is generated based on the storage address of each of the differentiated semantic blocks in response to the file update instruction.
[0013] In an optional implementation, after uploading the differentiated semantic block to the block data storage area, the method further includes: Establish a mapping relationship between the fingerprint vector of the differentiated semantic block and the storage address; Based on the mapping relationship, an index record is created or updated in the preset version library.
[0014] In a second aspect of this application, a file updating apparatus is also provided, the apparatus comprising: The attribute vector determination module is used to analyze the file to be managed and determine the file attribute vector corresponding to the file to be managed when a file update instruction is received. The semantic block generation module is used to semantically divide the file to be managed into blocks based on the file attribute vector to obtain at least one semantic block; The differential semantic block set determination module is used to filter each semantic block according to the file attribute vector and the preset version library to determine the differential semantic block set; The instruction response module is used to store and update the version of the differentiated semantic block set in response to the file update instruction.
[0015] In a third aspect of the embodiments of this application, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the file update method described in any one of the first aspects above.
[0016] In a fourth aspect of the embodiments of this application, a storage medium is also provided, the storage medium storing instructions that, when run on a computer, cause the computer to execute any of the file update methods described in the first aspect above.
[0017] In a fifth aspect of the embodiments of this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the file update methods described in the first aspect above.
[0018] The technical solution provided in this application analyzes the file to be managed upon receiving a file update instruction to determine the file attribute vector corresponding to the file to be managed; based on the file attribute vector, the file to be managed is semantically segmented to obtain at least one semantic block; based on the file attribute vector and a preset version library, each semantic block is filtered to determine a set of differentiated semantic blocks; and the set of differentiated semantic blocks is stored and updated to respond to the file update instruction. This technical solution, by introducing a semantic segmentation mechanism based on file attribute vectors, abandons the inefficient mode of traditional full copy storage or fixed-size segmentation. It can achieve precise segmentation based on file attribute vectors, ensuring that the data within each semantic block is complete and has independent meaning, thus laying the foundation for subsequent file updates. At the same time, by combining file attribute vectors with a preset version library to differentiate and filter semantic blocks, only the set of differentiated blocks is stored and updated to respond to the file update instruction, eliminating the need to repeatedly upload the complete file. This significantly reduces the expansion of the repository size and network transmission overhead, thereby achieving efficient incremental storage and low-overhead transmission of the file to be managed, significantly reducing the version management cost for enterprises and individual users, and meeting the needs of efficient and lightweight version management. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0022] Figure 1 A schematic diagram illustrating the implementation process of a file update method provided in this application embodiment; Figure 2 A schematic diagram illustrating the implementation process of a method for determining file attribute vectors provided in this application embodiment; Figure 3 A schematic diagram illustrating the implementation process of a method for segmenting files to be managed, provided in an embodiment of this application; Figure 4 A schematic diagram illustrating the implementation process of a semantic block filtering method provided in this application embodiment; Figure 5 A schematic diagram illustrating the implementation process of another file update method provided in this application embodiment; Figure 6 A schematic diagram illustrating the implementation process of another file update method provided in this application embodiment; Figure 7 This is a schematic diagram of the structure of a file updating device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] The following disclosure provides numerous different embodiments or examples for implementing various structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0025] The document update method provided in this application will be further explained and described below with reference to the accompanying drawings and specific embodiments. The embodiments do not constitute a limitation on the embodiments of the present invention.
[0026] To address the technical challenges of existing technologies for handling large files such as images, videos, and design documents, where direct replacement due to their size and complex structure leads to inefficient network transmission, and where storing the entire file with each update results in rapid expansion of repository storage space with each version iteration, failing to meet the requirements for efficient and lightweight version management, this application provides a file update method. Upon receiving a file update instruction, the method analyzes the file to be managed to determine its corresponding file attribute vector; based on the file attribute vector, it semantically segments the file to be managed into at least one semantic block; based on the file attribute vector and a preset version library, it filters each semantic block to determine a set of differentiated semantic blocks; and it stores and updates the set of differentiated semantic blocks in response to the file update instruction.
[0027] This technical solution introduces a semantic block segmentation mechanism based on file attribute vectors, abandoning the inefficient traditional full copy storage or fixed-size block segmentation model. It can achieve precise segmentation based on file attribute vectors, ensuring that the data within each semantic block is complete and has independent meaning, thus laying the foundation for subsequent file updates. At the same time, by combining file attribute vectors with a preset version library to perform differential filtering of semantic blocks, only the differential block set is stored and version updated to respond to file update commands, eliminating the need to repeatedly upload complete files. This significantly reduces the expansion of the repository size and network transmission overhead, thereby enabling efficient incremental storage and low-overhead transmission of files to be managed, significantly reducing the version management costs for enterprises and individual users, and meeting the needs of efficient and lightweight version management.
[0028] like Figure 1 The diagram shown illustrates the implementation flow of a file update method provided in this application, which may specifically include the following steps: S101, upon receiving a file update instruction, analyzes the file to be managed and determines the file attribute vector corresponding to the file to be managed.
[0029] The aforementioned file update command refers to the native command that triggers version management operations on the files to be managed, including but not limited to commands such as `git add`, `git commit`, and `git push` in distributed version control systems, or equivalent commands such as file commits, uploads, and synchronization requests. This command is used to trigger a version update for the files to be managed.
[0030] The aforementioned files to be managed refer to binary files that require version management (such as version updates), including but not limited to image files (such as PNG, JPG, etc.), video files (such as MP4, AVI, etc.), design source files (such as PSD, AI, etc.), and other unstructured or semi-structured binary data files.
[0031] The aforementioned file attribute vector refers to a set of features describing the file format and file type of the file to be managed. The file format refers to the binary data organization specifications and encoding methods of the file to be managed, used to determine the boundaries of divisible units and the types of semantic units within the file. For example, a PNG file uses key data blocks (IHDR, IDAT, IEND, etc.) to organize image data, while an MP4 file stores audio and video tracks, metadata, and sampling information using a box structure. The file type refers to the data category to which the file to be managed belongs, such as images, videos, audio, 3D models, design source files, engineering drawings, etc.
[0032] In this embodiment, upon receiving a file update instruction, it indicates that a version change is required for the file. At this point, the file to be managed can be analyzed to determine its corresponding file attribute vector. This step is used for identifying and classifying the file to be managed.
[0033] It should be noted that the execution entity in this application embodiment may be a plug-in module (such as Git Filter Driver) integrated into a distributed version control system, or an independent version management extension service, which is deployed on the user's local computing device or code repository server.
[0034] As for the specific methods for analyzing and determining the file attribute vectors corresponding to the files to be managed, these will be explained below. Figure 2 The process shown will be explained in detail here.
[0035] S102, based on the file attribute vector, perform semantic segmentation of the file to be managed to obtain at least one semantic block.
[0036] The aforementioned semantic chunking refers to the process of logically breaking down the files to be managed. Unlike existing fixed-size chunking, this semantic chunking ensures that each semantic block has complete semantic meaning in terms of business or content (such as a layer in an image file, a group of frames in a video file, or a vector object in a design file).
[0037] The aforementioned semantic block refers to the smallest data unit with independent semantic information obtained after semantic segmentation. Semantic blocks can serve as the basic granularity for version difference comparison and updates; for example, an IDAT compressed block in a PNG file, a sequence of P / B frames associated with an I-frame in an H.264 video file, or a visible layer in a PSD file.
[0038] In this embodiment, the file to be managed is semantically segmented based on the file attribute vector to obtain at least one semantic block. This step is used to decompose the file to be managed into multiple semantic blocks that are internally complete and have clear boundaries.
[0039] The specific method of semantically segmenting the file to be managed into blocks based on file attribute vectors to obtain at least one semantic block will be explained below. Figure 3 The process shown will be explained in detail here.
[0040] S103, based on the file attribute vector and the preset version library, filter each semantic block to determine the set of differentiated semantic blocks.
[0041] The aforementioned pre-defined repository refers to a data set used to store historical versions of managed binary files and their semantic block fingerprint vectors. This repository can reside on a local disk (such as the extended storage area of the object repository in a distributed version control system) or be deployed on a remote server or cloud storage.
[0042] The above filtering refers to comparing the semantic blocks obtained by splitting the current file to be managed with the semantic blocks of the corresponding historical versions in the preset version library, thereby eliminating semantic blocks that are exactly the same as the historical versions.
[0043] The aforementioned set of differentiated semantic blocks refers to the set of semantic blocks that have changed relative to any historical version in the preset version repository after filtering. This set only includes newly added and modified semantic blocks (i.e., differentiated semantic blocks), and does not include unchanged duplicate semantic blocks. That is, the set of differentiated semantic blocks consists of at least one differentiated semantic block.
[0044] In this embodiment, semantic blocks are filtered based on file attribute vectors and a preset version library to remove semantic blocks that are completely identical to historical versions, thereby determining the set of differentiated semantic blocks that need to be actually stored or transmitted. This step directly achieves the goal of storing only the changed parts, which can significantly reduce storage and transmission overhead.
[0045] The specific process of filtering semantic blocks based on file attribute vectors and preset version libraries to determine the set of differentiated semantic blocks will be explained below. Figure 4 The process shown will be explained in detail here.
[0046] S104 stores and updates the set of differentiated semantic blocks in response to file update commands.
[0047] In this embodiment of the application, a set of differentiated semantic blocks is processed in response to a file update instruction.
[0048] The specific details of how the differentiated semantic block set is stored and version-updated in response to file update commands can be explained below. Figure 5 The process shown will be explained in detail here.
[0049] Based on the above description of the technical solution provided by the embodiments of this application, upon receiving a file update instruction, the file to be managed is analyzed to determine the file attribute vector corresponding to the file to be managed; based on the file attribute vector, the file to be managed is semantically segmented to obtain at least one semantic block; based on the file attribute vector and a preset version library, each semantic block is filtered to determine a set of differentiated semantic blocks; the set of differentiated semantic blocks is stored and version updated to respond to the file update instruction.
[0050] This technical solution introduces a semantic block segmentation mechanism based on file attribute vectors, abandoning the inefficient traditional full copy storage or fixed-size block segmentation model. It can achieve precise segmentation based on file attribute vectors, ensuring that the data within each semantic block is complete and has independent meaning, thus laying the foundation for subsequent file updates. At the same time, by combining file attribute vectors with a preset version library to perform differential filtering of semantic blocks, only the differential block set is stored and version updated to respond to file update commands, eliminating the need to repeatedly upload complete files. This significantly reduces the expansion of the repository size and network transmission overhead, thereby enabling efficient incremental storage and low-overhead transmission of files to be managed, significantly reducing the version management costs for enterprises and individual users, and meeting the needs of efficient and lightweight version management.
[0051] like Figure 2 The diagram shown is a schematic representation of the implementation flow of a method for determining file attribute vectors provided in an embodiment of this application. Figure 2 exist Figure 1 Building upon this foundation, the paper details how to analyze files to be managed and determine the file attribute vectors corresponding to those files. Specifically, this may include the following: S201, call the format parsing engine to analyze the file to be managed and determine the file type and file format corresponding to the file to be managed.
[0052] The aforementioned format parsing engine refers to a functional module that has built-in parsers for multiple file formats, and can identify the true format of the file to be managed based on its header signature, extension, metadata structure, or binary stream characteristics.
[0053] The file types mentioned above refer to the data categories to which the files to be managed belong, such as images, videos, audio, design source files, engineering drawings, etc.
[0054] The aforementioned file formats refer to the binary data organization specifications and encoding methods of the files to be managed, which determine the boundaries of divisible units and the types of semantic units within the file. For example, the PNG file format uses key data blocks (IHDR, IDAT, IEND, etc.) to organize image data in its binary data organization specifications and encoding methods, while the MP4 format stores audio and video tracks, metadata, and sampling information through a box structure.
[0055] In this embodiment, the file to be managed can be analyzed by calling the format parsing engine to determine the file type and file format of the file to be managed, so that the corresponding file attribute vector can be determined based on the determined file type and file format.
[0056] As an optional implementation, the format parsing engine can determine the file type and file format of the file to be managed by reading a fixed offset byte in the file header of the file to be managed and matching it with the built-in format feature library (for example, the header of a PNG file contains a PNG signature, and the header of an MP4 file starts with an ftyp box). At the same time, it can combine the file extension to perform auxiliary verification of the file type and file format of the file to be managed, preventing misjudgments caused by forged extensions.
[0057] As an alternative implementation, a feature vector template can be pre-built for each supported file format. For the file to be managed, the corresponding features in its binary stream are extracted, and the similarity (such as cosine similarity or Euclidean distance) between it and each template is calculated. The format with the highest similarity that exceeds a preset threshold is taken as the analysis result.
[0058] For files to be managed that the format parsing engine cannot analyze, the user can be prompted to manually specify the format.
[0059] S202, based on file type and file format, determine the file attribute vector corresponding to the file to be managed.
[0060] In this embodiment, the file attribute vector corresponding to the file to be managed can be determined based on the file type and file format. Specifically, features can be extracted from the file type and file format respectively, and the extracted features can be concatenated to obtain the file attribute vector corresponding to the file to be managed.
[0061] As an optional implementation, file types can be encoded or tagged, for example, using one-hot encoding or category indexing (e.g., "image" mapped to 1, "video" mapped to 2, "design source file" mapped to 3); file formats can also be encoded, for example, "PNG" mapped to 101, "MP4" mapped to 202, "PSD" mapped to 303; the feature vectors of file types and file formats are concatenated in order to form a complete file attribute vector, for example: [file type encoding, file format encoding].
[0062] like Figure 3 The diagram shown is a schematic representation of the implementation process of a method for segmenting files to be managed, according to an embodiment of this application. Figure 3 exist Figure 1 Building upon this, the paper details how to semantically segment files to be managed based on file attribute vectors to obtain at least one semantic block, which may include the following: S301, determine the target block rule corresponding to the file attribute vector from the preset semantic splitting relationship.
[0063] The aforementioned preset semantic splitting relationship refers to a pre-established association used to map file attribute vectors (or features such as file type and file format) to corresponding segmentation rules. This relationship can be represented as a lookup table, rule base, configuration file, or decision tree, storing the semantic splitting methods applicable to different file formats and types. For example, for PNG image files, the preset splitting relationship maps them to the rule of "splitting by IDAT key data blocks"; for MP4 video files, it maps them to the rule of "splitting by GOP frame groups + audio / video tracks"; and for PSD design files, it maps them to the rule of "splitting by layers + vector objects".
[0064] The aforementioned target chunking rules refer to the specific operational rules determined from the preset semantic splitting relationships, matching the file attribute vector of the currently managed file, and used to guide semantic chunking. These rules may include the identification method of semantic units (e.g., splitting based on data block identifiers, container structures, or specific markers within the file); boundary determination conditions for semantic units (e.g., offsets of the start and end of blocks, byte length, or nesting level); integrity constraints on semantic units (e.g., prohibiting the splitting of the same logical unit into different blocks); and post-processing strategies (e.g., merging excessively small semantic units and performing secondary splitting on excessively large semantic units).
[0065] In this embodiment, a target segmentation rule corresponding to the file attribute vector is determined from a preset semantic segmentation relationship. This step ensures that subsequent semantic segmentation can select the correct segmentation method based on the specific format and type of the file, avoiding problems such as semantic fragmentation or low reusability caused by generic segmentation.
[0066] As an optional implementation, the preset semantic splitting relationship can be stored in a local configuration file or a remote configuration center in the form of a key-value pair mapping table, where the "key" is the file format identifier (such as "PNG", "MP4", "PSD"), and the "value" is the corresponding chunk rule name or rule object. After obtaining the file attribute vector, the file format field is directly extracted to find the corresponding target chunk rule.
[0067] As an alternative implementation, the preset semantic splitting relationship can be implemented based on a decision tree. The system matches file types, file formats, etc., in the file attribute vector level by level, and finally selects the optimal splitting rule.
[0068] S302, according to the target segmentation rules, perform semantic segmentation on the file to be managed to obtain at least one semantic block.
[0069] In this embodiment, the file to be managed can be semantically segmented according to the target segmentation rules to obtain at least one semantic block. This step, by following the boundary judgment conditions and integrity constraints of the semantic units defined in the target segmentation rules, can ensure that each semantic block has independent semantic information in terms of business or content, avoid cross-block semantic fragmentation, and achieve a data splitting effect with high cohesion and low redundancy, thereby providing a high-quality block-granularity foundation for subsequent fingerprint calculation, difference filtering, and incremental storage.
[0070] As an optional implementation, the binary stream of the file to be managed can be scanned sequentially based on the semantic unit identifiers defined in the target chunking rules (such as block type identifiers IDAT, IHDR, IEND in PNG files; box type identifiers moov, mdat, etc. in MP4 files). Whenever a complete semantic unit boundary is identified, the byte sequence corresponding to that unit is immediately extracted as a semantic block and output, and the scanning continues until the end of the file. This method does not require loading the entire file into memory, is suitable for large file processing, and has low memory overhead.
[0071] As an alternative implementation, an initial semantic block set can be obtained by first performing a preliminary split according to the basic semantic units in the target segmentation rules. Then, for semantic blocks that are too small (e.g., smaller than a preset threshold, such as 4KB), adjacent small blocks are merged to avoid generating too many fragments. For semantic blocks that are too large (e.g., exceeding a preset threshold, such as 1MB), they are further recursively split into finer-grained sub-blocks based on their internal structure (e.g., subframe groups in a video GOP) until the size of each semantic block falls within a reasonable range. This approach can balance semantic integrity and storage and transmission efficiency, and is particularly effective when processing multimedia files with mixed bitrates or variable-length encoding.
[0072] like Figure 4 The diagram shown is a schematic representation of the implementation process of a semantic block filtering method provided in an embodiment of this application. Figure 4 exist Figure 1 Building upon this foundation, the paper details how to filter semantic blocks based on file attribute vectors and preset version libraries to determine a set of differentiated semantic blocks. Specifically, this may include the following: S401, For any semantic block, determine the data feature vector corresponding to the semantic block.
[0073] The aforementioned data feature vector refers to a set of information used to uniquely identify or describe the content attributes of a semantic block, including but not limited to attributes of the data stream and local content features corresponding to the semantic block. This data feature is used to subsequently compare with the fingerprint vectors corresponding to historical semantic blocks in a preset version library to determine whether the semantic block has changed.
[0074] In this embodiment, for any semantic block, a data feature vector corresponding to the semantic block is determined. This transforms the data stream of each semantic block into a quantifiable and comparable feature representation, thereby providing a basis for subsequent difference comparison with historical semantic blocks in a preset version library.
[0075] As an optional embodiment, determining the data feature vector corresponding to the semantic block may specifically include the following steps: Step 11: Extract the data stream corresponding to the semantic block and determine the attributes of the data stream.
[0076] The aforementioned data stream refers to the continuous byte sequence corresponding to the semantic block at the binary level, that is, the actual data content of the semantic block.
[0077] The aforementioned attributes refer to basic metadata such as the length (number of bytes) of the data stream, data type (such as video frame data, image compressed blocks, layer metadata, etc.), starting offset, and checksum.
[0078] In this embodiment, the data stream corresponding to the semantic block is extracted, and the attributes of the data stream are determined. This step, by obtaining the basic metadata of the semantic block, can provide contextual information for subsequent feature extraction.
[0079] Specifically, by reading the position offset and length information of the semantic block in the file to be managed, the corresponding continuous byte sequence can be extracted as a data stream from the file to be managed. At the same time, by parsing the header structure of the data stream, combining the type label of the semantic block (such as the block type field recorded when the block is divided) or calculating its checksum, the length, data type, starting offset, checksum and other attributes of the data stream can be determined. For example, for a video GOP semantic block extracted from an MP4 file, its offset relative to the beginning of the file (such as 0x1A2F00) and length (such as 250KB) can be obtained, and then the byte sequence within this range can be read from the file as a data stream, and its attribute can be marked as "H.264 video frame group" according to the preset type field of the GOP block.
[0080] Step 12: Extract features from the data stream corresponding to the semantic block to obtain local content features.
[0081] The aforementioned local content features refer to feature vectors used to describe local attributes such as content distribution, texture, and structure within a data stream. Local content features may include: color histograms, edge orientation histograms, and local binary patterns of image patches; motion vector features and inter-frame difference hashes of video frame groups; and vector object contour features of design files, etc.
[0082] In this embodiment, feature extraction can be performed on the data stream corresponding to the semantic block to obtain local content features. Specifically, a corresponding feature extraction algorithm can be selected based on the attributes of the data stream (such as data type, length, etc.) to calculate one or more numerical vectors that can characterize its local content features from the data stream.
[0083] For example, if the attributes of the data stream indicate that the semantic block is an image compressed data block (such as an IDAT block of PNG), the data stream can be decompressed to obtain a pixel matrix. Then, the color histogram of the pixel matrix can be calculated (e.g., quantizing each of the RGB three channels into 32 bins to obtain a 96-dimensional vector), the edge orientation histogram (e.g., using the Sobel operator to extract and statistically analyze gradient directions), or the Local Binary Pattern (LBP) texture features. If the attributes of the data stream indicate that the semantic block is a video frame group (such as GOP data of MP4), the keyframes (I-frames) and difference frames (P / B frames) in the frame group can be parsed to extract motion vector distribution features, inter-frame difference hashes (e.g., calculating the perceptual hash difference sequence of adjacent frames), and statistical features such as the average brightness and contrast of the frame group. If the attributes of the data stream indicate that the semantic block is a vector object of a design file (such as vector layer data of PSD), the geometric features such as the point set, closure, and area of its path contour can be extracted as local content features.
[0084] Step 13: Determine the data feature vector corresponding to the semantic block based on the local content features and the attributes of the data flow.
[0085] In this embodiment of the application, the data feature vector corresponding to the semantic block can be determined based on the local content features and the attributes of the data stream.
[0086] Specifically, the attributes of the data stream (such as length and type) can be concatenated or weighted with local content features to form a multi-dimensional data feature vector. For example, for an IDAT semantic block extracted from a PNG file: the attributes of the data stream include: {"length": 65536 bytes, "type": "IDAT", "offset": 0x1A2F00}; the local content features include: {"color_histogram": [0.12, 0.08, 0.15, ...], "lbp_texture": [0.23, 0.19, ...], "edge_histogram": [0.05, 0.12, ...]}. Concatenating the values in the attributes with the local content feature vector in sequence yields the data feature vector: [65536, "IDAT", 0x1A2F00, 0.12, 0.08, 0.15, ..., 0.23, 0.19, ..., 0.05, 0.12, ...]. If it is necessary to control the vector dimension or eliminate the influence of the dimension, the numerical attribute can be normalized and then combined with the feature vector in a weighted manner. For example, the length can be divided by the preset maximum block length (such as 1MB) to obtain the normalized length of 0.0625, and then combined with each component in the feature vector according to a certain weight.
[0087] S402, Generate the fingerprint vector corresponding to the semantic block based on the file attribute vector and the data feature vector corresponding to the semantic block.
[0088] The fingerprint vectors mentioned above integrate the attribute information of the file to be managed (such as file type, file format, etc.) and the content information of the semantic block itself (such as data stream attributes, local content features), which are used to compare with historical semantic blocks in the preset version library.
[0089] In this embodiment of the application, a fingerprint vector corresponding to the semantic block is generated based on the file attribute vector and the data feature vector corresponding to the semantic block.
[0090] As an optional implementation, the file attribute vector and the data feature vector corresponding to the semantic block can be concatenated to generate the fingerprint vector corresponding to the semantic block. For example, if the file attribute vector is [2, 103] (video, MP4) and the data feature vector is [65536, 0.52, 0.33, ..., "a1b2c3"], the concatenation results in [2, 103, 65536, 0.52, 0.33, ..., "a1b2c3"] as the fingerprint vector.
[0091] As another optional embodiment, the file attribute vector and the data feature vector corresponding to the semantic block can be mapped according to a preset hash function (such as SHA-256, MD5) to generate a fingerprint vector corresponding to the semantic block. For example, the file attribute vector [2, 103] and the data feature vector [65536, "a1b2c3"] can be concatenated to obtain the string 2|103|65536|a1b2c3, and then the SHA-256 hash value of this string can be calculated to obtain "d4e5f6..." as the fingerprint vector of the semantic block. Alternatively, the two vectors can be serialized separately, their hash values calculated separately, and then the two hash values concatenated to obtain the final fingerprint vector.
[0092] As another optional embodiment, generating a fingerprint vector corresponding to a semantic block based on the file attribute vector and the data feature vector corresponding to the semantic block may specifically include the following steps: Step 21: Obtain the weight vector corresponding to the file attribute vector.
[0093] In this embodiment, a weight vector corresponding to the file attribute vector can be obtained according to a preset weight allocation strategy. The weight vector characterizes the importance of each dimension in the file attribute vector during the subsequent fingerprint generation process. The weight vector can be pre-determined by statistically analyzing the discriminative power (e.g., information gain) of each dimension in different file formats, or it can be customized by the user according to actual needs. The dimensions of the weight vector are the same as those of the file attribute vector, and the weight value of each dimension is a non-negative real number.
[0094] Step 22: Weight the file attribute vector based on the weight vector to obtain the weighted file attribute vector.
[0095] In this embodiment, each feature dimension in the file attribute vector can be multiplied by its corresponding weight component to obtain a weighted file attribute vector. This step is used to highlight the attribute features that contribute significantly to the differentiation and suppress the influence of noise or redundant features, thereby improving the discriminativeness and robustness of the fingerprint vector. For example, if the file attribute vector is [file type feature, file format feature], and the corresponding weight vector is [0.6, 1.0], the weighted vector is [0.6 × file type feature, 1.0 × file format feature].
[0096] Step 23: Generate the fingerprint vector corresponding to the semantic block based on the weighted file attribute vector and the data feature vector corresponding to the semantic block.
[0097] In this embodiment of the application, a fingerprint vector corresponding to the semantic block is generated based on the weighted file attribute vector and the data feature vector corresponding to the semantic block.
[0098] As an optional embodiment, a fingerprint vector corresponding to a semantic block can be generated based on the weighted file attribute vector and the data feature vector corresponding to the semantic block. This can be achieved by concatenating the weighted file attribute vector and the data feature vector corresponding to the semantic block. For example, the weighted file attribute vector is [1.2, 206] (where 1.2 represents the weighted value of the file type and 206 represents the weighted value of the file format), and the data feature vector corresponding to the semantic block is [128000, 0.65, 0.42, "a1b2c3d4"] (representing the data stream length, the value of a certain dimension of the color histogram, the edge direction feature, and the abbreviation of the SHA-256 data fingerprint, respectively). Concatenating the two yields the fingerprint vector [1.2, 206, 128000, 0.65, 0.42, "a1b2c3d4"].
[0099] As an optional implementation, a fingerprint vector corresponding to a semantic block can be generated based on the weighted file attribute vector and the data feature vector corresponding to the semantic block. This can be achieved by mapping the weighted file attribute vector and the data feature vector corresponding to the semantic block using a preset hash function. For example, the weighted file attribute vector [1.2, 206] and the data feature vector corresponding to the semantic block [128000, 0.65, 0.42, "a1b2c3d4"] can be merged into a single string, such as "1.2|206|128000|0.65|0.42|a1b2c3d4". Then, the SHA-256 preset hash function is called on this string to obtain a fixed-length hexadecimal hash value "3f4e5a6b7c8d9e0f1a2b3c4d5e6f7890abcdef1234567890abcdef12345678" as the fingerprint vector.
[0100] S403, compare the fingerprint vector corresponding to the semantic block with the fingerprint vector corresponding to each historical semantic block in the preset version library.
[0101] In this embodiment, the fingerprint vector corresponding to the semantic block is compared one by one with the fingerprint vectors corresponding to all historical semantic blocks in a preset version library that correspond to the same historical version of the file to be managed. The comparison process can use exact matching (such as determining whether two fingerprint vectors are completely identical) or approximate matching (such as calculating the cosine similarity or Hamming distance between vectors and determining whether it exceeds a preset similarity threshold). If the fingerprint vector matches successfully, it means that the content of the semantic block already exists in the historical version; if the match fails, it means that the semantic block is newly added or modified.
[0102] S404 If the fingerprint vector does not match the fingerprint vector corresponding to any historical semantic block in the preset version library, then the semantic block is used as a differentiated semantic block.
[0103] In this embodiment, if the fingerprint vector of a semantic block does not match the fingerprint vectors of any historical semantic blocks in the preset version library (i.e., no historical semantic block has the same fingerprint vector or a similarity exceeding a threshold), it is determined that the content of the semantic block has changed (added or modified), and therefore it is included in the differentiated semantic block set as a differentiated semantic block. Conversely, if a matching historical semantic block exists, it means that the content of the semantic block is the same as the historical version (no change has occurred), and therefore the semantic block is considered unchanged and not included in the differentiated set.
[0104] like Figure 5 The diagram shown is a schematic representation of the implementation process of another file update method provided in this application. Figure 5 exist Figure 1 Building upon this, the paper details how to store and version update collections of differentiated semantic blocks in response to file update commands, which may include the following: S501: For any differentiated semantic block in the differentiated semantic block set, upload the differentiated semantic block to the block data storage area and record the storage address of the differentiated semantic block.
[0105] The aforementioned block data storage area refers to the external storage space used to independently store binary semantic blocks. This space can be a dedicated directory on a local disk, a distributed file system, an object storage service, or cloud storage. This area is decoupled from the default version control repository and is dedicated to storing semantic block data, thus preventing the repository from growing in size.
[0106] The aforementioned storage address refers to the unique location identifier of a differentiated semantic block within the block data storage area, and may include a storage path, filename, block identifier, or object link. This address should support fast random reads and writes.
[0107] In this embodiment, for any differentiated semantic block in the differentiated semantic block set, the differentiated semantic block is uploaded to the block data storage area, and the storage address of the differentiated semantic block is recorded. This step is used to persist the changed semantic block content to external storage, providing a data source for subsequent version assembly and file transfer.
[0108] It should be noted that after uploading the differentiated semantic blocks to the block data storage area, the process may further include: obtaining the fingerprint vector corresponding to the differentiated semantic blocks; establishing a mapping relationship between the fingerprint vectors of the differentiated semantic blocks and their storage addresses; and creating or updating index records in a preset version library based on the mapping relationship. Specifically, the fingerprint vectors corresponding to the semantic blocks generated in step S402 can be mapped to the block storage addresses as key-value pairs (e.g., the fingerprint vector as the key and the storage address as the value) to facilitate quick location of the corresponding block data based on the fingerprints, and the mapping relationship is written into the index table of the preset version library. The index records in the preset version library contain at least: a file identifier (such as a file path), a version identifier, the fingerprint vector corresponding to the semantic block, and the storage address corresponding to each fingerprint vector. This index record is used to support complete file assembly during subsequent file version update comparisons and quick lookup during difference comparisons.
[0109] S502 generates version update information based on the storage address of each differentiated semantic block in response to file update instructions.
[0110] The aforementioned version update information refers to structured data used to record the set of differentiated semantic blocks involved in this file update and their storage locations. It may include: the current commit version number, the path to the file to be managed, the fingerprint vector corresponding to the associated semantic block, the storage address corresponding to each fingerprint vector, and a backup of the file attribute vector. This information can be embedded in the extended fields of the commit object of the distributed version control system or stored separately in the repository's metadata file.
[0111] In this embodiment, once all differentiated semantic blocks have been successfully uploaded to the block data storage area, version update information can be generated based on the storage address and corresponding fingerprint vector of each differentiated semantic block. This information, as the execution result of the current file update instruction, is returned to the distributed version control system (such as Git) to complete subsequent processes of other native commands (such as generating commit objects, updating branch references, etc.). In this way, the distributed version control system can manage the version history of binary files through index information and external storage blocks without directly storing the complete binary file.
[0112] In another embodiment of this application, to improve the observability of file version management, the differences between the updated and unupdated versions of the file can be compared and visualized. Specifically, in response to a user-triggered `git diff` command or an equivalent difference viewing instruction, the changes to the file to be managed are transformed into a visual result. The implementation process includes the following core operations: First, difference location is performed. By comparing the semantic block fingerprint vector of the current version with the fingerprint vectors of historical versions in the preset version repository, the set of differentiated semantic blocks that have changed is determined. Then, the specific change location is located according to the semantic unit type (such as image, video, or design file) corresponding to the differentiated semantic block: if the semantic block comes from an image file, it is located to the pixel block coordinates or layer area where the change occurred; if it comes from a video file, it is located to the time interval of the frame group where the change occurred (e.g., from 2 minutes 15 seconds to 2 minutes 30 seconds); if it comes from a design file (such as PSD), it is located to the corresponding layer ID (Identifier) or vector object identifier. Second, multi-dimensional visualization is performed. For image files, the changed pixel areas are marked on the original image with a highlighted box (such as a red rectangle), and the old and new versions can be displayed side-by-side or overlaid for comparison. For video files, the content of the old and new frame groups is displayed in split-screen mode, with the location of the change marked on the timeline, and frame-by-frame preview is supported. Simultaneously, a structured text summary is automatically generated, such as "Frame group 00:02:15~00:02:18 was replaced, and the average brightness of the image increased by 20%", so that users can quickly understand the nature of the change. Furthermore, interactive adaptation features are provided. It supports mouse hover to view difference details (such as displaying specific pixel value changes), zooming to locate local changed areas, and adapts to command-line output formats (such as outputting JSON or plain text descriptions of the differences) and the display specifications of mainstream graphical clients, ensuring that users have a consistent difference viewing experience in different working environments.
[0113] Furthermore, the file update method provided in this application is illustrated with specific examples in this embodiment: like Figure 6 The diagram shown is a schematic representation of the implementation process of another file update method provided in this application. Figure 6 Taking a distributed version control system (such as Git) as an example, this paper describes in detail how to update files, which may include the following: 1. In response to user modifications to local files (such as MP4 files) and the resulting file update command (e.g., the git add command), execute the current version update process.
[0114] 2. The Git plugin layer can intercept the git add command and forward the file to the core service layer.
[0115] 3. Upon receiving a file, the semantic segmentation module in the core service layer can semantically segment the file based on its attribute vector (e.g., an attribute file containing video type and MP4 format) and call the corresponding target segmentation rules. This process parses the file into three semantic units: GOP frame groups, audio tracks, and metadata, resulting in at least one semantic block (e.g., 12 semantic blocks). Each semantic block is the smallest data unit with independent semantic information. For example, a GOP frame group serves as an independent semantic block, ensuring the integrity of the video frame group content.
[0116] 4. The fingerprint index module calculates the dual fingerprint of each semantic block (e.g., SHA-256 data fingerprint and local feature fingerprint), and compares the calculated semantic block dual fingerprint with the historical index stored in the preset version library to determine the difference blocks. After comparison, it is found that there are 3 new blocks and 2 modified blocks in the 12 semantic blocks this time, totaling 5 difference blocks (i.e., differentiated semantic blocks).
[0117] 5. The incremental storage module uploads the 5 difference blocks to the storage area (e.g., the repository of the distributed version control system), generates commit information containing block indexes (e.g., the mapping relationship between fingerprint vectors and storage addresses), and passes it to the distributed version control system to complete this version commit.
[0118] In one optional embodiment of this application, the distributed version control system can also support collaborative interaction scenarios. When other users execute a fetch command, such as `git pull`, it can download each difference block from the block data storage area based on index information and assemble the complete file, allowing other users to obtain the updated complete file. When other users execute a commit command, such as `git diff`, the difference comparison module can respond to the command by comparing the semantic block fingerprint vectors of the current version with those of historical versions, locating the changed differential semantic blocks, and generating corresponding visual comparison results based on the type of the differential semantic blocks. For example, for video files, a split-screen frame comparison interface and a structured summary (e.g., frame group modification from 00:01:30 to 00:01:45) can be generated, allowing users to view specific difference details from the split-screen frame comparison interface.
[0119] Corresponding to the above method embodiments, this application also provides a file updating device, such as... Figure 7 As shown, the device may include an attribute vector determination module 701, a semantic block generation module 702, a differentiated semantic block set determination module 703, and an instruction response module 704.
[0120] The attribute vector determination module 701 is used to analyze the file to be managed and determine the file attribute vector corresponding to the file to be managed when a file update instruction is received. The semantic block generation module 702 is used to semantically divide the file to be managed into blocks based on the file attribute vector to obtain at least one semantic block. The differential semantic block set determination module 703 is used to filter each semantic block based on the file attribute vector and the preset version library to determine the differential semantic block set; The instruction response module 704 is used to store and update the version of the differentiated semantic block set in response to file update instructions.
[0121] This application also provides an electronic device, such as... Figure 8 As shown, it includes a processor 801, a communication interface 802, a memory 803, and a communication bus 804. The processor 801, communication interface 802, and memory 803 communicate with each other via the communication bus 804. Memory 803 is used to store computer programs; In one embodiment of this application, when the processor 801 executes a program stored in the memory 803, it performs the following steps: Upon receiving a file update instruction, the system analyzes the file to be managed to determine the file attribute vector corresponding to the file to be managed; based on the file attribute vector, the system performs semantic segmentation of the file to be managed to obtain at least one semantic block; based on the file attribute vector and a preset version library, the system filters each semantic block to determine a set of differentiated semantic blocks; and the system stores and updates the set of differentiated semantic blocks to respond to the file update instruction.
[0122] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not indicate that there is only one bus or one type of bus.
[0123] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0124] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0125] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0126] In another embodiment provided in this application, a storage medium is also provided, which stores instructions that, when run on a computer, cause the computer to execute any of the file update methods described in the above embodiments.
[0127] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the file update methods described in the above embodiments.
[0128] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a storage medium or transmitted from one storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0129] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0130] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0131] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the protection scope of this application.
Claims
1. A file update method, characterized in that, The method includes: Upon receiving a file update instruction, the file to be managed is analyzed to determine the file attribute vector corresponding to the file to be managed; Based on the file attribute vector, the file to be managed is semantically segmented to obtain at least one semantic block; Based on the file attribute vector and the preset version library, each semantic block is filtered to determine the set of differentiated semantic blocks; The differentiated semantic block set is stored and version updated in response to the file update command.
2. The method according to claim 1, characterized in that, The process of analyzing the files to be managed and determining the file attribute vector corresponding to the files to be managed includes: The format parsing engine is invoked to analyze the file to be managed, and to determine the file type and file format corresponding to the file to be managed; Based on the file type and the file format, determine the file attribute vector corresponding to the file to be managed.
3. The method according to claim 1, characterized in that, The step of semantically segmenting the file to be managed into blocks based on the file attribute vector to obtain at least one semantic block includes: From the preset semantic splitting relationships, determine the target block splitting rule corresponding to the file attribute vector; According to the target segmentation rules, the file to be managed is semantically segmented to obtain at least one semantic block.
4. The method according to claim 1, characterized in that, The differentiated semantic block set contains at least one differentiated semantic block. The step of filtering each semantic block based on the file attribute vector and a preset version library to determine the differentiated semantic block set includes: For any semantic block, determine the data feature vector corresponding to the semantic block; Generate a fingerprint vector corresponding to the semantic block based on the file attribute vector and the data feature vector corresponding to the semantic block; The fingerprint vector corresponding to the semantic block is compared with the fingerprint vector corresponding to each historical semantic block in the preset version library; If the fingerprint vector does not match the fingerprint vector corresponding to any historical semantic block in the preset version library, then the semantic block is taken as the differentiated semantic block.
5. The method according to claim 4, characterized in that, Determining the data feature vector corresponding to the semantic block includes: Extract the data stream corresponding to the semantic block and determine the attributes of the data stream; Feature extraction is performed on the data stream corresponding to the semantic block to obtain local content features; Based on the local content features and the attributes of the data stream, the data feature vector corresponding to the semantic block is determined.
6. The method according to claim 4, characterized in that, The step of generating a fingerprint vector corresponding to the semantic block based on the file attribute vector and the data feature vector corresponding to the semantic block includes: Obtain the weight vector corresponding to the file attribute vector; The file attribute vector is weighted based on the weight vector to obtain a weighted file attribute vector. Based on the weighted file attribute vector and the data feature vector corresponding to the semantic block, a fingerprint vector corresponding to the semantic block is generated; or, The file attribute vector and the data feature vector corresponding to the semantic block are concatenated to generate the fingerprint vector corresponding to the semantic block; or, The file attribute vector and the data feature vector corresponding to the semantic block are mapped according to a preset hash function to generate the fingerprint vector corresponding to the semantic block.
7. The method according to claim 6, characterized in that, The step of generating a fingerprint vector corresponding to the semantic block based on the weighted file attribute vector and the data feature vector corresponding to the semantic block includes: The weighted file attribute vector and the data feature vector corresponding to the semantic block are concatenated to generate the fingerprint vector corresponding to the semantic block; or, The weighted file attribute vector and the data feature vector corresponding to the semantic block are mapped according to a preset hash function to generate the fingerprint vector corresponding to the semantic block.
8. The method according to claim 1, characterized in that, The storage and version update processing of the differentiated semantic block set in response to the file update instruction includes: For any differentiated semantic block in the differentiated semantic block set, the differentiated semantic block is uploaded to the block data storage area, and the storage address of the differentiated semantic block is recorded. Version update information is generated based on the storage address of each of the differentiated semantic blocks in response to the file update instruction.
9. The method according to claim 8, characterized in that, After uploading the differentiated semantic block to the block data storage area, the method further includes: Obtain the fingerprint vector corresponding to the differential semantic block; Establish a mapping relationship between the fingerprint vector and the storage address; Based on the mapping relationship, an index record is created or updated in the preset version library.
10. A file updating device, characterized in that, The device includes: The attribute vector determination module is used to analyze the file to be managed and determine the file attribute vector corresponding to the file to be managed when a file update instruction is received. The semantic block generation module is used to semantically divide the file to be managed into blocks based on the file attribute vector to obtain at least one semantic block; The differential semantic block set determination module is used to filter each semantic block according to the file attribute vector and the preset version library to determine the differential semantic block set; The instruction response module is used to store and update the version of the differentiated semantic block set in response to the file update instruction.
11. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method of any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1 to 9.
