Archive merging method, archive merging apparatus, and computer-readable storage medium

By training similarity spatiotemporal density networks and trajectory networks in neural networks, the problem of difficulty in fully covering the merging of multiple types of archives in existing technologies with manually written rules has been solved, realizing a fast and accurate archive merging process and improving automation and accuracy.

CN117171580BActive Publication Date: 2026-07-24ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG DAHUA TECH CO LTD
Filing Date
2023-08-28
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing methods for merging archives mainly rely on manually written rules, which are difficult to fully cover a wide range of situations. As the number of logical conditions increases, the difficulty of manually writing rules also increases significantly, leading to a decrease in merging efficiency and accuracy.

Method used

Similarity networks, especially similarity spatiotemporal density networks and similarity trajectory networks, are used to train neural networks to replace manually written merging rules. Similarity matrices, distance matrices, and time matrices are used to measure the similarity value of files, and files are merged when preset conditions are met.

Benefits of technology

It enables fast and accurate file merging, uncovers complex and hidden rules, improves the automation and accuracy of merging, and reduces the complexity of manually writing rules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117171580B_ABST
    Figure CN117171580B_ABST
Patent Text Reader

Abstract

The application provides an archive merging method, an archive merging device and a computer readable storage medium. The archive merging method comprises: acquiring two archives, wherein each archive comprises a plurality of images; acquiring a similarity matrix, a distance matrix and / or a time matrix of the two archives; inputting the similarity matrix, the distance matrix and / or the time matrix into a pre-trained similarity network to obtain a similarity value of the two archives input into the similarity network; and merging the two archives into one archive when the similarity value meets a preset condition. In the above manner, the archive merging device replaces the manual writing of merging rules by a trained neural network, quickly and accurately completes archive merging, and can also mine complex and hidden rules that are difficult for humans to realize.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of machine learning technology, and in particular to a file merging method, file merging apparatus, and computer-readable storage medium. Background Technology

[0002] When clustering pedestrian images, Re-ID features and person attributes are first generated based on the captured images. Then, after passing through classic clustering algorithms such as DBSCAN, all images form files of varying sizes, with many files actually belonging to the same person. The current task is to determine whether two files, given known human features, spatiotemporal information, etc., belong to the same person.

[0003] Existing merging methods are basically based on manually written rules. These methods have two main drawbacks: first, they cannot adequately encompass all categories; and second, as the number of logical conditions increases, the difficulty of manually writing rules also increases. Summary of the Invention

[0004] This application provides a method for merging files, a device for merging files, and a computer-readable storage medium.

[0005] This application provides a method for merging files, the method comprising: Obtain two files, each containing several images; Obtain the similarity matrix, distance matrix, and / or time matrix of the two files; Input the similarity matrix, the distance matrix, and / or the time matrix into a pre-trained similarity network to obtain the similarity value between the two files input by the similarity network; When the similarity value meets the preset conditions, the two files are merged into one file.

[0006] The similarity network is a similarity spatiotemporal density network; After obtaining the similarity matrix, distance matrix, and / or time matrix of the two files, the file merging method further includes: The similarity density is obtained using the similarity matrix. Using the distance matrix, the distance density is obtained; Using the aforementioned time matrix, the time density is obtained; The similarity density, the distance density, and the time density are input into the similarity spatiotemporal density network to obtain the similarity value between the two files.

[0007] The step of obtaining the similarity density using the similarity matrix includes: The similarity matrix is ​​obtained by obtaining several intervals according to a preset interval width; Iterate through all elements in the similarity matrix and obtain the number of elements falling into each interval; The similarity density is obtained based on the number of elements in the aforementioned intervals.

[0008] The similarity spatiotemporal density network includes several sub-multilayer perceptrons, a total multilayer perceptron, and an activation function layer. Each sub-multilayer perceptron is used to extract matrix features of a matrix. Multiple matrix features are extracted and then concatenated to obtain concatenated features. The total multilayer perceptron is used to extract file similarity features from the concatenated features. The activation function layer is used to output the similarity value between the two files based on the file similarity features.

[0009] The similarity network is a similarity trajectory network; The step of obtaining the similarity matrix, distance matrix, and / or time matrix of the two files includes: The two files are combined into a single virtual file by sorting them chronologically. Obtain the similarity matrix, distance matrix, and / or time matrix between the virtual file and itself.

[0010] The similarity trajectory network includes a backbone network, a global average pooling layer, a fully connected layer, and an activation function layer.

[0011] The step of inputting the similarity matrix, the distance matrix, and / or the time matrix into a pre-trained similarity network includes: The similarity matrix, the distance matrix, and / or the time matrix are concatenated into a multidimensional tensor along the channel dimension; The multidimensional tensor is input into the backbone network of a pre-trained similarity trajectory network.

[0012] This application also provides a file merging device, which includes: a file acquisition module, a matrix acquisition module, a network detection module, and a file merging module; wherein... The file acquisition module is used to acquire two files, each of which includes several images; The matrix acquisition module is used to acquire the similarity matrix, distance matrix, and / or time matrix of the two files; The network detection module is used to input the similarity matrix, the distance matrix, and / or the time matrix into a pre-trained similarity network to obtain the similarity value of the two files input by the similarity network. The file merging module is used to merge the two files into one file when the similarity value meets the preset conditions.

[0013] This application also provides a file merging apparatus, which includes a processor and a memory, wherein the memory stores program data, and the processor executes the program data to implement the file merging method described above.

[0014] This application also provides a computer-readable storage medium for storing program data, which, when executed by a processor, is used to implement the above-described file merging method.

[0015] The beneficial effects of this application are as follows: The file merging device acquires two files, each file including several images; acquires the similarity matrix, distance matrix, and / or time matrix of the two files; inputs the similarity matrix, distance matrix, and / or time matrix into a pre-trained similarity network to acquire the similarity value of the two files input to the similarity network; when the similarity value meets a preset condition, the two files are merged into one file. Through the above method, the file merging device uses a trained neural network to replace manually written merging rules, quickly and accurately completing file merging, while also uncovering complex and hidden rules that are difficult for humans to implement. Attached Figure Description

[0016] 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 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. Wherein: Figure 1 This is a flowchart illustrating an embodiment of the file merging method provided in this application; Figure 2 This is a schematic diagram of the framework of an embodiment of the similarity spatiotemporal density network provided in this application; Figure 3 This is a flowchart illustrating another embodiment of the file merging method provided in this application; Figure 4 This is a schematic diagram of the estimated probability density provided in this application; Figure 5 This is a schematic diagram of the framework of an embodiment of the similarity trajectory network provided in this application; Figure 6 This is a flowchart illustrating yet another embodiment of the file merging method provided in this application; Figure 7 This is a schematic diagram of the structure of an embodiment of the file merging device provided in this application; Figure 8 This is a schematic diagram of another embodiment of the file merging device provided in this application; Figure 9 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation

[0017] 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 a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0018] The technical approach of this application to solve the problems of the prior art is to replace manual writing of merging rules by training a neural network, and to propose a clustering file merging scheme based on similarity networks.

[0019] Please refer to details. Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the file merging method provided in this application.

[0020] The file merging method of this application is applied to a file merging device, which can be a server or a system consisting of a server and terminal devices working together. Accordingly, the various parts of the file merging device, such as units, subunits, modules, and submodules, can all be located in the server, or they can be located separately in the server and terminal devices.

[0021] Furthermore, the aforementioned server can be either hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software programs or software modules, such as software or software modules used to provide distributed servers, or as a single software program or software module; no specific limitation is made here. In some possible implementations, the file merging method of this application embodiment can be implemented by a processor calling computer-readable instructions stored in memory.

[0022] Specifically, such as Figure 1 As shown, the file merging method in this application embodiment specifically includes the following steps: Step S11: Obtain two files, each of which contains several images.

[0023] In this embodiment of the application, it is assumed that there are two clusters, each of which is a file. The file can be an image set as described in the background art, or other datasets. The specific content of the file is not limited here.

[0024] Specifically, the feature vector of samples within a cluster is Dimension. For the first cluster, we have The size of the feature matrix ,length time vector and GPS coordinates of size Similarly, for the second cluster, we have The size of the feature matrix ,length time vector and GPS coordinates of size .

[0025] Step S12: Obtain the similarity matrix, distance matrix, and / or time matrix of the two files.

[0026] In this embodiment, the file merging device acquires the similarity matrix, distance matrix, and time matrix of two clusters. In other embodiments, the file merging device may also acquire one or two of the above matrices. In addition, this application also provides extended functions for data information. For example, in different application scenarios, the file merging device may also acquire the posture matrix and modality (pedestrian, non-motorized vehicle, etc.) matrix of the files, which can improve the efficiency of data utilization.

[0027] The following section uses three types of matrices—similarity matrix, distance matrix, and time matrix—as examples to further illustrate the working principle of similarity networks.

[0028] Step S13: Input the similarity matrix, distance matrix, and / or time matrix into the pre-trained similarity network to obtain the similarity value between the two files input into the similarity network.

[0029] In this embodiment of the application, the file merging device inputs the similarity matrix, distance matrix and time matrix of two files into a pre-trained similarity network, extracts the features of the similarity matrix, distance matrix and time matrix through the similarity network, thereby measuring the probability that the two files belong to the same target, and outputs the corresponding similarity value.

[0030] Specifically, the similarity network in this application embodiment can be a similarity spatiotemporal density network. Please refer to [link to relevant documentation]. Figure 2 , Figure 2 This is a schematic diagram of the framework of an embodiment of the similarity spatiotemporal density network provided in this application.

[0031] like Figure 2As shown, the similarity spatiotemporal density network of this application embodiment includes several sub-multilayer perceptrons, a total multilayer perceptron, and an activation function layer; wherein, each sub-multilayer perceptron is used to extract matrix features of a matrix, and multiple matrix features are concatenated to obtain concatenated features; the total multilayer perceptron is used to extract file similarity features of the concatenated features; and the activation function layer is used to output the similarity value of the two files based on the file similarity features.

[0032] The similarity spatiotemporal density network extracts features from each data matrix using a sub-multilayer perceptron, and then concatenates these matrices to extract the concatenated features, thereby measuring the probability that two files belong to the same target. The network principle of the similarity spatiotemporal density network is introduced below through a specific file merging method: Please continue reading for details. Figure 3 , Figure 3 This is a flowchart illustrating another embodiment of the file merging method provided in this application.

[0033] Specifically, such as Figure 3 As shown, the file merging method in this application embodiment specifically includes the following steps: Step S21: Use the similarity matrix to obtain the similarity density.

[0034] In this embodiment, the file merging device calculates the feature matrices of the two clusters to obtain a similarity matrix. Then, the similarity density is obtained by plotting the histogram of the similarity matrix.

[0035] The file merging device obtains several intervals of the similarity matrix according to a preset interval width; it traverses all elements in the similarity matrix to obtain the number of elements falling in each interval; and obtains the similarity density based on the number of elements in the several intervals.

[0036] Specifically, the formula for calculating the similarity density is as follows:

[0037]

[0038] Among them, such as Figure 4 As shown, Figure 4 This is a schematic diagram of the estimated probability density provided in this application. During statistics, for any value of... matrix First select the interval width Then select the interval to be counted. The number of intervals is obtained. Then iterate through ,for Its corresponding range index (from (Start counting) is The counter at that position is incremented. After the histogram statistics are completed, divide by... Normalization yields an approximate probability density.

[0039] Step S22: Obtain the distance density using the distance matrix.

[0040] In this embodiment, the file merging device calculates the GPS coordinates of the two clusters to obtain a distance matrix. Then, the distance density is obtained by statistically analyzing the histogram of the distance matrix.

[0041] Specifically, the formula for calculating distance density is as follows:

[0042]

[0043] Step S23: Obtain the time density using the time matrix.

[0044] In this embodiment, the file merging device calculates the time vectors of the two clusters to obtain a time matrix. Then, the time density is obtained by plotting the histogram of the statistical time matrix.

[0045] Specifically, the formula for calculating time density is as follows:

[0046]

[0047] It should be noted that the process of calculating the approximate probability density of the distance matrix and the time matrix is ​​the same as the process of calculating the approximate probability density of the similarity matrix, and will not be listed here.

[0048] Step S24: Input the similarity density, distance density, and time density into the similarity spatiotemporal density network to obtain the similarity value between the two files.

[0049] In this embodiment of the application, three probability density vectors, namely similarity density, distance density, and time density, are input as follows: Figure 2 The binary classification network shown is trained as follows. The network first learns features for similarity, distance, and time respectively, then concatenates the three features into one, and then learns a single feature by combining them. Finally, it outputs the confidence score for the 0-1 classification, i.e., the similarity value.

[0050] In this embodiment of the application, the file merging device uses a similarity spatiotemporal density network as a similarity network. Since the input data size is fixed, multiple batches can be trained together during training, resulting in faster convergence speed.

[0051] Furthermore, the similarity network provided in this application can also be a similarity trajectory network; please refer to [link / reference] for details. Figure 5 , Figure 5 This is a schematic diagram of the framework of an embodiment of the similarity trajectory network provided in this application.

[0052] like Figure 5 As shown, the similarity trajectory network in this embodiment includes a backbone network, a global average pooling layer, a fully connected layer, and an activation function layer. The network principle of the similarity trajectory network is explained below through a specific file merging method: Please continue reading for details. Figure 6 , Figure 6 This is a flowchart illustrating another embodiment of the file merging method provided in this application.

[0053] Specifically, such as Figure 6 As shown, the file merging method in this application embodiment specifically includes the following steps: Step S31: Sort the two files by time and combine them into a virtual file.

[0054] In this embodiment, the file merging device combines samples from two clusters into a single virtual file, ordered chronologically, and calculates the virtual file's... The size of the feature matrix ,length time vector and GPS coordinates of size .

[0055] Step S32: Obtain the similarity matrix, distance matrix, and / or time matrix between the virtual file and itself.

[0056] In this embodiment of the application, the file merging device calculates the similarity matrix. Distance matrix and time matrix .

[0057] Step S33: Concatenate the similarity matrix, distance matrix, and / or time matrix into a multidimensional tensor along the channel dimension.

[0058] In this embodiment of the application, the file merging device will , and In the third dimension, namely the channel dimension, they are spliced ​​together to form a three-dimensional tensor. Send in as Figure 5 The network training is shown.

[0059] Step S34: Input the multidimensional tensor into the backbone network of the pre-trained similarity trajectory network.

[0060] In this embodiment of the application, the file merging device uses a similarity trajectory network as a similarity network. The data input to the network itself contains spatiotemporal information, and the data information can be expanded, such as adding posture information, modal information (pedestrians, non-motorized vehicles), etc., which makes the data utilization efficiency higher.

[0061] Step S14: When the similarity value meets the preset conditions, merge the two files into one file.

[0062] In this embodiment of the application, the file merging device can preset a similarity threshold. When the similarity value of the two files calculated by the network in the above steps is higher than the preset similarity threshold, the two files can be merged into one file.

[0063] In this embodiment, the file merging device acquires two files, each file including several images; acquires a similarity matrix, a distance matrix, and / or a time matrix of the two files; inputs the similarity matrix, the distance matrix, and / or the time matrix into a pre-trained similarity network to acquire a similarity value between the two files; and merges the two files into one file when the similarity value meets a preset condition. Through this method, the file merging device uses a trained neural network to replace manually written merging rules, quickly and accurately completing file merging, while also uncovering complex and hidden rules that are difficult for humans to implement.

[0064] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0065] To implement the file merging method described in the above embodiments, this application also proposes a file merging apparatus, which can be found in the details below. Figure 7 , Figure 7 This is a schematic diagram of an embodiment of the file merging device provided in this application.

[0066] The file merging device 400 of this application embodiment includes a file acquisition module 41, a matrix acquisition module 42, a network detection module 43, and a file merging module 44.

[0067] The file acquisition module 41 is used to acquire two files, each of which includes several images.

[0068] The matrix acquisition module 42 is used to acquire the similarity matrix, distance matrix, and / or time matrix of the two files.

[0069] The network detection module 43 is used to input the similarity matrix, the distance matrix, and / or the time matrix into a pre-trained similarity network to obtain the similarity value of the two files input by the similarity network.

[0070] The file merging module 44 is used to merge the two files into one file when the similarity value meets the preset conditions.

[0071] To implement the file merging method of the above embodiments, this application also proposes another file merging apparatus, please refer to [link / reference needed]. Figure 8 , Figure 8 This is a schematic diagram of another embodiment of the file merging device provided in this application.

[0072] The file merging apparatus 500 of this application embodiment includes a memory 51 and a processor 52, wherein the memory 51 and the processor 52 are coupled together.

[0073] The memory 51 is used to store program data, and the processor 52 is used to execute the program data to implement the file merging method described in the above embodiments.

[0074] In this embodiment, processor 52 can also be referred to as a CPU (Central Processing Unit). Processor 52 may be an integrated circuit chip with signal processing capabilities. Processor 52 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor, or processor 52 can be any conventional processor.

[0075] To implement the file merging method of the above embodiments, this application also provides a computer-readable storage medium, such as... Figure 9 As shown, the computer-readable storage medium 600 is used to store program data 61, which, when executed by a processor, is used to implement the file merging method as described in the above embodiments.

[0076] This application also provides a computer program product, wherein the computer program product includes a computer program operable to cause a computer to perform the file merging method as described in the embodiments of this application. The computer program product may be a software installation package.

[0077] The file merging method described in the above embodiments of this application, when implemented as a software functional unit and sold or used as an independent product, can be stored in a device, such as a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0078] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for merging archives, characterized in that, The file merging method includes: Obtain two files, each containing several images; Obtain the similarity matrix, distance matrix, and time matrix of the two files; The similarity matrix is ​​obtained by multiplying the feature matrix of one of the two files by the transpose of the feature matrix of the other file; the distance matrix is ​​obtained by calculating the distance between the GPS coordinate matrices of the two files; and the time matrix is ​​obtained by calculating the time vectors of the two files. Several intervals of the similarity matrix, the distance matrix, and the time matrix are obtained according to a preset interval width; Iterate through all elements in each matrix and obtain the number of elements falling within each interval; Based on the number of elements in the aforementioned intervals, the similarity density, distance density, and time density are obtained respectively. The similarity density, the distance density, and the time density are input into a pre-trained similarity spatiotemporal density network to obtain the similarity value between the two files input by the similarity spatiotemporal density network. The similarity spatiotemporal density network includes: multiple sub-multilayer perceptrons, which are used to extract features of the similarity density, the distance density, and the temporal density, respectively; a total multilayer perceptron, which is used to concatenate the extracted features to extract comprehensive features; and an activation function layer, which is used to output the similarity value. When the similarity value meets the preset conditions, the two files are merged into one file.

2. The file merging method according to claim 1, characterized in that, The similarity spatiotemporal density network is a similarity trajectory network; The step of obtaining the similarity matrix, distance matrix, and time matrix of the two files includes: The two files are combined into a single virtual file by sorting them chronologically. Obtain the similarity matrix, distance matrix, and time matrix between the virtual file and itself.

3. The file merging method according to claim 2, characterized in that, The similarity trajectory network includes a backbone network, a global average pooling layer, a fully connected layer, and an activation function layer.

4. The file merging method according to claim 3, characterized in that, The step of inputting the similarity matrix, the distance matrix, and the time matrix into a pre-trained similarity spatiotemporal density network includes: The similarity matrix, the distance matrix, and the time matrix are concatenated into a multidimensional tensor along the channel dimension; The multidimensional tensor is input into the backbone network of a pre-trained similarity trajectory network.

5. A file merging device, characterized in that, The file merging device includes: a file acquisition module, a matrix acquisition module, a network detection module, and a file merging module; wherein... The file acquisition module is used to acquire two files, each of which includes several images; The matrix acquisition module is used to acquire the similarity matrix, distance matrix, and time matrix of the two files; The similarity matrix is ​​obtained by multiplying the feature matrix of one of the two files by the transpose of the feature matrix of the other file; the distance matrix is ​​obtained by calculating the distance between the GPS coordinate matrices of the two files; and the time matrix is ​​obtained by calculating the time vectors of the two files. The matrix acquisition module is further configured to acquire several intervals of the similarity matrix, the distance matrix, and the time matrix according to a preset interval width; traverse all elements in each matrix to obtain the number of elements falling in each interval; and acquire the similarity density, distance density, and time density based on the number of elements in the several intervals. The network detection module is used to input the similarity density, the distance density, and the temporal density into a pre-trained similarity spatiotemporal density network to obtain the similarity value between the two files input by the similarity spatiotemporal density network; wherein, the similarity spatiotemporal density network includes: multiple sub-multilayer perceptrons, respectively used to extract features of the similarity density, the distance density, and the temporal density; a total multilayer perceptron, used to concatenate the extracted features to extract comprehensive features; and an activation function layer, used to output the similarity value; The file merging module is used to merge the two files into one file when the similarity value meets the preset conditions.

6. A file merging device, characterized in that, The file merging device includes a processor and a memory, the memory storing program data, and the processor executing the program data to implement the file merging method as described in any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program data, which, when executed by a processor, is used to implement the file merging method according to any one of claims 1-4.