Image-text data rapid processing method and system
Through the combination of double cache queues and deep learning models, efficient processing and fusion of graphic and text data is achieved, the problems of inefficiency and difficulty in parallel processing in the existing technology are solved, the processing speed and accuracy are improved, and the rapid processing and retrieval of large-scale data is supported.
Patent Information
- Application Number
- CN202411681208.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-11
AI Technical Summary
The prior art has problems such as inefficient efficiency in graphic and text data processing, inability to realize parallel processing, and low data storage and access efficiency. Especially when large-scale graphic and text data processing, processing speed and accuracy are difficult to meet real-time requirements.
The double-cache queue is used to store graphics and text data, and efficient reading and writing is achieved through the switching mechanism of write queues and read queues. Feature extraction and fusion are combined with deep learning models. The parallel computing method is used to synchronize the processing of feature indexes and image feature vectors, and the fused feature data is stored in a distributed database.
It significantly improves the efficiency and accuracy of graphic and text data processing, realizes efficient data flow and fusion effects, and supports the rapid processing and efficient retrieval of large-scale graphic and text data.
Smart Images

Figure CN119597714A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method and system for quickly processing graphic and text data. Background Art
[0002] With the rapid development of big data and artificial intelligence technology, the demand for processing image and text data is gradually increasing. Image and text data usually includes text information and image information, which have different structures and characteristics, so different processing methods are required. In the field of image and text data processing, traditional image and text data processing methods mostly rely on manual feature extraction and a single processing flow, usually requiring independent processing of text and image data, and then subsequent data fusion and analysis. However, these methods are often inefficient and difficult to meet the needs of real-time processing, especially in the case of large-scale image and text data, where processing speed and accuracy face great challenges. In recent years, with the widespread application of deep learning, image feature extraction technology has been significantly developed, and technologies such as convolutional neural network (CNN) have become the mainstream means of processing image data. At the same time, the application of natural language processing (NLP)-based technologies in text data processing is also becoming increasingly mature. However, these technologies still have shortcomings in the rapid processing and efficient fusion of image and text data, especially in the process of synchronously processing text and image data and realizing feature fusion. How to ensure efficient data flow and fusion effect is still a key issue that needs to be solved urgently.
[0003] The existing technology generally has the following shortcomings in the process of processing graphic data. First, most traditional methods rely on single-threaded or inefficient processing mechanisms in the process of data processing, and cannot effectively realize parallel processing of graphic data, resulting in slow processing speed, especially when processing large-scale graphic data, the system response time is unacceptable. Secondly, the existing feature extraction and data fusion methods are mostly limited to processing text and image data separately, lacking an effective combination of the two, resulting in information loss and low processing efficiency. Although deep learning models have made certain progress in the processing of image and text data, how to efficiently combine these two different types of data and generate effective fusion feature data in a short time is still a technical challenge. In addition, traditional data storage methods are mostly centralized storage. When processing massive graphic data, the data storage and access efficiency is low and cannot meet the needs of fast reading and writing. Therefore, how to improve the processing speed and storage efficiency while ensuring data accuracy and integrity has become an urgent problem to be solved in the rapid processing technology of graphic data. Summary of the invention
[0004] In view of the problems existing in the prior art, the present invention proposes a method and system for quickly processing graphic and text data.
[0005] Therefore, the present invention provides a method for quickly processing graphic data, which can solve the problems mentioned in the background technology.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] In a first aspect, an embodiment of the present invention provides a method for quickly processing graphic data, which comprises:
[0008] Receiving graphic data uploaded by a user, and storing the graphic data in a double buffer queue, wherein the double buffer queue includes a write queue and a read queue;
[0009] Classify and annotate the image and text data in the double buffer queue, separate the text data from the image data, and establish a feature index for the text data;
[0010] Extract features from the image data based on a deep learning model to generate an image feature vector, and associate the image feature vector with a corresponding feature index;
[0011] Using parallel computing to synchronously process the feature index and the image feature vector to generate fused feature data;
[0012] The fused feature data is stored in a distributed database and organized and stored according to a preset data structure.
[0013] As a preferred solution of the method for rapid processing of graphic data of the present invention, wherein: the graphic data includes document files, picture files and their corresponding metadata information;
[0014] The dual-buffer queue adopts a read-write separation storage structure, wherein the write queue is used to cache newly received graphic and text data, and the read queue is used to provide data processing access;
[0015] When the amount of graphic data in the write queue reaches a preset threshold, a queue switching operation is triggered;
[0016] The queue switching operation includes:
[0017] Obtain the data count value of the write queue, and compare the data count value with a preset threshold; when the data count value is greater than or equal to the preset threshold, send a switching signal to the queue management module; after receiving the switching signal, the queue management module first marks the write queue as a to-be-switched state, and suspends receiving new graphic data; then, the queue management module checks whether there is any unprocessed graphic data in the read queue, and if so, adds the status identifier of the unprocessed graphic data to a list of pending tasks; after confirming that the status check of the graphic data in the read queue is completed, the queue management module calls the memory mapping mechanism to copy the graphic data in the write queue to a pre-allocated temporary buffer in batches according to the data block size;
[0018] After the temporary buffer completes data verification, the graphic data is migrated as a whole to the read queue and the data index table is updated; after the migration is completed, the queue management module resets the memory space of the original read queue and switches it to a new write queue; finally, the queue management module updates the queue status flag, releases the pause status of the new write queue, and resumes the graphic data receiving function.
[0019] As a preferred solution of the method for rapid processing of graphic data of the present invention, the classification and labeling of the graphic data includes:
[0020] Sequentially read the graphic data from the read queue;
[0021] Performing format recognition on the graphic data and generating a data type identifier;
[0022] According to the data type identifier, the graphic data is divided into a text data stream and an image data stream;
[0023] Establishing a feature index for the text data includes:
[0024] For the text data stream, a word segmentation algorithm is used to segment the text content, extract key words, and retain the position information and contextual relationship of the key words in the original text;
[0025] The keyword group and the location information form an initial feature item;
[0026] Calculate feature weights based on the initial feature items to generate feature vectors with weights;
[0027] Constructing a feature tree according to the feature vector and calculating the weight of each node;
[0028] The feature index is established by taking the weight of each node as a priority.
[0029] As a preferred solution of the method for rapid processing of graphic data of the present invention, the feature weight is calculated as shown in the following formula:
[0030]
[0031] Among them, Q is the query matrix, K is the key matrix, V is the value matrix, d is the feature dimension, P is the position encoding matrix, and R is the association strength matrix;
[0032] The correlation strength matrix R can be calculated using the following formula:
[0033]
[0034] Among them, F i and F i+1 is the adjacent feature vector, λ is a learnable scaling factor, ||F i || and ||F i+1 || represents the vector norm;
[0035] The calculation of the weight of each node is shown in the following formula:
[0036] W node =α·W(Q,K,V)+β·depth factor +γ·sibling similarity
[0037] Among them, α, β, and γ are weight coefficients, depth factor is the depth attenuation factor, sibling similarity is the similarity of nodes at the same level.
[0038] As a preferred solution of the method for rapid processing of graphic and text data of the present invention, wherein: the deep learning model includes a trunk feature extraction branch and an attention enhancement branch;
[0039] The backbone feature extraction branch adopts a residual structure, and each residual block contains two convolutional layers and an attention modulation module;
[0040] The attention enhancement branch includes a spatial attention module and a channel attention module, wherein the spatial attention module generates a spatial weight map by calculating the response intensity of each spatial position of the feature map, and the channel attention module generates a channel weight vector by establishing inter-channel dependencies.
[0041] As a preferred solution of the method for fast processing of graphic data of the present invention, the feature map of each residual block is calculated using the following formula:
[0042] F(x)=H(x)+W2·σ(BN(W1·x))·A(x)
[0043] Among them, H(x) is the identity mapping, W1 and W2 are convolution weight matrices, σ is the activation function, BN is the batch normalization operation, A(X) is the attention coefficient, and the attention coefficient calculation formula is:
[0044] A(x)=tanh(μ·Pool(Conv(x))+ω·S)
[0045] Among them, μ and ω are trainable parameters, S is the spatial position encoding matrix, and Pool is a mixed pooling operation.
[0046] As a preferred solution of the method for rapid processing of graphic data of the present invention, generating the image feature vector comprises:
[0047] Preprocessing the image data, and inputting the preprocessed image output into the deep learning model for feature extraction;
[0048] The extracted features are fused according to the fusion weights to obtain fusion features;
[0049] The fused features are input into the global context encoder, and important features are filtered through the attention mechanism;
[0050] The filtered important features are transformed through a fully connected layer to generate the image feature vector.
[0051] As a preferred solution of the method for rapid processing of graphic data of the present invention, the fusion weight is dynamically adjusted according to the similarity between feature branches, which can be expressed by the following formula:
[0052]
[0053] Among them, F i is the trunk branch feature, G i is the attention branch feature, a i and βi are dynamic weight coefficients, τ is the temperature parameter, and Z is the fusion weight.
[0054] In a second aspect, an embodiment of the present invention provides a system for rapid processing of graphic data, which includes:
[0055] A data acquisition module, used for receiving graphic data uploaded by a user, and storing the graphic data through a double buffer queue, wherein the double buffer queue includes a write queue and a read queue;
[0056] An index building module, used to classify and annotate the image and text data in the double buffer queue, separate the text data from the image data, and establish a feature index for the text data;
[0057] A feature extraction and index association module, used to extract features from the image data based on a deep learning model, generate an image feature vector, and associate the image feature vector with a corresponding feature index;
[0058] A feature fusion module, used to synchronously process the feature index and the image feature vector in a parallel computing manner to generate fused feature data;
[0059] The storage module is used to store the fused feature data into a distributed database and organize and store it according to a preset data structure.
[0060] The beneficial effect of the present invention is that the efficiency and accuracy of image and text data processing are significantly improved by adopting technologies such as dual-buffer queues to store image and text data, deep learning models to extract features, parallel computing and processing, and feature fusion. First, the dual-buffer queues realize efficient reading and writing of data, and the switching mechanism of the write queue and the read queue ensures the consistency of data and the fluency of processing. Secondly, the text data is enhanced by feature weighting and multi-level feature tree construction based on the attention mechanism, which enhances the accuracy of text processing and query efficiency, while the image data is realized through the improved multi-branch convolutional neural network and attention enhancement branch. Efficient image feature extraction. In addition, by synchronously processing text and image features in a parallel computing manner and combining an adaptive feature fusion mechanism, the generated fused feature data has stronger context perception and multimodal information fusion capabilities. Finally, the fused feature data is stored in a distributed database, which ensures the efficiency of data storage and access, and can support the rapid processing and efficient retrieval of large-scale image and text data. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0062] Figure 1 The figure is a flow chart of a method for rapid processing of graphic and text data. DETAILED DESCRIPTION
[0063] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0064] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0065] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0066] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.
[0067] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0068] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0069] Example 1
[0070] Reference Figure 1 , which is the first embodiment of the present invention, and provides a method for quickly processing graphic data, comprising:
[0071] Furthermore, this embodiment also provides a system for rapid processing of graphic and text data, including:
[0072] S1: receiving graphic data uploaded by a user, and storing the graphic data in a double buffer queue, wherein the double buffer queue includes a write queue and a read queue;
[0073] The graphic data uploaded by the user is obtained through the data receiving module, and the graphic data includes document files, image files and their corresponding metadata information; the double cache queue adopts a read-write separation storage structure, wherein the write queue is used to cache newly received graphic data, and the read queue is used to provide data processing access; when the amount of graphic data in the write queue reaches a preset threshold, a queue switching operation is triggered, and the graphic data in the write queue is migrated to the read queue as a whole, and the original read queue is cleared and converted to a new write queue; the double cache queue ensures data consistency during the queue switching process through a mutex lock mechanism, and sets a data status identifier between the write queue and the read queue to mark the processing status of the graphic data.
[0074] More specifically, when the amount of graphic data in the write queue reaches a preset threshold, a queue switching operation is triggered, which specifically includes:
[0075] First, the data count value of the write queue is obtained, and the data count value is compared with a preset threshold value; when the data count value is greater than or equal to the preset threshold value, a switching signal is sent to the queue management module; after receiving the switching signal, the queue management module first marks the write queue as a to-be-switched state and suspends receiving new graphic data; then, the queue management module checks whether there is any unprocessed graphic data in the read queue, and if so, adds the status identifier of the unprocessed graphic data to the list of pending tasks; after confirming that the status check of the graphic data in the read queue is completed, the queue management module calls the memory mapping mechanism to copy the graphic data in the write queue to a pre-allocated temporary buffer in batches according to the data block size; after the temporary buffer completes data verification, the graphic data is migrated as a whole to the read queue, and the data index table is updated; after the migration is completed, the queue management module resets the memory space of the original read queue and switches it to a new write queue; finally, the queue management module updates the queue status identifier, releases the pause state of the new write queue, and resumes the function of receiving graphic data.
[0076] It should be noted that the preset threshold is determined by dynamically adjusting the preset threshold according to the system hardware resource parameters and historical processing data; specifically: firstly, the system's available memory capacity, number of CPU cores, disk I / O rate and other hardware parameters are obtained; secondly, the recent processing records of graphic data are collected, including the data processing volume per unit time, average processing delay and resource utilization; then, the hardware parameters and historical processing records are substituted into the calculation formula:
[0077] T=Min(MM*α T ,P*β T )*γ T
[0078] Among them, T is the preset threshold, M is the available memory capacity, P is the processor performance index, α T and β T are the weight coefficients of memory and processor respectively, γ T is the correction coefficient of historical data; the correction coefficient γ T Dynamically adjust the resource utilization rate according to the recent processing records. When the resource utilization rate exceeds 85%, γ T The value decreases by 0.9 times. When the resource utilization rate is less than 50%, γ T The value is increased by 1.1 times; finally, the preset threshold is recalculated every predetermined time period, and the calculation result is updated to the queue management module.
[0079] S2: classifying and labeling the image and text data in the double buffer queue, separating the text data from the image data, and establishing a feature index for the text data;
[0080] First, the graphic data is sequentially read from the read queue, the format of the graphic data is identified, and a data type identifier is generated; according to the data type identifier, the graphic data is divided into a text data stream and an image data stream; for the text data stream, a word segmentation algorithm is used to segment the text content, extract the keyword group, and retain the position information and contextual relationship of the keyword group in the original text. The keyword group and the position information form the initial feature item;
[0081] Furthermore, the initial feature items are input into a pre-trained text classification model. The model calculates the weight of each feature item based on the attention mechanism and generates a weighted feature vector. After the feature vector is processed by dimensionality reduction, a multi-level feature tree is constructed, and each node contains a feature value, a weight value and an associated reference. The multi-level feature tree is stored in a B+ tree structure, and adjacent node pointers are added between leaf nodes to facilitate range queries. On this basis, an inverted index table is established to centrally manage the storage location information of text data with the same feature value. At the same time, the index items are stored in layers according to the node weight: high-weight index items are stored in memory, and low-weight index items are downgraded and stored on disk. When the capacity of the inverted index table reaches the preset upper limit, a merge operation is triggered based on the node weight, low-weight index items are merged first, and the associated index items are merged and stored and the index pointer is updated. At the same time, the cache strategy is dynamically adjusted to ensure fast access to high-weight node indexes.
[0082] For example, the calculation of the feature weight can be expressed by the following formula:
[0083]
[0084] Wherein, Q is the query matrix, K is the key matrix, V is the value matrix, d is the feature dimension, P is the position encoding matrix, and R is the association strength matrix. The association strength matrix R can be calculated as follows:
[0085]
[0086] Among them, F i and F i+1 is the adjacent feature vector, λ is a learnable scaling factor, ||F i || and ||F i+1 || represents the vector norm.
[0087] After the feature vector is processed by dimensionality reduction, a multi-level feature tree is constructed. Each node contains a feature value, a weight value and an associated reference. The comprehensive calculation of the feature weight of each node can be expressed by the following formula:
[0088] W node =α·W(Q,K,V)+βdepth factor +γ·sibling similarity
[0089] Among them, α, β, and γ are weight coefficients, depth factor is the depth attenuation factor, sibling similarity is the similarity of nodes at the same level.
[0090] Preferably, the semantic correlation between adjacent features is considered, the correlation strength matrix R is introduced on the basis of the traditional attention mechanism, and the adaptability of the model is improved through a learnable scaling factor λ, thereby enhancing the context-aware ability of feature extraction.
[0091] S3: extracting features from the image data based on a deep learning model, generating an image feature vector, and associating the image feature vector with a corresponding feature index;
[0092] First, the image data is preprocessed, including image size normalization, color space conversion and pixel value normalization, to generate standardized image data.
[0093] The standardized image data is input into an improved multi-branch convolutional neural network, wherein the multi-branch convolutional neural network comprises a trunk feature extraction branch and an attention enhancement branch; the trunk feature extraction branch adopts an improved residual structure, and improves the feature extraction capability by combining jump connection and residual mapping, wherein each residual block comprises two convolutional layers and an attention modulation module, and the attention enhancement branch comprises a spatial attention module and a channel attention module, wherein the spatial attention module generates a spatial weight map by calculating the response intensity of each spatial position of the feature map, and the channel attention module generates a channel weight vector by establishing a dependency relationship between channels; wherein the trunk feature extraction branch adopts a residual structure, and the feature map of each residual block is calculated by the following formula:
[0094] F(x)=H(x)+W2·σ(BN(W1·x))·A(x)
[0095] Among them, H(x) is the identity mapping, W1 and W2 are convolution weight matrices, σ is the activation function, BN is the batch normalization operation, A(x) is the attention coefficient, and the attention coefficient calculation formula is:
[0096] A(x)=tanh(μ·Pool(Conv(x))+ω·S)
[0097] Among them, μ and ω are trainable parameters, S is the spatial position encoding matrix, and Pool is a mixed pooling operation;
[0098] Furthermore, an adaptive feature fusion mechanism is used to dynamically adjust the fusion weight according to the similarity between feature branches. The similarity is obtained by calculating the mutual correlation coefficient of the feature graph. The fusion weight changes nonlinearly with the similarity. The calculation of the fusion weight can be expressed as follows:
[0099]
[0100] Among them, F i is the trunk branch feature, G i is the attention branch feature, a i and βi are dynamic weight coefficients, τ is the temperature parameter, and Z is the fusion weight.
[0101] The fused features are input into the global context encoder, which adopts a multi-scale feature aggregation strategy to extract global context information under different receptive fields, and selects important features through the attention mechanism. Finally, it is transformed through the fully connected layer to generate a fixed-dimensional image feature vector, as shown in the following formula:
[0102] V=Norm(MLP(GAP(Z)+∈·Channel Attention ((Z)))
[0103] Among them, GAP is global average pooling, MLP is multi-layer perceptron, Channel Attention is the channel attention mechanism, ∈ is the balance factor, Norm is the L2 normalization, and V is the image feature vector;
[0104] Finally, an association mapping table between the image feature vector and the feature index is established, and the high-dimensional feature vector is mapped into a low-dimensional feature fingerprint using the local sensitive hashing method. A bidirectional link structure is constructed between the feature fingerprint and the feature index to support fast retrieval and reverse tracking.
[0105] S4: using a parallel computing method to synchronously process the feature index and the image feature vector to generate fused feature data;
[0106] First, a bidirectional parallel processing framework is constructed, which includes a feature index processing channel and an image feature vector processing channel. In the feature index processing channel, a multi-threaded method is used to concurrently read the feature index table, and the index data is divided into multiple processing units according to a preset batch size. Each processing unit contains feature identification, location information, and associated references. These processing units are batch normalized to unify the feature representation format. Subsequently, the index features are weighted by importance using the attention mechanism through the feature enhancement module, and the weight value is calculated based on the frequency of occurrence and position correlation of the feature.
[0107] In the image feature vector processing channel, the image feature vector is divided into multiple sub-vector groups according to the dimension, and each sub-vector group is independently enhanced. The enhancement process includes nonlinear transformation and regularization. The enhanced sub-vector group will perform self-attention calculation.
[0108] Next, feature alignment is performed, which includes a temporal alignment module and a semantic alignment module. The temporal alignment module maintains the temporal consistency of features through a sliding window method, and the semantic alignment module establishes a semantic mapping relationship by calculating the cosine similarity of the features.
[0109] Finally, the aligned features are input into the fusion feature generator, and the fusion feature data is generated through the dynamic weight adaptive fusion mechanism. The gated recurrent unit (GRU) network structure is adopted, which includes an update gate and a reset gate. The update gate controls the degree of retention of historical features, and the reset gate adjusts the influence of the current input features.
[0110] S5: storing the fused feature data into a distributed database, and organizing and storing the data according to a preset data structure.
[0111] This embodiment also provides a computer device suitable for a method of quickly processing graphic data, including a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute computer executable instructions to implement a method of quickly processing graphic data as proposed in the above embodiment.
[0112] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0113] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, a method for quickly processing graphic and text data as proposed in the above embodiment is implemented.
[0114] The storage medium proposed in this embodiment and the data storage method proposed in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be found in the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0115] Example 2
[0116] This is the second embodiment of the present invention, which provides a method for rapid processing of graphic data. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.
[0117] This example selects a large enterprise document management system as the test platform, and the test data set contains various types of mixed text and image data such as various office documents, technical reports, product manuals, etc. The test environment is configured as follows: the server uses Dell PowerEdge R750, equipped with a dual-core Intel Xeon Gold 6348 processor (96 cores in total), 384GB DDR4 memory, and the storage system uses an NVMe SSD array (total capacity 8TB).
[0118] The testing process is divided into the following stages:
[0119] Data preprocessing stage:
[0120] A total of 100,000 mixed text and image documents were collected and sorted, with the document size ranging from 500KB to 50MB, containing multiple elements such as text, pictures, tables, etc. These documents were arranged in chronological order to simulate the real business data upload scenario.
[0121] Double buffer queue configuration:
[0122] The initial configuration write queue and read queue each occupy 50GB of memory space, and queue switching is achieved through memory mapping technology. Based on the system hardware parameters, the initial preset threshold is calculated as follows:
[0123] Available memory capacity (M) = 300GB
[0124] Processor performance index (P) = 96 (number of cores)
[0125] Memory weight coefficient (α) = 0.6
[0126] Processor weight factor (β) = 0.4
[0127] Initial correction factor (γ) = 1.0
[0128] Substituting the formula into the calculation, the initial preset threshold is 8,500 data records.
[0129] Performance test implementation:
[0130] Six groups of control tests were designed, using the traditional single queue solution, the simple dual queue solution, and this solution (optimized dual cache queue) to compare performance under different concurrency pressures. The test lasted for 48 hours, during which continuous data writing and reading operations were maintained. During the test, various system performance indicators were monitored in real time, including key parameters such as data processing delay, memory usage, CPU usage, and queue switching time.
[0131] To ensure the accuracy of the test, the following measures are adopted:
[0132] Use professional performance testing tool JMeter to simulate concurrent user requests
[0133] Preheat the system before testing to eliminate the impact of cold start
[0134] Each test is separated by 15 minutes to ensure that the system is restored to its initial state.
[0135] Detailed performance data is recorded in logs to provide a basis for subsequent analysis. The specific experimental data is shown in Table 1 below:
[0136] Table 1 Experimental data table
[0137]
[0138]
[0139] Through in-depth analysis of the test data, we can conclude that:
[0140] The optimized dual-buffer queue solution shows obvious advantages in all core indicators. Under low load conditions, the average response time is 46.8% higher than the traditional single-queue solution (from 235ms to 125ms) and 30.6% higher than the simple dual-queue solution (from 180ms to 125ms). Under high load conditions, the performance advantage is even more obvious, with the response time increasing by 68.5% compared to the traditional solution and 37.8% compared to the simple dual-queue solution.
[0141] In terms of memory usage, the optimized solution only occupies 58% of memory under high load, which is lower than the traditional solution (78%) and the simple dual-queue solution (68%), thanks to the dynamic threshold adjustment mechanism and efficient memory management strategy. CPU usage also shows similar advantages, only 65% under high load, which is 17 and 10 percentage points lower than the other two solutions respectively.
[0142] The optimized solution performs well in the queue switching process, with the switching time taking only 180ms (low load) and 220ms (high load), which is 52.6% and 57.7% less than the simple dual-queue solution, respectively. This is mainly due to the improved memory mapping mechanism and optimized switching strategy.
[0143] In terms of data processing throughput, the optimized solution reaches 1850 records / second under low load, which is 117.6% higher than the traditional solution and 54.2% higher than the simple dual-queue solution. It still maintains a processing capacity of 1480 records / second under high load, showing excellent performance stability.
[0144] The data consistency index reached 99.99%, which is extremely rare in large-scale data processing systems and exceeds the industry's common 99.95% standard. This proves that this solution not only ensures high performance, but also solves the data reliability problem well.
[0145] From the above analysis, it can be seen that the optimized dual-buffer queue solution in this embodiment has achieved significant improvements in multiple dimensions such as performance, efficiency and reliability, especially in the high-concurrency scenario, the stability and efficiency improvement fully prove the technical advancement and practical value of the solution. These improvements are mainly due to the comprehensive application of multiple technical innovations such as the innovative queue switching mechanism, dynamic threshold adjustment strategy and optimized memory management solution.
[0146] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A method for rapid processing of graphic and text data, characterized in that: include: Receiving graphic data uploaded by a user, and storing the graphic data in a double buffer queue, wherein the double buffer queue includes a write queue and a read queue; Classify and annotate the image and text data in the double buffer queue, separate the text data from the image data, and establish a feature index for the text data; Extract features from the image data based on a deep learning model to generate an image feature vector, and associate the image feature vector with a corresponding feature index; Using parallel computing to synchronously process the feature index and the image feature vector to generate fused feature data; The fused feature data is stored in a distributed database and organized and stored according to a preset data structure.
2. The method for rapid processing of graphic and text data as claimed in claim 1, characterized in that: The graphic data includes document files, picture files and their corresponding metadata information; The dual-buffer queue adopts a read-write separation storage structure, wherein the write queue is used to cache newly received graphic and text data, and the read queue is used to provide data processing access; When the amount of graphic data in the write queue reaches a preset threshold, a queue switching operation is triggered; The queue switching operation includes: Obtain the data count value of the write queue, and compare the data count value with a preset threshold; when the data count value is greater than or equal to the preset threshold, send a switching signal to the queue management module; after receiving the switching signal, the queue management module first marks the write queue as a to-be-switched state, and suspends receiving new graphic data; then, the queue management module checks whether there is any unprocessed graphic data in the read queue, and if so, adds the status identifier of the unprocessed graphic data to a list of pending tasks; after confirming that the status check of the graphic data in the read queue is completed, the queue management module calls the memory mapping mechanism to copy the graphic data in the write queue to a pre-allocated temporary buffer in batches according to the data block size; After the temporary buffer completes data verification, the graphic data is migrated as a whole to the read queue and the data index table is updated; after the migration is completed, the queue management module resets the memory space of the original read queue and switches it to a new write queue; finally, the queue management module updates the queue status flag, releases the pause status of the new write queue, and resumes the graphic data receiving function.
3. The method for rapid processing of graphic and text data as claimed in claim 2, characterized in that: Classifying and labeling the graphic data includes: Sequentially read the graphic data from the read queue; Performing format recognition on the graphic data and generating a data type identifier; According to the data type identifier, the graphic data is divided into a text data stream and an image data stream; Establishing a feature index for the text data includes: For the text data stream, a word segmentation algorithm is used to segment the text content, extract key words, and retain the position information and contextual relationship of the key words in the original text; The keyword group and the location information form an initial feature item; Calculate feature weights based on the initial feature items to generate feature vectors with weights; Constructing a feature tree according to the feature vector and calculating the weight of each node; The feature index is established by taking the weight of each node as a priority.
4. The method for rapid processing of graphic and text data as claimed in claim 3, characterized in that: The feature weight is calculated as follows: Among them, Q is the query matrix, K is the key matrix, V is the value matrix, d is the feature dimension, P is the position encoding matrix, and R is the association strength matrix; The correlation strength matrix R can be calculated using the following formula: Among them, F i and F i+1 is the adjacent feature vector, λ is a learnable scaling factor, ||F i || and ||F i+1 || represents the vector norm; The calculation of the weight of each node is shown in the following formula: W node =α·W(Q,K,V)+β·depth factor +g·sibling similarity Among them, α, β, and γ are weight coefficients, depth factor is the depth attenuation factor, sibling similarity is the similarity of nodes at the same level.
5. The method for rapid processing of graphic and text data as claimed in claim 4, characterized in that: The deep learning model includes a trunk feature extraction branch and an attention enhancement branch; The backbone feature extraction branch adopts a residual structure, and each residual block contains two convolutional layers and an attention modulation module; The attention enhancement branch includes a spatial attention module and a channel attention module, wherein the spatial attention module generates a spatial weight map by calculating the response intensity of each spatial position in the feature map, and the channel attention module generates a channel weight vector by establishing inter-channel dependencies.
6. The method for rapid processing of graphic and text data as claimed in claim 5, characterized in that: The feature map of each residual block is calculated using the following formula: F(x)=H(x)+W2·σ(BN(W1·x))·A(x) Among them, H(x) is the identity mapping, W1 and W2 are convolution weight matrices, σ is the activation function, BN is the batch normalization operation, A(x) is the attention coefficient, and the attention coefficient calculation formula is: A(x)=tanh(μ·Pool(Conv(x))+ω·S) Among them, μ and ω are trainable parameters, S is the spatial position encoding matrix, and Pool is a mixed pooling operation.
7. The method for rapid processing of graphic and text data as claimed in claim 6, characterized in that: Generating the image feature vector includes: Preprocessing the image data, and inputting the preprocessed image output into the deep learning model for feature extraction; The extracted features are fused according to the fusion weights to obtain fusion features; The fused features are input into the global context encoder, and important features are filtered through the attention mechanism; The filtered important features are transformed through a fully connected layer to generate the image feature vector.
8. The method for rapid processing of graphic and text data as claimed in claim 7, characterized in that: The fusion weight is dynamically adjusted according to the similarity between feature branches and can be expressed as follows: Among them, F i is the trunk branch feature, G i is the attention branch feature, a i and β i is the dynamic weight coefficient, τ is the temperature parameter, and Z is the fusion weight.
9. A system for rapid processing of graphic data, based on the method for rapid processing of graphic data according to any one of claims 1 to 8, characterized in that: include: A data acquisition module, used for receiving graphic data uploaded by a user, and storing the graphic data through a double buffer queue, wherein the double buffer queue includes a write queue and a read queue; An index building module, used to classify and annotate the image and text data in the double buffer queue, separate the text data from the image data, and establish a feature index for the text data; A feature extraction and index association module, used to extract features from the image data based on a deep learning model, generate an image feature vector, and associate the image feature vector with a corresponding feature index; A feature fusion module, used to synchronously process the feature index and the image feature vector in a parallel computing manner to generate fused feature data; The storage module is used to store the fused feature data into a distributed database and organize and store it according to a preset data structure.
Citation Information
Patent Citations
Multi-modal aspect-level sentiment analysis method
CN116108186A
Aspect-level multi-modal sentiment analysis method based on double channels and attention mechanism
CN116662924A
Multi-log high-concurrency message queue processing method and system
CN117667447A
Nuclear power equipment maintenance decision-making method and system based on intelligent technology
CN118155227A
Image text matching algorithm fusing local and global semantics
CN118279925A