Ecological resource data synchronization method, device and electronic equipment

By generating an ecological resource data index tree and a storage link table, the problem of low ecological resource data synchronization efficiency is solved, fast and efficient data synchronization is achieved, and delays are avoided.

CN118332049BActive Publication Date: 2024-09-13ZHONGKE SHANSHUI (BEIJING) TECH INFORMATION CO LTD
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202410748400.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-09-13
Estimated Expiration
2044-06-12

AI Technical Summary

Technical Problem

Ecological resource data synchronization efficiency is low, resulting in data synchronization delays.

Method used

By determining the storage address and timeliness measurement value of ecological resource data records, generate an ecological resource data index tree and establish a storage link table, obtain the data records to be synchronized and match them with the index tree, update the index tree and link table, and improve the data synchronization speed. and efficiency.

Benefits of technology

It improves the speed of ecological resource data synchronization, ensures the efficiency of data synchronization, avoids delays, and optimizes data management and storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118332049B
    Figure CN118332049B
Patent Text Reader

Abstract

The present application provides an ecological resource data synchronization method, device and electronic device, wherein the method includes: determining an ecological resource data record set formed when multiple target entities are stored in an ecological resource database, the ecological resource data record set including multiple ecological resource data records; generating an ecological resource data index tree and establishing a storage link table according to the storage addresses and timeliness metrics of all ecological resource data records; obtaining the ecological resource data records to be synchronized, and parsing them to determine the entities they describe and the corresponding meta-ecological resource data combinations, so as to match them with the ecological resource data index tree, and updating the ecological resource data index tree when matching any target entity among the multiple target entities, adding the meta-ecological resource data combinations in the ecological resource data records to be synchronized to the storage link table, updating the storage link table, and adding the ecological resource data records to be synchronized to the ecological resource data record set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of ecological resource data processing, and in particular to an ecological resource data synchronization method, device and electronic equipment. Background Art

[0002] Ecological resources refer to the materials, energy and other resources used by organisms and humans for survival, reproduction and development in human ecosystems. Ecological resources include tangible natural resources, biological resources, natural landscape resources, intangible environmental resources and ecological cultural resources. In order to strengthen the analysis of the changing trends and development laws of the value of ecological assets and ecological products, and provide green development guidance in assessment, compensation, decision-making, planning, auditing and other aspects, digital technology is used to digitize ecological resources to obtain ecological resource data, which may include basic environmental monitoring, geographic remote sensing, meteorology and hydrology, cultural tourism, agricultural resources and other information data. Using these ecological resource data, an ecological asset value assessment system is constructed.

[0003] However, due to the large number of ecological resource categories, the corresponding ecological resource data obtained will also be huge in volume, which leads to some problems in the synchronization of ecological resource data to the database, such as low data synchronization efficiency. Summary of the invention

[0004] The purpose of this application is to propose an ecological resource data synchronization method, device and electronic device to solve or alleviate the technical problems existing in the prior art.

[0005] The present application provides an ecological resource data synchronization method, which includes:

[0006] Determine an ecological resource data record set formed when multiple target entities are stored in an ecological resource database, wherein the ecological resource data record set includes multiple ecological resource data records, each ecological resource data record includes an ecological resource data record ID, an entity ID, and a meta-ecological resource data combination, and the meta-ecological resource data combination includes multiple feature values;

[0007] Determining the storage address of each ecological resource data record and the timeliness measurement value of each ecological resource data record;

[0008] Generate an ecological resource data index tree and establish a storage link table based on the storage addresses and timeliness metrics of all ecological resource data records;

[0009] Obtain the ecological resource data record to be synchronized, and parse it to determine the entity described by it and the corresponding meta-ecological resource data combination, so as to match it with the ecological resource data index tree, and update the ecological resource data index tree when matching any target entity among the multiple target entities, and add the meta-ecological resource data combination in the ecological resource data record to be synchronized to the storage link table to update the storage link table;

[0010] Based on the updated ecological resource data index tree and storage link table, the ecological resource data record to be synchronized is added to the ecological resource data record set.

[0011] The present application embodiment provides an ecological resource data synchronization device, which includes:

[0012] An ecological resource data acquisition unit, used to determine an ecological resource data record set formed when multiple target entities are stored in an ecological resource database, wherein the ecological resource data record set includes multiple ecological resource data records, each ecological resource data record includes an ecological resource data record ID, an entity ID, and a meta-ecological resource data combination, wherein the meta-ecological resource data combination includes multiple feature values;

[0013] An ecological resource data preprocessing unit, used to determine the storage address of each ecological resource data record and the timeliness measurement value of each ecological resource data record;

[0014] A time efficiency measurement unit is used to generate an ecological resource data index tree and establish a storage link table according to the storage addresses and time efficiency measurement values ​​of all ecological resource data records;

[0015] An ecological resource data updating unit, used for obtaining the ecological resource data record to be synchronized, parsing it to determine the entity described by it and the corresponding meta-ecological resource data combination, so as to match it with the ecological resource data index tree, and updating the ecological resource data index tree when matching any target entity among the multiple target entities, adding the meta-ecological resource data combination in the ecological resource data record to be synchronized to the storage link table to update the storage link table;

[0016] The ecological resource data synchronization unit adds the ecological resource data record to be synchronized to the ecological resource data record set based on the updated ecological resource data index tree and storage link table.

[0017] An embodiment of the present application provides an electronic device, comprising:

[0018] one or more processors;

[0019] A computer readable medium configured to store one or more programs,

[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in the embodiments of the present application.

[0021] In the present application, an ecological resource data record set is formed when multiple target entities are stored in an ecological resource database, wherein the ecological resource data record set includes multiple ecological resource data records, each ecological resource data record includes an ecological resource data record ID, an entity ID, and a meta-ecological resource data combination, wherein the meta-ecological resource data combination includes multiple characteristic values; the storage address of each ecological resource data record and the timeliness measurement value of each ecological resource data record are determined; according to the storage addresses and timeliness measurement values ​​of all ecological resource data records, an ecological resource data index tree is generated and a storage link table is established; the ecological resource data records to be synchronized are obtained, and they are parsed Determine the entity described by it and the corresponding meta-ecological resource data combination to match with the ecological resource data index tree, and update the ecological resource data index tree when matching any target entity among the multiple target entities, add the meta-ecological resource data combination in the ecological resource data record to be synchronized to the storage link table to update the storage link table; based on the updated ecological resource data index tree and storage link table, add the ecological resource data record to be synchronized to the ecological resource data record set, thereby improving the speed of ecological resource data synchronization, ensuring the efficiency of ecological resource data synchronization, and avoiding ecological resource data synchronization delays, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Hereinafter, some specific embodiments of the present application will be described in detail in an exemplary and non-limiting manner with reference to the accompanying drawings. The same reference numerals in the accompanying drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the accompanying drawings:

[0023] Figure 1 A flowchart of an ecological resource data synchronization method according to an embodiment of the present application.

[0024] Figure 2 A flowchart of an ecological resource data synchronization method according to an embodiment of the present application.

[0025] Figure 3 This is a structural diagram of an ecological resource data synchronization device according to an embodiment of the present application.

[0026] Figure 4 Schematic diagram of the structure of the electronic device of this embodiment.

[0027] Figure 5 Detailed description of the hardware structure of the electronic device of this embodiment. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.

[0029] Figure 1 This is a flow chart of an ecological resource data synchronization method according to an embodiment of the present application. Figure 1 As shown, it includes:

[0030] S101, determining a set of ecological resource data records formed when multiple target entities are stored in an ecological resource database;

[0031] Among them, the ecological resource data record set includes multiple ecological resource data records; each ecological resource data record includes an ecological resource data record ID, an entity ID, and a meta-ecological resource data combination, and the meta-ecological resource data combination includes multiple characteristic values.

[0032] Optionally, for example, by parsing the ecological resource data storage table structure of the ecological resource database, a set of ecological resource data records formed when multiple target entities are stored in the ecological resource database is determined.

[0033] In this embodiment, the type of the ecological resource database is not limited to uniqueness.

[0034] In this embodiment, the form of the ecological resource data record set is not limited, and can be matched according to the requirements of the application scenario and the type of ecological resource data.

[0035] In this embodiment, the target entity includes, for example, natural resources, biological resources, natural landscape resources, intangible environmental resources, and ecological and cultural resources.

[0036] S102, determining the storage address of each ecological resource data record and the timeliness measurement value of each ecological resource data record;

[0037] Optionally, in this embodiment, determining the timeliness measurement value of each ecological resource data record includes:

[0038] Mapping each ecological resource data record included in the ecological resource data record set into an ecological resource data pattern, wherein the ecological resource data pattern includes a tuple segment and an attribute feature segment, wherein the tuple segment includes the ecological resource data record ID and the entity ID, and the attribute feature segment includes the multiple feature values;

[0039] The ecological resource data model is input into a pre-constructed timeliness measurement logic formula to determine the timeliness measurement value of the ecological resource data record.

[0040] To this end, in this embodiment, the timeliness measurement value of each ecological resource data record is determined in a specific manner, which has the following technical benefits:

[0041] (1) Mapping ecological resource data records to ecological resource data schemas is actually a standardization of the data. By dividing the data into tuple segments (containing record IDs and entity IDs) and attribute feature segments (containing multiple feature values), the data can be organized and understood more clearly, which is helpful for subsequent data processing and analysis.

[0042] (2) Using the data model as an intermediate layer makes it easy to perform further operations on the data, such as data cleaning and data conversion, without having to directly operate on the original data. In addition, when the data structure or characteristics change, only the mapping rules of the data model need to be updated without modifying the entire data processing flow, thereby improving the flexibility and scalability of the system.

[0043] (3) By using a pre-built timeliness measurement logic formula to determine the timeliness measurement value of each ecological resource data record, the timeliness of the data can be evaluated more accurately. This is particularly important for application scenarios that require decision-making based on time-sensitive data, such as environmental monitoring and resource management. Accurate timeliness measurement helps to detect data changes in a timely manner, thereby making more timely responses.

[0044] (4) By measuring the timeliness of data, the data life cycle can be managed more effectively. For example, data that is not frequently updated can be stored on slower storage media, while data that is frequently updated and has high timeliness requirements can be stored on faster storage media to increase the speed of data retrieval.

[0045] (5) During data synchronization, by comparing the timeliness metrics, data with higher timeliness and greater changes can be synchronized first, thereby improving the efficiency and accuracy of data synchronization. This is especially important when processing large amounts of data, as it can help the system use resources more efficiently and reduce unnecessary data transmission and processing.

[0046] An exemplary implementation code is provided below to describe the process of determining the timeliness measurement value of each ecological resource data record in the above process:

[0047] / / Structure or class of ecological resource data record

[0048] struct EcologicalResourceRecord {

[0049] int recordID;

[0050] int entityID;

[0051] List <float>featureValues; / / The feature value is a list of floating point numbers

[0052] }

[0053] / / Ecological resource data model structure

[0054] struct EcologicalResourceDataPattern {

[0055] int recordID;

[0056] int entityID;

[0057] List <float>featureValues;

[0058] }

[0059] / / Time efficiency measurement logic function

[0060] float calculateTimelinessMetric(EcologicalResourceDataPatternpattern) {

[0061] / / Pre-built time efficiency measurement logic formula

[0062] float timelinessMetric = 0.0;

[0063] / / Simple weighted average eigenvalue as time efficiency measure

[0064] float sum = 0.0;

[0065] for (float feature : pattern.featureValues) {

[0066] sum += feature;

[0067] }

[0068] timelinessMetric = sum / pattern.featureValues.size();

[0069] return timelinessMetric;

[0070] }

[0071] / / Main logic

[0072] List <ecologicalresourcerecord>records = ... / / Get a collection of ecological resource data records from a database or other source

[0073] Map<Integer, Float> timelinessMetrics = new Map<Integer, Float> ();

[0074] for (EcologicalResourceRecord record : records) {

[0075] / / Map ecological resource data records to data models

[0076] EcologicalResourceDataPattern pattern = newEcologicalResourceDataPattern();

[0077] pattern.recordID = record.recordID;

[0078] pattern.entityID = record.entityID;

[0079] pattern.featureValues ​​= record.featureValues;

[0080] / / Calculate the timeliness metric

[0081] float timelinessMetric = calculateTimelinessMetric(pattern);

[0082] / / Store the aging measurement value for later use

[0083] timelinessMetrics.put(record.recordID, timelinessMetric);

[0084] }

[0085] Furthermore, in this embodiment, the timeliness measurement logic formula includes antecedent logic rules, consequent logic rules, and timeliness logic relationship expressions, and the inputting of the ecological resource data model into the pre-constructed timeliness measurement logic formula to determine the timeliness measurement value of the ecological resource data record includes:

[0086] The different tuple segments with the same entity ID are filled into the antecedent logic rule, and the corresponding attribute feature segments are filled into the consequent logic rule to judge the degree of matching with the expression of the temporal logic relationship, so as to determine the temporal measurement value of the corresponding ecological resource data record.

[0087] In this embodiment, the antecedent logic rule is used to define whether it is the same entity, and the consequent logic defines the relationship between the characteristic values ​​of the ecological resource data records representing the same entity. At the same time, the relationship between the characteristic values ​​of the ecological resource data records representing the same entity is characterized by the expression of the timeliness logic relationship. To this end, through this form, the use of timestamps can be avoided, and the determination of the timeliness measurement value can be accurately completed while ensuring the accuracy of the calculation.

[0088] To this end, in this embodiment, by adopting a timeliness measurement logic formula including antecedent logic rules, consequent logic rules and timeliness logic relationship expressions, and by filling different tuple segments with the same entity ID and corresponding attribute feature segments into these rules to judge the degree of matching with the timeliness logic relationship expressions, the timeliness measurement value of the ecological resource data record is determined, which has the following technical benefits:

[0089] (1) By constructing specific logical rules, the system can more accurately evaluate the timeliness of each ecological resource data record. The antecedent logic rules and consequent logic rules allow the system to customize the timeliness evaluation method according to specific business logic and data characteristics, thereby obtaining a more accurate timeliness measurement value.

[0090] (2) The introduction of logical rules means that the measurement of timeliness is no longer fixed, but can be adjusted and optimized according to actual needs. This flexibility enables the system to better adapt to different application scenarios and business needs, and improves the customizability of the system.

[0091] (3) By accurately evaluating timeliness, the system can promptly detect and process outdated or inaccurate data, thereby improving the data quality in the ecological resource database. This is crucial for application scenarios that rely on this data to make decisions.

[0092] (4) Understanding the timeliness of data helps the system allocate resources more reasonably. For example, for data with high timeliness requirements, the system can allocate more storage and computing resources to ensure its rapid processing and updating; while for data with low timeliness requirements, resource allocation can be appropriately reduced, thereby optimizing overall resource utilization.

[0093] (5) During the data synchronization process, by comparing the timeliness metrics, the system can prioritize the synchronization of data records with high timeliness and large changes, thereby improving the efficiency and accuracy of data synchronization. This helps reduce unnecessary data transmission and processing time and improves the response speed of the entire system.

[0094] The following is an exemplary code that describes how to fill different tuple segments with the same entity ID and the corresponding attribute feature segments into the antecedent logic rules and the consequent logic rules, and judge the degree of matching with the temporal logic relationship expression, so as to determine the temporal measurement value of the ecological resource data record:

[0095] / / Structure and data

[0096] struct EcologicalResourceRecord {

[0097] int recordID;

[0098] int entityID;

[0099] List <float>featureValues;

[0100] }

[0101] List <ecologicalresourcerecord>records = ... / / A collection of records retrieved from a database or other source

[0102] / / Related structures and functions of time efficiency measurement logic formula

[0103] struct LogicRule {

[0104] string expression; / / Logical rule expression, which can be any logical expression, such as "feature1>10"

[0105] float weight; / / The weight of the rule, used to calculate the timeliness metric

[0106] }

[0107] List <logicrule>preConditions = ... / / Precondition logic rule set

[0108] List <logicrule>postConditions = ... / / Post-condition logic rule set

[0109] / / Time-limited logical relationship expression

[0110] string timingLogicRelation = "...";

[0111] float evaluateLogicExpression(List <float>featureValues, stringexpression) {

[0112] / / Function, used to evaluate the truth of a logical expression and return a matching degree value (between 0 and 1)

[0113] / / Logical evaluation

[0114] if (expression == "feature1>10"&&featureValues[0]>10) {

[0115] return 1.0;

[0116] }

[0117] return 0.0;

[0118] }

[0119] Map<Integer, Float> timelinessMetrics = new Map<Integer, Float> ();

[0120] for (EcologicalResourceRecord record : records) {

[0121] float timelinessMetric = 0.0;

[0122] float totalWeight = 0.0;

[0123] / / Evaluate the antecedent logic rules

[0124] for (LogicRule rule : preConditions) {

[0125] float matchDegree = evaluateLogicExpression(record.featureValues,rule.expression);

[0126] timelinessMetric += matchDegree * rule.weight;

[0127] totalWeight += rule.weight;

[0128] }

[0129] / / Evaluate the consequent logic rules

[0130] for (LogicRule rule : postConditions) {

[0131] float matchDegree = evaluateLogicExpression(record.featureValues,rule.expression);

[0132] timelinessMetric += matchDegree * rule.weight;

[0133] totalWeight += rule.weight;

[0134] }

[0135] / / Perform the final evaluation based on the expression of time-effect logic relationship, which is simplified here to directly use the accumulated value of time-effect measurement

[0136] / / Calculate the final time measurement value

[0137] timelinessMetric = timelinessMetric / totalWeight; / / weighted average

[0138] timelinessMetrics.put(record.recordID, timelinessMetric);

[0139] }

[0140] / / timelinessMetrics contains the timeliness metrics for each record

[0141] In the above exemplary code, the evaluateLogicExpression function needs to write complex logical judgments according to the actual logical rule expression, and the timingLogicRelation also needs to implement the corresponding logic according to specific needs.

[0142] Optionally, in this embodiment, the logic in the timeliness measurement logic formula can be a monotonic logic increasing or decreasing order based on the time sequence, or a state transition order based on the time sequence. The specific one to be selected can be determined according to the requirements of the application scenario.

[0143] Optionally, in this embodiment, determining the storage address of each ecological resource data record includes:

[0144] Parsing the table structure for managing the storage of each ecological resource data record to determine the size of the ecological resource data block and the ecological resource data storage index table used when storing the ecological resource data;

[0145] Determine the first storage address of each ecological resource data record according to the size of the ecological resource data block and the ecological resource data storage index table, wherein the first storage address is the storage address of the first characteristic value;

[0146] The storage address of each ecological resource data record is determined according to the first storage address and the ecological resource data length of each ecological resource data record.

[0147] To this end, the method described above in this embodiment is used to determine the storage address of each ecological resource data record, which has the following technical advantages:

[0148] (1) By analyzing the table structure and using the ecological resource data storage index table, the system can quickly locate the first storage address of each ecological resource data record. This efficient positioning mechanism can significantly reduce data retrieval time and improve data access speed.

[0149] (2) Determining the size of ecological resource data blocks enables the system to manage data storage more flexibly. Based on the size of the data blocks, the system can optimize the allocation and utilization of storage space, while also helping to improve the efficiency of data read and write operations.

[0150] (3) The storage address of each ecological resource data record is determined according to its ecological resource data length, which can ensure the integrity and accuracy of the data. The system can accurately know the storage space occupied by each record, thus avoiding data overflow or loss.

[0151] (4) By combining the first storage address and the data length to determine the storage address of each record, it helps to build an optimized and orderly storage structure. This structure not only facilitates fast data retrieval, but also improves the overall efficiency of data storage.

[0152] (5) This method has good scalability and maintainability. As the amount of data grows, the system can easily expand the storage capacity while maintaining fast data access capabilities. In addition, the clear storage structure also facilitates data maintenance and management.

[0153] The following is an example code that describes how to determine the storage address of each ecological resource data record:

[0154] class EcologicalResourceDataRecord:

[0155] def __init__(self, record_id, data_length, feature_values):

[0156] self.record_id = record_id

[0157] self.data_length = data_length

[0158] self.feature_values ​​= feature_values

[0159] # Ecological resource data storage block size

[0160] BLOCK_SIZE = 1024 # Each data block size is 1024 bytes

[0161] # Ecological resource data storage index table, key is the record ID, value is the offset of the first storage address

[0162] index_table = {

[0163] 1: 0,# The data record with record ID 1 is stored from the beginning of the data block

[0164] 2: 512, # The data record with record ID 2 is stored starting from the middle of the data block

[0165] # ... the first storage address offset of other records

[0166] }

[0167] # List of ecological resource data records

[0168] records = [

[0169] EcologicalResourceDataRecord(1, 256, [0.1, 0.2, 0.3]), # The record ID is 1 and the data length is 256 bytes

[0170] EcologicalResourceDataRecord(2, 128, [0.4, 0.5, 0.6]), # Record ID is 2, data length is 128 bytes ]

[0172] def determine_storage_address(record, block_size, index_table):

[0173] # Get the offset of the first storage address from the index table based on the record ID

[0174] start_offset = index_table[record.record_id]

[0175] # Calculate the first storage address

[0176] # Assume that the starting address of the data block is fixed

[0177] base_address = 0x1000

[0178] first_feature_address = base_address + start_offset

[0179] # Determine the storage address range of the entire record based on the first storage address and data length

[0180] last_feature_address = first_feature_address + record.data_length - 1

[0181] return first_feature_address, last_feature_address

[0182] # Determine the storage address for each record

[0183] for record in records:

[0184] first_address, last_address = determine_storage_address(record,BLOCK_SIZE, index_table)

[0185] print(f"Record ID: {record.record_id}, First Address: {first_address}, Last Address: {last_address}")

[0186] In the above code example, an EcologicalResourceDataRecord class is defined to represent an ecological resource data record, including a record ID, data length, and feature value. The determine_storage_address function receives a record, a data block size, and a storage index table as parameters, and returns the storage address of the first feature value and the storage address of the last feature value of the record.

[0187] Furthermore, in this embodiment, the storage address of each ecological resource data record is determined according to the first storage address and the ecological resource data length of each ecological resource data record, including:

[0188] The ecological resource data record ID is used as the key, and the first storage address and the ecological resource data length of each ecological resource data record are used as values ​​to form a key-value pair, and the key-value pair is used as the storage address of each ecological resource data record; or, the ecological resource data record ID is used as the key, and the first storage address and the ecological resource data length of each ecological resource data record are hashed to obtain the corresponding hash value, and the hash value is used as the value to form a key-value pair, and the key-value pair is used as the storage address of each ecological resource data record.

[0189] To this end, the storage address of each ecological resource data record is determined by the above method and represented in the form of a key-value pair, which has the following technical benefits:

[0190] (1) By using the ecological resource data record ID as the key, specific data records can be retrieved and located very quickly. This key-value pair design makes data search efficient because the key (i.e., record ID) is unique and can be directly mapped to the corresponding data record.

[0191] (2) The storage address contains the first storage address and data length, which makes it easy for the system to verify the integrity of the data. By comparing the stored data length with the actual read data length, it can be detected whether the data has been truncated or damaged during storage or transmission.

[0192] (3) The data length information contained in the storage address enables the system to manage data records of different sizes more flexibly. The system can dynamically allocate storage space based on the actual length of each record, thereby improving the utilization of storage space.

[0193] (4) When the hash operation is used to convert the first storage address and data length into a hash value, this hash value can be used as a data verification mechanism. If the data is tampered with, the hash value will also change, so that data anomalies can be quickly detected.

[0194] (5) The key-value pair storage method simplifies the data maintenance process. When you need to update, delete, or query a data record, you only need to use the key (record ID) to operate without traversing the entire data set.

[0195] (6) As the amount of data grows, the key-value storage method can be easily expanded. New key-value pairs can be easily added to the existing data set without affecting other data records.

[0196] The following is an example code that describes how to determine the storage address of each ecological resource data record based on the first storage address and the length of the ecological resource data, and represent it in the form of a key-value pair. This example includes two representation methods: one is to directly use the first storage address and the data length as the value, and the other is to use the hash value obtained by hashing the two as the value.

[0197] import hashlib

[0198] class EcologicalResourceDataRecord:

[0199] def __init__(self, record_id, data_length, feature_values):

[0200] self.record_id = record_id

[0201] self.data_length = data_length

[0202] self.feature_values ​​= feature_values

[0203] # Data Logging

[0204] records = [

[0205] EcologicalResourceDataRecord(1, 256, [0.1, 0.2, 0.3]),

[0206] EcologicalResourceDataRecord(2, 128, [0.4, 0.5]), ]

[0208] # The first storage address (these addresses are usually assigned by the database or file system)

[0209] first_addresses = {

[0210] 1: 0x1000,# record the first storage address of ID 1

[0211] 2: 0x1200,# The first storage address of record ID 2

[0212] }

[0213] def create_storage_address_key_value(record, first_addresses):

[0214] # Get the record ID and the corresponding first storage address

[0215] record_id = record.record_id

[0216] first_address = first_addresses[record_id]

[0217] # Method 1: Directly use the first storage address and data length as the value

[0218] kv_pair1 = (record_id, (first_address, record.data_length))

[0219] # Method 2: Using a hash as a value

[0220] hasher = hashlib.sha256()

[0221] hasher.update(f"{first_address}:{record.data_length}".encode('utf-8'))

[0222] hash_value = hasher.hexdigest()

[0223] kv_pair2 = (record_id, hash_value)

[0224] return kv_pair1, kv_pair2

[0225] # Generate key-value pairs for each record

[0226] for record in records:

[0227] kv_pair1, kv_pair2 = create_storage_address_key_value(record, first_addresses)

[0228] print(f"Record ID: {record.record_id}")

[0229] print(f"Key-Value Pair (Method 1): {kv_pair1}")

[0230] print(f"Key-Value Pair (Method 2): {kv_pair2}")

[0231] print()

[0232] In this example, the create_storage_address_key_value function receives an EcologicalResourceDataRecord object and a dictionary containing the first storage address. The function first gets the first storage address from the dictionary based on the record ID, and then creates a key-value pair using two methods: the first method directly uses the first storage address and the data length as the tuple value, and the second method uses the hash value obtained by hashing the first storage address and the data length as the value. Finally, the function returns the two key-value pairs.

[0233] S103, generating an ecological resource data index tree and establishing a storage link table according to the storage addresses and timeliness metrics of all ecological resource data records;

[0234] In this embodiment, in step S103, generating an ecological resource data index tree and establishing a storage link table according to the storage addresses and timeliness metrics of all ecological resource data records includes:

[0235] According to the storage address of the ecological resource data record, a node in the ecological resource data index tree is generated, and the ecological resource data record and the corresponding timeliness measurement value are inserted into the storage link table in the form of relational ecological resource data.

[0236] In this embodiment, the structure of the ecological resource data index tree is not limited to uniqueness, for example, it can be a binary tree of any structure.

[0237] In this embodiment, in order to quickly generate nodes in the ecological resource data index tree, pointers are used to index storage addresses. Therefore, when generating nodes, based on the cooperation of pointers, the storage address can be directly used as a node and directly inserted into the ecological resource data index tree.

[0238] In this embodiment, the above insertion may be implemented based on, for example, a SQL statement.

[0239] In this embodiment, the technical operation of generating an ecological resource data index tree and establishing a storage link table according to the storage addresses and timeliness metrics of all ecological resource data records has the following technical benefits:

[0240] (1) The generation of an ecological resource data index tree provides an efficient data structure for data retrieval. The index tree can quickly locate specific data records, thereby reducing retrieval time and improving query efficiency.

[0241] (2) The structure of the index tree makes data more ordered in physical storage. This orderliness helps improve the locality of data access and further optimizes storage and reading performance.

[0242] (3) By inserting ecological resource data records into the storage link table together with the corresponding timeliness measurement values, the system can easily track and manage the timeliness of the data. This is especially important in scenarios where outdated data needs to be updated or deleted regularly.

[0243] (4) The storage link table stores information in the form of relational ecological resource data, which means that the powerful functions of the relational database management system can be used to perform data addition, deletion, modification and query operations, thereby simplifying the complexity of data maintenance.

[0244] (5) As the amount of data grows, the index tree and storage link table can be expanded accordingly to accommodate more data records. At the same time, this structure is also easy to customize and optimize according to actual needs.

[0245] (6) By combining the index tree and the storage link table, it is easier to maintain the consistency and integrity of the data. Any modification to the data needs to be updated synchronously in the index tree and the storage link table to ensure the accuracy of the data.

[0246] The following is an exemplary code that implements how to generate an ecological resource data index tree based on the storage address of the ecological resource data record, and insert the data record and the corresponding timeliness measurement value into the storage link table in the form of relational data:

[0247] import os

[0248] from collections import defaultdict

[0249] from datetime import datetime

[0250] import sqlite3

[0251] # Ecological resource data record

[0252] records = [

[0253] {"record_id": 1, "storage_address": "0x1000", "timestamp": "2023-04-01 12:00:00", "value": "some_data_1"},

[0254] {"record_id": 2, "storage_address": "0x1200", "timestamp": "2023-04-02 13:00:00", "value": "some_data_2"}, ]

[0256] # Create a SQLite database connection to store the link table

[0257] conn = sqlite3.connect('storage_link_table.db')

[0258] cursor = conn.cursor()

[0259] # Create a storage link table

[0260] cursor.execute('''CREATE TABLE IF NOT EXISTS storage_link (

[0261] record_id INTEGER PRIMARY KEY,

[0262] storage_address TEXT NOT NULL,

[0263] timestamp TEXT NOT NULL,

[0264] value TEXT NOT NULL

[0265] )''')

[0266] # Generate index tree (data structure such as B-tree, etc.)

[0267] index_tree = defaultdict(list)

[0268] #Insert data into the storage link table and build the index tree

[0269] for record in records:

[0270] record_id = record['record_id']

[0271] storage_address = record['storage_address']

[0272] timestamp = record['timestamp']

[0273] value = record['value']

[0274] # Insert data into the storage link table

[0275] cursor.execute("INSERT INTO storage_link (record_id, storage_address,timestamp, value) VALUES (?, ?, ?, ?)",

[0276] (record_id, storage_address, timestamp, value))

[0277] conn.commit()

[0278] # Add the record to the index tree (using the storage address as the key)

[0279] index_tree[storage_address].append(record_id)

[0280] # Print the index tree

[0281] print("Index Tree:")

[0282] for address, ids in index_tree.items():

[0283] print(f"Address {address}: Record IDs {ids}")

[0284] # Close the database connection

[0285] conn.close()

[0286] In this example, Python's sqlite3 library is used to operate the SQLite database to simulate the storage link table. A table named storage_link is created, which contains record_id, storage_address, timestamp, and value fields. Then, the simulated ecological resource data records are traversed and inserted into the storage_link table. At the same time, a defaultdict is used to simulate the index tree, where the key is the storage address and the value is the list of record IDs associated with the address.

[0287] Optionally, in this embodiment, generating a node in the ecological resource data index tree according to the storage address of the ecological resource data record includes:

[0288] Perform inverted index processing on the storage addresses of multiple ecological resource data records to obtain a static address index table;

[0289] Based on the static address index table, nodes in the ecological resource data index tree are generated.

[0290] Optionally, in this embodiment, the nodes in the ecological resource data index tree are generated by the following steps: first, the storage addresses of multiple ecological resource data records are processed by inverted indexing to obtain a static address index table; then, based on the static address index table, the nodes in the ecological resource data index tree are generated, which has the following technical advantages:

[0291] (1) Through inverted index processing, the system can quickly locate ecological resource data records stored at specific addresses. This indexing method avoids full table scanning, thereby significantly reducing query time and improving data retrieval efficiency.

[0292] (2) The static address index table provides a compact and orderly storage structure for ecological resource data. This structure not only reduces the waste of storage space, but also makes data access and updating more efficient.

[0293] (3) Generate index tree nodes based on the static address index table, which simplifies the index construction and management process. This method makes the system implementation and maintenance easier and reduces the overall complexity of the system.

[0294] (4) The static address index table can conveniently support the addition, deletion and modification of data. When the ecological resource data changes, the system can quickly update the index table to maintain the accuracy and timeliness of the index.

[0295] (5) As the ecological resource data continues to grow, the static address index table can be easily expanded to accommodate more data records. This scalability ensures that the system can maintain efficient performance when processing large-scale data.

[0296] The following is an exemplary code that describes how to perform inverted index processing on the storage addresses of multiple ecological resource data records to obtain a static address index table, and generate nodes in the ecological resource data index tree based on the index table:

[0297] from collections import defaultdict

[0298] # Ecological resource data record

[0299] records = [

[0300] {"record_id": 1, "storage_address": "addr1", "data": "some data 1"},

[0301] {"record_id": 2, "storage_address": "addr2", "data": "some data 2"},

[0302] {"record_id": 3, "storage_address": "addr1", "data": "some data 3"}, ]

[0304] # Create a static address index table

[0305] static_address_index = defaultdict(list)

[0306] # Perform inverted index processing and fill the static address index table

[0307] for record in records:

[0308] static_address_index[record['storage_address']].append(record)

[0309] # Print static address index table

[0310] print("Static Address Index Table:")

[0311] for address, associated_records in static_address_index.items():

[0312] print(f"Address: {address}, Associated Records: {associated_records}")

[0313] # Based on the static address index table, generate nodes in the ecological resource data index tree

[0314] index_tree_nodes = {}

[0315] for address, associated_records in static_address_index.items():

[0316] # 'node_data' can contain child node pointers, etc.

[0317] node_data = {

[0318] 'address': address,

[0319] 'records': associated_records

[0320] }

[0321] index_tree_nodes[address] = node_data

[0322] # Print index tree nodes

[0323] print("\nIndex Tree Nodes:")

[0324] for address, node_data in index_tree_nodes.items():

[0325] print(f"Address: {address}, Node Data: {node_data}")

[0326] In this example, a defaultdict is first created as a static address index table, where the key is the storage address and the value is a list of records associated with the address. Then, the ecological resource data records are traversed and added to the static address index table according to the storage address. Next, a simplified index tree node dictionary is generated based on the static address index table. In this dictionary, each key is a storage address, and the corresponding value is a dictionary containing the address and related records (i.e., a node of the index tree). In actual applications, this node dictionary may contain more information, such as pointers to child nodes, etc., to build a more complex index tree structure.

[0327] On the basis of the above pointer, the pointer is associated with the static address index table to achieve pointer-based coordination. Along the static address index table, the storage addresses corresponding to different ecological resource data records are used as nodes of different levels of the ecological resource data index tree in reverse order. For example, the storage address is approximately at the front and close to the root node of the ecological resource data index tree, and the root node is, for example, the storage address corresponding to the ecological resource data record with the frontmost storage address.

[0328] S104, obtaining the ecological resource data record to be synchronized, and parsing it to determine the entity described by it and the corresponding meta-ecological resource data combination, so as to match it with the ecological resource data index tree, and updating the ecological resource data index tree when matching any target entity among the multiple target entities, adding the meta-ecological resource data combination in the ecological resource data record to be synchronized to the storage link table to update the storage link table;

[0329] In this embodiment, by matching with the ecological resource data index tree, it is determined whether it is an existing entity and / or the corresponding meta-ecological resource data combination. If it is an existing entity but not an existing meta-ecological resource data combination, it indicates that new ecological resource data has been generated, so the meta-ecological resource data combination of the synchronized ecological resource data record is added to the storage link table, realizing the dynamic association between the storage address and the storage link table, which facilitates the subsequent fast and accurate storage of ecological resource data records.

[0330] S105. Based on the updated ecological resource data index tree and storage link table, add the ecological resource data record to be synchronized to the ecological resource data record set.

[0331] Optionally, in this embodiment, adding the to-be-synchronized ecological resource data record to the ecological resource data record set based on the updated ecological resource data index tree and storage link table includes:

[0332] Based on the updated ecological resource data index tree, a storage address is allocated for the ecological resource data record to be synchronized, and based on the storage link table, a timeliness measurement value is assigned to the ecological resource data record to be synchronized.

[0333] In this embodiment, a time efficiency measurement value is dynamically assigned to newly generated ecological resource data records when they are stored. The time efficiency measurement value only needs to be greater than the existing time efficiency measurement value, so as to facilitate the subsequent iteration of ecological resource data storage. In addition, it also has the following technical benefits:

[0334] (1) Through the updated ecological resource data index tree, the system can quickly assign storage addresses to the ecological resource data records to be synchronized. This mechanism ensures efficient storage and rapid location of data, thereby improving the efficiency of data processing.

[0335] (2) By using the storage link table to assign timeliness metrics to the ecological resource data records to be synchronized, the timeliness of the data can be easily tracked and managed. This is particularly important for scenarios where outdated data needs to be updated or deleted regularly, and helps maintain the accuracy and validity of the data.

[0336] (3) This method provides flexibility and scalability for the data synchronization process. As the amount of data grows, the index tree and storage link table can be expanded accordingly to accommodate more data records while maintaining efficient performance.

[0337] The following also provides an exemplary implementation code, which describes how to add the ecological resource data record to be synchronized to the ecological resource data record set based on the updated ecological resource data index tree and storage link table:

[0338] import time

[0339] from collections import defaultdict

[0340] # Ecological resource data index tree (dictionary form)

[0341] index_tree = {

[0342] 'next_available_address': 'addr10' # The available address is 'addr10'

[0343] }

[0344] #Store link table (in list form)

[0345] storage_link_table = [

[0346] {'record_id': 1, 'storage_address': 'addr1', 'timestamp':1680000000}, ]

[0348] # Data records of ecological resources to be synchronized

[0349] pending_sync_records = [

[0350] {'data': 'new data 1'},

[0351] {'data': 'new data 2'}, ]

[0353] # Based on the updated ecological resource data index tree, assign storage addresses to the records to be synchronized

[0354] def allocate_address(index_tree, record):

[0355] next_addr = index_tree['next_available_address']

[0356] index_tree['next_available_address'] = increment_address(next_addr) #Update the next available address

[0357] record['storage_address'] = next_addr

[0358] return record

[0359] # Auxiliary function: increment storage address (simple example, address generation may be more complicated in actual application)

[0360] def increment_address(address):

[0361] num = int(address[-1]) + 1

[0362] return f'addr{num}'

[0363] # Assign a time efficiency metric value to the records to be synchronized based on the storage link table

[0364] def assign_timestamp(record):

[0365] record['timestamp'] = int(time.time()) # Use Unix timestamp as time measurement value

[0366] return record

[0367] # Add the records to be synchronized to the ecological resource data record collection

[0368] def sync_records(pending_sync_records, index_tree, storage_link_table):

[0369] for record in pending_sync_records:

[0370] # Allocate storage address

[0371] allocated_record = allocate_address(index_tree, record)

[0372] # Assign time measurement value

[0373] timestamped_record = assign_timestamp(allocated_record)

[0374] # Add to storage link table

[0375] storage_link_table.append(timestamped_record)

[0376] # Perform synchronous operations

[0377] sync_records(pending_sync_records, index_tree, storage_link_table)

[0378] # Print the updated storage link table to verify the result

[0379] print("Updated Storage Link Table:")

[0380] for record in storage_link_table:

[0381] print(record)

[0382] In the above example, a simplified ecological resource data index tree and a storage link table are first defined. Then, a list of ecological resource data records to be synchronized is created. Next, several auxiliary functions are defined to allocate storage addresses, assign timeliness metrics, and add records to the storage link table. Finally, the sync_records function is called to perform the synchronization operation and print the updated storage link table to verify the result.

[0383] Figure 2 A flowchart of an ecological resource data synchronization method is provided for an embodiment of the present application. Figure 2 As shown, it includes:

[0384] S201, determining a set of ecological resource data records formed when multiple target entities are stored in an ecological resource database;

[0385] The ecological resource data record set includes a plurality of ecological resource data records, each ecological resource data record includes an ecological resource data record ID, an entity ID, and a meta-ecological resource data combination, and the meta-ecological resource data combination includes a plurality of characteristic values;

[0386] S202, determining the storage address of each ecological resource data record and the timeliness measurement value of each ecological resource data record;

[0387] S203, generating an ecological resource data index tree and establishing a storage link table according to the storage addresses and timeliness measurement values ​​of all ecological resource data records;

[0388] S204: Add the to-be-synchronized ecological resource data record to the ecological resource data record set according to the ecological resource data index tree and the storage link table.

[0389] In this embodiment, S204 may include, for example:

[0390] Obtain the ecological resource data record to be synchronized, and parse it to determine the entity described by it and the corresponding meta-ecological resource data combination, so as to match it with the ecological resource data index tree, and update the ecological resource data index tree when matching any target entity among the multiple target entities, and add the meta-ecological resource data combination in the ecological resource data record to be synchronized to the storage link table to update the storage link table;

[0391] Based on the updated ecological resource data index tree and storage link table, the ecological resource data record to be synchronized is added to the ecological resource data record set.

[0392] Figure 2 In the embodiment, the exemplary description of each step can be found in the above Figure 1 .

[0393] Figure 3 This is a schematic diagram of the structure of an ecological resource data synchronization device according to an embodiment of the present application. Figure 3 As shown, it includes:

[0394] The ecological resource data acquisition unit 301 is used to determine an ecological resource data record set formed when multiple target entities are stored in the ecological resource database, wherein the ecological resource data record set includes multiple ecological resource data records, each ecological resource data record includes an ecological resource data record ID, an entity ID, and a meta-ecological resource data combination, wherein the meta-ecological resource data combination includes multiple feature values;

[0395] The ecological resource data preprocessing unit 302 is used to determine the storage address of each ecological resource data record and the timeliness measurement value of each ecological resource data record;

[0396] The timeliness measurement unit 303 is used to generate an ecological resource data index tree and establish a storage link table according to the storage addresses and timeliness measurement values ​​of all ecological resource data records;

[0397] The ecological resource data updating unit 304 is used to obtain the ecological resource data record to be synchronized, and parse it to determine the entity described by it and the corresponding meta-ecological resource data combination, so as to match it with the ecological resource data index tree, and update the ecological resource data index tree when matching any target entity among the multiple target entities, and add the meta-ecological resource data combination in the ecological resource data record to be synchronized to the storage link table to update the storage link table;

[0398] The ecological resource data synchronization unit 305 adds the ecological resource data record to be synchronized to the ecological resource data record set based on the updated ecological resource data index tree and storage link table.

[0399] For an exemplary description of each unit in the above device embodiment, please refer to the above Figure 1 Records of.

[0400] Figure 4 Schematic diagram of the structure of the electronic device of this embodiment; the electronic device may include:

[0401] One or more processors 401;

[0402] The computer readable medium 402 may be configured to store one or more programs,

[0403] When the one or more programs are executed by the one or more processors, the one or more processors implement the methods described in the above embodiments.

[0404] Figure 5 is the hardware structure of the electronic device of this embodiment; Figure 5 As shown, the hardware structure of the electronic device may include: a processor 501, a communication interface 502, a computer readable medium 503 and a communication bus 504;

[0405] The processor 501, the communication interface 502, and the computer readable medium 503 communicate with each other via a communication bus 504;

[0406] Optionally, the communication interface 502 may be an interface of a communication module, such as an interface of a GSM module;

[0407] Among them, the processor 501 can be specifically configured to: determine an ecological resource data record set formed when multiple target entities are stored in an ecological resource database, the ecological resource data record set including multiple ecological resource data records, each ecological resource data record including an ecological resource data record ID, an entity ID, and a meta-ecological resource data combination, and the meta-ecological resource data combination includes multiple characteristic values; determine the storage address of each ecological resource data record and the timeliness measurement value of each ecological resource data record; generate an ecological resource data index tree and establish a storage link table based on the storage addresses and timeliness measurement values ​​of all ecological resource data records; obtain the ecological resource data record to be synchronized, and parse it to determine the entity described by it and the corresponding meta-ecological resource data combination to match it with the ecological resource data index tree, and update the ecological resource data index tree when matching any target entity among the multiple target entities, add the meta-ecological resource data combination in the ecological resource data record to be synchronized to the storage link table to update the storage link table; based on the updated ecological resource data index tree and storage link table, add the ecological resource data record to be synchronized to the ecological resource data record set.

[0408] The processor 501 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0409] The computer readable medium 503 can be, but is not limited to, a random access memory medium (RAM), a read-only memory medium (ROM), a programmable read-only memory medium (PROM), an erasable programmable read-only memory medium (EPROM), an electrically erasable read-only memory medium (EEPROM), etc.

[0410] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code configured to execute the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), the above functions defined in the method of the present application are executed. It should be noted that the computer-readable medium described in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access storage medium (RAM), a read-only storage medium (ROM), an erasable programmable read-only storage medium (EPROM or flash memory), an optical fiber, a portable compact disk read-only storage medium (CD-ROM), an optical storage medium, a magnetic storage medium, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include an ecological resource data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated ecological resource data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program configured to be used by or in combination with an instruction execution system, device or device. The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0411] Computer program code configured to perform the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through 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).

[0412] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of the code contains one or more executable instructions configured to implement the specified logical function. There are specific sequential relationships in the above-mentioned specific embodiments, but these sequential relationships are only exemplary. When the specific implementation is implemented, these steps may be less, more, or the execution order may be adjusted. That is, in some implementations as replacements, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0413] As another aspect, the present application further provides a computer-readable medium having a computer program stored thereon, which implements the method described in the above embodiment when the program is executed by a processor.

[0414] As another aspect, the present application further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the device, the device: obtains multiple groups of ecological resource data records describing the same ecological resource data entity, any group of ecological resource data records includes at least one meta-ecological resource data set, and the meta-ecological resource data set includes several meta-ecological resource data; for any group of ecological resource data records in the multiple groups of ecological resource data records, key-values ​​them to map them into key-value pairs, the key of the key-value pair matches the unique ID of the any group of ecological resource data records, and the value of the key-value pair matches the meta-ecological resource data set of the any group of ecological resource data records; performs hash operation on the key-value pair to obtain the corresponding hash value, so as to determine the ecological resource data storage task of storing the any group of ecological resource data records in the target ecological resource database based on the hash value; stores the any group of ecological resource data records in the target ecological resource database based on the ecological resource data task, thereby realizing dynamic and semi-structured ecological resource data storage.

[0415] The expressions "first", "second", "the first" or "the second" used in various embodiments of the present disclosure may modify various components regardless of order and / or importance, but these expressions do not limit the corresponding components. The above expressions are only configured for the purpose of distinguishing an element from other elements. For example, a first user device and a second user device represent different user devices, although both are user devices. For example, a first element may be referred to as a second element, and similarly, a second element may be referred to as a first element without departing from the scope of the present disclosure.

[0416] When one element (e.g., a first element) is referred to as being "(operably or communicatively) coupled" to another element (e.g., a second element) or "(operably or communicatively) coupled to" another element (e.g., a second element) or "connected to" another element (e.g., a second element), it is understood that the one element is directly connected to the other element or the one element is indirectly connected to the other element via yet another element (e.g., a third element). Conversely, it is understood that when an element (e.g., a first element) is referred to as being "directly connected" or "directly coupled" to another element (the second element), no element (e.g., a third element) is interposed therebetween.

[0417] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.< / float> < / logicrule> < / logicrule> < / ecologicalresourcerecord> < / float> < / ecologicalresourcerecord> < / float> < / float>

Claims

1. A method for synchronizing ecological resource data, characterized in that: include: Determine an ecological resource data record set formed when multiple target entities are stored in an ecological resource database, wherein the ecological resource data record set includes multiple ecological resource data records, each ecological resource data record includes an ecological resource data record ID, an entity ID, and a meta-ecological resource data combination, and the meta-ecological resource data combination includes multiple feature values; Determining the storage address of each ecological resource data record and the timeliness measurement value of each ecological resource data record; Generate an ecological resource data index tree and establish a storage link table based on the storage addresses and timeliness metrics of all ecological resource data records; Obtain the ecological resource data record to be synchronized, and parse it to determine the entity described by it and the corresponding meta-ecological resource data combination, so as to match it with the ecological resource data index tree, and update the ecological resource data index tree when matching any target entity among the multiple target entities, and add the meta-ecological resource data combination in the ecological resource data record to be synchronized to the storage link table to update the storage link table; Based on the updated ecological resource data index tree and storage link table, adding the ecological resource data record to be synchronized to the ecological resource data record set; Wherein, determining the timeliness measurement value of each ecological resource data record includes: Mapping each ecological resource data record included in the ecological resource data record set into an ecological resource data pattern, wherein the ecological resource data pattern includes a tuple segment and an attribute feature segment, wherein the tuple segment includes the ecological resource data record ID and the entity ID, and the attribute feature segment includes the multiple feature values; Inputting the ecological resource data model into a pre-constructed time-effectiveness measurement logic formula to determine the time-effectiveness measurement value of the ecological resource data record; The timeliness measurement logic formula includes antecedent logic rules, consequent logic rules, and timeliness logic relationship expressions. The inputting of the ecological resource data model into the pre-constructed timeliness measurement logic formula to determine the timeliness measurement value of the ecological resource data record includes: Fill different tuple segments with the same entity ID into the antecedent logic rule, and fill corresponding attribute feature segments into the consequent logic rule to judge the degree of matching with the temporal logic relationship expression, so as to determine the temporal measurement value of the corresponding ecological resource data record; The antecedent logic rule is used to define whether it is the same entity, and the consequent logic defines the relationship between the characteristic values ​​of the ecological resource data records representing the same entity. At the same time, the relationship between the characteristic values ​​of the ecological resource data records representing the same entity is characterized and defined by the temporal logic relationship expression; The method of generating an ecological resource data index tree and establishing a storage link table according to the storage addresses and timeliness measurement values ​​of all ecological resource data records includes: According to the storage address of the ecological resource data record, a node in the ecological resource data index tree is generated, and the ecological resource data record and the corresponding timeliness measurement value are inserted into the storage link table in the form of relational ecological resource data.

2. The method according to claim 1, characterized in that Determining the storage address of each ecological resource data record includes: Parsing the table structure for managing the storage of each ecological resource data record to determine the size of the ecological resource data block and the ecological resource data storage index table used when storing the ecological resource data; Determine the first storage address of each ecological resource data record according to the size of the ecological resource data block and the ecological resource data storage index table, wherein the first storage address is the storage address of the first characteristic value; The storage address of each ecological resource data record is determined according to the first storage address and the ecological resource data length of each ecological resource data record.

3. The method according to claim 2, characterized in that The step of determining the storage address of each ecological resource data record according to the first storage address and the ecological resource data length of each ecological resource data record includes: The ecological resource data record ID is used as the key, and the first storage address and the ecological resource data length of each ecological resource data record are used as values ​​to form a key-value pair, and the key-value pair is used as the storage address of each ecological resource data record; or, the ecological resource data record ID is used as the key, and the first storage address and the ecological resource data length of each ecological resource data record are hashed to obtain the corresponding hash value, and the hash value is used as the value to form a key-value pair, and the key-value pair is used as the storage address of each ecological resource data record.

4. The method according to claim 1, characterized in that: The step of generating a node in an ecological resource data index tree according to the storage address of the ecological resource data record comprises: Perform inverted index processing on the storage addresses of multiple ecological resource data records to obtain a static address index table; Based on the static address index table, nodes in the ecological resource data index tree are generated.

5. The method according to any one of claims 1 to 4, characterized in that: The adding the to-be-synchronized ecological resource data record to the ecological resource data record set based on the updated ecological resource data index tree and storage link table includes: Based on the updated ecological resource data index tree, a storage address is allocated for the ecological resource data record to be synchronized, and based on the storage link table, a timeliness measurement value is assigned to the ecological resource data record to be synchronized.

6. An ecological resource data synchronization device, characterized in that: include: An ecological resource data acquisition unit, used to determine an ecological resource data record set formed when multiple target entities are stored in an ecological resource database, wherein the ecological resource data record set includes multiple ecological resource data records, each ecological resource data record includes an ecological resource data record ID, an entity ID, and a meta-ecological resource data combination, wherein the meta-ecological resource data combination includes multiple feature values; An ecological resource data preprocessing unit, used to determine the storage address of each ecological resource data record and the timeliness measurement value of each ecological resource data record; A time efficiency measurement unit is used to generate an ecological resource data index tree and establish a storage link table according to the storage addresses and time efficiency measurement values ​​of all ecological resource data records; An ecological resource data updating unit, used for obtaining the ecological resource data record to be synchronized, parsing it to determine the entity described by it and the corresponding meta-ecological resource data combination, so as to match it with the ecological resource data index tree, and updating the ecological resource data index tree when matching any target entity among the multiple target entities, adding the meta-ecological resource data combination in the ecological resource data record to be synchronized to the storage link table to update the storage link table; An ecological resource data synchronization unit, based on the updated ecological resource data index tree and storage link table, adds the ecological resource data record to be synchronized to the ecological resource data record set; Wherein, determining the timeliness measurement value of each ecological resource data record includes: Mapping each ecological resource data record included in the ecological resource data record set into an ecological resource data pattern, wherein the ecological resource data pattern includes a tuple segment and an attribute feature segment, wherein the tuple segment includes the ecological resource data record ID and the entity ID, and the attribute feature segment includes the multiple feature values; Inputting the ecological resource data model into a pre-constructed time-effectiveness measurement logic formula to determine the time-effectiveness measurement value of the ecological resource data record; The timeliness measurement logic formula includes antecedent logic rules, consequent logic rules, and timeliness logic relationship expressions. The inputting of the ecological resource data model into the pre-constructed timeliness measurement logic formula to determine the timeliness measurement value of the ecological resource data record includes: Fill different tuple segments with the same entity ID into the antecedent logic rule, and fill corresponding attribute feature segments into the consequent logic rule to judge the degree of matching with the temporal logic relationship expression, so as to determine the temporal measurement value of the corresponding ecological resource data record; The antecedent logic rule is used to define whether it is the same entity, and the consequent logic defines the relationship between the characteristic values ​​of the ecological resource data records representing the same entity. At the same time, the relationship between the characteristic values ​​of the ecological resource data records representing the same entity is characterized and defined by the temporal logic relationship expression; The method of generating an ecological resource data index tree and establishing a storage link table according to the storage addresses and timeliness measurement values ​​of all ecological resource data records includes: According to the storage address of the ecological resource data record, a node in the ecological resource data index tree is generated, and the ecological resource data record and the corresponding timeliness measurement value are inserted into the storage link table in the form of relational ecological resource data.

7. An electronic device, characterized in that: include: one or more processors; A computer readable medium configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Internal memory database system and method and device for implementing internal memory data base

    CN101315628A

  • Reliable index update system and method under mass data

    CN104899249A

  • System, method and device for updating index

    CN107315825A

  • Static resource loading method and device, equipment and storage medium

    CN113568752A

  • Index-based on-chain data query method and device

    CN113901131A