Database-based file resource reuse library management method and device
By adopting a database-based distributed column family database cluster in the project file resource management system, a multi-dimensional index and version management mechanism is built, the efficiency and consistency problems of traditional systems in large-scale file resource reuse are solved, and efficient and reliable resource reuse and version management are achieved.
Patent Information
- Application Number
- CN202510026353.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2045-01-08
AI Technical Summary
Traditional project file resource management systems have efficiency and consistency problems when dealing with large-scale file resource reuse, and the lack of effective management mechanisms leads to resource conflicts and version confusion.
The database-based file resource multiplexing library management method is adopted to achieve efficient management of project resources by building a distributed column family database cluster and dividing multiple dedicated column families. This method includes building reverse indexes, inverted indexes, version link tables and resource overview tables, supporting flexible resource retrieval, and handling concurrent access through distributed version locks and transaction managers, and automating resource imports and toolchain configuration.
It realizes efficient resource reuse for large-scale project development, solves the problems of resource conflicts and version chaos, and improves the consistency and reliability of development efficiency and resource reuse.
Smart Images

Figure CN119415481B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a method and device for managing a file resource reuse library based on a database. Background Art
[0002] Traditional project file resource management systems usually use simple file system storage methods, which have efficiency and consistency issues when dealing with large-scale file resource reuse. Existing technologies lack effective management mechanisms when dealing with concurrent access and version control, which easily leads to resource conflicts and version confusion.
[0003] At the same time, the existing system has obvious deficiencies in resource retrieval and indexing. Traditional methods often use a single retrieval method, lack multi-dimensional indexing support, and are difficult to meet complex resource retrieval needs. The system is also relatively simple in terms of resource metadata management and version association analysis, and fails to give full play to the advantages of distributed databases.
[0004] In addition, existing technologies also have limitations in project resource import and tool chain configuration. There is a lack of automated resource integration mechanisms and conflict handling capabilities, and the management and synchronization mechanisms of preview data are not perfect, which affects development efficiency. Solving these problems is of great significance to improving the collaborative efficiency of project development. Summary of the invention
[0005] In response to the problems in the prior art, the present application provides a database-based file resource reuse library management method and device, which can break through the limitations of traditional file resource management and provide an efficient resource reuse solution for large-scale project development.
[0006] In order to solve at least one of the above problems, the present application provides the following technical solutions:
[0007] In a first aspect, the present application provides a method for managing a file resource reuse library based on a database, comprising:
[0008] Construct a distributed column family database cluster and divide it into master and slave nodes, establish a column family storage structure through the master node and divide it into basic information column family, label index column family, full-text search column family, version association column family and preview additional column family, parse the project template file resources to generate a resource identification index table, write metadata into the distributed column family database cluster according to the resource identification index table, establish a reverse index table, an inverted index table, a version link table and a resource overview table according to the metadata, and synchronize the reverse index table, the inverted index table, the version link table and the resource overview table to the slave node for backup storage;
[0009] Receive concurrent search requests from developers and assign search tasks to the master and slave nodes through a concurrent access controller, call the label index column family and the full-text search column family to search for matching resource identifiers, obtain metadata from the basic information column family according to the resource identifier, call the version association column family to analyze the resource association relationship corresponding to the metadata, start a distributed version lock to monitor concurrent access conflicts, compare the resource association relationship with the version link table to determine the optimal version, and extract preview data corresponding to the optimal version from the preview additional column family;
[0010] Start the distributed transaction manager to monitor the project resource import task, copy the file resources corresponding to the optimal version to the target project engineering directory, read the tool chain configuration in the basic information column family and update the build script of the target project engineering, identify multiple concurrent modifications through the conflict detector and generate a solution, write the resource path and dependency in the tool chain configuration into the build script, write the preview data into the description document of the target project engineering, broadcast the resource status change information to the distributed column family database cluster and synchronize it to the slave node.
[0011] Furthermore, the distributed column family database cluster is constructed and divided into master and slave nodes, and a column family storage structure is established through the master node and divided into basic information column family, label index column family, full-text search column family, version association column family and preview additional column family, including:
[0012] Deploy distributed column family database nodes and configure the master node election strategy, divide the master node and slave node groups according to the network topology, create a data directory and initialize data files on the master node, configure the network communication protocol and data synchronization cycle between nodes, build a distributed file system for storing data shards, and establish a node heartbeat detection mechanism to monitor node status;
[0013] A column family storage structure is created based on the master node, and the data is divided into a basic information column family for storing metadata, a label index column family for storing retrieval labels, a full-text retrieval column family for storing keyword indexes, a version association column family for storing historical records, and a preview additional column family for storing preview data. The column family data is distributed to the slave node group through a data sharding strategy, and a data replication channel is established between the master and slave nodes.
[0014] Further, the parsing of the project template file resources generates a resource identification index table, writes metadata into the distributed column family database cluster according to the resource identification index table, establishes a reverse index table, an inverted index table, a version link table and a resource overview table according to the metadata, and synchronizes the reverse index table, the inverted index table, the version link table and the resource overview table to the slave node for backup storage, including:
[0015] Read the structural information of the project template file resource, extract the file name, type, version number, creation time and modification time from the structural information, calculate the file resource feature value by using a hash algorithm, combine the file name, type, version number, creation time, modification time and feature value to generate a resource identifier, and construct a resource identifier index table to store the mapping relationship between the resource identifier and the file resource;
[0016] The file resource content is parsed based on the resource identification index table, resource tags, keywords, historical versions and preview data are extracted to generate metadata, the metadata is written into the distributed column family database cluster, a reverse index table is established according to the tags, an inverted index table is established according to the keywords, a version link table is established according to the historical versions, a resource overview table is established according to the preview data, and the index table is copied to the slave node through a data synchronization mechanism.
[0017] Further, the receiving of concurrent search requests from developers and assigning search tasks to the master and slave nodes through a concurrent access controller, calling the label index column family and the full-text search column family to search for matching resource identifiers, obtaining metadata from the basic information column family according to the resource identifier, and calling the version association column family to analyze the resource association relationship corresponding to the metadata include:
[0018] Construct a concurrent access controller to monitor the search request queue, parse and optimize the search conditions in the search request queue, calculate the task processing capacity of the master and slave nodes based on the load balancing algorithm, assign the search tasks to the corresponding nodes according to the task processing capacity, and establish a task status monitoring mechanism to track the search progress;
[0019] The label index column family and the full-text search column family are called to perform parallel search, a set of resource identifiers matching labels are obtained from the label index column family, a set of resource identifiers matching keywords are obtained from the full-text search column family, the resource identifier sets are merged and deduplicated, metadata is queried from the basic information column family based on the merged resource identifiers, and resource association information in the metadata is analyzed using the version association column family.
[0020] Further, the starting of the distributed version lock monitoring concurrent access conflicts, comparing the resource association relationship with the version link table to determine the optimal version, and extracting the preview data corresponding to the optimal version from the preview additional column family include:
[0021] Create a distributed version lock table to record resource access status, set resource locking granularity based on the resource identifier, use a two-phase commit protocol to control concurrent access operations, monitor resource read and write requests in real time and record access timestamps, detect resource competition during concurrent access by multiple users, and handle conflicts through an optimistic locking mechanism;
[0022] According to the resource association relationship, the version link table is traversed to obtain the version dependency tree, the timestamp difference and update frequency of each version node in the version dependency tree are calculated, the version nodes are sorted based on the version scoring algorithm, the version with the highest score is selected as the optimal version, and the preview data corresponding to the optimal version is read from the preview additional column family.
[0023] Furthermore, the distributed transaction manager is started to monitor the project resource import task, the file resource corresponding to the optimal version is copied to the target project engineering directory, the tool chain configuration in the basic information column family is read and the build script of the target project engineering is updated, and the conflict detector is used to identify multiple people's concurrent modifications and generate solutions, including:
[0024] Construct a distributed transaction manager to maintain a resource import transaction status table, perform transaction control on the resource import process based on a two-phase commit protocol, copy the file resources corresponding to the optimal version to the target project according to the directory structure, read tool chain configuration information such as resource dependencies and compilation parameters from the basic information column family, and update the build script of the target project;
[0025] Deploy a conflict detector to monitor concurrent modification operations during resource import, analyze file content changes based on a version difference comparison algorithm, calculate the degree of conflict of the changed content and generate conflict markers, formulate corresponding resolution strategies for different types of conflicts, and apply the resolution strategies to the target project to eliminate conflicts.
[0026] Furthermore, writing the resource path and dependency in the tool chain configuration into the build script, writing the preview data into the description document of the target project, broadcasting the resource status change information to the distributed column family database cluster and synchronizing it to the slave node includes:
[0027] Parsing the toolchain configuration to extract information such as resource path, compilation parameters, dependent library version and build order, configuring the resource path as a relative path, setting resource reference rules according to the dependent library version, generating a compilation instruction sequence based on the build order, writing the compilation instruction sequence and the resource reference rules into the build script, creating a resource description file in the target project and writing the preview data;
[0028] A publish-subscribe mode is adopted to send resource status change messages to the distributed column family database cluster, and resource import completion mark, resource path information and construction script update record are encapsulated into a status data packet. The status data packet is transmitted to the slave node through a data synchronization mechanism, and a status data update operation is performed on the slave node.
[0029] In a second aspect, the present application provides a file resource reuse library management device based on a database, comprising:
[0030] An index module is used to construct a distributed column family database cluster and divide the master and slave nodes, establish a column family storage structure through the master node and divide it into basic information column family, label index column family, full-text search column family, version association column family and preview additional column family, parse the project template file resources to generate a resource identification index table, write metadata into the distributed column family database cluster according to the resource identification index table, establish a reverse index table, an inverted index table, a version link table and a resource overview table according to the metadata, and synchronize the reverse index table, the inverted index table, the version link table and the resource overview table to the slave node for backup storage;
[0031] A link module is used to receive concurrent search requests from developers and assign search tasks to the master and slave nodes through a concurrent access controller, call the label index column family and the full-text search column family to search for matching resource identifiers, obtain metadata from the basic information column family according to the resource identifier, call the version association column family to analyze the resource association relationship corresponding to the metadata, start a distributed version lock to monitor concurrent access conflicts, compare the resource association relationship with the version link table to determine the optimal version, and extract preview data corresponding to the optimal version from the preview additional column family;
[0032] A reuse module is used to start a distributed transaction manager to monitor the import task of project resources, copy the file resources corresponding to the optimal version to the target project engineering directory, read the tool chain configuration in the basic information column family and update the build script of the target project engineering, identify multiple concurrent modifications through a conflict detector and generate a solution, write the resource path and dependency in the tool chain configuration into the build script, write the preview data into the description document of the target project engineering, broadcast resource status change information to the distributed column family database cluster and synchronize it to the slave node.
[0033] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the database-based file resource reuse library management method when executing the program.
[0034] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the database-based file resource reuse library management method.
[0035] In a fifth aspect, the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the database-based file resource reuse library management method.
[0036] It can be seen from the above technical solution that the present application provides a database-based file resource reuse library management method and device, which realizes efficient management of project resources by constructing a distributed column family database cluster and dividing it into multiple dedicated column families. An innovative multi-dimensional indexing mechanism is designed, including reverse index, inverted index and version link, to support flexible resource retrieval. Distributed version locks and transaction managers are introduced to handle concurrent access, and multi-person collaboration scenarios are intelligently handled through conflict detectors. The system automatically handles resource import and tool chain configuration to ensure the consistency and reliability of resource reuse. This method breaks through the limitations of traditional file resource management and provides an efficient resource reuse solution for large-scale project development. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0038] Figure 1 This is one of the flow charts of the database-based file resource reuse library management method in the embodiment of the present application;
[0039] Figure 2 This is a second flow chart of a method for managing a file resource reuse library based on a database in an embodiment of the present application;
[0040] Figure 3 This is a flowchart of the third method for managing a file resource reuse library based on a database in an embodiment of the present application;
[0041] Figure 4 This is a fourth flow chart of a method for managing a file resource reuse library based on a database in an embodiment of the present application;
[0042] Figure 5 This is a fifth flow chart of a method for managing a file resource reuse library based on a database in an embodiment of the present application;
[0043] Figure 6 This is a sixth flow chart of the method for managing a file resource reuse library based on a database in an embodiment of the present application;
[0044] Figure 7 This is the seventh flow chart of the method for managing a file resource reuse library based on a database in an embodiment of the present application;
[0045] Figure 8 It is a structural diagram of a file resource reuse library management device based on a database in an embodiment of the present application;
[0046] Fig. 9 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application.
[0047] Reference numerals:
[0048] Electronic device 9600, central processing unit 9100, memory 9140, communication module 9110, input unit 9120, audio processor 9130, display 9160, power supply 9170, buffer memory 9141, application / function storage unit 9142, data storage unit 9143, driver program storage unit 9144, antenna 9111, speaker 9131, microphone 9132. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0050] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0051] Taking into account the problems existing in the prior art, the present application provides a database-based file resource reuse library management method and device, which realizes efficient management of project resources by constructing a distributed column family database cluster and dividing it into multiple dedicated column families. An innovative multi-dimensional indexing mechanism is designed, including reverse index, inverted index and version link, to support flexible resource retrieval. Distributed version locks and transaction managers are introduced to handle concurrent access, and multi-person collaboration scenarios are intelligently handled through conflict detectors. The system automatically handles resource import and tool chain configuration to ensure the consistency and reliability of resource reuse. This method breaks through the limitations of traditional file resource management and provides an efficient resource reuse solution for large-scale project development.
[0052] In order to break through the limitations of traditional file resource management and provide an efficient resource reuse solution for large-scale project development, this application provides an embodiment of a file resource reuse library management method based on a database, see Figure 1 The database-based file resource reuse library management method specifically includes the following contents:
[0053] Step S101: construct a distributed column family database cluster and divide it into master and slave nodes, establish a column family storage structure through the master node and divide it into basic information column family, label index column family, full-text search column family, version association column family and preview additional column family, parse the project template file resources to generate a resource identification index table, write metadata into the distributed column family database cluster according to the resource identification index table, establish a reverse index table, an inverted index table, a version link table and a resource overview table according to the metadata, and synchronize the reverse index table, the inverted index table, the version link table and the resource overview table to the slave node for backup storage;
[0054] Optionally, this embodiment implements a distributed column family database architecture for the file resource management requirements in the software development process. First, the master-slave node architecture is constructed using an election mechanism based on the Raft consensus protocol to ensure that a new master node can be quickly elected to maintain service when a node fails. The master node monitors the slave node status in real time through a heartbeat detection mechanism. When an abnormality is detected in a slave node, data rebalancing is automatically triggered to migrate the affected data shards to healthy nodes.
[0055] The column family storage structure on the master node adopts a multi-dimensional design. The basic information column family stores core metadata such as file name, type, and size; the label index column family supports multi-level resource classification through a label tree structure; the full-text search column family uses inverted index technology to achieve fast retrieval of text content; the version association column family uses a directed acyclic graph to store resource version dependencies; the preview attachment column family stores preview information such as resource thumbnails and document summaries.
[0056] When parsing project template file resources, the directory structure is processed recursively. The SHA-256 hash value is calculated for each file as a unique identifier, and the resource identifier is generated by combining the file path, creation time and other information. The Bloom filter is used to quickly determine whether the resource already exists to avoid repeated imports. The resource identifier index table is stored in a B+ tree structure, which supports efficient range queries and prefix matching.
[0057] The metadata writing process implements a batch processing mechanism. First, the metadata is cached in memory. When a certain amount is accumulated or the time threshold is reached, it is persisted in batches to the database through an asynchronous writer. The write operation uses write-ahead log technology to ensure data consistency, and data can be restored through logs in the event of a failure.
[0058] A hierarchical structure is used when building an index system based on metadata. The reverse index table supports multi-dimensional retrieval by mapping labels to resource identifiers; the inverted index table establishes a mapping from terms to documents after word segmentation of the file content; the version link table uses an adjacency table to store the inheritance relationship between versions; and the resource overview table stores preview data and statistical information of resources. These indexes are kept synchronized through an asynchronous update mechanism to ensure the real-time nature of the retrieval results.
[0059] The index building process adopts an incremental update strategy. When a resource change is detected, only the affected index items are updated to avoid the performance overhead caused by full reconstruction. The index items to be updated are marked through bitmap index technology to achieve efficient incremental index maintenance. For large-scale index updates, batch processing is adopted to avoid instantaneous pressure on the system.
[0060] The slave node data synchronization adopts a multi-level cache mechanism. The master node encapsulates the update operation as a transaction log and pushes it to the slave node through the message queue. The slave node first writes the data into the memory cache and then asynchronously refreshes it to the disk. The pre-read mechanism optimizes the access performance of hot data and reduces disk IO overhead.
[0061] This embodiment implements an intelligent sharding strategy when distributing indexes. Based on the access frequency and data volume of resources, the index of hot data is copied to multiple slave nodes to achieve load balancing. The consistent hashing algorithm is used for data sharding to ensure that the amount of data migration is minimized when the node is expanded or reduced.
[0062] In practical applications, this embodiment significantly improves resource management efficiency. By supporting flexible resource retrieval through multi-dimensional indexing, developers can quickly locate the required code templates and configuration files. The version management mechanism ensures the traceability of resources, facilitates code reuse and problem location. The distributed architecture ensures the high availability and scalability of the system.
[0063] This embodiment solves the problems of low retrieval efficiency, complex version management, and poor system scalability in traditional file management systems. Through the distributed architecture and multi-dimensional indexing mechanism, efficient management and fast retrieval of massive resources are achieved. Version control and preview functions simplify the resource reuse process and improve development efficiency. The perfect fault-tolerant mechanism ensures the stability and reliability of the system.
[0064] Step S102: receiving a concurrent search request from a developer and assigning a search task to the master and slave nodes through a concurrent access controller, calling the label index column family and the full-text search column family to search for matching resource identifiers, obtaining metadata from the basic information column family according to the resource identifier, calling the version association column family to analyze the resource association relationship corresponding to the metadata, starting a distributed version lock to monitor concurrent access conflicts, comparing the resource association relationship with the version link table to determine the optimal version, and extracting preview data corresponding to the optimal version from the preview additional column family;
[0065] Optionally, this embodiment implements an efficient resource retrieval and version management mechanism, mainly for the resource retrieval needs of the development team during code reuse. First, a concurrent access controller is built, and a token bucket algorithm is used to implement request current limiting to ensure the stability of the system in high-concurrency scenarios. The controller manages retrieval requests through a task queue and schedules task execution based on a priority strategy.
[0066] The allocation of concurrent retrieval tasks adopts a dynamic load balancing mechanism. The controller monitors the CPU usage, memory usage, network bandwidth and other indicators of the master and slave nodes in real time to build a node health scoring model. Through the weighted polling algorithm, the retrieval task is allocated to the most suitable node. When the node performance is detected to be degraded, the task allocation weight is automatically adjusted to avoid excessive pressure on a single point.
[0067] The retrieval process implements a multi-dimensional parallel query strategy. In the label index column family, a prefix tree structure is used to quickly match label combinations; in the full-text search column family, an inverted index technology is used to implement keyword search. The two retrieval processes are executed in parallel, and the Bloom filter is used to quickly filter out impossible matching resources to reduce invalid queries. Finally, the search results are merged through set intersection operations.
[0068] The batch pre-reading mechanism is implemented in the metadata acquisition phase. Based on the historical access pattern, the related resources that may be accessed are predicted and their metadata is loaded into the memory cache in advance. The LRU-K cache replacement algorithm is used to manage the cache space and retain the data with high access frequency. The asynchronous loading mechanism is used to prevent the pre-reading operation from affecting the main query performance.
[0069] The resource association relationship analysis uses a graph traversal algorithm. In the version association column family, the dependency relationship between resources is stored using an adjacency table. The direct and indirect dependencies of resources are identified through a depth-first search algorithm to build a complete dependency graph. A circular dependency detection mechanism is implemented to prevent version selection from falling into an infinite loop.
[0070] The implementation of distributed version locks is based on a two-phase locking protocol. First, a shared lock of a resource is obtained for read operations, and then upgraded to an exclusive lock when modification is required. The deadlock detection algorithm monitors lock dependencies in real time, and automatically rolls back some transactions when deadlock risks are found. The version lock table adopts a segmented lock design to reduce lock granularity and improve concurrency.
[0071] The process of determining the optimal version adopts a multi-factor scoring mechanism. A version scoring model is constructed to comprehensively consider factors such as version timestamp, update frequency, number of citations, stability, etc. For the version dependency chain, the optimal version combination is calculated through a dynamic programming algorithm to ensure that the selected version set meets all dependency constraints.
[0072] The extraction of preview data implements a progressive loading strategy. First, basic preview information of the resource is returned, such as file size, modification time, etc. Based on user interaction needs, more detailed preview content, such as code snippets, document summaries, etc., is gradually loaded. The transmission efficiency of preview data is optimized through data compression and incremental transmission technology.
[0073] In actual application scenarios, this embodiment significantly improves the response speed and accuracy of resource retrieval. Developers can quickly locate required resources through tag combinations and keywords, and the version management mechanism ensures that the most suitable resource version is obtained. The concurrency control mechanism ensures the stability of the system when multiple people access it at the same time.
[0074] This embodiment solves the problems of low retrieval efficiency, complex version selection, concurrent access conflicts, etc. in traditional resource management systems. Through multi-dimensional retrieval and intelligent version management, the resource reuse efficiency is significantly improved. The perfect concurrency control mechanism ensures the reliability of the system in high-load scenarios and meets the collaboration needs of large-scale development teams.
[0075] The implementation of the preview mechanism simplifies the resource evaluation process. Developers can quickly understand the content and features of resources without having to download them in full, which improves the efficiency of resource selection. The version lock mechanism ensures the security of resource access and avoids data inconsistency caused by concurrent modifications.
[0076] Step S103: Start the distributed transaction manager to monitor the project resource import task, copy the file resources corresponding to the optimal version to the target project engineering directory, read the tool chain configuration in the basic information column family and update the build script of the target project engineering, identify multiple concurrent modifications through the conflict detector and generate a solution, write the resource path and dependency in the tool chain configuration into the build script, write the preview data into the description document of the target project engineering, broadcast the resource status change information to the distributed column family database cluster and synchronize it to the slave node.
[0077] Optionally, this embodiment implements a complete set of project resource import and configuration management mechanisms, mainly to solve the resource integration needs of the development team during code reuse. First, a distributed transaction manager is built, and a two-phase commit protocol based on the Paxos algorithm is used to ensure the atomicity and consistency of the resource import process. The transaction manager implements transaction concurrency control through a state machine, decomposing the resource import task into three stages: preparation, execution, and submission. A timeout retry mechanism and compensation transaction are set for each stage.
[0078] The resource replication process implements an adaptive block transmission mechanism. The data block size is dynamically adjusted through the sliding window algorithm. The initial block size is set to 1MB and adjusted in real time according to the network throughput. A multi-threaded parallel transmission strategy is adopted, and the number of threads is dynamically optimized according to the number of CPU cores of the target server. A fault-tolerant mechanism based on breakpoint continuation is implemented. When the transmission is interrupted, the breakpoint position is quickly located through binary comparison, and only the unfinished data blocks are transmitted, which significantly improves the reliability of large file transmission.
[0079] The toolchain configuration update adopts a three-stage merge strategy. The first stage parses the existing build script and converts the configuration information into a syntax tree structure; the second stage matches the configuration items and identifies duplicates and conflicts; the third stage performs intelligent merging, giving priority to retaining the newer configuration version, while ensuring the integrity of the configuration through dependency graph analysis. For compilation parameter conflicts, a priority-based resolution mechanism is implemented to ensure that core parameters are not overwritten by errors.
[0080] The conflict detector implements a multi-dimensional change analysis mechanism. At the syntax level, it uses abstract syntax tree comparison to identify code structure changes; at the semantic level, it uses symbol table analysis to identify interface changes and behavior modifications; at the dependency level, it uses call graph analysis to identify the impact range between components. For each type of change, the system calculates the change impact score, which takes into account factors such as the number of modified lines, modification frequency, and number of dependencies.
[0081] Solution generation uses a decision-making mechanism enhanced by machine learning. By analyzing historical conflict resolution records, the decision model is trained to predict the optimal resolution strategy. The model input features include conflict type, code location, modification content, etc., and the output includes decision suggestions such as merge strategy and retention version selection. To improve accuracy, the model uses an ensemble learning method to combine the prediction results of multiple basic classifiers.
[0082] The build script update implements intelligent dependency management. First, the explicit dependencies in the code are extracted through static analysis, and the runtime dependencies are identified through dynamic analysis to build a complete dependency graph. The dependency version selection uses a constraint solving algorithm to ensure the version compatibility of all components. For circular dependencies, a processing mechanism based on strongly connected component decomposition is implemented.
[0083] The document generation adopts a templated automation mechanism. The document parser extracts the comments and interface definitions in the code, and generates a standardized document structure in combination with the preview data. Multi-language document templates are implemented to support document specifications in different programming languages. The document content is organized in a topic-based clustering manner, and the relevant function descriptions are automatically classified and organized.
[0084] The synchronization of state change information adopts the publish-subscribe model. The change message is broadcast to each node in the cluster through the message queue. The message contains information such as the change type, impact range, and timestamp. The slave node adopts an asynchronous confirmation mechanism to ensure that the message is received reliably. The message compression and batch transmission mechanism are implemented to reduce network overhead.
[0085] This embodiment significantly improves the reliability and efficiency of resource import in practical applications. The atomicity of operations is ensured through distributed transactions, and data consistency can be maintained even in the event of network failures. The intelligent conflict detection and resolution mechanism greatly reduces the need for manual intervention and improves the collaboration efficiency of the development team.
[0086] This embodiment solves several key problems in the traditional resource import process: it ensures the reliability of operations through distributed transaction management; it improves the efficiency of concurrent collaboration through intelligent conflict detection and resolution mechanisms; and it simplifies the resource integration process through automated configuration management and document generation. These improvements enable development teams to reuse code and share resources more efficiently.
[0087] From the above description, it can be seen that the database-based file resource reuse library management method provided in the embodiment of the present application can achieve efficient management of project resources by building a distributed column family database cluster and dividing it into multiple dedicated column families. An innovative multi-dimensional indexing mechanism is designed, including reverse index, inverted index and version link, to support flexible resource retrieval. Distributed version locks and transaction managers are introduced to handle concurrent access, and multi-person collaboration scenarios are intelligently handled through conflict detectors. The system automatically handles resource import and tool chain configuration to ensure the consistency and reliability of resource reuse. This method breaks through the limitations of traditional file resource management and provides an efficient resource reuse solution for large-scale project development.
[0088] In one embodiment of the database-based file resource reuse library management method of the present application, see Figure 2 , and can also include the following:
[0089] Step S201: deploy distributed column family database nodes and configure the master node election strategy, divide the master node and slave node group according to the network topology structure, create a data directory and initialize data files on the master node, configure the network communication protocol and data synchronization cycle between nodes, build a distributed file system for storing data shards, and establish a node heartbeat detection mechanism to monitor node status;
[0090] Step S202: Create a column family storage structure based on the master node, divide the data into a basic information column family for storing metadata, a label index column family for storing retrieval labels, a full-text retrieval column family for storing keyword indexes, a version association column family for storing historical records, and a preview additional column family for storing preview data; distribute the column family data to the slave node group through a data sharding strategy, and establish a data replication channel between the master and slave nodes.
[0091] Optionally, this embodiment implements a distributed column family database cluster architecture for the file resource management needs of large-scale software development teams. First, the master node election mechanism is implemented through the Raft consensus algorithm. The election process is divided into three stages: pre-election, voting, and result confirmation. Each node maintains an election timer. When the timer times out, the node enters the candidate state and initiates an election. To avoid the dispersion of votes, a randomized election timeout is used to ensure that consensus can be reached quickly after the network partition is restored.
[0092] When dividing the network topology, a hierarchical node organization method is adopted. Nodes with close physical distances are divided into the same group. Nodes in the group communicate directly through the local area network, and data is synchronized between groups through the wide area network. Each node group is configured with a master node and multiple slave nodes. The master node is responsible for coordinating data consistency within the group, and the slave nodes are responsible for data backup and read load sharing.
[0093] The data directory on the master node adopts a hierarchical storage structure. Hot data is stored in the cache layer, and cold data is migrated to the slow storage layer. The data access pattern is analyzed through the prediction model, and the distribution of data between different storage layers is dynamically adjusted. The data file adopts a log structure merge tree organization to support efficient range query and data compression.
[0094] The communication between nodes adopts an asynchronous message transmission mechanism. A TCP-based long connection is used to maintain persistent communication between nodes, and the connection status is detected through heartbeat packets. The message transmission adopts a two-way streaming transmission protocol, which supports batch processing and compressed transmission of messages. A message priority queue is implemented to ensure that key operation messages are processed first.
[0095] The data synchronization cycle is dynamically adjusted according to the network conditions. The network delay and bandwidth between nodes are monitored in real time through network detectors. When the network conditions are good, the synchronization frequency is increased, and when the network is congested, the synchronization frequency is appropriately reduced. The synchronization process adopts incremental transmission mode, and only the changed data blocks are transmitted.
[0096] The distributed file system implements a multi-copy storage mechanism. Each data shard maintains multiple copies in the cluster, and the copy placement strategy takes rack awareness into account to ensure that the copies are distributed on nodes in different racks. Data sharding is performed through a consistent hashing algorithm to minimize the amount of data migration when the number of nodes changes.
[0097] The heartbeat detection mechanism adopts a multi-level timeout strategy. The node sends heartbeat messages regularly, and the receiver maintains the most recent reception timestamp. Multiple timeout thresholds are set, and different thresholds trigger different levels of fault handling. An automatic failover mechanism is implemented to quickly elect a new master node when the master node fails.
[0098] The column family storage structure adopts a column-oriented storage format. The basic information column family stores the core attributes of the file, such as name, size, timestamp, etc. The label index column family uses an inverted table to store the mapping of labels to documents. The full-text search column family uses a word segmentation index to support full-text search. The version association column family stores version dependencies through a directed graph. The preview attachment column family stores the abbreviated information of resources.
[0099] Data sharding is distributed using a consistent hash ring. Virtual node technology is used to improve the balance of data distribution. Each physical node corresponds to multiple virtual nodes distributed on the hash ring. The sharding strategy takes data locality into consideration and distributes highly correlated data to the same node.
[0100] Data replication between master and slave nodes uses an asynchronous pipeline mechanism. The master node encapsulates update operations as transaction logs and transmits them to slave nodes through parallel replication channels. Bandwidth-aware replication scheduling is implemented, and replication concurrency is dynamically adjusted according to network conditions.
[0101] This embodiment solves several key problems in traditional distributed storage systems: it improves system scalability through intelligent node management and data sharding strategies; it ensures high availability of services through a multi-level fault tolerance mechanism; and it improves data access performance through an optimized storage structure and replication mechanism. These improvements enable the system to stably support the collaborative work of large-scale development teams.
[0102] In one embodiment of the database-based file resource reuse library management method of the present application, see Figure 3 , and can also include the following:
[0103] Step S301: Read the structural information of the project template file resource, extract the file name, type, version number, creation time and modification time from the structural information, calculate the file resource feature value by using a hash algorithm, combine the file name, type, version number, creation time, modification time and feature value to generate a resource identifier, and construct a resource identifier index table to store the mapping relationship between the resource identifier and the file resource;
[0104] Step S302: Parse the file resource content based on the resource identification index table, extract resource tags, keywords, historical versions and preview data to generate metadata, write the metadata into the distributed column family database cluster, establish a reverse index table according to the tags, establish an inverted index table according to the keywords, establish a version link table according to the historical versions, establish a resource overview table according to the preview data, and copy the index table to the slave node through a data synchronization mechanism.
[0105] Optionally, this embodiment implements a complete set of project template resource parsing and indexing construction mechanisms, which mainly solves the need for efficient management of project template resources during software development. First, the directory structure of the project template is read through a recursive traversal algorithm, and basic attribute information is extracted for each file node. A multi-threaded parallel processing strategy is adopted during the parsing process, and the thread pool size is dynamically adjusted according to the number of CPU cores, which significantly improves the parsing efficiency of large-scale project templates.
[0106] The file feature value calculation adopts an improved block hash algorithm. First, the file content is divided into blocks of fixed size, and the SHA-256 hash value is calculated for each data block. Then, these hash values are organized through the Merkle tree structure to finally generate the overall feature value of the file. This method not only ensures the uniqueness of the feature value, but also supports subsequent incremental updates. When part of the file content changes, only the hash value of the changed block needs to be recalculated.
[0107] The generation of resource identifiers adopts a multi-dimensional combination strategy. The file name is normalized, special characters are removed and converted to a unified format; the type information is double-confirmed by the file extension and content characteristics; the version number adopts the semantic version specification; and the timestamp uses a unified UTC format. This information is combined with a specific separator and Base64 encoded to generate the final resource identifier.
[0108] The resource identification index table is stored in an LSM tree structure, which caches write operations in memory and writes them to disk in batches when the threshold is reached. The key-value pairs in the index table are quickly searched through Bloom filters, which significantly reduces invalid disk access. The index sharding mechanism is implemented to evenly distribute index data to different storage nodes according to the hash value of the resource identification.
[0109] The metadata extraction process implements intelligent content analysis. For source code files, key identifiers such as function names, class names, and variable names are extracted through abstract syntax tree analysis; for document files, natural language processing technology is used to extract keywords and key phrases; for configuration files, pattern matching is used to identify configuration items and parameter values. These analysis results serve as the source of tags and keywords.
[0110] The label system is constructed using a hierarchical classification strategy. The extracted labels are semantically grouped through a clustering algorithm to establish parent-child and association relationships between labels. The reverse index table is implemented using a skip table structure to support efficient range queries and prefix matching. Each label node maintains a bitmap index to quickly locate resources containing the label.
[0111] The keyword index adopts an improved inverted index structure. First, the file content is segmented, and the TF-IDF algorithm is used to calculate the word weights, and the keywords with higher weights are retained. The inverted list adopts a compressed storage format and uses variable-length encoding technology to reduce storage space. Index merging optimization is achieved, and small index files are merged regularly to improve retrieval efficiency.
[0112] The version link table stores the version evolution relationship through a directed acyclic graph. Each version node contains information such as version number, parent version list, and child version list. The dependency order between versions is determined by a topological sorting algorithm, and version backtracking and branch management are supported. A version compression mechanism is implemented to regularly merge intermediate versions to reduce storage overhead.
[0113] The resource overview table adopts a tiered storage strategy. Common preview data (such as file size and modification time) is stored in the memory layer, and detailed preview content (such as code snippets and document summaries) is stored in the disk layer. The access performance is optimized through the pre-reading mechanism, and the preview data that may be needed is predicted based on the user's behavior pattern.
[0114] The data synchronization mechanism adopts an incremental replication strategy. The master node maintains an operation log to record changes to the index table. The slave node obtains new operation logs by pulling and applies these changes in sequence. A parallel synchronization mechanism is implemented, and multiple slave nodes can pull data from the master node at the same time, improving synchronization efficiency.
[0115] This embodiment significantly improves the management efficiency of project template resources through a complete resource parsing and indexing mechanism. Intelligent content analysis and multi-dimensional indexing support accurate resource retrieval, and hierarchical version management ensures the traceability of resources. These improvements enable development teams to manage and reuse project template resources more conveniently.
[0116] In one embodiment of the database-based file resource reuse library management method of the present application, see Figure 4, and can also include the following:
[0117] Step S401: construct a concurrent access controller to monitor a search request queue, parse and optimize the search conditions in the search request queue, calculate the task processing capabilities of the master and slave nodes based on a load balancing algorithm, assign the search tasks to the corresponding nodes according to the task processing capabilities, and establish a task status monitoring mechanism to track the search progress;
[0118] Step S402: Call the label index column family and the full-text search column family to perform parallel search, obtain a set of resource identifiers that match labels from the label index column family, obtain a set of resource identifiers that match keywords from the full-text search column family, merge and deduplicate the resource identifier sets, query metadata from the basic information column family based on the merged resource identifiers, and use the version association column family to analyze resource association information in the metadata.
[0119] Optionally, this embodiment implements an efficient concurrent resource retrieval mechanism, mainly for the resource reuse needs of large-scale software development teams. First, a request queue manager is constructed, and a multi-level priority queue structure is used to organize retrieval requests. The queue priority is determined based on the urgency of the request, user weight, and resource type. The token bucket algorithm is used to implement request current limiting to ensure system stability.
[0120] Retrieval condition optimization uses a cost-based query rewriting mechanism. First, the retrieval condition is parsed and the query tree structure is constructed. The query tree is rewritten using equivalent transformation rules, such as merging similar conditions, eliminating redundant constraints, and adjusting the execution order. The optimizer estimates the cost of different execution plans based on index statistics and selects the optimal execution path.
[0121] The load balancing algorithm implements an adaptive task allocation strategy. The performance collector monitors the CPU usage, memory usage, I / O load, network bandwidth and other indicators of the node in real time. A weighted polling algorithm is used for task allocation, and the weight calculation takes into account the hardware configuration and current load status of the node. A dynamic weight adjustment mechanism is implemented to automatically reduce the weight of a node when abnormal performance is detected.
[0122] Task status monitoring uses an event-driven model. Each retrieval task is decomposed into multiple subtasks, and the progress of the subtasks is reported in real time through the message queue during execution. The monitor maintains the task dependency graph and identifies delayed tasks on the critical path. When the task execution times out or fails, the task reallocation mechanism is triggered to ensure the reliable completion of the retrieval request.
[0123] Parallel search achieves two-way query optimization. Tag index search uses a prefix tree structure to support multi-tag combination query. Tree nodes save the mapping relationship between tags and resources, and quickly calculate tag intersections through bitmap indexes. Full-text search uses an improved inverted index to achieve efficient term search based on Skip List. Two search processes are executed in parallel, and computing resources are managed through a thread pool.
[0124] The tag matching process implements a fuzzy matching mechanism. First, the input tags are standardized to remove stop words and special characters. Similar tags are identified through the edit distance algorithm, supporting synonym expansion and hyponym derivation. The matching results are sorted by similarity, and high-quality matches are retained through threshold filtering.
[0125] Keyword search uses a semantically enhanced matching strategy. The Word2Vec model is used to calculate word vectors, and the semantic relevance of keywords is measured by cosine similarity. A query expansion mechanism is implemented to expand search terms based on the neighbor relationship in the word vector space to improve the recall rate. For professional terms and domain-specific vocabulary, a custom dictionary is established to enhance recognition capabilities.
[0126] The result merging adopts a multi-way merge algorithm. The resource identifiers from different sources are constructed into an ordered stream and merged by merge sorting. The Bloom filter is implemented to accelerate the deduplication process, significantly reducing the number of comparison operations. The merged results are sorted according to the relevance score, and the score calculation comprehensively considers the tag matching, keyword matching and resource popularity.
[0127] Metadata query implements a batch pre-fetch mechanism. Based on the resource access pattern, the relevant resources that may need to be queried are predicted and their metadata is loaded into the cache in advance. The cache adopts a layered design, with hot data stored in memory and cold data downgraded to persistent storage. The cache space is managed through the LRU-K algorithm to maintain a high cache hit rate.
[0128] Version association analysis uses a graph traversal algorithm. Through depth-first search, the dependency chain between resources is identified and a resource association graph is constructed. Circular dependency detection is implemented to avoid version selection falling into an infinite loop. The association analysis results are used for subsequent version selection and update strategy formulation.
[0129] This embodiment solves several key problems in traditional resource retrieval: it improves the concurrent processing capability of the system through intelligent request scheduling and load balancing; it improves the query response speed through optimized retrieval algorithms and cache mechanisms; and it improves the accuracy of retrieval through semantically enhanced matching strategies. These improvements enable the development team to find the required resources more efficiently.
[0130] In one embodiment of the database-based file resource reuse library management method of the present application, see Figure 5, and can also include the following:
[0131] Step S501: Create a distributed version lock table to record resource access status, set resource locking granularity based on the resource identifier, use a two-phase commit protocol to control concurrent access operations, monitor resource read and write requests in real time and record access timestamps, detect resource competition during concurrent access by multiple users, and handle conflicts through an optimistic locking mechanism;
[0132] Step S502: traverse the version link table according to the resource association relationship to obtain the version dependency tree, calculate the timestamp difference and update frequency of each version node in the version dependency tree, sort the version nodes based on the version scoring algorithm, select the version with the highest score as the optimal version, and read the preview data corresponding to the optimal version from the preview additional column family.
[0133] Optionally, this embodiment implements a refined resource version control mechanism, which mainly solves the version management needs of the development team during resource reuse. First, a distributed version lock table is constructed, and a hierarchical design is used to store lock information in multiple nodes. The lock table structure contains fields such as resource identification, lock range, holder information, and acquisition time. The lock records are evenly distributed to different nodes through a consistent hashing algorithm.
[0134] The resource locking granularity adopts an adaptive adjustment strategy. For frequently modified hot resources, the lock granularity is refined to the file block level; for seldom modified resources, file-level locking is adopted. The lock granularity adjustment process is implemented through access pattern analysis, recording and counting the access frequency and concurrency of resources, and automatically adjusting the lock granularity when frequent lock contention is detected.
[0135] The two-phase commit protocol implements distributed transaction control. In the first phase, the coordinator sends a prepare request to all participating nodes, and the participating nodes check the local resource status and reserve necessary resources; in the second phase, the commit or rollback operation is decided based on the responses of all participating nodes. The automatic rollback mechanism of transaction timeout is implemented to avoid long-term resource locking.
[0136] Access monitoring uses a distributed event collection mechanism. Each node maintains a local access log to record detailed information about read and write operations. Access events are transmitted to the central monitor in real time through the message queue. The monitor statistically analyzes resource access characteristics through time windows to identify potential access hotspots and contention situations.
[0137] The optimistic locking mechanism implements conflict detection based on version numbers. Each resource maintains a version counter, and the version number is incremented when the resource is modified. When submitting an update, check whether the current version number of the resource is consistent with the version number at the beginning of the operation. If it is inconsistent, it means that concurrent modification has occurred. A conflict resolution strategy is implemented, supporting automatic merging or manual intervention.
[0138] Version dependency analysis uses an improved depth-first search algorithm. Starting from the current version node, the version dependency tree is recursively traversed, and the dependency relationship and version attributes between nodes are recorded. Circular dependency detection is implemented. When a circular dependency is found, the cycle is broken through heuristic rules to ensure the feasibility of version selection.
[0139] The timestamp difference calculation takes into account the time interval between versions. For directly connected version nodes, the difference in their creation time is calculated; for indirectly connected nodes, the time distribution of the intermediate versions is considered. The time difference is weighted by an exponential decay function, so that recent version changes have a higher weight.
[0140] Update frequency analysis implements multi-dimensional statistics. It horizontally counts the number of version updates within a specific time period, and vertically analyzes the time distribution characteristics of version updates. It calculates the short-term and long-term update trends of versions through sliding windows, and identifies the regular characteristics of version evolution.
[0141] The version scoring algorithm uses a multi-factor weighted model. Scoring factors include version timeliness, update activity, dependency integrity, usage frequency, etc. Weight parameters are trained using machine learning methods, and the training data comes from historical version selection records. The model input includes various statistical features of the version, and the output is a comprehensive score for the version.
[0142] The preview data reading implements a progressive loading mechanism. First, basic preview information such as file size and modification time are loaded, and detailed preview content is loaded on demand based on user interaction. Preview data caching is implemented, and recently accessed preview information is saved in memory to improve the response speed of repeated access.
[0143] This embodiment significantly improves the efficiency of resource version management through a complete version control and selection mechanism. The intelligent lock mechanism ensures the correctness of concurrent access, and the version scoring algorithm helps users quickly locate the most suitable resource version. These improvements enable development teams to better manage and utilize different versions of project resources.
[0144] This embodiment solves several key problems in traditional version control in practical applications: improving concurrent access efficiency through refined lock control; simplifying the version selection process through an intelligent version scoring mechanism; and improving the resource browsing experience through an optimized preview mechanism. These improvements significantly improve the collaboration efficiency of the development team.
[0145] In one embodiment of the database-based file resource reuse library management method of the present application, see Figure 6 , and can also include the following:
[0146] Step S601: construct a distributed transaction manager to maintain a resource import transaction status table, perform transaction control on the resource import process based on a two-phase commit protocol, copy the file resources corresponding to the optimal version to the target project according to the directory structure, read tool chain configuration information such as resource dependencies and compilation parameters from the basic information column family, and update the build script of the target project;
[0147] Step S602: deploy a conflict detector to monitor concurrent modification operations during resource import, analyze file content changes based on a version difference comparison algorithm, calculate the conflict level of the changed content and generate conflict markers, formulate corresponding resolution strategies for different types of conflicts, and apply the resolution strategies to the target project to eliminate conflicts.
[0148] Optionally, this embodiment implements an intelligent resource import and conflict handling mechanism, mainly for the resource integration needs of large-scale software projects. First, a distributed transaction manager is constructed, and a multi-layer state machine design is adopted to decompose resource import transactions into three main stages: preparation, execution, and submission. The state table adopts a shard storage structure, and distributes transaction records to multiple nodes through consistent hashing to improve concurrent processing capabilities.
[0149] Transaction control uses an improved two-phase commit protocol. In the preparation phase, the coordinator sends a transaction preprocessing request to all participating nodes, and the participating nodes verify the local resource status and reserve necessary resources; in the commit phase, the commit or rollback operation is decided based on the responses of all participating nodes. A transaction compensation mechanism is implemented, which can automatically roll back the completed operations when some nodes fail to execute.
[0150] The resource copying process implements intelligent transmission control. First, the directory tree structure is constructed to maintain the hierarchical relationship of the original project. A multi-threaded parallel transmission strategy is adopted to dynamically adjust the transmission concurrency according to the file size and network conditions. A breakpoint resume mechanism is implemented to support rapid recovery after transmission interruption through file block checksum comparison.
[0151] Toolchain configuration updates use an incremental merge strategy. First, the existing build script of the target project is parsed and the configuration information is converted into an abstract syntax tree structure. The differences between the new and old configurations are identified through a tree difference algorithm. Non-conflicting configurations are directly merged, and intelligent decisions are made for conflicting configuration items.
[0152] The build script update enables automatic maintenance of dependencies. Static analysis is used to extract explicit dependencies in the code, and dynamic analysis is used to identify runtime dependencies to build a complete dependency graph. Dependency version selection uses a constraint solving algorithm to ensure version compatibility of all components.
[0153] The conflict detector uses an event-driven monitoring mechanism. It captures all file operation events through file system hooks and tracks the modification status of resources in real time. It implements change log recording, which records the content, time and operator information of each modification in detail.
[0154] Version difference comparison adopts a multi-level analysis strategy. At the syntax level, abstract syntax tree comparison is used to identify code structure changes; at the semantic level, symbol table analysis is used to identify interface changes and behavior modifications; at the dependency level, call graph analysis is used to identify the impact range between components.
[0155] The conflict severity calculation implements an evaluation model based on machine learning. The model input features include objective indicators such as the number of modified rows, modification location, and modification type, as well as empirical features extracted from historical conflict resolution records. The deep neural network learns the impact of different feature combinations on the severity of the conflict and outputs the risk score of the conflict.
[0156] The conflict resolution strategy adopts a classification processing mechanism. For simple text conflicts, a three-way merge algorithm is used to automatically resolve them; for complex semantic conflicts, interactive resolution suggestions are provided; for architectural conflicts, refactoring suggestions are provided through dependency graph analysis. A strategy knowledge base is implemented to record and reuse successful solutions.
[0157] The strategy application process implements transactional operations. Each resolution step is encapsulated as an atomic operation, supporting independent commit and rollback. By logging the detailed operation process, it can accurately roll back to the previous state when an exception occurs. A concurrency control mechanism is implemented to ensure that multiple conflict resolution tasks do not interfere with each other.
[0158] This embodiment solves several key problems in traditional resource import: the reliability of the import process is ensured through distributed transactions; the efficiency of concurrent collaboration is improved through intelligent conflict detection and resolution mechanisms; and the resource integration process is simplified through automated configuration management. These improvements enable development teams to reuse code and share resources more efficiently.
[0159] This embodiment significantly improves the reliability and efficiency of resource import in practical applications. The atomicity of operations is ensured through distributed transactions, and data consistency can be maintained even in the event of network failures. The intelligent conflict detection and resolution mechanism greatly reduces the need for manual intervention and improves the collaboration efficiency of the development team.
[0160] In one embodiment of the database-based file resource reuse library management method of the present application, see Figure 7 , and can also include the following:
[0161] Step S701: parsing the tool chain configuration to extract information such as resource path, compilation parameters, dependent library version and build order, configuring the resource path as a relative path, setting resource reference rules according to the dependent library version, generating a compilation instruction sequence based on the build order, writing the compilation instruction sequence and the resource reference rules into the build script, creating a resource description file in the target project and writing the preview data;
[0162] Step S702: Use the publish-subscribe mode to send a resource status change message to the distributed column family database cluster, encapsulate the resource import completion mark, resource path information and build script update record into a status data packet, transmit the status data packet to the slave node through the data synchronization mechanism, and perform a status data update operation on the slave node.
[0163] Optionally, this embodiment implements a complete toolchain configuration parsing and state synchronization mechanism, which mainly solves the configuration management requirements of software projects during resource integration. First, the toolchain configuration file is processed by a lexical analyzer and a syntax parser to convert the configuration information into an abstract syntax tree structure. The parsing process uses a recursive descent algorithm and supports a variety of common configuration file formats, such as XML, JSON, YAML, etc.
[0164] Path processing uses an intelligent normalization strategy. First, the absolute path reference in the configuration is identified and converted to a relative path relative to the project root directory through path calculation. A path mapping table is implemented to record the path correspondence of resources in different environments. For cross-platform projects, the differences in path separators of different operating systems are automatically processed.
[0165] Dependent library version management uses semantic version control. The version parser extracts the major version, minor version, and revision number of the version number to achieve version comparison and compatibility check. A version constraint graph is established to resolve complex version dependencies through graph algorithms. When version conflicts are found, the optimal version combination is selected through heuristic rules.
[0166] The build order analysis uses a topological sorting algorithm. First, a component dependency graph is constructed, where nodes represent build targets and edges represent dependency relationships. Circular dependencies are identified through depth-first search, and feedback edges are used to break the loop when necessary. The generated build order ensures that dependencies are built before dependents.
[0167] The compilation instruction sequence generation adopts a template design. According to different build tools (such as Make, CMake, Gradle, etc.), the corresponding instruction template library is maintained. The configuration parameters are filled into the template through the template engine to generate a complete build command. Conditional compilation support is implemented to generate different instruction sequences according to the target platform and build type.
[0168] Resource reference rules adopt a multi-level configuration structure. Global reference policies are set at the project level, and local overrides can be made at the module level. The configuration process is simplified through the inheritance mechanism, and submodules inherit the reference rules of the parent module by default. A dynamic loading mechanism is implemented to support switching different reference policies according to conditions at runtime.
[0169] The resource description file adopts a structured document format. The key features of the resource are extracted through the preview data generator, including function description, interface description, usage examples, etc. An automatic update mechanism is implemented, and when the resource content changes, the relevant description documents are automatically updated.
[0170] The state change message adopts an asynchronous publish-subscribe mode. The message producer encapsulates the state change as an event object and sends it to the subscriber through the message queue. A message persistence mechanism is implemented to ensure that the state information will not be lost even in the event of a system failure.
[0171] The state data packet adopts binary serialization format. The compression algorithm reduces the amount of data transmission and supports incremental updates to improve synchronization efficiency. A data verification mechanism is implemented to ensure the integrity of data transmission through checksum detection. A version mark is included in the data packet to support backward-compatible format upgrades.
[0172] Data synchronization uses a multi-level cache strategy. The master node maintains a write buffer and processes status update requests in batches. The slave node obtains updated data through pull operations and maintains a read cache locally to improve query performance. An incremental synchronization mechanism is implemented to only transmit the changed data.
[0173] The state update operation uses optimistic concurrency control. Each state object contains a version number, and version consistency is checked when updating. When conflicts occur, they are resolved through a customized merge function. Update log records are implemented to support auditing and rollback of state changes.
[0174] This embodiment significantly improves the reliability and efficiency of project resource integration through a complete configuration management and state synchronization mechanism. Intelligent configuration parsing and version management ensure the correctness of project dependencies, and the asynchronous state synchronization mechanism provides good system scalability.
[0175] This embodiment solves several key problems in traditional configuration management in practical applications: it simplifies resource reference configuration through intelligent path processing, avoids dependency conflicts through semantic version management, and improves system responsiveness through asynchronous state synchronization. These improvements enable development teams to manage and share project resources more conveniently.
[0176] In order to break through the limitations of traditional file resource management and provide an efficient resource reuse solution for large-scale project development, the present application provides an embodiment of a file resource reuse library management device based on a database for implementing all or part of the contents of the file resource reuse library management method based on a database, see Figure 8 The file resource reuse library management device based on the database specifically includes the following contents:
[0177] An index module 10 is used to construct a distributed column family database cluster and divide it into master and slave nodes, establish a column family storage structure through the master node and divide it into basic information column family, label index column family, full-text search column family, version association column family and preview additional column family, parse the project template file resources to generate a resource identification index table, write metadata into the distributed column family database cluster according to the resource identification index table, establish a reverse index table, an inverted index table, a version link table and a resource overview table according to the metadata, and synchronize the reverse index table, the inverted index table, the version link table and the resource overview table to the slave node for backup storage;
[0178] The link module 20 is used to receive concurrent search requests from developers and assign search tasks to the master and slave nodes through a concurrent access controller, call the label index column family and the full-text search column family to search for matching resource identifiers, obtain metadata from the basic information column family according to the resource identifier, call the version association column family to analyze the resource association relationship corresponding to the metadata, start a distributed version lock to monitor concurrent access conflicts, compare the resource association relationship with the version link table to determine the optimal version, and extract preview data corresponding to the optimal version from the preview additional column family;
[0179] The reuse module 30 is used to start the distributed transaction manager to monitor the project resource import task, copy the file resources corresponding to the optimal version to the target project engineering directory, read the tool chain configuration in the basic information column family and update the build script of the target project engineering, identify multiple concurrent modifications through the conflict detector and generate a solution, write the resource path and dependency in the tool chain configuration into the build script, write the preview data into the description document of the target project engineering, broadcast the resource status change information to the distributed column family database cluster and synchronize it to the slave node.
[0180] From the above description, it can be seen that the database-based file resource reuse library management device provided in the embodiment of the present application can achieve efficient management of project resources by constructing a distributed column family database cluster and dividing it into multiple dedicated column families. An innovative multi-dimensional indexing mechanism is designed, including reverse index, inverted index and version link, to support flexible resource retrieval. Distributed version locks and transaction managers are introduced to handle concurrent access, and multi-person collaboration scenarios are intelligently handled through conflict detectors. The system automatically handles resource import and tool chain configuration to ensure the consistency and reliability of resource reuse. This method breaks through the limitations of traditional file resource management and provides an efficient resource reuse solution for large-scale project development.
[0181] From the hardware level, in order to break through the limitations of traditional file resource management and provide an efficient resource reuse solution for large-scale project development, the present application provides an embodiment of an electronic device for implementing all or part of the contents of the database-based file resource reuse library management method, and the electronic device specifically includes the following contents:
[0182] Processor, memory, communication interface and bus; wherein the processor, memory and communication interface communicate with each other through the bus; the communication interface is used to realize information transmission between the file resource reuse library management device based on database and the core business system, user terminal and related database and other related devices; the logic controller can be a desktop computer, a tablet computer and a mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the logic controller can be implemented with reference to the embodiment of the file resource reuse library management method based on database and the embodiment of the file resource reuse library management device based on database, and the contents thereof are incorporated herein and the repeated parts are not repeated.
[0183] It is understandable that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Among them, the smart wearable device may include smart glasses, a smart watch, a smart bracelet, etc.
[0184] In practical applications, part of the database-based file resource reuse library management method can be executed on the electronic device side as described above, or all operations can be completed in the client device. The specific selection can be based on the processing capability of the client device and the limitations of the user's usage scenario. This application does not limit this. If all operations are completed in the client device, the client device may also include a processor.
[0185] The client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side, and other implementation scenarios may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or a server cluster consisting of multiple servers, or a server structure of a distributed device.
[0186] Fig. 9 FIG. 9 is a schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Fig. 9 As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Fig. 9 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.
[0187] In one embodiment, the database-based file resource reuse library management method function can be integrated into the central processor 9100. The central processor 9100 can be configured to perform the following control:
[0188] Step S101: construct a distributed column family database cluster and divide it into master and slave nodes, establish a column family storage structure through the master node and divide it into basic information column family, label index column family, full-text search column family, version association column family and preview additional column family, parse the project template file resources to generate a resource identification index table, write metadata into the distributed column family database cluster according to the resource identification index table, establish a reverse index table, an inverted index table, a version link table and a resource overview table according to the metadata, and synchronize the reverse index table, the inverted index table, the version link table and the resource overview table to the slave node for backup storage;
[0189] Step S102: receiving a concurrent search request from a developer and assigning a search task to the master and slave nodes through a concurrent access controller, calling the label index column family and the full-text search column family to search for matching resource identifiers, obtaining metadata from the basic information column family according to the resource identifier, calling the version association column family to analyze the resource association relationship corresponding to the metadata, starting a distributed version lock to monitor concurrent access conflicts, comparing the resource association relationship with the version link table to determine the optimal version, and extracting preview data corresponding to the optimal version from the preview additional column family;
[0190] Step S103: Start the distributed transaction manager to monitor the project resource import task, copy the file resources corresponding to the optimal version to the target project engineering directory, read the tool chain configuration in the basic information column family and update the build script of the target project engineering, identify multiple concurrent modifications through the conflict detector and generate a solution, write the resource path and dependency in the tool chain configuration into the build script, write the preview data into the description document of the target project engineering, broadcast the resource status change information to the distributed column family database cluster and synchronize it to the slave node.
[0191] From the above description, it can be seen that the electronic device provided in the embodiment of the present application realizes efficient management of project resources by constructing a distributed column family database cluster and dividing it into multiple dedicated column families. An innovative multi-dimensional indexing mechanism is designed, including reverse index, inverted index and version link, to support flexible resource retrieval. Distributed version locks and transaction managers are introduced to handle concurrent access, and multi-person collaboration scenarios are intelligently handled through conflict detectors. The system automatically handles resource import and tool chain configuration to ensure the consistency and reliability of resource reuse. This method breaks through the limitations of traditional file resource management and provides an efficient resource reuse solution for large-scale project development.
[0192] In another embodiment, the database-based file resource reuse library management device can be configured separately from the central processing unit 9100. For example, the database-based file resource reuse library management device can be configured as a chip connected to the central processing unit 9100, and the database-based file resource reuse library management method function can be implemented through the control of the central processing unit.
[0193] like Fig. 9 As shown, the electronic device 9600 may also include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Fig. 9 In addition, the electronic device 9600 may also include Fig. 9 For components not shown, reference may be made to the prior art.
[0194] like Fig. 9 As shown, the central processing unit 9100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device, which receives input and controls the operation of various components of the electronic device 9600.
[0195] The memory 9140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 9100 may execute the program stored in the memory 9140 to implement information storage or processing, etc.
[0196] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.
[0197] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 9600 through the central processor 9100.
[0198] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0199] The communication module 9110 is a transmitter / receiver that sends and receives signals via the antenna 9111. The communication module 9110 (transmitter / receiver) is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
[0200] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module, etc. The communication module 9110 (transmitter / receiver) is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby realizing a common telecommunication function. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the local machine through the microphone 9132, and the sound stored on the local machine can be played through the speaker 9131.
[0201] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps of the method for managing a file resource reuse library based on a database in the above-mentioned embodiment, where the execution subject is a server or a client. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, all the steps of the method for managing a file resource reuse library based on a database in the above-mentioned embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0202] Step S101: construct a distributed column family database cluster and divide it into master and slave nodes, establish a column family storage structure through the master node and divide it into basic information column family, label index column family, full-text search column family, version association column family and preview additional column family, parse the project template file resources to generate a resource identification index table, write metadata into the distributed column family database cluster according to the resource identification index table, establish a reverse index table, an inverted index table, a version link table and a resource overview table according to the metadata, and synchronize the reverse index table, the inverted index table, the version link table and the resource overview table to the slave node for backup storage;
[0203] Step S102: receiving a concurrent search request from a developer and assigning a search task to the master and slave nodes through a concurrent access controller, calling the label index column family and the full-text search column family to search for matching resource identifiers, obtaining metadata from the basic information column family according to the resource identifier, calling the version association column family to analyze the resource association relationship corresponding to the metadata, starting a distributed version lock to monitor concurrent access conflicts, comparing the resource association relationship with the version link table to determine the optimal version, and extracting preview data corresponding to the optimal version from the preview additional column family;
[0204] Step S103: Start the distributed transaction manager to monitor the project resource import task, copy the file resources corresponding to the optimal version to the target project engineering directory, read the tool chain configuration in the basic information column family and update the build script of the target project engineering, identify multiple concurrent modifications through the conflict detector and generate a solution, write the resource path and dependency in the tool chain configuration into the build script, write the preview data into the description document of the target project engineering, broadcast the resource status change information to the distributed column family database cluster and synchronize it to the slave node.
[0205] From the above description, it can be seen that the computer-readable storage medium provided in the embodiment of the present application realizes efficient management of project resources by constructing a distributed column family database cluster and dividing it into multiple dedicated column families. An innovative multi-dimensional indexing mechanism is designed, including reverse index, inverted index and version link, to support flexible resource retrieval. Distributed version locks and transaction managers are introduced to handle concurrent access, and multi-person collaboration scenarios are intelligently handled through conflict detectors. The system automatically handles resource import and tool chain configuration to ensure the consistency and reliability of resource reuse. This method breaks through the limitations of traditional file resource management and provides an efficient resource reuse solution for large-scale project development.
[0206] The embodiments of the present application also provide a computer program product capable of implementing all the steps of the database-based file resource reuse library management method in the above embodiments, where the execution subject is a server or a client. When the computer program / instruction is executed by a processor, the steps of the database-based file resource reuse library management method are implemented. For example, the computer program / instruction implements the following steps:
[0207] Step S101: construct a distributed column family database cluster and divide it into master and slave nodes, establish a column family storage structure through the master node and divide it into basic information column family, label index column family, full-text search column family, version association column family and preview additional column family, parse the project template file resources to generate a resource identification index table, write metadata into the distributed column family database cluster according to the resource identification index table, establish a reverse index table, an inverted index table, a version link table and a resource overview table according to the metadata, and synchronize the reverse index table, the inverted index table, the version link table and the resource overview table to the slave node for backup storage;
[0208] Step S102: receiving a concurrent search request from a developer and assigning a search task to the master and slave nodes through a concurrent access controller, calling the label index column family and the full-text search column family to search for matching resource identifiers, obtaining metadata from the basic information column family according to the resource identifier, calling the version association column family to analyze the resource association relationship corresponding to the metadata, starting a distributed version lock to monitor concurrent access conflicts, comparing the resource association relationship with the version link table to determine the optimal version, and extracting preview data corresponding to the optimal version from the preview additional column family;
[0209] Step S103: Start the distributed transaction manager to monitor the project resource import task, copy the file resources corresponding to the optimal version to the target project engineering directory, read the tool chain configuration in the basic information column family and update the build script of the target project engineering, identify multiple concurrent modifications through the conflict detector and generate a solution, write the resource path and dependency in the tool chain configuration into the build script, write the preview data into the description document of the target project engineering, broadcast the resource status change information to the distributed column family database cluster and synchronize it to the slave node.
[0210] From the above description, it can be seen that the computer program product provided in the embodiment of the present application realizes efficient management of project resources by constructing a distributed column family database cluster and dividing it into multiple dedicated column families. An innovative multi-dimensional indexing mechanism is designed, including reverse index, inverted index and version link, to support flexible resource retrieval. Distributed version locks and transaction managers are introduced to handle concurrent access, and multi-person collaboration scenarios are intelligently handled through conflict detectors. The system automatically handles resource import and tool chain configuration to ensure the consistency and reliability of resource reuse. This method breaks through the limitations of traditional file resource management and provides an efficient resource reuse solution for large-scale project development.
[0211] It should be understood by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0212] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0213] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0214] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0215] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A file resource reuse library management method based on a database, characterized in that: The method comprises: Construct a distributed column family database cluster and divide it into master and slave nodes, establish a column family storage structure through the master node among the master and slave nodes and divide it into basic information column family, label index column family, full-text search column family, version association column family and preview additional column family, parse the project template file resources to generate a resource identification index table, write metadata into the distributed column family database cluster according to the resource identification index table, establish a reverse index table, an inverted index table, a version link table and a resource overview table according to the metadata, and synchronize the reverse index table, the inverted index table, the version link table and the resource overview table to the slave nodes among the master and slave nodes for backup storage; Receive concurrent search requests from developers and assign search tasks to the master and slave nodes through a concurrent access controller, call the label index column family and the full-text search column family to search for matching resource identifiers, obtain metadata from the basic information column family according to the resource identifier, call the version association column family to analyze the resource association relationship corresponding to the metadata, start a distributed version lock to monitor concurrent access conflicts, compare the resource association relationship with the version link table to determine the optimal version, and extract preview data corresponding to the optimal version from the preview additional column family; Start the distributed transaction manager to monitor the project resource import task, copy the file resources corresponding to the optimal version to the target project engineering directory, read the tool chain configuration in the basic information column family and update the build script of the target project engineering, identify multiple concurrent modifications through the conflict detector and generate a solution, write the resource path and dependency in the tool chain configuration into the build script, write the preview data into the description document of the target project engineering, broadcast the resource status change information to the distributed column family database cluster and synchronize it to the slave node.
2. The method for managing a file resource reuse library based on a database according to claim 1, characterized in that: The method of constructing a distributed column family database cluster and dividing the master and slave nodes, establishing a column family storage structure through the master node and dividing the basic information column family, label index column family, full-text search column family, version association column family and preview additional column family, includes: Deploy distributed column family database nodes and configure the master node election strategy, divide the master node and slave node groups according to the network topology, create a data directory and initialize data files on the master node, configure the network communication protocol and data synchronization cycle between nodes, build a distributed file system for storing data shards, and establish a node heartbeat detection mechanism to monitor node status; A column family storage structure is created based on the master node, and the data is divided into a basic information column family for storing metadata, a label index column family for storing retrieval labels, a full-text retrieval column family for storing keyword indexes, a version association column family for storing historical records, and a preview additional column family for storing preview data. The column family data is distributed to the slave node group through a data sharding strategy, and a data replication channel is established between the master and slave nodes.
3. The method for managing a file resource reuse library based on a database according to claim 1, characterized in that: The parsing of the project template file resources generates a resource identification index table, writing metadata into the distributed column family database cluster according to the resource identification index table, establishing a reverse index table, an inverted index table, a version link table and a resource overview table according to the metadata, and synchronizing the reverse index table, the inverted index table, the version link table and the resource overview table to the slave node for backup storage, including: Read the structural information of the project template file resource, extract the file name, type, version number, creation time and modification time from the structural information, calculate the file resource feature value by using a hash algorithm, combine the file name, type, version number, creation time, modification time and feature value to generate a resource identifier, and construct a resource identifier index table to store the mapping relationship between the resource identifier and the file resource; The file resource content is parsed based on the resource identification index table, resource tags, keywords, historical versions and preview data are extracted to generate metadata, the metadata is written into the distributed column family database cluster, a reverse index table is established according to the tags, an inverted index table is established according to the keywords, a version link table is established according to the historical versions, a resource overview table is established according to the preview data, and the index table is copied to the slave node through a data synchronization mechanism.
4. The method for managing a file resource reuse library based on a database according to claim 1, characterized in that: The receiving of concurrent search requests from developers and assigning search tasks to the master and slave nodes through a concurrent access controller, calling the label index column family and the full-text search column family to search for matching resource identifiers, obtaining metadata from the basic information column family according to the resource identifier, and calling the version association column family to analyze the resource association relationship corresponding to the metadata, includes: Construct a concurrent access controller to monitor the search request queue, parse and optimize the search conditions in the search request queue, calculate the task processing capacity of the master and slave nodes based on the load balancing algorithm, assign the search tasks to the corresponding nodes according to the task processing capacity, and establish a task status monitoring mechanism to track the search progress; The label index column family and the full-text search column family are called to perform parallel search, a set of resource identifiers matching labels are obtained from the label index column family, a set of resource identifiers matching keywords are obtained from the full-text search column family, the resource identifier sets are merged and deduplicated, metadata is queried from the basic information column family based on the merged resource identifiers, and resource association information in the metadata is analyzed using the version association column family.
5. The method for managing a file resource reuse library based on a database according to claim 1, characterized in that: The starting of the distributed version lock monitoring concurrent access conflicts, comparing the resource association relationship with the version link table to determine the optimal version, and extracting preview data corresponding to the optimal version from the preview additional column family, includes: Create a distributed version lock table to record resource access status, set resource locking granularity based on the resource identifier, use a two-phase commit protocol to control concurrent access operations, monitor resource read and write requests in real time and record access timestamps, detect resource competition during concurrent access by multiple users, and handle conflicts through an optimistic locking mechanism; According to the resource association relationship, the version link table is traversed to obtain the version dependency tree, the timestamp difference and update frequency of each version node in the version dependency tree are calculated, the version nodes are sorted based on the version scoring algorithm, the version with the highest score is selected as the optimal version, and the preview data corresponding to the optimal version is read from the preview additional column family.
6. The method for managing a file resource reuse library based on a database according to claim 1, characterized in that: The distributed transaction manager is started to monitor the import task of the project resources, the file resources corresponding to the optimal version are copied to the target project engineering directory, the tool chain configuration in the basic information column family is read and the build script of the target project engineering is updated, and the conflict detector is used to identify the concurrent modification of multiple people and generate a solution, including: Construct a distributed transaction manager to maintain a resource import transaction status table, perform transaction control on the resource import process based on a two-phase commit protocol, copy the file resources corresponding to the optimal version to the target project according to the directory structure, read resource dependencies and compilation parameter tool chain configuration information from the basic information column family, and update the build script of the target project; Deploy a conflict detector to monitor concurrent modification operations during resource import, analyze file content changes based on a version difference comparison algorithm, calculate the degree of conflict of the changed content and generate conflict markers, formulate corresponding resolution strategies for different types of conflicts, and apply the resolution strategies to the target project to eliminate conflicts.
7. The method for managing a file resource reuse library based on a database according to claim 1, characterized in that: The step of writing the resource path and dependency relationship in the tool chain configuration into the build script, writing the preview data into the description document of the target project, broadcasting the resource status change information to the distributed column family database cluster and synchronizing it to the slave node includes: Parsing the toolchain configuration to extract resource path, compilation parameters, dependent library version and build order information, configuring the resource path as a relative path, setting resource reference rules according to the dependent library version, generating a compilation instruction sequence based on the build order, writing the compilation instruction sequence and the resource reference rules into the build script, creating a resource description file in the target project and writing the preview data; A publish-subscribe mode is adopted to send resource status change messages to the distributed column family database cluster, and resource import completion mark, resource path information and construction script update record are encapsulated into a status data packet. The status data packet is transmitted to the slave node through a data synchronization mechanism, and a status data update operation is performed on the slave node.
8. A file resource reuse library management device based on a database, characterized in that: The device comprises: An index module is used to construct a distributed column family database cluster and divide it into master and slave nodes, establish a column family storage structure through a master node among the master and slave nodes and divide it into basic information column family, label index column family, full-text search column family, version association column family and preview additional column family, parse the project template file resources to generate a resource identification index table, write metadata into the distributed column family database cluster according to the resource identification index table, establish a reverse index table, an inverted index table, a version link table and a resource overview table according to the metadata, and synchronize the reverse index table, the inverted index table, the version link table and the resource overview table to the slave nodes among the master and slave nodes for backup storage; A link module is used to receive concurrent search requests from developers and assign search tasks to the master and slave nodes through a concurrent access controller, call the label index column family and the full-text search column family to search for matching resource identifiers, obtain metadata from the basic information column family according to the resource identifier, call the version association column family to analyze the resource association relationship corresponding to the metadata, start a distributed version lock to monitor concurrent access conflicts, compare the resource association relationship with the version link table to determine the optimal version, and extract preview data corresponding to the optimal version from the preview additional column family; A reuse module is used to start a distributed transaction manager to monitor the import task of project resources, copy the file resources corresponding to the optimal version to the target project engineering directory, read the tool chain configuration in the basic information column family and update the build script of the target project engineering, identify multiple concurrent modifications through a conflict detector and generate a solution, write the resource path and dependency in the tool chain configuration into the build script, write the preview data into the description document of the target project engineering, broadcast resource status change information to the distributed column family database cluster and synchronize it to the slave node.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the database-based file resource reuse library management method described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the database-based file resource reuse library management method described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Big data technology-based space data storage processing middleware framework
CN106611046A
Dynamic module operation management system based on programming language
CN119248255A