Sea and island intelligent adaptation analysis method and system based on micro-service fusion of three-dimensional sea area basic data
Patent Information
- Application Number
- CN202611066576.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-17
- Publication Date
- 2026-08-18
AI Technical Summary
当多个微服务实例并发返回分析结果时,现有机制通常采用数值聚合方式,缺少针对结果时效性和内容一致性的融合策略,既难以衡量不同数据结果源时间戳所反映的时效差异,也难以通过语义特征分布识别并降低异常结果的影响,容易导致数值型评估指标失真,进而影响用海用岛空间准入与规划决策中适配分析结论的可靠性
[0013] This invention constructs a causal dependency directed acyclic graph (DAG) of the microservice call chain by analyzing the parameter dependencies of the analysis factors, thereby clarifying the call order and dependencies between microservices. It obtains upstream microservice output data through a sidecar proxy and extracts core content feature vectors. These vectors are then fused with normalized spatial location codes and analysis time features to generate a spatiotemporal context routing probe vector. Based on the cosine similarity between this probe vector and the spatiotemporal service profile vectors of each microservice instance, one or more microservice instances with high matching degrees are selected for request distribution. During the data aggregation phase, time weights are calculated based on the difference between the source timestamps of each data result and the target analysis time, and content weights are calculated based on the Euclidean distance between the content feature vector and the geometric center vector. The time weights and content weights are then fused to form a comprehensive weight, which is then weighted and summed for the corresponding numerical evaluation indicators. This achieves effective fusion of multi-source microservice return results, helping to reduce the impact of outdated data and abnormal deviations on the final conclusions, and improving the objectivity and reliability of the sea-island adaptation analysis conclusions.
Smart Images

Figure CN122594822A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of analysis, and in particular relates to a method and system for intelligent adaptation analysis of sea and island use based on microservice fusion of three-dimensional marine basic data. Background Technology
[0002] The adaptation analysis of sea and island use requires the integration of heterogeneous data from multiple sources, including marine hydrology, ecological environment, and socio-economic factors, and involves multiple analytical factors and their parameter dependencies. Traditional monolithic architectures are prone to problems such as insufficient scalability, rigid resource allocation, and high system coupling when handling high-dimensional, large-scale spatiotemporal computing tasks. By introducing microservice architecture and service mesh technology into marine spatial information systems, different analytical factors can be decoupled into independent microservices, and inter-service communication can be taken over by sidecar proxies, achieving the separation of business logic and network governance, thereby improving the distributed processing capabilities and system resilience of geospatial analysis tasks.
[0003] However, in the scenario of sea and island use adaptation analysis, existing service mesh routing and distribution mostly rely on round-robin, random, or simple load balancing strategies, lacking the ability to perceive business context. When processing microservice call chains with causal dependencies, it is difficult to combine the target sea area spatial location encoding, analysis time, and core semantic features of upstream output data for accurate routing. This may result in analysis tasks being assigned to microservice instances with low spatiotemporal service profile matching, leading to wasted computing resources and request response delays. In addition, marine spatial data has obvious spatiotemporal variation characteristics. When multiple microservice instances concurrently return analysis results, existing mechanisms usually adopt numerical aggregation methods, lacking fusion strategies for result timeliness and content consistency. It is difficult to measure the timeliness differences reflected by the timestamps of different data result sources, and it is also difficult to identify and reduce the impact of abnormal results through semantic feature distribution. This easily leads to distortion of numerical evaluation indicators, thereby affecting the reliability of adaptation analysis conclusions in sea and island use spatial access and planning decisions. Summary of the Invention
[0004] To improve the objectivity and accuracy of the analysis conclusions on the adaptation of sea and island use, this invention provides a method and system for intelligent adaptation analysis of sea and island use based on microservice-integrated three-dimensional marine basic data.
[0005] According to one aspect of the present invention, a method for intelligent adaptation analysis of sea and island use based on microservice fusion of three-dimensional marine basic data is provided, the method comprising:
[0006] The system analyzes the marine and island usage factor library, constructs a causal dependency directed acyclic graph of the microservice call chain based on the parameter dependencies of the analysis factors, receives adaptation analysis requests, obtains the target sea area spatial location code, analysis time and analysis indicators, intercepts the output data of upstream microservices through a sidecar proxy, cleans it and inputs it into a pre-set semantic representation model to extract the core content feature vector of the output data.
[0007] Based on the directed acyclic graph, the next level of candidate microservice clusters is determined; after normalizing the spatial location encoding and analysis time, it is concatenated with the core content feature vector to generate a spatiotemporal context routing probe vector; the cosine similarity between the probe vector and the preset spatiotemporal service profile vector of each instance in the candidate microservice cluster is calculated, and one or more instances whose similarity meets the preset threshold are selected for parallel request distribution.
[0008] The system receives data results returned by one or more microservice instances, extracts content feature vectors for each data result using the semantic representation model, calculates time weights using an exponential decay function based on the absolute value of the difference between the source timestamp and the current time for each data result, calculates the geometric center vector of all content feature vectors, obtains the Euclidean distance between each content feature vector and the geometric center vector, takes the reciprocal of the Euclidean distance and normalizes it to obtain the content weight, extracts numerical evaluation indicators from the data results, multiplies the time weights and content weights and normalizes them to obtain a comprehensive weight, and performs a weighted summation of the numerical evaluation indicators based on the comprehensive weight to generate adaptation analysis conclusions.
[0009] According to another aspect of the present invention, a smart adaptation and analysis system for sea and island use based on microservice fusion of three-dimensional marine basic data is provided, the system comprising the following modules:
[0010] The extraction module is used to parse the sea and island use analysis factor library, construct a causal dependency directed acyclic graph of microservice call chain based on the parameter dependency relationship of the analysis factors; receive adaptation analysis requests, obtain the target sea area spatial location code, analysis time and analysis indicators; intercept the output data of upstream microservices through the side vehicle proxy, clean it and input it into the pre-set semantic representation model to extract the core content feature vector of the output data;
[0011] The selection module is used to determine the next-level candidate microservice clusters based on the directed acyclic graph; after normalizing the spatial location encoding and analysis time, it is concatenated with the core content feature vector to generate a spatiotemporal context routing probe vector; the cosine similarity between the probe vector and the preset spatiotemporal service profile vector of each instance in the candidate microservice cluster is calculated, and one or more instances whose similarity meets the preset threshold are selected for parallel request distribution.
[0012] The analysis module receives data results returned by one or more microservice instances, extracts content feature vectors for each data result using the semantic representation model, calculates time weights using an exponential decay function based on the absolute value of the difference between the source timestamp and the current time of each data result, calculates the geometric center vector of all content feature vectors, obtains the Euclidean distance between each content feature vector and the geometric center vector, takes the reciprocal of the Euclidean distance and normalizes it to obtain the content weight, extracts numerical evaluation indicators from the data results, multiplies the time weights and content weights and normalizes them to obtain a comprehensive weight, and performs a weighted summation of the numerical evaluation indicators based on the comprehensive weight to generate adaptation analysis conclusions.
[0013] This invention constructs a causal dependency directed acyclic graph (DAG) of the microservice call chain by analyzing the parameter dependencies of the analysis factors, thereby clarifying the call order and dependencies between microservices. It obtains upstream microservice output data through a sidecar proxy and extracts core content feature vectors. These vectors are then fused with normalized spatial location codes and analysis time features to generate a spatiotemporal context routing probe vector. Based on the cosine similarity between this probe vector and the spatiotemporal service profile vectors of each microservice instance, one or more microservice instances with high matching degrees are selected for request distribution. During the data aggregation phase, time weights are calculated based on the difference between the source timestamps of each data result and the target analysis time, and content weights are calculated based on the Euclidean distance between the content feature vector and the geometric center vector. The time weights and content weights are then fused to form a comprehensive weight, which is then weighted and summed for the corresponding numerical evaluation indicators. This achieves effective fusion of multi-source microservice return results, helping to reduce the impact of outdated data and abnormal deviations on the final conclusions, and improving the objectivity and reliability of the sea-island adaptation analysis conclusions. Attached Figure Description
[0014] Figure 1 A flowchart of a microservice-based intelligent adaptation analysis method for sea and island usage;
[0015] Figure 2 Filter node distribution map using cosine similarity of spatiotemporal service vectors;
[0016] Figure 3 The figure shows the experimental results comparing the performance indicators of different technical solutions. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0018] One or more embodiments of the present invention provide a method for intelligent adaptation and analysis of sea and island use based on microservice fusion of three-dimensional marine basic data, such as... Figure 1 As shown, the method includes:
[0019] S1 parses the sea and island use analysis factor library, and constructs a causal dependency directed acyclic graph of microservice call chain based on the parameter dependency relationship of the analysis factors; receives adaptation analysis requests, obtains the target sea area spatial location code, analysis time and analysis indicators; intercepts the output data of upstream microservices through sidecar proxy, cleans it and inputs it into a pre-set semantic representation model to extract the core content feature vector of the output data.
[0020] The system reads the sea and island usage analysis factor relationship data table stored in a MySQL relational database to obtain the source analysis factor field and the target analysis factor field. Simultaneously, it reads the mapping data table between analysis factors and microservice interfaces. This mapping data table includes at least the analysis factor identifier, the microservice identifier that produces the analysis factor, the microservice identifier that consumes the analysis factor, the input parameter name, and the output field name. Based on this mapping data table, the source analysis factor is mapped to the upstream microservice node that produces the factor, and the target analysis factor is mapped to the downstream microservice node that consumes related factors or produces the target factor. The analysis factor dependencies are written into the dependency attributes of the corresponding directed edges. This constructs a call relationship graph with microservices or microservice clusters as nodes. A directed graph object is instantiated using the networkx library, and directed edges are added from upstream microservice nodes to downstream microservice nodes to obtain an initial call relationship graph. A topology check is then performed on this initial call relationship graph to determine if circular dependencies exist.
[0021] The "Marine and Island Utilization Analysis Factor Library" refers to a structured set of various professional indicators, constraints, and characteristic parameters used for quantitative analysis and decision support in the process of marine and island resource development, spatial planning, and ecological protection assessment. For example, when assessing whether a sea area is suitable for "offshore wind farm site selection," this factor library will include basic analysis factors such as "seabed topography slope," "average annual wind energy density," "overlap rate of marine ecological red lines," and "safe avoidance distance of main shipping channels." In the business dependency logic, source factors such as "seabed topography slope" and "average annual wind energy density" will be calculated and output by upstream microservices and input as parameters to downstream microservices to calculate the target analysis factor of "spatial suitability index for wind power construction."
[0022] The FastAPI network framework exposes a REST interface to receive JSON-formatted adaptation analysis requests from the front end. This is parsed to obtain a hexadecimal spatial location code string generated based on the H3 hierarchical grid algorithm, an ISO8601 standard analysis time string, and a list of adaptation analysis index strings. The H3 hierarchical grid code serves as a unified entry code for the spatial location of the target sea area. When latitude and longitude values are needed, the H3 encoding and decoding process yields the latitude and longitude of the grid center point or a set of boundary coordinates. When spatial embedding features are required, the H3 code is used as a spatial discrete identifier input to the spatial feature embedding layer. If the current request corresponds to the first-level node of the call chain and there is no upstream microservice output data yet, the spatial location code, analysis time, adaptation analysis index, and request payload fields are concatenated and formatted into structured text, which is then used as input to the semantic representation model to generate the first-level core content feature vector.
[0023] Envoy is used as a sidecar proxy in a Kubernetes container orchestration cluster, and the HTTP response payload returned by upstream microservices is intercepted through a WebAssembly-based interception filter. The response payload is cleaned by removing HTML tags, special escape characters, and invalid fields to obtain plain text or structured text data. The cleaned text is then input into a pre-trained BERT semantic model to obtain the last hidden state. After excluding padding words based on attention masks, average pooling is performed along the effective sequence length dimension to generate content feature vectors.
[0024] In some embodiments, the parsing uses a marine island analysis factor library to construct a causal dependency directed acyclic graph of the microservice call chain based on the parameter dependencies of the analysis factors, including:
[0025] Extract the pre-dependent conditions and expected output indicators of the analytical factors;
[0026] Scan the global microservice registry to obtain the input parameter settings and output data structures of each microservice interface;
[0027] Type matching is performed between the output data structure of microservices and the pre-dependent conditions of analysis factors to construct directed edges between nodes;
[0028] Perform topological sorting on the generated initial call graph, and detect and record loops;
[0029] For dependency chains with loops, non-core feedback links are disconnected based on preset business priority rules to eliminate loops and generate a causal dependency directed acyclic graph.
[0030] This process analyzes factors related to sea and island use, such as water quality compliance rate and ecological red line overlap, extracting their prerequisite dependencies and expected output indicators. It calls the API of the global microservice registry center to batch retrieve the interface documents of each microservice and extracts the input parameter settings and output data structures. Using a combination of data type validation and fuzzy semantic matching, it compares the microservice output data with the prerequisite dependencies of subsequent services. When the similarity reaches a preset threshold and the output of microservice A covers the input requirements of microservice B, a directed edge is generated from microservice A to microservice B. If the factor relationship table records the dependency relationship between the source analysis factor and the target analysis factor, it converts the factor dependency into a microservice call dependency based on the analysis factor-microservice interface mapping table. The source analysis factor, target analysis factor, and field mapping relationship are then written into the corresponding directed edge attributes, completing the initial call relationship graph construction.
[0031] The initial call relationship graph is topologically sorted, and circular call loops are detected based on the changes in the in-degree of each node. If a loop exists, the business priority dictionary is read to identify low-priority non-core feedback links, and before disconnecting, it is determined whether the link carries the necessary input parameters for downstream microservices. For links that only represent monitoring feedback, historical correction, or non-real-time scheduling feedback, they are directly disconnected. For links that carry necessary input parameters, they are converted into delayed feedback edges or cache read edges, and the corresponding input fields are completed using a parameter cache library, the most recent valid output snapshot, or preset default parameters. Through the above loop disconnection or feedback edge transformation processing, real-time scheduling loops are eliminated, a causal dependency directed acyclic graph for scheduling execution is generated, and it is ensured that downstream microservices can still obtain the pre-entry data that satisfies the interface constraints.
[0032] In some embodiments, the step of intercepting the output data of the upstream microservice through a sidecar proxy, cleaning it, inputting it into a pre-set semantic representation model, and extracting the core content feature vector of the output data includes:
[0033] By intercepting microservice response messages through a sidecar proxy, removing network protocol headers and null fields, and extracting the numerical values and text sequences of the payload;
[0034] The extracted sequences are transformed into a unified structured text;
[0035] A pre-trained deep neural network model is used as the semantic representation model to transform the structured text into a sequence of word embedding vectors. Contextual features are extracted through a multi-layer self-attention mechanism, and the hidden states of the last layer are subjected to average pooling to generate core content feature vectors.
[0036] The application-layer sidecar proxy component intercepts successful response messages returned by microservice instances in real time by configuring network filters. The proxy module performs deep packet inspection, using regular expressions to strip application-layer protocol header information from the messages and filtering out invalid data nodes with empty values. The extracted payload is transformed and formatted into key-value pair style strings by a template engine, resulting in a unified structured text sequence.
[0037] The generated structured text is then input into a fine-tuned pre-trained deep neural network model. This deep neural network model employs a multi-layer transformer structure, taking the generated structured text sequence as input and outputting core content feature vectors representing deep semantics. The model's network structure includes a feature embedding layer and stacked multi-layer self-attention encoders. The model's built-in word segmenter divides the text into a sequence of words with a maximum length of 512, and the feature embedding layer transforms this into a sequence of word embedding vectors with a fixed dimension of 768.
[0038] The sequence is fed into a multi-layer self-attention encoder containing 12 layers and 12 attention heads. Attention weights are calculated for each self-attention sublayer. After multiple rounds of matrix dot product operations to extract contextually relevant features, a 512×768 hidden state feature matrix is extracted from the output of the 12th layer. Average pooling is then performed along the sequence length dimension to compress and fuse all features into a single 768-dimensional one-dimensional floating-point array, which serves as the core content feature vector for the output. In the same implementation, the upstream output data and the data returned by multiple subsequent microservice instances all employ the same average pooling method to extract content feature vectors, ensuring consistency in feature distribution during similarity calculations with the spatiotemporal service profile and subsequent content weight calculations.
[0039] S2, Based on the directed acyclic graph, determine the next level of candidate microservice clusters; after normalizing the spatial location encoding and analysis time, concatenate it with the core content feature vector to generate a spatiotemporal context routing probe vector; calculate the cosine similarity between the probe vector and the preset spatiotemporal service profile vector of each instance in the candidate microservice cluster, and select one or more instances whose similarity meets the preset threshold for parallel request distribution.
[0040] The `successors` function is called within the directed acyclic graph (DAG) object, taking the globally unique identifier of the current microservice node as input to obtain its successor node as a candidate microservice for the next level. Then, based on the current adaptation analysis metrics, the analysis factor dependencies in the edge attributes, and the input parameter constraints of downstream services, the set of downstream microservices that must be called in this task is determined from the candidate microservices. For each downstream microservice that must be called, its corresponding healthy and active instance is queried from the Nacos Service Registration and Discovery Center to obtain its IP address and communication port. When a directed edge attribute contains multiple analysis factor fields, the scheduling module reads the field mapping relationship of that edge, converting the output fields of the upstream microservice into the input parameter names required by the downstream candidate microservices, thus connecting the graph structure scheduling with the actual interface call parameters.
[0041] For spatial location features, H3 encoding is used as a spatial discrete identifier input to the spatial feature embedding layer to obtain a 64-dimensional spatial feature vector. When the target H3 encoding is not included in the pre-trained spatial embedding dictionary, an alternative spatial feature vector is generated using an unknown grid placeholder vector, the mean of adjacent H3 grid embeddings, a hash mapping vector, or a method based on continuous latitude and longitude feature projection. When subsequent business requires display or spatial range verification, the latitude and longitude coordinates of the grid center point or boundary coordinates can be obtained through H3 encoding and decoding, but the latitude and longitude values are not involved in the construction of the hybrid splicing vector in this embodiment. For time features, the analysis time string is parsed into a timestamp and split into four time dimensions: month, day, hour, and day of the week. Normalization is performed by combining the preset historical extreme value range to obtain a 4-dimensional time feature array.
[0042] A 64-dimensional spatial feature vector, a 4-dimensional temporal feature array, and a 768-dimensional core content feature vector are concatenated along their feature dimensions to generate an 836-dimensional hybrid concatenated vector. This hybrid concatenated vector is then input into a fully connected layer for dimensionality reduction and feature alignment, outputting a 256-dimensional spatiotemporal context routing probe vector. Subsequently, the 256-dimensional spatiotemporal service profile vectors corresponding to each candidate microservice instance are read from Redis, and their cosine similarity with the routing probe vector is calculated. Instances with a similarity greater than a preset threshold of 0.75 are selected, and asynchronous HTTP requests are concurrently sent to the selected instances using asyncio and aiohttp based on an event loop to achieve parallel request distribution.
[0043] In some embodiments, the step of normalizing the spatial location encoding and analysis time, and then concatenating it with the core content feature vector to generate a spatiotemporal context routing probe vector includes:
[0044] The spatial location of the target sea area is encoded as an H3-level grid spatial discrete identifier and converted into a spatial embedding feature vector through feature embedding mapping;
[0045] Extract the timestamp of the analysis time, split it into a multi-dimensional time feature array, and perform min-max normalization processing by combining it with the preset historical extreme values;
[0046] The spatial embedding feature vector, the normalized temporal feature array, and the core content feature vector are linearly concatenated along the feature dimension to generate a concatenated vector.
[0047] The concatenated vector is input into a fully connected layer for dimensionality reduction and feature alignment, and the spatiotemporal context routing probe vector is output.
[0048] The H3-level grid-encoded string of the target sea area is obtained, and the latitude and longitude coordinates of the center point or boundary of the grid cell are obtained through the H3 decoding function. In the spatial embedding process, the H3-level grid-encoded string is used as a discrete spatial identifier input to a feature embedding layer pre-trained based on geographic block data, and it is mapped and transformed into a 64-dimensional continuous spatial embedding feature vector. Thus, the spatial embedding features originate from the same H3 spatial location code and together with subsequent temporal and content features, constitute the routing probe input.
[0049] Simultaneously, by parsing the timestamps of incoming requests, the analysis time is extracted and split into a time feature array containing four dimensions: month, day, hour, and day of the week. Combining this with the historical extreme value ranges of business requests over the past three years, a normalization formula is used to transform the values to the range of 0 to 1.
[0050] The generated 64-dimensional spatial feature vector, the four-dimensional normalized temporal feature array, and the 768-dimensional core content feature vector obtained in the previous stage are linearly concatenated along the feature axis using tensor operation functions, generating a hybrid concatenated vector of length 836. This concatenated vector is then input into a fully connected layer containing batch normalization and linear rectified activation functions. The weight matrix of this layer is set to 836×256. High-dimensional features are compressed and reduced in dimensionality through linear projection calculation, and multimodal feature alignment is performed, outputting a continuous 256-dimensional spatiotemporal context routing probe vector. The spatiotemporal service profile vector subsequently used in cosine similarity calculation is also set to 256 dimensions to ensure dimensionality consistency between the two.
[0051] In some embodiments, calculating the cosine similarity between the probe vector and the preset spatiotemporal service profile vectors of each instance in the candidate microservice cluster, and selecting one or more instances whose similarity meets a preset threshold for parallel request distribution, includes:
[0052] Obtain the updated spatiotemporal service profile vectors of each instance in the candidate microservice cluster, where the spatiotemporal service profile vectors represent the historical spatiotemporal distribution preferences of the instance's processing.
[0053] Calculate the inner product of the spatiotemporal context routing probe vector and the spatiotemporal service profile vector of each instance, and calculate the vector norm of both respectively;
[0054] Divide the inner product by the product of the norms of the two vectors to obtain the cosine similarity;
[0055] The top N microservice instances in the candidate microservice cluster whose cosine similarity meets the preset threshold are selected as the target node cluster, and requests are distributed by establishing connections or multiple concurrent connections.
[0056] The control plane program periodically retrieves access logs from the monitoring system for each instance within the current-level candidate microservice cluster. Based on successfully responded request records from each instance over a past period, and following the same feature construction method as the spatiotemporal context routing probe vector, it extracts H3 spatial embedding features, normalized temporal features, and request or response content features corresponding to historical requests. These are then input into a fully connected projection layer that is identical to or shares parameters with the routing probe, resulting in a 256-dimensional projection vector corresponding to the historical request. A moving average is applied to this historical projection vector to generate a 256-dimensional spatiotemporal service profile vector, representing its business processing preferences, and this vector is cached in high-speed memory. The dimension of this spatiotemporal service profile vector is consistent with the spatiotemporal context routing probe vector output by the fully connected layer. The spatiotemporal service profile vector is generated from historical requests using the same spatial, temporal, and content feature construction method as the spatiotemporal context routing probe vector, and mapped to a 256-dimensional feature space through the same or shared parameter projection layer to ensure that the two can be compared using cosine similarity.
[0057] When a new analysis request arrives, a 256-dimensional spatiotemporal context routing probe vector is extracted from the vector computation engine and a dot product operation is performed with the spatiotemporal service profile vector of each instance. That is, the inner product scalar is obtained by multiplying element by element in the 256 corresponding dimensions and summing them. The L2 norm of the two feature vectors is calculated using the square and square root formulas respectively.
[0058] Divide the calculated inner product by the product of the norms of the two vectors to output a cosine similarity value within the range of -1 to 1. Iterate through all candidate instances in the cluster and sort them in descending order of similarity scores using a quicksort algorithm. With a preset similarity matching threshold of 0.75, select the top-ranking microservice instances with a cosine similarity greater than or equal to 0.75 from the sorted results and set them as the target node cluster. If the selection results are empty, select at least one instance with the highest cosine similarity ranking from healthy and active instances as a fallback target node; or degenerate to a round-robin, least-connections, or random load balancing method to determine the target node cluster according to the system's preset strategy to avoid requests failing to be distributed due to an excessively high threshold. Figure 2As shown, the spatiotemporal context probe and service profile vector similarity matching and distribution mechanism achieves target node filtering through a preset cosine similarity threshold. The gateway scheduling module then opens a bidirectional channel to the target instance and concurrently delivers remote procedure call requests carrying analysis payloads, reducing the total waiting latency for service response through parallel distribution.
[0059] S3: Receive data results returned by one or more microservice instances; extract content feature vectors for each data result using the semantic representation model; calculate time weights using an exponential decay function based on the absolute value of the difference between the source timestamp and the current time for each data result; calculate the geometric center vector of all content feature vectors; obtain the Euclidean distance between each content feature vector and the geometric center vector; take the reciprocal of the Euclidean distance and normalize it to obtain the content weight; extract numerical evaluation indicators from the data results; multiply the time weights and content weights and normalize them to obtain a comprehensive weight; perform a weighted summation of the numerical evaluation indicators based on the comprehensive weight to generate adaptation analysis conclusions.
[0060] The response body data results from multiple concurrent network requests are collected through an asynchronous callback mechanism. The forward inference engine of the preloaded BERT model is then invoked again to process the text of each response body, obtain the last hidden state matrix, and perform average pooling along the sequence length dimension to generate content feature vectors for each data result. This extraction method is consistent with the core content feature vector extraction method of the upstream output data in S1.
[0061] Before fusion, the data trees of each response body are parsed to extract numerical evaluation indicators corresponding to the current adaptation analysis indicators. If the names, dimensions, or value ranges of the indicators returned by different microservices are inconsistent, they are first converted into unified evaluation scores or normalized scores according to a preset indicator mapping table before participating in subsequent weighted fusion. The system time module is called to obtain the current server timestamp and read the analysis time in the adaptation analysis request. When the adaptation analysis request belongs to a real-time analysis task, the absolute value of the difference between the timestamp generated by each response data source and the current timestamp is calculated. When the adaptation analysis request belongs to a historical time point analysis or planned time point analysis task, the absolute value of the difference between the timestamp generated by each response data source and the analysis time is calculated. The obtained difference is substituted into a negative exponential decay function to obtain the initial time weight of each data result. Then, all initial time weights are normalized using the first norm to obtain normalized time weights. The arithmetic mean of all content feature vectors is calculated by dimension to obtain the global geometric center vector. The Euclidean distance between each content feature vector and the geometric center vector is calculated, and a smoothing constant is added to the distance value. The reciprocal of the initial content weights is then taken to obtain the initial content weights. The sum of these initial content weights is then divided to obtain the normalized content weights. In some embodiments, normalized numerical evaluation indicators corresponding to each data result are extracted, and their numerical deviation from the median or mean of similar indicators is calculated. The content feature vector distance and the numerical deviation are then weighted and fused to obtain a comprehensive deviation distance. A smoothing constant is added to the comprehensive deviation distance, and the reciprocal is taken and normalized to generate the content weights. In embodiments using the comprehensive deviation distance, the comprehensive deviation distance replaces the aforementioned Euclidean distance in the reciprocal transformation; or the initial content weights obtained based on the Euclidean distance are multiplied by the corrected weights obtained based on the numerical deviation and then normalized again to generate the final content weights.
[0062] The initial comprehensive weight is obtained by multiplying the time weight and content weight of each data result, and then normalizing all initial comprehensive weights again. If the sum of the initial comprehensive weights is zero, a preset smoothing constant is added or the result is degenerated into equal-weighted fusion. Finally, the normalized comprehensive weights are multiplied by the corresponding numerical evaluation indicators of the same type or unified evaluation scores and summed to obtain the final weighted score. An adaptation analysis conclusion containing level descriptions and weighted scores is generated based on a preset evaluation level mapping dictionary. Because the comprehensive weights have been normalized, the final weighted score maintains the same dimensional range as the indicators participating in the fusion.
[0063] In some embodiments, calculating the time weight based on the absolute value of the difference between the source timestamp and the current time of each data result using an exponential decay function includes:
[0064] Obtain the current system absolute timestamp when the gateway node receives each data result;
[0065] Extract the source timestamp carried in the header of each data result message;
[0066] Calculate the absolute value of the difference between the current system's absolute timestamp and the source timestamp;
[0067] The absolute value of the difference is substituted into a preset negative exponential decay function to calculate the initial time weight;
[0068] The initial time weights of all data results are normalized to obtain the time weights corresponding to each data result.
[0069] When the aggregation engine completes the collection of response results from multiple parallel microservice instances, it calls the clock of the gateway server's operating system to obtain the current millisecond-level absolute timestamp. Each microservice node and the gateway node maintain time synchronization through a network time protocol or a unified clock service. Simultaneously, it parses the header fields or response body metadata fields of each data result response message to extract the source timestamp field recording the data generation time. The source timestamp is preferentially the original data acquisition time, business data update time, or model analysis result generation time upon which the data result is based, and is written into the response message header or response body metadata by the microservice instance returning the data result. When the aforementioned source timestamp is missing, exceeds a preset reliable range, or has an abnormal offset from the gateway time, the microservice response generation time, gateway reception time, or request response time are used as alternative timeliness parameters. The difference between the two is calculated by absolute value subtraction to obtain the time deviation value of the data result relative to the current real-time analysis time or a specified analysis time. This difference is used to characterize the timeliness or time matching degree of the data result; the larger the difference, the lower the matching degree between the data and the target analysis time.
[0070] Substitute the obtained millisecond difference into the preset negative exponential decay function. The calculation is performed in the attenuation coefficient. These are empirical hyperparameters set based on the rate of business change. After calculating the initial time weights for each response, norm normalization is performed, dividing each initial time weight by the sum of all weights to obtain a normalized time weight array. This processing method tends to give higher weights to data results with higher timeliness when synthesizing analytical conclusions.
[0071] In some embodiments, calculating the geometric center vector of all content feature vectors, obtaining the Euclidean distance between each content feature vector and the geometric center vector, and taking the reciprocal of the Euclidean distance and normalizing it as the content weight includes:
[0072] For all the content feature vectors corresponding to the received data results, sum them in each dimension and calculate the arithmetic mean to generate the geometric center vector;
[0073] The Euclidean distance between each content feature vector and the geometric center vector is calculated using the Euclidean distance formula;
[0074] The initial content weights are obtained by adding a preset smoothing constant to the Euclidean distance and taking its reciprocal.
[0075] The normalization operation is performed by dividing the initial content weight of each data result by the sum of the initial content weights of all data results, thus obtaining the content weight corresponding to each data result.
[0076] For multiple data results received in parallel, a 768-dimensional content feature vector extracted from the previous processing step is retrieved from the cache. In the matrix operation unit, the values of the vector in each of the 768 dimensions are added along the column direction, and the sum of each dimension is divided by the number of samples to obtain the arithmetic mean. This allows a 768-dimensional geometric center vector representing the consensus feature of multi-source data to be located in the feature space.
[0077] The Euclidean distance calculation logic is invoked. For each original content feature vector, the sum of squared differences between it and the geometric center vector across all dimensions is calculated, and then the square root is taken to calculate the distance value representing the degree of dispersion of each result. Before taking the reciprocal, a preset smoothing constant is added to each calculated Euclidean distance value. Applying the formula The reciprocal of the smoothed values is used to generate the initial content weights.
[0078] The initial content weights of all results are summed to obtain a cumulative sum. Each initial content weight is then divided by this sum to achieve numerical normalization through proportional mapping. Data closer to the center vector indicates a lower degree of deviation between the analysis provided by the microservice and the general trend, and will be assigned a higher content weight in the reciprocal transformation. In subsequent fusion, the normalized time weight is multiplied by the normalized content weight to obtain the initial comprehensive weight, which is then normalized again before being used in the calculation of numerical evaluation indicators.
[0079] The experimental environment deployed a cluster of ten high-performance servers, with a concurrent request volume set at 5000 requests per second and running continuously for 12 hours. The experiment included four comparison groups: the first group was the baseline scheme using traditional round-robin distribution and simple arithmetic average aggregation; the second group was a variant scheme retaining topology loop elimination but removing the spatiotemporal context routing probe module; the third group was a variant scheme retaining the spatiotemporal routing probe but removing the time and content weight aggregation module; and the fourth group was the complete scheme of this application, including causal dependency reconstruction, parallel distribution, and weighted aggregation. The core evaluation metrics were the system's end-to-end average response latency, the accuracy of multi-source data synthesis analysis, and the request failure rate caused by microservice deadlock. The comparative evaluation results of the accuracy of multi-source data synthesis analysis are as follows: Figure 3 As shown.
[0080] The first baseline scheme achieved an end-to-end average response latency of 520ms, with an analysis accuracy of 75.2% and a request failure rate of 4.8%. The second variant scheme achieved an end-to-end average response latency of 360ms, improved analysis accuracy to 88.5%, and reduced the request failure rate to 0.9%. The third variant scheme reduced the end-to-end average response latency to 210ms, achieved an analysis accuracy of 84.6%, and a request failure rate of 0.7%. Under the experimental conditions, the fourth scheme, deploying the complete mechanism, achieved superior results, with an end-to-end average response latency reduced to 150ms, a data analysis accuracy of 96.3%, and a request failure rate as low as 0.02%.
[0081] One or more embodiments of the present invention also provide a smart adaptation and analysis system for sea and island use based on microservice fusion of three-dimensional marine basic data, the system comprising:
[0082] The extraction module is used to parse the sea and island use analysis factor library, construct a causal dependency directed acyclic graph of microservice call chain based on the parameter dependency relationship of the analysis factors; receive adaptation analysis requests, obtain the target sea area spatial location code, analysis time and analysis indicators; intercept the output data of upstream microservices through the side vehicle proxy, clean it and input it into the pre-set semantic representation model to extract the core content feature vector of the output data;
[0083] The selection module is used to determine the next-level candidate microservice clusters based on the directed acyclic graph; after normalizing the spatial location encoding and analysis time, it is concatenated with the core content feature vector to generate a spatiotemporal context routing probe vector; the cosine similarity between the probe vector and the preset spatiotemporal service profile vector of each instance in the candidate microservice cluster is calculated, and one or more instances whose similarity meets the preset threshold are selected for parallel request distribution.
[0084] The analysis module receives data results returned by one or more microservice instances, extracts content feature vectors for each data result using the semantic representation model, calculates time weights using an exponential decay function based on the absolute value of the difference between the source timestamp and the current time of each data result, calculates the geometric center vector of all content feature vectors, obtains the Euclidean distance between each content feature vector and the geometric center vector, takes the reciprocal of the Euclidean distance and normalizes it to obtain the content weight, extracts numerical evaluation indicators from the data results, multiplies the time weights and content weights and normalizes them to obtain a comprehensive weight, and performs a weighted summation of the numerical evaluation indicators based on the comprehensive weight to generate adaptation analysis conclusions.
[0085] In some embodiments, the parsing uses a marine island analysis factor library to construct a causal dependency directed acyclic graph of the microservice call chain based on the parameter dependencies of the analysis factors, including:
[0086] Extract the pre-dependent conditions and expected output indicators of the analytical factors;
[0087] Scan the global microservice registry to obtain the input parameter settings and output data structures of each microservice interface;
[0088] Type matching is performed between the output data structure of microservices and the pre-dependent conditions of analysis factors to construct directed edges between nodes;
[0089] Perform topological sorting on the generated initial call graph, and detect and record loops;
[0090] For dependency chains with loops, non-core feedback links are disconnected based on preset business priority rules to eliminate loops and generate a causal dependency directed acyclic graph.
[0091] In some embodiments, the step of intercepting the output data of the upstream microservice through a sidecar proxy, cleaning it, inputting it into a pre-set semantic representation model, and extracting the core content feature vector of the output data includes:
[0092] By intercepting microservice response messages through a sidecar proxy, removing network protocol headers and null fields, and extracting the numerical values and text sequences of the payload;
[0093] The extracted sequences are transformed into a unified structured text;
[0094] A pre-trained deep neural network model is used as the semantic representation model to transform the structured text into a sequence of word embedding vectors. Contextual features are extracted through a multi-layer self-attention mechanism, and the hidden states of the last layer are subjected to average pooling to generate core content feature vectors.
[0095] In some embodiments, the step of normalizing the spatial location encoding and analysis time, and then concatenating it with the core content feature vector to generate a spatiotemporal context routing probe vector includes:
[0096] The spatial location of the target sea area is encoded as an H3-level grid spatial discrete identifier and converted into a spatial embedding feature vector through feature embedding mapping;
[0097] Extract the timestamp of the analysis time, split it into a multi-dimensional time feature array, and perform min-max normalization processing by combining it with the preset historical extreme values;
[0098] The spatial embedding feature vector, the normalized temporal feature array, and the core content feature vector are linearly concatenated along the feature dimension to generate a concatenated vector.
[0099] The concatenated vector is input into a fully connected layer for dimensionality reduction and feature alignment, and the spatiotemporal context routing probe vector is output.
[0100] In some embodiments, calculating the cosine similarity between the probe vector and the preset spatiotemporal service profile vectors of each instance in the candidate microservice cluster, and selecting one or more instances whose similarity meets a preset threshold for parallel request distribution, includes:
[0101] Obtain the updated spatiotemporal service profile vectors of each instance in the candidate microservice cluster, where the spatiotemporal service profile vectors represent the historical spatiotemporal distribution preferences of the instance's processing.
[0102] Calculate the inner product of the spatiotemporal context routing probe vector and the spatiotemporal service profile vector of each instance, and calculate the vector norm of both respectively;
[0103] Divide the inner product by the product of the norms of the two vectors to obtain the cosine similarity;
[0104] The top N microservice instances in the candidate microservice cluster whose cosine similarity meets the preset threshold are selected as the target node cluster, and requests are distributed by establishing connections or multiple concurrent connections.
[0105] In some embodiments, calculating the time weight based on the absolute value of the difference between the source timestamp and the current time of each data result using an exponential decay function includes:
[0106] Obtain the current system absolute timestamp when the gateway node receives each data result;
[0107] Extract the source timestamp carried in the header of each data result message;
[0108] Calculate the absolute value of the difference between the current system's absolute timestamp and the source timestamp;
[0109] The absolute value of the difference is substituted into a preset negative exponential decay function to calculate the initial time weight;
[0110] The initial time weights of all data results are normalized to obtain the time weights corresponding to each data result.
[0111] In some embodiments, calculating the geometric center vector of all content feature vectors, obtaining the Euclidean distance between each content feature vector and the geometric center vector, and taking the reciprocal of the Euclidean distance and normalizing it as the content weight includes:
[0112] For all the content feature vectors corresponding to the received data results, sum them in each dimension and calculate the arithmetic mean to generate the geometric center vector;
[0113] The Euclidean distance between each content feature vector and the geometric center vector is calculated using the Euclidean distance formula;
[0114] The initial content weights are obtained by adding a preset smoothing constant to the Euclidean distance and taking its reciprocal.
[0115] The normalization operation is performed by dividing the initial content weight of each data result by the sum of the initial content weights of all data results, thus obtaining the content weight corresponding to each data result.
[0116] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0117] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A microservice-based intelligent adaptation analysis method for sea and island usage, characterized in that, Includes the following steps: The analysis factor library for sea and island usage is analyzed, and based on the parameter dependencies of the analysis factors, a causal dependency directed acyclic graph of the microservice call chain is constructed. Receive adaptation analysis requests, obtain the target sea area spatial location code, analysis time and analysis indicators; intercept the output data of upstream microservices through the side vehicle proxy, clean it and input it into the pre-set semantic representation model to extract the core content feature vector of the output data; Based on the directed acyclic graph, candidate microservice clusters for the next level are determined; after normalizing the spatial location encoding and analysis time, they are concatenated with the core content feature vector to generate a spatiotemporal context routing probe vector. Calculate the cosine similarity between the probe vector and the preset spatiotemporal service profile vector of each instance in the candidate microservice cluster, and select one or more instances whose similarity meets the preset threshold for parallel request distribution; Receive data results returned by one or more microservice instances, extract content feature vectors for each data result using the semantic representation model, and calculate time weights using an exponential decay function based on the absolute value of the difference between the source timestamp and the current time for each data result. Calculate the geometric center vector of all content feature vectors, obtain the Euclidean distance between each content feature vector and the geometric center vector, take the reciprocal of the Euclidean distance and normalize it to obtain the content weight; extract the numerical evaluation index from the data results, multiply the time weight and the content weight and normalize it to obtain the comprehensive weight, and perform a weighted summation of the numerical evaluation index based on the comprehensive weight to generate the adaptation analysis conclusion.
2. The method according to claim 1, characterized in that, The analytical factor library for the sea and island is used to construct a causal dependency directed acyclic graph of the microservice call chain based on the parameter dependencies of the analytical factors, including: Extract the pre-dependent conditions and expected output indicators of the analytical factors; Scan the global microservice registry to obtain the input parameter settings and output data structures of each microservice interface; Type matching is performed between the output data structure of microservices and the pre-dependent conditions of analysis factors to construct directed edges between nodes; Perform topological sorting on the generated initial call graph, and detect and record loops; For dependency chains with loops, non-core feedback links are disconnected based on preset business priority rules to eliminate loops and generate a causal dependency directed acyclic graph.
3. The method according to claim 2, characterized in that, The process involves intercepting the output data of upstream microservices via a sidecar proxy, cleaning it, inputting it into a pre-defined semantic representation model, and extracting the core content feature vector of the output data, including: By intercepting microservice response messages through a sidecar proxy, removing network protocol headers and null fields, and extracting the numerical values and text sequences of the payload; The extracted sequences are transformed into a unified structured text; A pre-trained deep neural network model is used as the semantic representation model to transform the structured text into a sequence of word embedding vectors. Contextual features are extracted through a multi-layer self-attention mechanism, and the hidden states of the last layer are subjected to average pooling to generate core content feature vectors.
4. The method according to claim 1, characterized in that, The step of normalizing the spatial location encoding and analysis time, and then concatenating it with the core content feature vector to generate a spatiotemporal context routing probe vector includes: The spatial location of the target sea area is encoded as an H3-level grid spatial discrete identifier and converted into a spatial embedding feature vector through feature embedding mapping; Extract the timestamp of the analysis time, split it into a multi-dimensional time feature array, and perform min-max normalization processing by combining it with the preset historical extreme values; The spatial embedding feature vector, the normalized temporal feature array, and the core content feature vector are linearly concatenated along the feature dimension to generate a concatenated vector. The concatenated vector is input into a fully connected layer for dimensionality reduction and feature alignment, and the spatiotemporal context routing probe vector is output.
5. The method according to claim 1 or 4, characterized in that, The calculation of the cosine similarity between the probe vector and the preset spatiotemporal service profile vectors of each instance in the candidate microservice cluster, and the selection of one or more instances whose similarity meets a preset threshold for parallel request distribution, includes: Obtain the updated spatiotemporal service profile vectors of each instance in the candidate microservice cluster, where the spatiotemporal service profile vectors represent the historical spatiotemporal distribution preferences of the instance's processing. Calculate the inner product of the spatiotemporal context routing probe vector and the spatiotemporal service profile vector of each instance, and calculate the vector norm of both respectively; Divide the inner product by the product of the norms of the two vectors to obtain the cosine similarity; The top N microservice instances in the candidate microservice cluster whose cosine similarity meets the preset threshold are selected as the target node cluster, and requests are distributed by establishing connections or multiple concurrent connections.
6. The method according to claim 1, characterized in that, The step of calculating time weights based on the absolute value of the difference between the source timestamp and the current time of each data result using an exponential decay function includes: Obtain the current system absolute timestamp when the gateway node receives each data result; Extract the source timestamp carried in the header of each data result message; Calculate the absolute value of the difference between the current system's absolute timestamp and the source timestamp; The absolute value of the difference is substituted into a preset negative exponential decay function to calculate the initial time weight; The initial time weights of all data results are normalized to obtain the time weights corresponding to each data result.
7. The method according to claim 1, characterized in that, The process of calculating the geometric center vector of all content feature vectors, obtaining the Euclidean distance between each content feature vector and the geometric center vector, and then taking the reciprocal of the Euclidean distance and normalizing it as the content weight includes: For all the content feature vectors corresponding to the received data results, sum them in each dimension and calculate the arithmetic mean to generate the geometric center vector; The Euclidean distance between each content feature vector and the geometric center vector is calculated using the Euclidean distance formula; The initial content weights are obtained by adding a preset smoothing constant to the Euclidean distance and taking its reciprocal. The normalization operation is performed by dividing the initial content weight of each data result by the sum of the initial content weights of all data results, thus obtaining the content weight corresponding to each data result.
8. A microservice-based intelligent adaptation and analysis system for sea and island usage, characterized in that, include: The extraction module is used to parse the sea and island usage analysis factor library and construct a causal dependency directed acyclic graph of the microservice call chain based on the parameter dependency relationship of the analysis factors. Receive adaptation analysis requests, obtain the target sea area spatial location code, analysis time and analysis indicators; intercept the output data of upstream microservices through the side vehicle proxy, clean it and input it into the pre-set semantic representation model to extract the core content feature vector of the output data; The selection module is used to determine the candidate microservice clusters at the next level based on the directed acyclic graph; after normalizing the spatial location encoding and analysis time, it is concatenated with the core content feature vector to generate a spatiotemporal context routing probe vector. Calculate the cosine similarity between the probe vector and the preset spatiotemporal service profile vector of each instance in the candidate microservice cluster, and select one or more instances whose similarity meets the preset threshold for parallel request distribution; The analysis module is used to receive data results returned by one or more microservice instances, extract the content feature vector of each data result using the semantic representation model, and calculate the time weight using an exponential decay function based on the absolute value of the difference between the source timestamp and the current time of each data result. Calculate the geometric center vector of all content feature vectors, obtain the Euclidean distance between each content feature vector and the geometric center vector, take the reciprocal of the Euclidean distance and normalize it to obtain the content weight; extract the numerical evaluation index from the data results, multiply the time weight and the content weight and normalize it to obtain the comprehensive weight, and perform a weighted summation of the numerical evaluation index based on the comprehensive weight to generate the adaptation analysis conclusion.
9. The system according to claim 8, characterized in that, The analytical factor library for the sea and island is used to construct a causal dependency directed acyclic graph of the microservice call chain based on the parameter dependencies of the analytical factors, including: Extract the pre-dependent conditions and expected output indicators of the analytical factors; Scan the global microservice registry to obtain the input parameter settings and output data structures of each microservice interface; Type matching is performed between the output data structure of microservices and the pre-dependent conditions of analysis factors to construct directed edges between nodes; Perform topological sorting on the generated initial call graph, and detect and record loops; For dependency chains with loops, non-core feedback links are disconnected based on preset business priority rules to eliminate loops and generate a causal dependency directed acyclic graph.
10. The system according to claim 8, characterized in that, The process involves intercepting the output data of upstream microservices via a sidecar proxy, cleaning it, inputting it into a pre-defined semantic representation model, and extracting the core content feature vector of the output data, including: By intercepting microservice response messages through a sidecar proxy, removing network protocol headers and null fields, and extracting the numerical values and text sequences of the payload; The extracted sequences are transformed into a unified structured text; A pre-trained deep neural network model is used as the semantic representation model to transform the structured text into a sequence of word embedding vectors. Contextual features are extracted through a multi-layer self-attention mechanism, and the hidden states of the last layer are subjected to average pooling to generate core content feature vectors.