Historical and cultural protection planning and compiling method and device based on large model and knowledge graph, equipment and medium

By constructing a historical and cultural preservation planning method based on large models and knowledge graphs, the problems of data integration difficulties and inaccurate planning schemes in historical and cultural preservation planning have been solved. This has enabled automated, structured, and professional preservation planning, improving the accuracy and efficiency of planning documents.

CN121659900APending Publication Date: 2026-03-13ARCHITECTURAL DESIGN & RES INST OF TSINGHUA UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing methods for compiling historical and cultural preservation plans suffer from low levels of digitization of historical documents and difficulties in integrating heterogeneous data from multiple sources. This results in insufficient completeness and accuracy of basic planning information. Furthermore, manual compilation is inefficient and makes it difficult to form a systematic basis for decision support. Moreover, existing protection measures lack case studies on the intrinsic characteristics of cultural heritage, which may lead to protection measures being out of touch with reality.

Method used

By employing a large-scale model and knowledge graph-based approach, a cultural heritage database and auxiliary knowledge base are constructed. A planning text generation model is used to automatically generate protection guidelines for historical and cultural heritage, thereby improving the accuracy and professionalism of the planning text.

Benefits of technology

It has enabled the automation, structuring, and professionalization of historical and cultural heritage protection planning, improved the accuracy and efficiency of protection planning documents, and ensured that planning schemes meet actual needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121659900A_ABST
    Figure CN121659900A_ABST
Patent Text Reader

Abstract

The invention relates to a historical culture protection planning and compiling method and device based on a large model and a knowledge graph, equipment and a medium. The method comprises the steps of obtaining basic information of a target historical culture heritage input by a user; querying detailed information related to the target historical cultural heritage from a cultural heritage database based on the basic information; wherein the cultural heritage database represents a knowledge graph of various historical and cultural heritage; on the basis of the basic information, querying auxiliary knowledge related to the target historical and cultural heritage from an auxiliary knowledge base; and utilizing a planning text generation model to generate a protection planning text of the target historical and cultural heritage according to the basic information, the detailed information and the auxiliary knowledge, the protection planning text being a protection planning scheme of the target historical and cultural heritage described by adopting a standard text structure. Therefore, the protection specification text of the historical and cultural heritage can be automatically generated, and the accuracy, the specialty and the compiling efficiency of the protection specification text of the historical text heritage are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of historical and cultural preservation planning, and in particular to a method, apparatus, equipment and medium for historical and cultural preservation planning based on large models and knowledge graphs. Background Technology

[0002] Against the backdrop of continuously increasing awareness of historical and cultural heritage protection, the field of historical and cultural heritage protection planning faces multiple technical challenges: First, traditional manual methods of compiling protection plans suffer from insufficient completeness and accuracy of basic planning information due to low levels of digitization of historical documents and difficulties in integrating heterogeneous data from multiple sources, resulting in low efficiency. Second, the historical and cultural knowledge system, involving multiple disciplines such as architecture, archaeology, and sociology, is fragmented, making it difficult to form a systematic basis for decision support. Third, existing protection measures often lack case studies on the intrinsic characteristics of cultural heritage, potentially leading to some protection measures being out of touch with reality. These problems may not only cause protection plans to have a counterproductive effect, leading to damage to cultural relics, but may also hinder the sustainable transmission of historical context. Therefore, there is an urgent need to propose an intelligent method for compiling historical and cultural heritage protection plans to quickly and accurately generate historical text protection standard schemes, thereby improving the accuracy, professionalism, and compilation efficiency of historical text heritage protection standards. Summary of the Invention

[0003] In view of this, this disclosure proposes a method, apparatus, equipment and medium for compiling historical and cultural protection plans based on large models and knowledge graphs, which can automatically generate protection norms for historical and cultural heritage, and improve the accuracy, professionalism and compilation efficiency of historical and cultural heritage protection norms.

[0004] According to one aspect of this disclosure, a method for compiling a historical and cultural heritage protection plan is provided, comprising: acquiring basic information of a target historical and cultural heritage input by a user, the basic information being used to briefly describe the attributes of the target historical and cultural heritage; querying detailed information related to the target historical and cultural heritage from a cultural heritage database based on the basic information; wherein the cultural heritage database represents a knowledge graph of various historical and cultural heritages, and the detailed information is used to describe the attributes of the target historical and cultural heritage in detail; querying auxiliary knowledge related to the target historical and cultural heritage from an auxiliary knowledge base based on the basic information, the auxiliary knowledge base being used to store knowledge in related fields involved in the protection of historical and cultural heritage; and generating a protection plan text for the target historical and cultural heritage using a planning text generation model based on the basic information, the detailed information, and the auxiliary knowledge, wherein the protection plan text is a protection plan scheme for the target historical and cultural heritage described using a standard text structure.

[0005] In one possible implementation, the construction process of the cultural heritage database includes: collecting textual data on various historical and cultural heritages; using a triplet extraction model, with historical and cultural heritage as entities, identifying triplet information related to historical and cultural heritage from the textual data, wherein the triplet information is used to describe the relationship between entities and attributes in triplet form; performing textual normalization processing on the triplet information and storing the normalized triplet information in a vector database, wherein the vector database stores triplet information of various historical and cultural heritages in vector form; and fusing the triplet information corresponding to entities with similar attributes in the vector database to obtain the knowledge-fused cultural heritage database.

[0006] In one possible implementation, the training process of the triplet extraction model includes: obtaining a prompt sample library by tripling representative textual materials of at least one historical and cultural heritage, the prompt sample library including multiple sample examples; the sample examples representing standardized training samples; performing textual standardization and corpus segmentation on the representative textual materials of the at least one historical and cultural heritage to obtain multiple sample corpus blocks; determining sample corpus blocks that are semantically similar to each sample example based on the multiple sample examples in the prompt sample library; generating an extended training set based on the sample corpus blocks that are semantically similar to each sample example, the extended training set including multiple training samples, each training sample including a sample triplet and the source text of the sample triplet; and performing supervised fine-tuning training on a pre-trained large language model based on the extended training set to obtain the triplet extraction model.

[0007] In one possible implementation, the construction process of the auxiliary knowledge base includes: collecting domain text data related to the protection of historical and cultural heritage; performing textual standardization and corpus segmentation on the domain text data to obtain multiple text corpus blocks and storing them in a non-relational database; extracting feature vectors from each text corpus block and normalizing them to obtain corpus vectors for multiple text corpus blocks and storing them in a corpus vector database; establishing a correlation between the non-relational database and the corpus vector database for the same text corpus block and its corresponding corpus vector; clustering the corpus vectors of at least some text corpus blocks in the corpus vector database to obtain multiple cluster centers, which are used as vector indexes for retrieving data from the corpus vector database; and the non-relational database and the corpus vector database together constitute the auxiliary knowledge base.

[0008] In one possible implementation, the step of querying auxiliary knowledge related to the target historical and cultural heritage from an auxiliary knowledge base based on the basic information includes: generating a query vector and a keyword list based on the basic information; the query vector is used to query the auxiliary knowledge base using vectorized basic information; the keyword list includes keywords from the basic information to query the auxiliary knowledge base using keywords; querying the auxiliary knowledge base based on the query vector and the keyword list respectively to obtain query results; the query results include multiple text corpus blocks retrieved using the query vector and multiple text corpus blocks retrieved using the keyword list; for any text corpus block in the query results, determining a comprehensive score for the text corpus block based on at least one of the following: similarity between the text corpus block and the basic information, keyword matching strength, geographical proximity, period overlap, type consistency, and source quality of the text corpus block; and selecting the K text corpus blocks with the highest comprehensive scores from the auxiliary knowledge base as auxiliary knowledge related to the target historical and cultural heritage, where K is a positive integer.

[0009] In one possible implementation, the training process of the planning text generation model includes: constructing a training dataset, which includes multiple training data sets, each training data set including the text structure information of the original protection planning text for any historical and cultural heritage site and the triplet information extracted from the original protection planning text; the text structure information includes the first-level and second-level headings in the original protection planning text described in the form of a chapter tree; using a pre-trained large language model based on the text structure information and triplet information in the training data to generate the estimated protection planning text corresponding to the training data; wherein, a low-rank matrix is ​​inserted into the original weight matrix of the specified output layer of the large language model; based on the estimated protection planning text and the original protection planning text, At least one of the following is determined: language modeling loss, structural compliance loss, citation coverage loss, and terminology style loss; wherein, the language modeling loss is used to make the text generated by the model approximate real text; the structural compliance loss is used to make the text structure of the text generated by the model conform to the text structure information in the training data; the citation coverage loss is used to make the text generated by the model correctly cite legal clauses; and the terminology style loss is used to make the terminology and sentence style in the text generated by the model conform to the terminology and sentence style in the original protected normative text; based on at least one of the language modeling loss, the structural compliance loss, the citation coverage loss, and the terminology style loss, the low-rank matrix in the large language model is adjusted to obtain a trained planning text generation model.

[0010] In one possible implementation, the method further includes: obtaining specified text structure information and / or specified legal clauses input by the user; and using the planning text generation model to generate a protection specification text that conforms to the specified text structure information and references the specified legal clauses based on the basic information, the detailed information, the auxiliary knowledge, and the specified text structure information and / or the specified legal clauses.

[0011] According to another aspect of this disclosure, a device for compiling a historical and cultural heritage protection plan is provided, comprising: an acquisition module for acquiring basic information of a target historical and cultural heritage input by a user, the basic information being used to briefly describe the attributes of the target historical and cultural heritage; a detailed information query module for querying detailed information related to the target historical and cultural heritage from a cultural heritage database based on the basic information; wherein the cultural heritage database represents a knowledge graph of various historical and cultural heritages, and the detailed information is used to describe the attributes of the target historical and cultural heritage in detail; an auxiliary knowledge query module for querying auxiliary knowledge related to the target historical and cultural heritage from an auxiliary knowledge base based on the basic information, the auxiliary knowledge base being used to store knowledge in related fields involved in the protection of historical and cultural heritage; and a text generation module for generating a protection plan text for the target historical and cultural heritage using a planning text generation model based on the basic information, the detailed information, and the auxiliary knowledge, wherein the protection plan text is a protection plan for the target historical and cultural heritage described using a standard text structure.

[0012] According to another aspect of this disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above-described method.

[0013] According to another aspect of this disclosure, a non-volatile computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the above-described method.

[0014] According to another aspect of this disclosure, a computer program product is provided, including a computer program or a non-volatile computer-readable storage medium carrying the computer program, wherein the computer program, when executed by a processor, implements the steps of the above-described method.

[0015] According to the various aspects of this disclosure, based on the basic information input by the user, detailed information and auxiliary knowledge in related fields related to the target historical text heritage are queried from the cultural heritage database and auxiliary knowledge base, respectively. Then, a planning text generation model capable of generating standard text structures is used to generate protection planning texts based on the basic and detailed information, referencing and citing external knowledge such as auxiliary knowledge in related fields. This makes the protection planning texts output by the model reliable and alleviates the illusion problem that the model may have. As a result, accurate, comprehensive and standardized protection planning texts are generated, which greatly enhances the accuracy, professionalism and compilation efficiency of the protection standard texts for historical text heritage.

[0016] Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0017] The accompanying drawings, which are included in and form part of this specification, illustrate exemplary embodiments, features, and aspects of this disclosure together with the specification and serve to explain the principles of this disclosure.

[0018] Figure 1 A flowchart is shown for a method of preparing a historical and cultural preservation plan according to an embodiment of the present disclosure.

[0019] Figure 2 A block diagram of a historical and cultural preservation planning apparatus according to an embodiment of the present disclosure is shown.

[0020] Figure 3 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation

[0021] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.

[0022] As used herein, the terms “comprising,” “including,” “having,” or variations thereof are open-ended and include one or more of the stated features, integrals, elements, steps, components, or functions, but do not exclude the presence or addition of one or more other features, integrals, elements, steps, components, functions, or groups thereof.

[0023] When an element is referred to as “connected,” “coupled,” “responding,” or a variation thereof relative to another element, it may be directly connected, coupled, or responding to another element, or there may be an intermediate element present.

[0024] Although the terms first, second, third, etc., may be used herein to describe various elements / operations, these elements / operations should not be limited by these terms. These terms are only used to distinguish one element / operation from another. Therefore, without departing from the teachings of the inventive concept, a first element / operation in some embodiments may be referred to as a second element / operation in other embodiments.

[0025] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.

[0026] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.

[0027] The inventors' research revealed that existing historical and cultural preservation planning focuses on traditional planning methods or a single method. For example, "A Planning Method for Revitalizing Historical Building Clusters Based on Regional Cultural Revitalization" describes a top-down approach to historical and cultural preservation planning; "A Planning Height Control and Evaluation Method and System for Historical and Cultural Heritage Resources in Urban Renewal Projects" proposes a planning height evaluation method; and "An Analysis Method for the Protection of Historical and Cultural Towns Based on Social Network Dynamic Attacks" describes an analysis method for historical and cultural towns. However, these methods lack a planning approach based on emerging technologies. Existing large-scale models and knowledge graphs can be categorized into three types: the first type improves the performance of general large-scale models and knowledge graphs, but is difficult to apply to the planning field; the second type involves the interaction between large-scale models and knowledge graphs to improve the performance of large-scale models, but this approach still focuses on general techniques and is also difficult to apply to the planning field; the third type consists of large-scale models for vertical fields, but none have been found for planning, with the urban field focusing on smart cities, and no specific technologies have been proposed for the historical and cultural preservation field.

[0028] Furthermore, historical and cultural heritage information is characterized by its multi-source heterogeneity, unstructured nature, and fragmentation, severely restricting the ability to acquire and integrate basic data for planning. Related materials are often scattered across multiple media such as architectural drawings, historical records, oral histories, and intangible cultural heritage databases, lacking unified expression and systematic summarization. This results in information gaps, logical breaks, and difficulty in tracing the origins of existing plans. Simultaneously, as mentioned above, existing large-scale language models lack domain adaptability, making it difficult to output planning texts that meet the requirements of historical and cultural heritage protection. On the one hand, model training does not fully cover professional knowledge in areas such as architectural heritage, cultural relic restoration, and intangible cultural heritage expression, resulting in knowledge blind spots. On the other hand, the model-generated results are mostly continuous natural language text, lacking the necessary chapter structure, logical organization, and professional terminology control required for planning documents, making it difficult to meet compliance standards.

[0029] To address the aforementioned issues, this disclosure proposes a method for compiling historical and cultural preservation plans. This method addresses the two major problems of "unclear knowledge structure" and "non-standard model output." Through collaborative technologies such as cross-domain dynamic knowledge graph construction, continuous learning of large models, enhanced domain retrieval, and structured output control, it achieves automation, structuring, and professionalization in the compilation of historical and cultural preservation plans, and improves the accuracy and efficiency of historical text preservation plans.

[0030] Figure 1 A flowchart illustrating a method for developing a historical and cultural preservation plan according to an embodiment of this disclosure is shown. Figure 1 As shown, the method includes steps S11 to S14.

[0031] In step S11, the basic information of the target historical and cultural heritage input by the user is obtained. The basic information is used to briefly describe the attributes of the target historical and cultural heritage.

[0032] It is understood that historical and cultural heritage can be a regional entity (such as the Forbidden City or Foguang Temple) or a single entity (such as the Qianqing Palace in the Forbidden City or the East Hall in Foguang Temple), and this embodiment of the disclosure does not impose any limitations on this. It should be understood that users can input basic information about the target historical and cultural heritage for which a protection plan needs to be developed, according to their actual needs, and this embodiment of the disclosure does not impose any limitations on this.

[0033] In practical applications, the basic information input by the user may include at least the following: the name, historical context, type (e.g., individual object or regional object), geographical location (e.g., latitude and longitude and geographical boundaries), structure and materials (e.g., wooden frame beams, painted decorations), cultural value elements (e.g., historical, artistic, and scientific value), damage and repair records (e.g., component cracking, painted decoration fading), relevant intangible cultural heritage, lists of regulations and standards, lists of higher-level plans, text format and length constraints (e.g., Word document, 10,000 to 20,000 words), and confidentiality level (e.g., internal). Optionally, for some batch tasks (e.g., generating protection planning texts for multiple sub-regions within a certain area), the basic information input by the user may also include: the zoning and control lines of the entire historical and cultural heritage site. Zoning is used to indicate the core protection scope of the historical and cultural heritage site, and control lines are used to indicate the construction control zone of the historical and cultural heritage site. Users can indicate zoning and control lines by inputting a plan of the historical and cultural heritage site, which is not limited in this embodiment.

[0034] For example, the following shows basic information about the East Hall of Foguang Temple described in JSON format:

[0035] { "type": "Single object",

[0036] "name": "East Hall of Foguang Temple",

[0037] "geom": {"centroid":[113.569,38.856], "boundary":"..."},

[0038] "period": "Mid-to-late Tang Dynasty",

[0039] "structure_material": ["timber frame","painted"],

[0040] "values": ["History","Art","Science"],

[0041] "diseases": ["component cracking", "paint fading"],

[0042] "intangible_links": ["Woodwork Painting Techniques"],

[0043] "regulations": ["Regulations on Cultural Relics Protection of ×× Province (2023)", "National Technical Guidelines for Cultural Relics Restoration (Excerpt)"],

[0044] "upper_plans": ["×× City Historical and Cultural City Protection Plan (Upper Level)"],

[0045] "output_format": "Word", / /

[0046] "confidential": "internal"}".

[0047] It should be understood that this disclosure does not limit the type or specific content of the basic information input by the user, but the basic information should at least include the name, period, and geographical location (i.e., the location, for example, latitude and longitude and regional boundaries can be used to describe the geographical location of the target historical and cultural heritage). The more comprehensive the basic information input by the user, the more accurate the protection plan scheme indicated in the final generated protection plan text.

[0048] In step S12, based on the basic information, detailed information related to the target historical and cultural heritage is queried from the cultural heritage database; wherein, the cultural heritage database represents a knowledge graph of various historical and cultural heritages, and the detailed information is used to describe in detail the attributes of the target historical and cultural heritage.

[0049] It should be understood that the basic information input by the user is a brief description of the attributes of the target historical and cultural heritage; that is, the basic information input by the user may be incomplete and not detailed. Therefore, in order to make the generated protection plan more comprehensive, a cultural heritage database can be established in advance. This database can store knowledge graphs of various known historical and cultural heritages both domestically and internationally. The knowledge graph of any historical and cultural heritage can be used to describe in detail the relationship between that historical and cultural heritage and all its attributes. Furthermore, detailed information about the target historical and cultural heritage can be queried from this database; this detailed information can be understood as a supplement and expansion of the aforementioned basic information.

[0050] In practical applications, cultural heritage databases can indicate knowledge graphs of various historical textual heritages. Each knowledge graph of a historical and cultural heritage site can contain triple information about that site. This triple information can describe the relationship between the entity and its attributes using triples, such as (Foguang Temple, structural type, wooden beam frame), or (Foguang Temple, construction date, Tang Dynasty). This triple information can be stored in the cultural heritage database in text or vector form. Keyword retrieval or vector retrieval methods can then be used to query detailed information related to the target historical and cultural heritage site based on its basic information. In other words, the detailed information retrieved from the cultural heritage database can be based on keyword matching (e.g., containing keywords from the basic information) or similarity matching (e.g., vector similarity exceeding a threshold) with the basic information of the target historical and cultural heritage site.

[0051] The knowledge graph of any historical and cultural heritage can be generated using various textual materials related to that heritage. These textual materials can include, but are not limited to: textual materials describing the intrinsic information of the cultural heritage (such as the category, structure, form, and material of the artifacts); descriptive textual materials about the cultural heritage (such as relevant historical records in historical documents and archives); textual materials describing the current state of cultural heritage protection (such as damage and repair records); textual materials describing folk customs and intangible cultural heritage (such as rituals, festivals, crafts, and their transmission); and relevant laws and regulations (such as the Law on the Protection of Cultural Relics). It should be understood that any textual materials related to historical and cultural heritage can be collected and used to generate the knowledge graph of historical and cultural heritage.

[0052] It should be understood that those skilled in the art can use any known knowledge graph construction method in the art to generate a knowledge graph of the aforementioned cultural heritage textual materials based on historical and cultural heritage, and store it in a cultural heritage database. In some embodiments, this disclosure provides a method for constructing a cultural heritage database, which can construct a comprehensive and standardized cultural heritage database. Specifically, the construction process of the aforementioned cultural heritage database may include:

[0053] Collect textual materials on cultural heritage from various historical and cultural heritage sources;

[0054] Using a triplet extraction model, with historical and cultural heritage as entities, triplet information related to historical and cultural heritage is identified from cultural heritage text data. The triplet information is used to describe the relationship between entities and attributes in triplet form.

[0055] The triplet information is processed into text normalization, and the normalized triplet information is stored in a vector database. The vector database stores triplet information of various historical and cultural heritages in vector form.

[0056] By fusing the triplet information corresponding to entities with similar attributes in the vector database, a knowledge-fused cultural heritage database is obtained.

[0057] In practical applications, comprehensive and multi-disciplinary textual data on each type of historical and cultural heritage can be collected as much as possible. Optionally, after collecting the cultural heritage textual data, it can be segmented into multiple corpus blocks. These corpus blocks are then input into a triplet extraction model, enabling the model to identify triplet information from each corpus block. This method improves the efficiency of the triplet extraction model in identifying triplet information. Of course, the entire cultural heritage textual data can also be input into the triplet model; this embodiment does not limit this approach.

[0058] Those skilled in the art can use large language models known in the art as triple extraction models, and can also fine-tune and train pre-trained large language models to obtain triple extraction models that are suitable for the field of historical and cultural protection compilation. This disclosure does not limit such practices.

[0059] The text standardization process can include at least one of the following: unification of traditional and simplified Chinese characters, unification of variant characters, elimination of spaces, elimination of punctuation, elimination of auxiliary words, standardization of numbers and year designations, conversion of foreign language transliterations into alternative names, and unification of historical place names. It should be understood that those skilled in the art can employ known text processing techniques to achieve the above-mentioned text standardization processes, and various databases can support such standardization processes; therefore, this disclosure does not impose any limitations. In this disclosure, by first using a triplet extraction model to identify triplet information and then performing text standardization processing on the triplet information, compared to directly performing text standardization processing on cultural heritage texts, the amount of data processing can be reduced, and the efficiency of text standardization can be improved.

[0060] Considering that cultural heritage knowledge involves various textual materials from ancient and modern times, entity disambiguation is necessary. Therefore, after standardizing the triplet information and storing the standardized triplet information in a vector database, the triplet information corresponding to entities with similar attributes in the vector database can be merged (i.e., entity merging) to obtain a cultural heritage database after knowledge fusion (i.e., after entity disambiguation). (Entity disambiguation is not performed at the corpus stage because the corpus is too large and the computational load is too high.) Specifically, a vector database can be established first, with historical and cultural heritage as entities, and relevant attributes can be stored in the database in vector form to form a cultural heritage vector database. It should be understood that this can be utilized... The triplet information is encoded into a vector using known encoding techniques in the art and stored in a vector database. This disclosure does not limit the specific implementation of the embodiments. Then, a query vector template is constructed, and a search is performed based on cosine similarity (i.e., using cosine similarity to calculate whether the attributes between any two entities are similar). Manual review can also be combined to set an appropriate threshold. If the cosine similarity between the attributes of two entities is higher than the threshold (i.e., it means that the two entities have many similar attributes, including name, geographical location, age, type, structure, etc., and there is reason to suspect that they are the same entity), then the triplet information of the two entities is fused to obtain a knowledge-fused cultural heritage database, which is also a knowledge graph after knowledge fusion.

[0061] In practical applications, a periodic dynamic update mechanism can be constructed. For example, it can be set to update once a week. New books and papers related to historical and cultural heritage can be collected from the Internet and other channels. Then, the triple extraction model can be called to extract triple information. Then, at least one of the following processes can be performed: text normalization and triple information fusion. This will enable continuous updates to the cultural heritage database (also the knowledge graph of historical and cultural heritage) to ensure that the cultural heritage database always reflects the latest knowledge related to historical and cultural heritage.

[0062] As described above, this disclosure does not limit the training process of the triplet extraction model. This disclosure proposes an efficient training method to train the aforementioned triplet extraction model. Specifically, in some embodiments, the training process of the triplet extraction model may include:

[0063] A prompt sample library is obtained by tripling representative textual materials of at least one historical and cultural heritage. The prompt sample library includes multiple sample examples, and the sample examples represent standardized training samples.

[0064] The representative textual materials of at least one historical and cultural heritage were processed by textual planning and corpus segmentation to obtain multiple sample corpus blocks;

[0065] Based on multiple sample examples in the prompt sample library, identify sample corpus blocks that are semantically similar to each sample example;

[0066] An extended training set is generated based on sample corpus blocks that are semantically similar to each sample example. The extended training set includes multiple training samples, and each training sample includes a sample triplet and the source text of the sample triplet.

[0067] Based on the expanded training set, supervised fine-tuning training is performed on the pre-trained large language model to obtain the triple extraction model.

[0068] In practical applications, representative textual materials of any historical and cultural heritage can be understood as high-quality textual materials introducing that historical and cultural heritage. Users can select a certain textual material as representative textual material based on the implementation situation, and this disclosure embodiment does not limit this. Furthermore, a small number of high-quality triplet annotations can be manually performed on one or more representative textual materials of historical and cultural heritage (e.g., textual materials used to describe cultural ontological information), such as: annotating {object, location, area}, {object, construction year, time period}, {object, structural type, timber beam frame}, {object, value, historical value}, {object, applicable standard, Article ×× of ×× method} in the textual materials to form a prompt sample library (i.e., obtain multiple sample examples). For example, the sample examples in the prompt sample library can be represented as:

[0069] Example 1: {"domain":"timber structure", "rel":"structure type", "tpl":"{A} is the structure of {B},...", "triple":{"h":"Foguang Temple","r":"structure type","t":"timber beam frame"}, "evidence":"...original sentence...", "lang":"zh"};

[0070] Example 2: {"domain":"era", "rel":"era of construction", "tpl":"{A} was built in {B}", "triple":{"h":"Yingxian Wooden Pagoda","r":"era of construction","t":"Liao Dynasty"}, "evidence":"…", "lang":"zh"}.

[0071] Wherein, "domain" indicates the domain described by the sample example, "rel" indicates the relationship described in the sample example, "tpl" indicates the statement template corresponding to the sample example, "triple" indicates the specific triple information, "evidence" indicates the source text of the triple information, and "lang" indicates the language type of the source text of the triple information.

[0072] As described above, text standardization processing can include at least one of the following: unification of traditional and simplified Chinese characters, unification of variant characters, elimination of spaces, elimination of punctuation, elimination of auxiliary words, standardization of numbers and year designations, conversion of foreign language transliterations into alternative names, and unification of historical place names. Corpus segmentation processing involves dividing long texts (such as the representative text data mentioned above) into multiple short texts (such as the multiple sample corpus blocks mentioned above). For example, each representative text data can be segmented into sample corpus blocks of 200–600 characters with a text overlap rate of 20–30%. This embodiment of the present disclosure does not restrict the execution order of text standardization processing and corpus segmentation processing. For example, text standardization processing can be performed first, followed by corpus segmentation processing; conversely, corpus segmentation processing can be performed first, followed by text standardization processing.

[0073] The process of determining sample corpus blocks that are semantically similar to each sample example based on multiple sample examples in the prompt sample example library may include: calculating the semantic similarity between each sample example and each sample corpus block, or determining whether there are keywords in each sample corpus block that are the same as the triple information in each sample example; if the semantic similarity between one or more sample corpus blocks and the sample example is higher than a threshold or they have the same keywords (for example, one or more sample corpus blocks contain the cultural relic name and structural type in "Example 1" above), then the one or more sample corpus blocks are considered to be semantically similar to the sample example above; then, for one or more sample corpus blocks that are semantically similar to each sample example, candidate triples can be extracted from these sample corpus blocks (existing triple extraction techniques or other existing models can be used here, for example, candidate triples can be directly generated using a large language model, and this embodiment of the disclosure does not limit this). Subsequently, to improve the accuracy of the training samples, candidate triples can be manually reviewed and revised to form an expanded training set, i.e., multiple sample triples and the source text of each sample triple. Of course, candidate triples can also be directly used as sample triples to generate the expanded training set; this embodiment does not limit this approach. The source text of the sample triples can be a block of sample corpus, or sentences and / or paragraphs within the sample corpus, as long as the source of the sample triple can be identified; this embodiment does not limit this approach either.

[0074] In practical applications, known supervised fine-tuning techniques in this field, such as Low-Rank Adaptation (LoRA) fine-tuning, can be used to supervise the training of a pre-trained large language model (i.e., a mature large language model) based on an expanded training set, thereby obtaining a triplet extraction model. For example, a low-rank matrix can be inserted into some output layers of the large language model. Then, the source text from the training samples is input into the large language model, and the model is instructed to output triplet information. After the large language model outputs the triplet information, the difference between the triplet information output by the model and the sample triplets in the training samples is used to calculate the loss, thereby optimizing the low-rank matrix inserted into the large language model to obtain a trained triplet extraction model.

[0075] For example, taking any linear output layer of a large language model as an example, its forward propagation function can be expressed as: y = (W0 + ΔW)x, W0 ∈ R d×k , x∈R k Where W0 is the original weight matrix of the linear output, x is the input data of the linear layer, y is the output data of the linear layer, ΔW is the low-rank matrix of the insertion, and R d×k R represents the size of the original weight matrix. k This represents the size of the input data. The LoRA technique utilizes the sparsity property of the low-rank matrix ΔW, decomposing it into two smaller matrices A and B, i.e., ΔW = BA, A ∈ R. r×k , B∈R d×r , Therefore, the forward propagation function becomes: , where s is a learnable or fixed scaling factor. During model training, only A and B can be adjusted, thereby reducing the number of training parameters (from d×k to r(d+k)). This is because the output layer of a large language model is generally a sparse matrix, and LoRA fine-tuning can reduce parameters and computational cost while adjusting the output. The training process can specifically include: ① Initialization of the large language model, i.e., inserting A∈R into the target output layer. r×k , B∈R d×r② Freeze the backbone (i.e., do not change the original weight parameters of the large language model). ③ Use the expanded training set generated in the previous step to allow the model to output corresponding triplet information based on each source text. The objective function can be set as: the matching rate between the triplet information output by the model and the triplets in the expanded training set. The loss is calculated based on this objective function to adjust the low-rank matrix inserted into the large language model. Then, evaluation metrics such as the F1 score between the triplet information output by the model and the triplets in the expanded training set can be used to test whether the model training is up to standard, or whether a triplet extraction model that meets performance requirements has been obtained. The optimization algorithm used to optimize the low-rank matrix can be the AdamW algorithm, with a learning rate of 1e-4, which is not limited in this embodiment. Through the above supervised fine-tuning training method, the fine-tuned large language model can possess information extraction capabilities, that is, it can identify new entity-relationship-attribute triplet information from updated text data.

[0076] In step S13, based on the basic information, auxiliary knowledge related to the target historical and cultural heritage is queried from the auxiliary knowledge base, which is used to store and protect knowledge in related fields involved in the protection of historical and cultural heritage.

[0077] Considering that the drafting of historical and cultural heritage protection standards also requires reference to knowledge from related fields, such as architecture, history, and sociology, an auxiliary knowledge base can be established to further improve the professionalism and accuracy of the generated protection planning text in the context of historical and cultural heritage protection planning. By introducing a retrieval enhancement mechanism, knowledge from this auxiliary knowledge base can be dynamically invoked during the protection planning text generation stage, thereby improving the professionalism and accuracy of the generated protection planning text.

[0078] In some embodiments, the process of constructing the auxiliary knowledge base may include:

[0079] Collecting and protecting textual materials related to relevant fields of historical and cultural heritage;

[0080] The domain text data is processed by text planning and corpus segmentation to obtain multiple text corpus blocks, which are then stored in a non-relational database.

[0081] Feature vectors are extracted from each text corpus block and normalized to obtain corpus vectors for multiple text corpus blocks, which are then stored in a corpus vector database. The non-relational database and the corpus vector database have a correlation relationship between the same text corpus block and its corresponding corpus vector.

[0082] By clustering the corpus vectors of at least a portion of the text corpus blocks in the corpus vector database, multiple cluster centers are obtained. These multiple cluster centers are used as vector indexes to retrieve data from the corpus vector database. The non-relational database and the corpus vector database together constitute the auxiliary knowledge base.

[0083] In practical applications, a large amount of textual data in architecture, history, and sociology can be collected to form a corpus of textual data in the field. For example, it can include at least: architectural data on historical and cultural heritage (such as architectural history books), related historical and cultural knowledge (such as archaeological records), social and humanistic materials from historical periods (such as renovation project reports), and textual data in the fields of laws and policies related to historical and cultural heritage (such as the latest higher-level plans).

[0084] As described above, text standardization processing can include at least one of the following: unification of traditional and simplified Chinese characters, unification of variant characters, elimination of spaces, elimination of punctuation, elimination of auxiliary words, standardization of numbers and year designations, conversion of foreign language transliterations into alternative names, and unification of historical place names. Corpus segmentation processing involves segmenting domain text data into multiple text corpus blocks, typically into blocks of 200–600 characters with a text overlap rate of 20–30%. Regulations and standards involved in the domain text data can be segmented by clause as the smallest unit, while tables and directories can be serialized into blocks by row or topic to obtain corresponding text corpus blocks, which are then stored in a non-relational database, such as a NoSQL database or a MongoDB database. This disclosure does not limit the specific implementation of these methods. It should be understood that this disclosure does not restrict the execution order of text standardization processing and corpus segmentation processing.

[0085] In this process, semantic embedding techniques (such as the Chinese Domain General Language Model) can be used to calculate and normalize the feature vectors of each text chunk and write them into a corpus vector database (such as the FAISS vector database). It should be understood that there is a correlation between the same text chunk and its corresponding corpus vector in the non-relational database and the corpus vector database. For example, an index can be established to allow the feature vectors in the corpus vector database to reference the text chunks in the non-relational database, thereby establishing the correlation between the two.

[0086] Furthermore, vector indexes can be built for corpus vector databases to improve indexing efficiency. For example, an inverted file system (IVF system) can be used to determine cluster centers based on at least a portion of the corpus vectors (e.g., 5–10% of the corpus vectors). These cluster centers can then be used as vector indexes to retrieve data from the corpus vector database. Specifically, clustering algorithms (such as the K-Means algorithm) can be used to divide the entire vector space (e.g., 5–10% of the corpus vectors) into n clusters (or partitions, units). Each cluster has a cluster center (i.e., the cluster center). Then, an inverted index is constructed: for each cluster, an inverted list is created, which records the IDs of all vectors belonging to that cluster. This forms an index: cluster center -> [list of vector IDs belonging to that cluster]. In the IVF Search process, when a query vector is available, the IVF system first calculates the distance between the query vector and the centers of all clusters. Then, it selects the m closest clusters (m is a parameter that can be set by the user) and performs precise or approximate similarity comparisons only on all vectors contained in the inverted lists of these m clusters, finding the K most similar results. This vector-based approach supports efficient information retrieval from the corpus vector database. The difference between this and the cultural heritage database mentioned above is that the cultural heritage database is a carefully constructed knowledge graph reflecting core knowledge in the field of historical and cultural heritage. By utilizing a large language model, it can be quickly fine-tuned from a general model to a vertical domain planning text generation model through learning. Then, a larger knowledge graph (auxiliary knowledge base) is used to supplement the knowledge gaps encountered in the planning and protection text generation process. By designing the aforementioned cultural heritage database and auxiliary knowledge base, the efficiency and practicality of text generation can be improved. Directly constructing a large and specialized knowledge graph is both impractical and difficult to guarantee accuracy.

[0087] Based on the aforementioned auxiliary knowledge base, in some embodiments, querying auxiliary knowledge related to the target historical and cultural heritage from the auxiliary knowledge base based on basic information may include:

[0088] Based on the basic information, a query vector and a keyword list are generated. The query vector is used to query the auxiliary knowledge base using the vectorized basic information, and the keyword list includes keywords from the basic information to query the auxiliary knowledge base using keywords.

[0089] The auxiliary knowledge base is queried based on the query vector and the keyword list respectively to obtain the query results. The query results include: multiple text corpus blocks retrieved using the query vector and multiple text corpus blocks retrieved using the keyword list.

[0090] For any text corpus in the query results, the comprehensive score of the text corpus is determined based on at least one of the following: similarity between the text corpus and the basic information, keyword matching strength, geographical proximity, time overlap, type consistency, and source quality of the text corpus.

[0091] Based on the comprehensive score of each text corpus in the query results, the K text corpus blocks with the highest comprehensive scores are selected as auxiliary knowledge related to the target historical and cultural heritage retrieved from the auxiliary knowledge base, where K is a positive integer.

[0092] In practical applications, semantic embedding technology can be used to convert the basic information input by the user (such as the name of the cultural heritage, its era, and its location, optionally including structural materials and value descriptions) into a query vector q. Simultaneously, keywords from the basic information are retained, resulting in a keyword list kw. Then, the query vector q is used to perform vector retrieval on the aforementioned corpus vector database. For example, by constructing the query command search(q, k_vec=100), the IVF system first calculates the distance between the query vector and all cluster centers, then selects the m closest clusters. It then performs precise or approximate vector similarity comparisons only on all vectors contained in the inverted lists of these m clusters, identifying the k_vec=100 corpus vectors with the highest similarity to the query vector. Based on the association between each queried corpus vector and the text corpus blocks, the corresponding text corpus blocks can be obtained from the aforementioned non-relational data, i.e., the k_vec text corpus blocks retrieved using the query vector. Simultaneously, based on the keyword list kw, a sparse query command s can be constructed. The sparse query command `earch(kw, k_lex=200)` directly queries the aforementioned relational database. Specifically, it queries the relational database using keyword matching (i.e., checking if a text block contains keywords from a keyword list). The more keywords a text block matches, the higher its ranking. Then, based on the keyword matching results, the top-ranked text blocks (k_lex=200) are selected as multiple text blocks retrieved using the keyword list. Finally, the text blocks obtained from the query vector and the keyword list are merged to obtain the overall query result. In this embodiment, by using both the query vector and the keyword list to query the auxiliary knowledge base, comprehensive domain knowledge related to the protected historical and cultural heritage can be retrieved.

[0093] Then, the overall score S for each retrieved text corpus block can be calculated using the following formula: S=w1cos(q,v) chunkThe expression `cos(q, vchunk) + w2bm25(q, chunk) + w3geo(TaskSpec, chunk) + w4time(TaskSpec, chunk) + w5type(TaskSpec, chunk) + w6qual(source_type, ocr_conf)` is used. Here, `w1`, `w2`, `w3`, `w4`, `w5`, and `w6` are weighting coefficients, and `cos(q, vchunk)` represents the query vector `q` (i.e., the basic information) and the corpus vector `v` of the text corpus block. chunkThe cosine similarity between the two; bm25(q,chunk) represents the keyword matching strength between the query vector q of the basic information calculated using the bm25 algorithm and the text corpus chunk chunk; geo(TaskSpec,chunk) represents the geographical proximity between the geographical location in the basic information TaskSpec and the geographical location indicated in the text corpus chunk chunk. For example, if TaskSpec and chunk are in the same region (i.e., geographically the same), then geo(TaskSpec,chunk)=1; if TaskSpec and chunk are adjacent (i.e., geographically adjacent, or relatively close), then geo(TaskSpec,chunk)=1. If `taskSpec` and `chunk` are geographically distant (i.e., geographically far apart), then `geo(TaskSpec,chunk)` = 0.7. `time(TaskSpec,chunk)` represents the degree of overlap between the period in the basic information and the period indicated in the text corpus block. For example, if the periods of `taskSpec` and `chunk` match (i.e., the periods overlap), then `time(TaskSpec,chunk)` = 1; if the periods of `taskSpec` and `chunk` are unknown (i.e., it is unclear whether the periods overlap), then `time(TaskSpec,chunk)` = 0.5. If the time periods of TaskSpec and chunk conflict (i.e., the time periods do not overlap), then time(TaskSpec, chunk) = 0; where type(TaskSpec, chunk) represents the degree of consistency between the type of historical and cultural heritage in the basic information and the type indicated in the text corpus. As mentioned above, the type of historical and cultural heritage can be a single object or a regional object, specifically, it can be a palace, a tower, a street, etc. If the object types of TaskSpec and chunk are consistent, for example, the type of historical and cultural heritage in the basic information and the type of historical and cultural heritage in the text corpus are both streets, then type(TaskSpec, chunk) = 1. If the object types of TaskSpec and chunk are inconsistent, for example, the type of historical and cultural heritage in the basic information is a palace, and the type of historical and cultural heritage in the text corpus is a tower, then type(TaskSpec, chunk) = 0; qual(source_type, ocr_conf) represents the source quality determined based on the source_type and OCR confidence ocr_conf of the text corpus. The more standardized the source_type, the higher the source quality. For example, regulations / official reports > In academic reports and online data, the source quality is crucial. Some materials can be obtained through OCR (Optical Character Recognition) technology; therefore, the higher the OCR confidence level, the higher the source quality.

[0094] It should be understood that the above-mentioned calculation method for the comprehensive score can be one possible implementation provided by the embodiments of this disclosure. In fact, the comprehensive score can also be obtained by weighted summation or weighted average, summation or averaging, etc., of at least two of the similarity, keyword matching strength, geographical proximity, period overlap, type consistency, and source quality. Alternatively, one of them can be directly used as the comprehensive score. This disclosure does not limit this approach. In the disclosed embodiments, by determining the comprehensive score based on at least one of the similarity between the text corpus block and the basic information, keyword matching strength, geographical proximity, period overlap, type consistency, and source quality of the text corpus block, the auxiliary knowledge selected using the comprehensive score can be more closely matched with the target historical and cultural heritage, thereby improving the professionalism and accuracy of the subsequent protection planning text generated using the auxiliary knowledge.

[0095] After obtaining the comprehensive score of each text corpus block in the query results, the top K text corpus blocks with the highest comprehensive scores can be selected as retrieved auxiliary knowledge (i.e., domain knowledge). This retrieved auxiliary knowledge (such as relevant historical events, existing protection measures and experience in the region, and restoration techniques for similar cultural relics) can then be provided to the planning text generation model along with the original input requirements (the aforementioned basic information and detailed information, as well as instructions for generating protection planning text). In this way, during the model's text generation process, the model can refer to and cite this external domain knowledge, thereby greatly enhancing the professionalism and accuracy of the generated text, ensuring that the model output is based on evidence, alleviating the potential illusion problem of the model, and enabling it to adapt to fine-grained domain question-answering needs.

[0096] In step S14, the planning text generation model is used to generate a protection planning text for the target historical and cultural heritage based on basic information, detailed information and auxiliary knowledge. The protection planning text is a protection planning scheme for the target historical and cultural heritage described using a standard text structure.

[0097] Among them, the protection plan text for historical and cultural heritage can be defined as a structured text describing the protection plan for historical and cultural heritage, containing statutory or standardized chapters / entries and main text, charts, lists, and appendices. This type of text has structural requirements for standard consistency (e.g., it needs to include "General Provisions," "Value and Characteristics of Historical and Cultural Heritage Objects," "Protection Objectives and Principles," "Protection Content and Protection Zoning Requirements," "Protection Measures and Engineering Guidelines," "Phase Implementation and Policy Recommendations," "Supplementary Provisions," and "Appendices"). This type of text differs from general narrative reports, emphasizing alignment with laws and regulations, higher-level plans, and technical standards, clarity of object lists and spatial control boundaries, and descriptions of feasibility.

[0098] The system can generate prompts based on basic information, detailed information, and auxiliary knowledge (e.g., "Please output a protection plan text for Foguang Temple based on the input basic information, detailed information, and auxiliary knowledge"). These prompts and related information can then be input into the planning text generation model, allowing the model to generate a protection plan text that meets the user's needs. In practical applications, the protection plan text output by the model can also be exported as a Word document, PDF document, or other document format for user download and use; this embodiment does not impose any limitations on this.

[0099] In practical applications, a planned text generation model can be obtained by fine-tuning a mature large language model to perform structured long text writing under a certain standard text structure. For example, the LoRA fine-tuning training method described above can be used to fine-tune a pre-trained large language model to obtain a protected planned text generation model. This disclosure does not limit the scope of the embodiments.

[0100] In some embodiments, planning the training process of a text generation model may include:

[0101] Construct a training dataset, which includes: multiple training data, each training data including the text structure information of the original protection plan text of any historical and cultural heritage and the triplet information extracted from the original protection plan text; the text structure information includes the first-level headings and second-level headings in the original protection plan text described in the form of a chapter tree;

[0102] Using a pre-trained large language model, based on the text structure information and triplet information in the training data, a predicted conservation planning text corresponding to the training data is generated; wherein, a low-rank matrix is ​​inserted into the original weight matrix of the specified output layer of the large language model.

[0103] Based on the estimated protection planning text and the original protection planning text, at least one of the following is determined: language modeling loss, structural compliance loss, citation coverage loss, and terminology style loss. Among them, language modeling loss is used to make the text generated by the model close to the real text; structural compliance loss is used to make the text structure of the text generated by the model conform to the text structure information in the training data; citation coverage loss is used to make the text generated by the model correctly cite the legal provisions; and terminology style loss is used to make the terminology and sentence style in the text generated by the model conform to the terminology and sentence style in the original protection specification text.

[0104] Based on at least one of language modeling loss, structural compliance loss, citation coverage loss, and terminology style loss, the low-rank matrix in the large language model is adjusted to obtain a well-trained planning text generation model.

[0105] This process involves collecting and digitizing the original conservation planning texts of historical and cultural heritage (e.g., using OCR to recognize paper texts to obtain digitized text). Then, the original conservation planning texts are abstracted into a chapter tree format (i.e., JSON format) of text structure information. This text structure information only contains first-level and second-level headings, not the text content. Alternatively, first-level and second-level headings can be extracted from the original conservation planning text to obtain the text structure information. For example, the following shows a portion of the text structure information from an original conservation planning text:

[0106] 1 General Provisions

[0107] 2. Historical and Cultural Characteristics and Value

[0108] 2.1 Historical Development and Periodization

[0109] 2.2 Valuation

[0110] 3. Protection Framework

[0111] 3.1 Hierarchical Zoning and Control Lines

[0112] 3.2 Key Control Points

[0113] 4. Protection of the cultural relics themselves

[0114] 4.1 Structural Safety and Material Protection

[0115] 4.2 Repair Technical Guidelines

[0116] ……

[0117] The triplet extraction model described above can be used to extract valid triplet information from the original conservation planning text. This extraction process can be referenced in the relevant documentation above and will not be elaborated upon here. Furthermore, training data can be constructed, i.e., model input = [text structure information in chapter tree form (JSON) + triplet information]. This allows the text structure information and user input requirements to be used as conditional inputs during training and inference, prompting the model to "place chapters according to their positions" to form chapter memory and output compliant conservation planning text.

[0118] In practical applications, the implementation method of training the triple extraction model using LoRA fine-tuning can be referenced above. A low-rank matrix can be inserted into the original weight matrix of the specified output layer of the large language model. This low-rank matrix can also be decomposed into two smaller matrices, A and B. In this way, during the training of the large language model, the backbone parameters of the large language model can be frozen, and only the low-rank matrix can be optimized to obtain a well-trained planning text generation model. Specifically, the text structure information and triple information from the training data can be input into the large language model, and the large language model can be instructed to output a long text that conforms to the text structure information based on the triple information, thus obtaining the predicted conservation planning text output by the large language model.

[0119] Then, based on the estimated protection planning text and the original protection planning text, at least one of the following is determined: language modeling loss, structural compliance loss, citation coverage loss, and terminology style loss. This is used to optimize the low-rank matrix inserted into the large language model to obtain a trained planning text generation model.

[0120] Among them, the language modeling loss can adopt the standard language model cross-entropy loss, the purpose of which is to make each token output by the model as close as possible to the real text, so that the language flow of the model output text is grammatically correct; for example, the cross-entropy loss function shown in formula (1) can be used to calculate the semantic modeling loss. :

[0121] (1)

[0122] in, The total length of the output text sequence (i.e., the estimated protection planning text generated by the model) (i.e., the total number of tokens). The number of valid tokens is the number of tokens remaining after excluding placeholders and other tokens that are not used in training. This represents the t-th original token (also known as the target token) in the original protection plan text. The text structure information, plus triplet information, represents the chapter tree format (JSON) of the input. For the model in parameters Predict the conditional probability of the next token; This is a mask variable used to exclude special segments that do not participate in training, such as reference markers and placeholders.

[0123] The structural compliance loss is used to ensure that the chapters, entries, and fields in the model's output text conform to the input text structure information. In other words, it ensures that the model's output text, after being parsed into a JSON chapter tree, meets the chapter and field constraints imposed by the text structure information. This structural compliance loss can be used to penalize validation failures after parsing the model's output text into a JSON chapter tree. For example, suppose the text structure information in the model's output estimated conservation planning text is as follows: ,for Each field in The following three types of violation indicator functions can be defined:

[0124] Field missing violation: ;

[0125] Incorrect base number: Violation ;

[0126] Invalid value / violation of enumeration rules: ;

[0127] Based on the above three types of violation indication functions, structural compliance losses can be calculated using formula (2). :

[0128] (2)

[0129] in, This is a set of required fields for text structure information. The complete set of required and optional fields representing text structure information; Cardinality constraints represent fields, such as field length conforming to the maximum and minimum length constraints, and the number of times a field appears not exceeding a specified number of times. It represents the set of allowed values ​​for a field, that is, the set of controlled words / enumerations; , , The weight coefficients represent the three types of violation indicator functions (usually, the missing field has the highest weight). Represents the normalization constant; where, Represents if field It is a required field. However, it did not appear in the output. In the middle, then ,otherwise, ; If There are fields in violation ,but ,otherwise, ; If There are fields in Not in the pre-defined enumeration set In the middle, then ,otherwise, .

[0130] The citation coverage loss can be used to penalize the failure to cite required regulatory clauses, while also moderately penalizing excessive or incorrect citations (illusionary citations). In other words, it penalizes the model's output text for failing to cover specified regulations / evidence. Assume the set of required regulatory clauses is... ,Should It can be determined based on the regulatory clauses cited in the original conservation planning text; the model output's estimated set of regulatory clauses cited in the conservation planning text is... The precision of the definition reference is: The recall rate is: Then the reference coverage loss can be calculated using formula (3). :

[0131] (3)

[0132] The first item: Used to penalize omissions in regulatory provisions (to improve model recall); second item Using weighting coefficients Penalize the overprinting or misquotation of regulatory provisions (reduce model citation illusion). Control the intensity of punishment.

[0133] Among them, the terminology style loss can control the terminology and sentence style of the generated text, making it conform to professional norms and avoiding the terminology and style of the model output text from deviating from the original terminology and style; the terminology style loss can be composed of two parts: terminology coverage and sentence constraints, which are linearly weighted. For example, the terminology style loss can be calculated using formula (4):

[0134] (4)

[0135] in, Represents terminology coverage. , The set of terms that should appear in the text It can be determined based on the terminology appearing in the original conservation planning text mentioned above; The set of terms appearing in the predicted conservation planning text representing the model output; The proportion of passive sentences (or redundancy rate, long sentence rate, etc.) appearing in the estimated protection planning text output by the representative mode. This represents the preset target ratio (which can be set with reference to style guidelines, or by the proportion of passive sentences, redundancy rate, or long sentence rate in the original conservation planning text). and These are the weighting coefficients.

[0136] In some embodiments, the total loss can be obtained by weighted summation, weighted averaging, direct summation, or averaging of at least two of the aforementioned language modeling loss, structural compliance loss, citation coverage loss, and terminology style loss. For example, the total loss can be expressed as: ,in, , , and This represents the weight coefficients; then, the total loss is used to optimize the low-rank matrix inserted in the large language model to obtain the trained planning text generation model.

[0137] It should be understood that training a large language model can be iterated multiple times until the training termination condition is met, such as loss convergence or being set to zero, or reaching a specified number of training rounds. This disclosure does not limit this.

[0138] Optionally, after obtaining the trained planning text generation model, multiple evaluation metrics can be used to evaluate its performance. For example, evaluation metrics can include semantic perplexity (evaluating the model's predictive ability for text), structural compliance rate (completeness of chapters / entries / fields), evidence hit rate (Top-K triple coverage, i.e., the proportion of triples that match the input information), and regulatory alignment accuracy (the ratio of correctly cited regulatory clauses). Semantic perplexity can be expressed as: , with the above Same origin The lower the value, the better; this can be reported on a further development set or specialized corpus. The structural compliance rate can be expressed as: The accuracy of regulatory alignment can be expressed as: ,in, The set of regulatory clauses referenced in the predicted protection plan text output by the model (the set after deduplication). This refers to the set of correct legal provisions for the current text (this set can come from an existing legal knowledge base or be manually labeled). Optionally, the performance of the planning text generation model can be considered to have met the standards, i.e., a well-trained planning text generation model, provided that the semantic perplexity is ≤10%, the structural compliance rate is ≥95%, the legal alignment accuracy is ≥95%, and the evidence hit rate is ≥95%.

[0139] It should be understood that the planning text generation model can generate protection planning texts with a standard text structure by default, and cite relevant legal provisions based on the cultural heritage database and auxiliary knowledge base. If the user has special text structure requirements and / or specific legal provision citation requirements, in some embodiments, the method may further include: obtaining the specified text structure information and / or specified legal provisions input by the user; and using the planning text generation model to generate protection specification texts that conform to the specified text structure information and cite the specified legal provisions based on basic information, detailed information, auxiliary knowledge, and the specified text structure information and / or specified legal provisions. The user can input the specified text structure information and / or specified legal provisions based on actual needs, and this disclosure does not limit the specific content of the specified text structure information and / or specified legal provisions. In practical applications, the planning text generation model can be instructed to generate a protection plan text for Fo Guang Temple based on the input basic information, detailed information, auxiliary knowledge, specified text structure information, and specified legal clauses, requiring the protection plan text to conform to the input specified text structure information and cite the specified legal clauses, etc., by inputting prompt words (e.g., "Please output the protection plan text for Fo Guang Temple based on the input basic information, detailed information, auxiliary knowledge, and specified text structure information and / or specified legal clauses), and this disclosure does not limit this aspect.

[0140] According to the planning method of this disclosure, based on the basic information input by the user, detailed information about the target historical text heritage and auxiliary knowledge in related fields are queried from the cultural heritage database and the auxiliary knowledge base, respectively. Then, a planning text generation model capable of generating standard text structures is used to generate the protection planning text based on the basic information and detailed information, and to refer to and cite external knowledge such as auxiliary knowledge in related fields. This makes the protection planning text output by the model reliable and alleviates the illusion problem that the model may have. As a result, accurate, comprehensive and standardized protection planning text is generated, which greatly enhances the professionalism and accuracy of the text.

[0141] The planning and compilation method according to the embodiments of this disclosure can enhance the modeling and utilization capabilities of historical and cultural knowledge, and achieve systematic information fusion and timely updates. Specifically, it is the first to deeply integrate LoRA technology with information extraction tasks. Through minimal manual annotation, a large language model is driven to efficiently identify entity-relation triples, automatically constructing a cross-disciplinary historical and cultural knowledge graph. Using Neo4j as the underlying support, it achieves semantically consistent and structurally standardized knowledge network expression. Based on this, through a weekly incremental update mechanism, combined with automatic crawling and model recognition, the knowledge graph dynamically absorbs new policies, research results, and cultural relic records, ensuring that model training and document compilation are always based on the latest knowledge state. This significantly improves the model's coverage breadth, accuracy, and timeliness of historical and cultural knowledge.

[0142] The planning method according to embodiments of this disclosure supports the structured generation and professional output of protection planning texts, significantly improving text compliance and compilation efficiency. Specifically, a dual control mechanism is introduced in the generation stage: on the one hand, based on a preset JSON hierarchical document structure tree, the model is guided to generate content according to the "chapter-item" logic, ensuring that the output conforms to the standard format of planning texts; on the other hand, a reinforcement learning reward function is designed to continuously optimize the model's generation preferences with "format correctness, language professionalism, and information completeness" as objectives. Through this mechanism, the generated planning documents are not only logically structured and well-organized, but also automatically embed background information, technical countermeasures, and policy citations related to specific cultural relics or regions, greatly reducing the cost of manual proofreading and rewriting. This significantly improves the work efficiency and technical content of professional institutions.

[0143] Figure 2 This diagram shows a block diagram of a historical and cultural preservation planning apparatus according to an embodiment of the present disclosure, such as... Figure 2 As shown, the device includes:

[0144] The acquisition module 201 is used to acquire basic information of the target historical and cultural heritage input by the user, wherein the basic information is used to briefly describe the attributes of the target historical and cultural heritage.

[0145] The detailed information query module 202 is used to query detailed information related to the target historical and cultural heritage from the cultural heritage database based on the basic information; wherein, the cultural heritage database represents a knowledge graph of various historical and cultural heritages, and the detailed information is used to describe in detail the attributes of the target historical and cultural heritage.

[0146] The auxiliary knowledge query module 203 is used to query auxiliary knowledge related to the target historical and cultural heritage from the auxiliary knowledge base based on the basic information. The auxiliary knowledge base is used to store knowledge in related fields involved in the protection of historical and cultural heritage.

[0147] The text generation module 204 is used to generate a protection plan text for the target historical and cultural heritage based on the basic information, the detailed information, and the auxiliary knowledge using a planning text generation model. The protection plan text is a protection plan for the target historical and cultural heritage described using a standard text structure.

[0148] In one possible implementation, the construction process of the cultural heritage database includes: collecting textual data on various historical and cultural heritages; using a triplet extraction model, with historical and cultural heritage as entities, identifying triplet information related to historical and cultural heritage from the textual data, wherein the triplet information is used to describe the relationship between entities and attributes in triplet form; performing textual normalization processing on the triplet information and storing the normalized triplet information in a vector database, wherein the vector database stores triplet information of various historical and cultural heritages in vector form; and fusing the triplet information corresponding to entities with similar attributes in the vector database to obtain the knowledge-fused cultural heritage database.

[0149] In one possible implementation, the training process of the triplet extraction model includes: obtaining a prompt sample library by tripling representative textual materials of at least one historical and cultural heritage, the prompt sample library including multiple sample examples; the sample examples representing standardized training samples; performing textual standardization and corpus segmentation on the representative textual materials of the at least one historical and cultural heritage to obtain multiple sample corpus blocks; determining sample corpus blocks that are semantically similar to each sample example based on the multiple sample examples in the prompt sample library; generating an extended training set based on the sample corpus blocks that are semantically similar to each sample example, the extended training set including multiple training samples, each training sample including a sample triplet and the source text of the sample triplet; and performing supervised fine-tuning training on a pre-trained large language model based on the extended training set to obtain the triplet extraction model.

[0150] In one possible implementation, the construction process of the auxiliary knowledge base includes: collecting domain text data related to the protection of historical and cultural heritage; performing textual standardization and corpus segmentation on the domain text data to obtain multiple text corpus blocks and storing them in a non-relational database; extracting feature vectors from each text corpus block and normalizing them to obtain corpus vectors for multiple text corpus blocks and storing them in a corpus vector database; establishing a correlation between the non-relational database and the corpus vector database for the same text corpus block and its corresponding corpus vector; clustering the corpus vectors of at least some text corpus blocks in the corpus vector database to obtain multiple cluster centers, which are used as vector indexes for retrieving data from the corpus vector database; and the non-relational database and the corpus vector database together constitute the auxiliary knowledge base.

[0151] In one possible implementation, the step of querying auxiliary knowledge related to the target historical and cultural heritage from an auxiliary knowledge base based on the basic information includes: generating a query vector and a keyword list based on the basic information; the query vector is used to query the auxiliary knowledge base using vectorized basic information; the keyword list includes keywords from the basic information to query the auxiliary knowledge base using keywords; querying the auxiliary knowledge base based on the query vector and the keyword list respectively to obtain query results; the query results include multiple text corpus blocks retrieved using the query vector and multiple text corpus blocks retrieved using the keyword list; for any text corpus block in the query results, determining a comprehensive score for the text corpus block based on at least one of the following: similarity between the text corpus block and the basic information, keyword matching strength, geographical proximity, period overlap, type consistency, and source quality of the text corpus block; and selecting the K text corpus blocks with the highest comprehensive scores from the auxiliary knowledge base as auxiliary knowledge related to the target historical and cultural heritage, where K is a positive integer.

[0152] In one possible implementation, the training process of the planning text generation model includes: constructing a training dataset, which includes multiple training data sets, each training data set including the text structure information of the original protection planning text for any historical and cultural heritage site and the triplet information extracted from the original protection planning text; the text structure information includes the first-level and second-level headings in the original protection planning text described in the form of a chapter tree; using a pre-trained large language model based on the text structure information and triplet information in the training data to generate the estimated protection planning text corresponding to the training data; wherein, a low-rank matrix is ​​inserted into the original weight matrix of the specified output layer of the large language model; based on the estimated protection planning text and the original protection planning text, At least one of the following is determined: language modeling loss, structural compliance loss, citation coverage loss, and terminology style loss; wherein, the language modeling loss is used to make the text generated by the model approximate real text; the structural compliance loss is used to make the text structure of the text generated by the model conform to the text structure information in the training data; the citation coverage loss is used to make the text generated by the model correctly cite legal clauses; and the terminology style loss is used to make the terminology and sentence style in the text generated by the model conform to the terminology and sentence style in the original protected normative text; based on at least one of the language modeling loss, the structural compliance loss, the citation coverage loss, and the terminology style loss, the low-rank matrix in the large language model is adjusted to obtain a trained planning text generation model.

[0153] In one possible implementation, the acquisition module is further configured to: acquire the specified text structure information and / or specified legal clauses input by the user; the text generation module is further configured to: utilize the planned text generation model to generate a protection specification text that conforms to the specified text structure information and references the specified legal clauses based on the basic information, the detailed information, the auxiliary knowledge, and the specified text structure information and / or the specified legal clauses.

[0154] According to the planning device of this disclosure, based on the basic information input by the user, it queries the cultural heritage database and the auxiliary knowledge base for detailed information on the target historical text heritage and auxiliary knowledge in related fields. Then, it uses a planning text generation model that can generate a standard text structure to generate a protection planning text based on the basic information and detailed information, and refers to and cites external knowledge such as auxiliary knowledge in related fields. This makes the protection planning text output by the model reliable and alleviates the illusion problem that the model may have. As a result, it generates an accurate, comprehensive and standardized protection planning text, which greatly enhances the professionalism and accuracy of the text.

[0155] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0156] This disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above method.

[0157] This disclosure also provides a non-volatile computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the above-described method.

[0158] This disclosure also provides a computer program product, including a computer program or a non-volatile computer-readable storage medium carrying the computer program, wherein the computer program, when executed by a processor, implements the steps of the above method.

[0159] Figure 3 A block diagram of an electronic device 1900 according to an embodiment of the present disclosure is shown. For example, the electronic device 1900 may be provided as a server or a terminal device. (Refer to...) Figure 3 The electronic device 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by the processing component 1922. The application programs stored in memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform the methods described above.

[0160] Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input / output interface 1958 (I / O interface). Electronic device 1900 can operate on an operating system, such as Windows Server, stored in memory 1932. TM Mac OS X TM Unix TM Linux TM FreeBSD TM Or similar.

[0161] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions that can be executed by a processing component 1922 of an electronic device 1900 to perform the above-described method.

[0162] Computer-readable storage media can be tangible devices capable of holding and storing programs / instructions used by instruction execution devices. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0163] The computer program (or computer-readable program instructions) described herein can be downloaded from a computer-readable storage medium to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage medium in the respective computing / processing device.

[0164] The computer program (or computer program instructions) used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the computer-readable program instructions to implement various aspects of this disclosure.

[0165] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0166] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0167] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0168] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0169] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for compiling a historical and cultural preservation plan, characterized in that, include: Obtain basic information about the target historical and cultural heritage site input by the user, wherein the basic information is used to briefly describe the attributes of the target historical and cultural heritage site; Based on the aforementioned basic information, detailed information related to the target historical and cultural heritage is retrieved from a cultural heritage database; wherein, the cultural heritage database represents a knowledge graph of various historical and cultural heritages, and the detailed information is used to describe in detail the attributes of the target historical and cultural heritage. Based on the aforementioned basic information, auxiliary knowledge related to the target historical and cultural heritage is queried from the auxiliary knowledge base, which is used to store and protect knowledge in related fields involved in the protection of historical and cultural heritage. Using a planning text generation model, a protection planning text for the target historical and cultural heritage is generated based on the basic information, the detailed information, and the auxiliary knowledge. The protection planning text is a protection planning scheme for the target historical and cultural heritage described using a standard text structure.

2. The method according to claim 1, characterized in that, The process of constructing the cultural heritage database includes: Collect textual materials on cultural heritage from various historical and cultural heritage sources; Using a triplet extraction model, with historical and cultural heritage as entities, triplet information related to historical and cultural heritage is identified from the textual data of the cultural heritage. The triplet information is used to describe the relationship between entities and attributes in the form of triplets. The triplet information is processed for text normalization, and the normalized triplet information is stored in a vector database. The vector database stores triplet information of various historical and cultural heritages in vector form. The triplet information corresponding to entities with similar attributes in the vector database is fused to obtain the cultural heritage database after knowledge fusion.

3. The method according to claim 2, characterized in that, The training process of the triplet extraction model includes: A prompt sample library is obtained by tripling representative textual materials of at least one historical and cultural heritage. The prompt sample library includes multiple sample examples, and the sample examples represent standardized training samples. The representative textual materials of at least one of the historical and cultural heritages are subjected to textual planning and corpus segmentation to obtain multiple sample corpus blocks; Based on multiple sample examples in the aforementioned prompt sample library, determine sample corpus blocks that are semantically similar to each sample example; An extended training set is generated based on sample corpus blocks that are semantically similar to each sample example. The extended training set includes multiple training samples, and each training sample includes a sample triplet and the source text of the sample triplet. Based on the extended training set, the pre-trained large language model is subjected to supervised fine-tuning training to obtain the triple extraction model.

4. The method according to claim 1, characterized in that, The construction process of the auxiliary knowledge base includes: Collecting and protecting textual materials related to relevant fields of historical and cultural heritage; The text data in the aforementioned domain are subjected to text planning and corpus segmentation to obtain multiple text corpus blocks, which are then stored in a non-relational database. Feature vectors are extracted from each text corpus block and normalized to obtain corpus vectors for multiple text corpus blocks, which are then stored in a corpus vector database. The non-relational database and the corpus vector database have a correlation relationship between the same text corpus block and its corresponding corpus vector. By clustering the corpus vectors of at least a portion of the text corpus blocks in the corpus vector database, multiple cluster centers are obtained. These multiple cluster centers are used as vector indexes to retrieve data from the corpus vector database. The non-relational database and the corpus vector database together constitute the auxiliary knowledge base.

5. The method according to claim 1 or 4, characterized in that, The step of querying auxiliary knowledge related to the target historical and cultural heritage from the auxiliary knowledge base based on the basic information includes: Based on the aforementioned basic information, a query vector and a keyword list are generated. The query vector is used to query the auxiliary knowledge base using the vectorized basic information, and the keyword list includes keywords from the basic information to query the auxiliary knowledge base using the keywords. Based on the query vector and the keyword list respectively, the auxiliary knowledge base is queried to obtain query results, which include: multiple text corpus blocks retrieved using the query vector and multiple text corpus blocks retrieved using the keyword list; For any text corpus block in the query results, the comprehensive score of the text corpus block is determined based on at least one of the following: similarity between the text corpus block and the basic information, keyword matching strength, geographical proximity, time overlap, type consistency, and source quality of the text corpus block. Based on the comprehensive score of each text corpus in the query results, the K text corpus blocks with the highest comprehensive scores are selected as auxiliary knowledge related to the target historical and cultural heritage retrieved from the auxiliary knowledge base, where K is a positive integer.

6. The method according to claim 1, characterized in that, The training process of the planned text generation model includes: Construct a training dataset, which includes: multiple training data, each training data including the text structure information of the original protection plan text of any historical and cultural heritage and the triplet information extracted from the original protection plan text; the text structure information includes the first-level headings and second-level headings in the original protection plan text described in the form of a chapter tree; Using a pre-trained large language model, based on the text structure information and triplet information in the training data, a predicted conservation planning text corresponding to the training data is generated; wherein, a low-rank matrix is ​​inserted into the original weight matrix of the specified output layer of the large language model. Based on the estimated protection plan text and the original protection plan text, at least one of the following is determined: language modeling loss, structural compliance loss, citation coverage loss, and terminology style loss. The language modeling loss is used to make the text generated by the model approximate real text; the structural compliance loss is used to make the text structure of the model-generated text conform to the text structure information in the training data; the citation coverage loss is used to ensure that the model-generated text correctly cites the relevant legal provisions; and the terminology style loss is used to make the terminology and sentence style in the model-generated text conform to the terminology and sentence style in the original protection plan text. Based on at least one of the language modeling loss, the structural compliance loss, the citation coverage loss, and the terminology style loss, the low-rank matrix in the large language model is adjusted to obtain a trained planning text generation model.

7. The method according to claim 1, characterized in that, The method further includes: Obtain the specified text structure information and / or specified legal clauses input by the user; The planning text generation model is used to generate a protection specification text that conforms to the specified text structure information and references the specified legal provisions, based on the basic information, the detailed information, the auxiliary knowledge, the specified text structure information, and / or the specified legal provisions.

8. A device for compiling historical and cultural preservation plans, characterized in that, include: The acquisition module is used to acquire basic information of the target historical and cultural heritage input by the user. The basic information is used to briefly describe the attributes of the target historical and cultural heritage. The detailed information query module is used to query detailed information related to the target historical and cultural heritage from the cultural heritage database based on the basic information; wherein, the cultural heritage database represents a knowledge graph of various historical and cultural heritages, and the detailed information is used to describe in detail the attributes of the target historical and cultural heritage. The auxiliary knowledge query module is used to query auxiliary knowledge related to the target historical and cultural heritage from the auxiliary knowledge base based on the basic information. The auxiliary knowledge base is used to store knowledge in related fields involved in the protection of historical and cultural heritage. The text generation module is used to generate a protection plan text for the target historical and cultural heritage based on the basic information, the detailed information, and the auxiliary knowledge using a planning text generation model. The protection plan text is a protection plan for the target historical and cultural heritage described using a standard text structure.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.

10. A non-volatile computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.