NLP-based emotion analysis method, apparatus and device, and medium

By generating requirement specifications and optimizing the service composition of the microservice capability knowledge graph, the problems of module conflict and high false positive rate in traditional sentiment analysis methods are solved, thereby improving stability and accuracy and balancing resource consumption and analysis accuracy.

CN121303142APending Publication Date: 2026-01-09SHANGHAI SECOND POLYTECHNIC UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511506408.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2026-01-09

AI Technical Summary

Technical Problem

Traditional sentiment analysis methods suffer from high module conflict probability and poor system stability when expanding multidimensional features. Deep models have excessive computational load, while lightweight models have insufficient representation capabilities, leading to an imbalance between accuracy and resource consumption. Furthermore, they have a high misjudgment rate in ambiguous semantic scenarios such as irony and polysemy.

Method used

By parsing configuration data to generate requirement specifications, optimizing the service composition of the microservice capability knowledge graph, generating a targeted data flow pipeline for streaming processing, and combining performance monitoring, sentiment polarity tag generation is achieved. A modular architecture is adopted to avoid feature dimension expansion conflicts under hard-coded rules, and resource consumption and analysis accuracy are balanced through service composition optimization and performance monitoring.

Benefits of technology

It improves the stability of multidimensional feature expansion, reduces polarity misjudgment in implicit semantic scenarios, avoids computational overload and missed detection of key sentiment features, and achieves a balance between resources and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121303142A_ABST
    Figure CN121303142A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence. The NLP-based sentiment analysis method, device and equipment and the medium are provided, and the method comprises the following steps: performing parameter analysis processing on configuration data input by a user to obtain a demand specification; performing service combination optimization processing on a preset micro-service capability knowledge graph based on the demand specification to generate an optimized service arrangement scheme; performing micro-service instantiation processing on the module description information stored in the micro-service registration center according to the optimized service arrangement scheme to generate a directional data flow pipeline; inputting the input text data into a directional data stream pipeline for stream processing, and generating an emotion polarity label; and performing monitoring processing on the directional data flow pipeline during operation to generate performance feedback data so as to achieve the technical effects of improving the stability of multi-dimensional feature expansion, reducing the obscure semantic misjudgment rate and balancing the resource consumption and the sentiment analysis precision.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to a sentiment analysis method and device based on NLP, equipment and medium. BACKGROUND

[0002] With the wide application of natural language processing technology, sentiment analysis plays an increasingly important role in user comment analysis, public opinion monitoring, intelligent customer service and other fields. Accurate sentiment polarity recognition is the core link to improve human-computer interaction experience and is also a key technical difficulty of intelligent text processing. An efficient sentiment analysis method needs to ensure analysis accuracy while adapting to changing business needs and complex language environments.

[0003] In traditional technology, the architecture of hard-coded rules coupled with multi-dimensional feature extraction modules leads to an exponential increase in module conflict probability when feature dimension expansion occurs, resulting in a sharp decline in system stability. The sentiment reasoning mechanism based on static rules frequently produces polarity misjudgments in sarcastic, ambiguous and other implicit semantic scenarios due to the lack of context awareness. In addition, although deep models can improve accuracy, they cause computational load overload in streaming tasks, while lightweight models miss key sentiment features due to insufficient representation ability, ultimately leading to structural imbalance between accuracy and resource consumption. SUMMARY

[0004] Therefore, it is necessary to provide a sentiment analysis method, device and equipment based on NLP to improve the stability of multi-dimensional feature expansion, reduce the misjudgment rate of implicit semantics, and balance the technical effects of resource consumption and sentiment analysis accuracy.

[0005] In a first aspect, the present application provides a sentiment analysis method based on NLP, which comprises:

[0006] performing parameter analysis processing on the configuration data input by the user to obtain a requirement specification;

[0007] performing service combination optimization processing on the preset micro-service capability knowledge graph based on the requirement specification to generate an optimized service orchestration scheme;

[0008] performing micro-service instantiation processing on the module description information stored in the micro-service registration center according to the optimized service orchestration scheme to generate a directional data flow pipeline;

[0009] injecting the input text data into the directional data flow pipeline for streaming processing to generate a sentiment polarity label;

[0010] performing runtime monitoring processing on the directional data flow pipeline to generate performance feedback data.

[0011] In one embodiment, a service composition optimization process is performed on a preset microservice capability knowledge graph based on requirement specifications to generate an optimized service orchestration scheme, including:

[0012] Based on the requirements specifications, the dependency relationship traversal of the microservice capability knowledge graph is performed to obtain a set of candidate service chains.

[0013] Constraint conflict detection and resolution are performed on the candidate service chain set to generate feasible service combination schemes;

[0014] Based on preset optimization strategies, the topology of feasible service combination schemes is reconstructed to generate optimized service orchestration schemes.

[0015] In one embodiment, a dependency traversal is performed on the microservice capability knowledge graph based on the requirement specifications to obtain a candidate service chain set, including:

[0016] Based on the text preprocessing granularity parameters in the requirements specification, the microservice capability knowledge graph is initially filtered to obtain a preprocessed service node set.

[0017] Based on the feature extraction dimension constraints in the requirement specifications, the preprocessed service node set is traversed by the associated edges to obtain the feature extraction service path set.

[0018] Based on the model complexity threshold and service quality constraints in the requirements specification, the feature extraction service path set is aggregated with inference nodes to generate a candidate service chain set.

[0019] In one embodiment, a topology reconstruction is performed on feasible service composition schemes based on a preset optimization strategy to generate an optimized service orchestration scheme, including:

[0020] Based on the latency optimization objective in the preset optimization strategy, critical path identification is performed in the feasible service combination scheme to obtain the bottleneck service node set.

[0021] The bottleneck service node set is processed by parallel sharding to generate parallel service unit groups;

[0022] Based on the resource constraints in the preset optimization strategy, the parallel service unit groups are integrated into the feasible service composition scheme for topology rearrangement to generate an optimized service orchestration scheme.

[0023] In one embodiment, the configuration data input by the user is parsed to obtain the requirement specification, including:

[0024] The configuration data is parsed using structured syntax to obtain an initial set of configuration items;

[0025] Perform semantic dependency analysis on the initial set of configuration items to generate a validated set of configuration parameters;

[0026] Based on the preset business rule template, the verified configuration parameter set is adapted and transformed to generate the requirement specification.

[0027] In one embodiment, input text data is injected into a directed data stream pipeline for streaming processing to generate sentiment polarity tags, including:

[0028] Adaptive preprocessing is performed on the input text data to obtain context-aware standardized text;

[0029] Based on the feature extraction dimension constraints in the requirements specification, dynamic feature extraction is performed on the context-aware standardized text to generate dimension-adapted feature vectors.

[0030] Using the following formula, real-time sentiment inference is performed based on the model complexity threshold and dimensionally adapted feature vectors in the requirements specification to generate sentiment polarity labels:

[0031]

[0032] in, Indicates emotional polarity label, This represents the sentiment classification function. Indicates the first dimensional feature weights, The feature vector representing dimension adaptation. 3D eigenvalues This represents the model selection function. This represents the threshold of model complexity. Representing feature dimension The complexity threshold, This represents the number of dimensions of the feature vector.

[0033] In one embodiment, the module description information stored in the microservice registry is instantiated according to the optimized service orchestration scheme to generate a directed data flow pipeline, including:

[0034] Container image matching is performed on the version identifiers in the optimized service orchestration scheme to obtain a set of versioned functional containers.

[0035] Based on the data flow definition of the optimized service orchestration scheme, the versioned function container set is processed to construct the data flow topology and generate a directed data flow pipeline.

[0036] Secondly, this application also provides an NLP-based sentiment analysis device, which includes:

[0037] The configuration parsing module is used to parse and process the configuration data input by the user to obtain the required specifications;

[0038] The service orchestration module is used to perform service composition optimization on the pre-defined microservice capability knowledge graph based on the requirement specifications, and generate an optimized service orchestration scheme.

[0039] The pipeline construction module is used to instantiate microservices based on the module description information stored in the microservice registry according to the optimized service orchestration scheme, and generate directed data flow pipelines.

[0040] The sentiment analysis module is used to inject input text data into a directed data stream pipeline for streaming processing and generate sentiment polarity tags.

[0041] The performance monitoring module is used to perform runtime monitoring and processing of the directed data flow pipeline and generate performance feedback data.

[0042] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods in the first aspect of this application.

[0043] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any of the methods in the first aspect of this application.

[0044] This application provides a sentiment analysis method, apparatus, device, and medium based on NLP. It generates requirement specifications by parsing the parameters of configuration data, optimizes the service composition of the microservice capability knowledge graph based on this specification, and generates an orchestration scheme. Based on this scheme, microservices are instantiated to form a directed data flow pipeline, realizing the streaming processing of input text and the generation of sentiment polarity tags. At the same time, performance feedback data is generated by combining runtime monitoring. In the above series of processes, the modular architecture of microservices avoids module conflicts when expanding feature dimensions under hard-coded rules, and improves the stability of multi-dimensional feature expansion.

[0045] Streaming processing via a targeted data pipeline can better perceive context and reduce polarity misjudgments in scenarios with obscure semantics such as irony and ambiguity. Furthermore, the combination of service composition optimization and performance monitoring can find a balance between resource consumption and analytical accuracy based on demand, avoiding both computational overload of deep models in streaming tasks and preventing missed detection of key sentiment features due to insufficient representational capabilities in lightweight models. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 A flowchart illustrating an NLP-based sentiment analysis method in one embodiment of the present invention;

[0048] Figure 2 This is a flowchart of a process for performing dependency traversal on a microservice capability knowledge graph based on requirement specifications to obtain a set of candidate service chains, as described in one embodiment of the present invention.

[0049] Figure 3 This is a structural diagram of an NLP-based sentiment analysis device according to one embodiment of the present invention. Detailed Implementation

[0050] To make the above-mentioned objects, features, and advantages of this application more apparent and understandable, the specific embodiments of this application will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the application. Therefore, this application is not limited to the specific embodiments disclosed below.

[0051] First, the application scenarios of the embodiments of this application are described. In the embodiments of this application, an NLP-based sentiment analysis method, apparatus, device, and medium are provided, applicable to scenarios such as user comment analysis, public opinion monitoring, and intelligent customer service.

[0052] As an illustration, the NLP-based sentiment analysis method, apparatus, device, and medium provided in this application embodiment can also be applied to other application scenarios such as social media sentiment tracking, e-commerce product evaluation summarization, and news public opinion guidance analysis. This is only an example and does not limit the specific application scenarios.

[0053] like Figure 1 As shown, this application provides a sentiment analysis method based on NLP, which includes:

[0054] S101: Perform parameter parsing and processing on the configuration data input by the user to obtain the requirement specifications.

[0055] For example, user-input configuration data is obtained and subjected to structured syntax parsing to form an initial set of configuration items. Then, semantic dependency analysis is performed to verify logical coherence and legality, and invalid content is removed to generate a validated set of configuration parameters. Based on a preset business rule template, adaptation, transformation, and standardization are performed to generate the requirement specification.

[0056] S102: Based on the requirements specifications, perform service composition optimization on the pre-set microservice capability knowledge graph to generate an optimized service orchestration scheme.

[0057] For example, based on the text preprocessing granularity parameters and feature extraction dimension constraints in the requirement specification, a dependency traversal is performed on the pre-defined microservice capability knowledge graph to filter out preprocessing service nodes and associated feature extraction service paths that match the requirements. Inference nodes are then aggregated by combining model complexity thresholds and service quality constraints to generate a candidate service chain set. Constraint conflict detection is performed on the candidate service chain set to identify and resolve resource requirement conflicts and dependency contradictions between services, generating a feasible service composition scheme that meets basic operating conditions.

[0058] Based on the preset optimization strategy, the bottleneck service node set that affects the overall performance is identified in the feasible service composition scheme. The bottleneck service node set is then processed in parallel to form a parallel service unit group. Based on the resource constraints, the parallel service unit group is integrated into the feasible service composition scheme for topology rearrangement to generate an optimized service orchestration scheme.

[0059] S103: Based on the optimized service orchestration scheme, perform microservice instantiation on the module description information stored in the microservice registry center to generate a directed data flow pipeline.

[0060] For example, the version identifier and service node information in the optimized service orchestration scheme are parsed. Based on the version identifier, the corresponding module description information is retrieved from the microservice registry, and container images that meet the version requirements are matched to generate a set of versioned functional containers. Based on the data flow definition in the optimized service orchestration scheme, the data interaction methods and transmission paths between the versioned functional containers are determined. Node associations and topology construction are performed on the set of versioned functional containers, and the mapping relationship of service input and output interfaces is clarified. By configuring the communication protocol and data conversion rules between services, the scattered versioned functional containers are integrated into an orderly connected processing link, generating a directed data flow pipeline.

[0061] S104: Inject the input text data into the directed data stream pipeline for streaming processing to generate sentiment polarity tags.

[0062] For example, input text data is passed to the starting processing node of the directed data flow pipeline. The directed data flow pipeline performs adaptive preprocessing on the input text data, removing interference information and unifying the format to generate context-aware standardized text. The directed data flow pipeline then passes the context-aware standardized text to the feature extraction stage. Based on the feature extraction dimension constraints in the requirements specification, it extracts multi-dimensional features such as semantic features and sentiment features from the context-aware standardized text, generating dimension-adapted feature vectors.

[0063] The targeted data flow pipeline delivers dimension-adapted feature vectors to the sentiment inference stage. It then calls the corresponding sentiment classification model based on the model complexity threshold in the requirements specification. The sentiment classification model determines the sentiment tendency of the dimension-adapted feature vectors and generates sentiment polarity labels.

[0064] S105: Performs runtime monitoring and processing on the directed data stream pipeline to generate performance feedback data.

[0065] For example, a dedicated monitoring component is deployed during the operation of the directed data flow pipeline. This monitoring component includes all service processing nodes of the directed data flow pipeline, and core monitoring indicators such as latency, throughput, resource utilization, and data processing accuracy are clearly defined. The monitoring component captures the operating status data and data processing process data of each service processing node in real time, and performs cleaning operations such as deduplication and noise reduction on the captured raw monitoring data to remove invalid data entries.

[0066] Following the pre-defined performance data integration specifications, the cleaned monitoring data is categorized and summarized according to service nodes and indicator types to construct a structured performance data set. Based on the performance feedback format requirements corresponding to the business scenario, the structured performance data set undergoes field standardization and content organization to generate performance feedback data.

[0067] One embodiment of this application provides a sentiment analysis method based on NLP. It generates requirement specifications by parsing the parameters of configuration data. Based on this, it optimizes the service composition of the microservice capability knowledge graph and generates an orchestration scheme. Based on the scheme, it instantiates microservices to form a directed data flow pipeline, realizing the streaming processing of input text and the generation of sentiment polarity tags. At the same time, it generates performance feedback data by combining runtime monitoring. In the above series of processes, the modular architecture of microservices avoids module conflicts when expanding feature dimensions under hard-coded rules, and improves the stability of multi-dimensional feature expansion.

[0068] Streaming processing via a targeted data pipeline can better perceive context and reduce polarity misjudgments in scenarios with obscure semantics such as irony and ambiguity. Furthermore, the combination of service composition optimization and performance monitoring can find a balance between resource consumption and analytical accuracy based on demand, avoiding both computational overload of deep models in streaming tasks and preventing missed detection of key sentiment features due to insufficient representational capabilities in lightweight models.

[0069] In one embodiment, a service composition optimization process is performed on a preset microservice capability knowledge graph based on requirement specifications to generate an optimized service orchestration scheme, including:

[0070] (1) Based on the requirements specification, the dependency relationship of the microservice capability knowledge graph is traversed to obtain a set of candidate service chains.

[0071] For example, based on the text preprocessing granularity parameters in the requirements specification, the basic granularity requirements for text processing are clarified. Using this as a filtering condition, a pre-defined microservice capability knowledge graph is retrieved, and service nodes with corresponding preprocessing capabilities are matched to generate a preprocessing service node set. The feature extraction dimension constraints in the requirements specification are decomposed to determine the specific feature dimensions to be extracted, such as semantics and sentiment. Based on these feature dimensions, the connection edges of each node in the preprocessing service node set are traversed, and service nodes that can provide corresponding feature extraction functions are selected and connection paths are constructed to generate a feature extraction service path set.

[0072] By combining the model complexity threshold in the requirements specification, the range of selectable model levels is determined. At the same time, by referring to the latency, accuracy and other indicators in the service quality constraints, the functional adaptability of the inference nodes of each path in the feature extraction service path set is evaluated and integrated. The paths that meet the constraints are integrated into a complete service link to obtain a set of candidate service chains.

[0073] The dependency traversal includes parsing text preprocessing granularity parameters and screening preprocessing service node sets, decomposing feature extraction dimension constraints and constructing feature extraction service path sets, and evaluating and integrating paths to form a candidate service chain set by combining model complexity thresholds and service quality constraints.

[0074] (2) Perform constraint conflict detection and resolution on the candidate service chain set to generate feasible service combination schemes.

[0075] For example, resource requirements are calculated for each service chain in the candidate service chain set, including CPU and memory resource requirements for each service node. The resource allocation between service nodes is compared to identify conflicting nodes with resource contention. By traversing the dependency graph of the service chains, circular dependencies between service nodes are detected, and the missing prerequisite services for each node are checked to pinpoint logical dependency anomalies.

[0076] For resource conflict nodes, alternative service nodes with equivalent functions and matching resource requirements are retrieved from the microservice capability knowledge graph and replaced. For logical dependency anomalies, circular dependencies are broken by adjusting the order of service nodes or missing preceding service nodes are added. After conflict resolution, all service chains that meet the constraints are retained, and a feasible service combination scheme is generated.

[0077] The constraint conflict detection and resolution process includes calculating resource requirements and identifying resource conflict nodes, traversing the dependency graph to detect logical dependency anomalies, resolving conflicts through node replacement or dependency adjustment, and selecting service chains that meet the conditions.

[0078] (3) Based on the preset optimization strategy, the topology of the feasible service combination scheme is reconstructed to generate an optimized service orchestration scheme.

[0079] For example, based on the latency optimization target in the preset optimization strategy, historical processing latency data of each service node in the feasible service combination scheme is collected, latency bottleneck judgment criteria are set, and service nodes whose processing latency exceeds the standard are screened out and integrated into a bottleneck service node set. The bottleneck service node set is split according to the functional module boundaries of the service nodes to ensure that each sub-module after splitting has independent functional integrity, and the interface protocol required for parallel operation is configured to generate a parallel service unit group.

[0080] Based on the resource constraints in the preset optimization strategy, the total amount of CPU, memory and other resources that can be allocated to the system is determined, the resource requirements of the parallel service unit group are evaluated, the access position of the parallel service unit group in the feasible service combination scheme is determined, the connection relationship between the original service nodes and the parallel service unit group is adjusted, the data transmission path between each node is optimized, the overall service topology is rearranged, and an optimized service orchestration scheme is generated.

[0081] The topology reconstruction includes collecting latency data and filtering it to form a bottleneck service node set, splitting the bottleneck nodes according to functional boundaries and configuring interfaces to form a parallel service unit group, and determining the access location and adjusting the topology structure in combination with resource constraint assessment.

[0082] like Figure 2 As shown, based on the requirement specifications, the dependency traversal of the microservice capability knowledge graph yields a set of candidate service chains, including:

[0083] S201: Based on the text preprocessing granularity parameters in the requirements specification, perform initial node screening on the microservice capability knowledge graph to obtain a preprocessed service node set.

[0084] For example, semantic parsing is performed on the text preprocessing granularity parameters in the requirements specification to clarify the basic granularity standard for text processing. This standard includes processing requirements at different levels, such as lexical, sentence, and document levels. Using the parsed granularity standard as the search criteria, all service nodes in the pre-defined microservice capability knowledge graph are traversed. The functional description information of each service node is checked, and service nodes with preprocessing functions matching the granularity standard are selected. The selected service nodes are then aggregated and integrated to obtain a preprocessing service node set.

[0085] Among them, the text preprocessing granularity parameter parsing includes clarifying the processing requirements at different levels, and the initial node screening process includes traversing service nodes based on granularity standards, verifying functional description information, filtering matching nodes, and summarizing them.

[0086] S202: Based on the feature extraction dimension constraints in the requirement specifications, perform edge traversal processing on the preprocessed service node set to obtain the feature extraction service path set.

[0087] For example, the feature extraction dimension constraints in the requirement specification are decomposed and analyzed to determine the specific feature types to be extracted. These feature types include semantic features, sentiment features, syntactic features, and other multi-dimensional content. Based on the decomposed feature types, the associated edges of each service node in the preprocessing service node set are traversed. Through the functional identifiers corresponding to the associated edges, the associated service nodes that can provide the target feature extraction function are identified. A complete path containing preprocessing nodes and feature extraction nodes is constructed according to the connection relationship of the service nodes. All paths that meet the requirements are collected and set to obtain the feature extraction service path set.

[0088] Among them, the feature extraction dimension constraint decomposition includes determining the specific feature types of multiple dimensions, and the associated edge traversal processing includes traversing the associated edges of nodes, identifying the associated nodes of the target function, constructing the complete path and organizing the set.

[0089] S203: Based on the model complexity threshold and service quality constraints in the requirements specification, perform inference node aggregation processing on the feature extraction service path set to generate a candidate service chain set.

[0090] For example, the model complexity threshold in the requirement specification is analyzed to define the complexity range of the available sentiment analysis models. Simultaneously, core indicators from the service quality constraints are extracted, including processing latency, analysis accuracy, and resource utilization. Based on the defined model complexity range and the extracted core service quality indicators, each path in the feature extraction service path set is evaluated, and paths that are suitable for the model complexity and meet the service quality requirements are selected.

[0091] The inference nodes in the selected paths are checked for functional compatibility and integrated to eliminate functional redundancy between nodes, and a service link with complete structure and compatible functions is constructed. All qualified service links are summarized to generate a candidate service link set.

[0092] The application of model complexity threshold and service quality constraints includes defining the range of model complexity and extracting core service quality indicators. The inference node aggregation processing includes path evaluation and screening, node function compatibility verification and integration, and construction and aggregation of service links.

[0093] In one embodiment, a topology reconstruction is performed on feasible service composition schemes based on a preset optimization strategy to generate an optimized service orchestration scheme, including:

[0094] (1) Based on the latency optimization target in the preset optimization strategy, the critical path identification process is carried out in the feasible service combination scheme to obtain the bottleneck service node set.

[0095] For example, the latency optimization objective in the preset optimization strategy is analyzed to clarify the upper limit standard for service processing latency and the judgment rules for critical paths. These judgment rules include core dimensions such as the proportion of total path latency and the single-step latency threshold for nodes. Based on the above analysis results, all service paths in feasible service combination schemes are traversed, and the processing latency data of each service node on each path is collected. The total latency of each path is calculated and compared with the upper limit standard. Paths with total latency exceeding the standard are selected as critical paths. The service nodes on the critical paths that cause latency exceeding the standard are further located. These nodes are then aggregated and integrated to obtain the bottleneck service node set.

[0096] The critical path identification process includes parsing latency optimization targets and judgment rules, traversing service paths to collect latency data, filtering critical paths, and locating and summarizing bottleneck service nodes.

[0097] (2) Parallelize the bottleneck service node set to generate parallel service unit groups.

[0098] For example, a functional decomposition analysis is performed on each service node in the bottleneck service node set to identify the core functional modules of each node and the interaction logic between modules, thus dividing them into independently operable functional units. Based on the business relevance and data dependency of the functional units, the decomposed functional units are grouped to ensure that each group has complete independent processing capabilities. The interface protocols, data synchronization mechanisms, and resource scheduling rules required for parallel operation are configured for each group of functional units. The configured functional unit groups are then integrated to generate parallel service unit groups.

[0099] Parallelized sharding processing includes breaking down bottleneck node functional modules, dividing them into independent functional units, grouping them and configuring parallel operation parameters, and integrating them into parallel service unit groups.

[0100] (3) Based on the resource constraints in the preset optimization strategy, the parallel service unit group is integrated into the feasible service combination scheme for topology rearrangement to generate an optimized service orchestration scheme.

[0101] For example, the resource constraints in the preset optimization strategy are analyzed to clarify the total upper limit of allocable resources such as CPU, memory, and bandwidth, as well as the resource allocation priority rules. Based on these resource constraints, the resource requirements of the parallel service unit group are evaluated to determine whether it is compatible with the resource allocation of existing feasible service composition schemes. The access position of the parallel service unit group in the feasible service composition scheme is determined, and the connection relationship, data transmission path, and task scheduling order between the original service nodes and the parallel service unit group are adjusted to optimize the overall service topology to meet resource constraints and performance requirements, generating an optimized service orchestration scheme.

[0102] The topology reordering process includes resolving resource constraints, evaluating the resource compatibility of parallel unit groups, determining access locations, adjusting connection and scheduling relationships, and optimizing the topology structure.

[0103] In one embodiment, the configuration data input by the user is parsed to obtain the requirement specification, including:

[0104] (1) Perform structured syntax parsing on the configuration data to obtain the initial set of configuration items.

[0105] For example, the format type of the configuration data input by the user is clearly defined, including common forms such as key-value pair format, XML format, and JSON format. The corresponding format's syntax parser is invoked to scan and validate the configuration data segment by segment according to preset syntax rules, identifying the configuration fields, field attributes, and field values. The parsed configuration elements are then organized and categorized to generate an initial set of configuration items containing all the original configuration content.

[0106] The structured syntax parsing process includes determining the configuration data format type, calling the corresponding syntax parser, syntax verification and element extraction, and classifying and organizing configuration elements.

[0107] (2) Perform semantic dependency analysis on the initial set of configuration items to generate a set of verified configuration parameters.

[0108] For example, each configuration item in the initial configuration item set is traversed, and the logical relationships between each configuration item are analyzed. These relationships include prerequisite dependencies, mutual exclusions, and association mappings. Based on preset semantic verification rules, the validity of the value range, data type, and association logic of the configuration items is checked. Configuration items with semantic conflicts, abnormal values, or logical contradictions are removed. Missing necessary associated configurations are marked and supplemented, generating a verified configuration parameter set that conforms to semantic specifications.

[0109] Semantic dependency analysis includes analyzing the logical relationships between configuration items, verifying their validity based on semantic rules, removing abnormal configuration items, and supplementing necessary configurations.

[0110] (3) Adapt and convert the verified configuration parameter set based on the preset business rule template to generate the requirement specification.

[0111] For example, the configuration adaptation standards and format specifications are extracted from the preset business rule template. These standards and specifications include parameter naming rules, field hierarchy, and content description paradigms corresponding to the business scenario. Based on these standards and specifications, the verified configuration parameter set is adjusted in terms of field names, restructured in terms of hierarchy, and optimized in terms of content description. The scattered configuration parameters are then integrated and standardized according to the requirements of the business rule template to generate a requirement specification that meets the needs of the business scenario.

[0112] The adaptation and conversion process includes extracting adaptation standards and format specifications from business rule templates, adjusting parameter fields and structures, optimizing content descriptions, and integrating standardized configuration parameters.

[0113] In one embodiment, input text data is injected into a directed data stream pipeline for streaming processing to generate sentiment polarity tags, including:

[0114] (1) Adaptive preprocessing is performed on the input text data to obtain context-aware standardized text.

[0115] For example, adaptive preprocessing is performed on the input text data, including identifying the source format characteristics such as the encoding format and language type of the input text data, calling the adaptive preprocessing module, and automatically selecting a word segmentation strategy based on the language type to perform word segmentation. Noise data such as meaningless special characters and repetitive content in the text is cleaned. Semantic disambiguation is performed on the segmented words in conjunction with the text context, and then the processed text is standardized according to a unified format to obtain context-aware standardized text.

[0116] The adaptive preprocessing includes identifying the format characteristics of the text source, selecting a word segmentation strategy, cleaning noisy data, semantic disambiguation, and normalizing the text format.

[0117] (2) Based on the feature extraction dimension constraints in the requirement specification, dynamic feature extraction is performed on the context-aware standardized text to generate dimension-adapted feature vectors.

[0118] For example, dynamic feature extraction is performed based on the feature extraction dimension constraints in the requirements specification. This includes parsing the feature extraction dimension constraints and clarifying the types of features to be extracted, such as semantic features, sentiment features, and syntactic features. The dynamic feature extraction model scans the context-aware standardized text segment by segment, identifying words, phrases, or sentence structures related to the target feature types. Extraction rules are assigned to different feature types according to the feature extraction dimension constraints. The identified content is then quantified, converting each feature into a numerical form. All quantized feature values ​​are integrated in the order of feature extraction dimensions to generate dimension-adapted feature vectors.

[0119] Dynamic feature extraction includes parsing feature extraction dimension constraints, identifying target feature-related content in the text, assigning extraction rules and quantifying features, and integrating feature values ​​to generate feature vectors.

[0120] (3) Using the following formula, perform real-time sentiment inference based on the model complexity threshold and dimension-adapted feature vectors in the requirements specification to generate sentiment polarity labels:

[0121]

[0122] in, Indicates emotional polarity label, This represents the sentiment classification function. Indicates the first dimensional feature weights, The feature vector representing dimension adaptation. 3D eigenvalues This represents the model selection function. This represents the threshold of model complexity. Representing feature dimension The complexity threshold, This represents the number of dimensions of the feature vector.

[0123] For example, the model complexity threshold in the requirements specification is obtained to clarify the upper limit of the sentiment inference model's complexity. Simultaneously, the feature values ​​and corresponding feature weights of each dimension in the dimension-adapted feature vector are extracted. The model selection function is invoked to select a suitable sentiment classification function from a pre-defined set of sentiment inference models based on the model complexity threshold and the complexity thresholds of each feature dimension. The feature values ​​and corresponding feature weights of the dimension-adapted feature vector are input into the selected sentiment classification function, and operations such as weighted summation and activation function calculations are performed according to the defined calculation logic to output the sentiment polarity label.

[0124] Real-time sentiment inference includes obtaining model complexity thresholds and feature data, selecting a suitable sentiment classification function, inputting feature data, and calculating and generating sentiment polarity labels according to formulas.

[0125] In one embodiment, the module description information stored in the microservice registry is instantiated according to the optimized service orchestration scheme to generate a directed data flow pipeline, including:

[0126] (1) Perform container image matching processing on the version identifier in the optimized service orchestration scheme to obtain a set of versioned functional containers.

[0127] For example, the version identifiers of each service node within the optimized service orchestration scheme are parsed to clarify key information such as the version number and function identifier corresponding to each service node. Then, the module description information stored in the microservice registry is queried, which includes the container image repository address of each module, the mapping relationship between version and function, and other information.

[0128] Based on the version identifier, the corresponding container image is retrieved from the image repository. The retrieved container images undergo integrity verification and functional matching verification to ensure that they can provide the service functions required for the optimized service orchestration scheme. The successfully matched and verified container images are aggregated and integrated to obtain a versioned functional container set.

[0129] The container image matching process includes parsing the service node version identifier, querying module description information, retrieving and verifying container images, and summarizing them to form a set of versioned functional containers.

[0130] (2) Based on the data flow definition of the optimized service orchestration scheme, the versioned function container set is processed to build the data flow topology and generate a directional data flow pipeline.

[0131] For example, the data flow definition in the optimized service orchestration scheme is extracted to clarify the data input source, the data processing order of each service node, the data transmission direction and format requirements between service nodes. A network communication identifier is assigned to each container in the versioned functional container set, and the interfaces and protocols required for data transmission between containers are configured.

[0132] Following the data flow definition, each versioned functional container is connected via a network to construct a data transmission path from the input source to the final output, and the triggering conditions and processing logic for data flow between containers are set. The connectivity of the entire data flow topology and the correctness of data transmission are verified to ensure that data can flow directionally between containers as expected, generating a directional data flow pipeline.

[0133] The data flow topology construction process includes extracting data flow definitions, configuring container communication identifiers and interfaces, connecting containers to build data paths, and verifying topology connectivity and correctness.

[0134] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0135] In one embodiment, such as Figure 3 As shown, this application also provides an NLP-based sentiment analysis device 300, which includes:

[0136] The configuration parsing module 301 is used to parse and process the configuration data input by the user to obtain the required specifications;

[0137] Service orchestration module 302 is used to perform service composition optimization on the preset microservice capability knowledge graph based on the requirement specifications, and generate an optimized service orchestration scheme.

[0138] The pipeline construction module 303 is used to instantiate microservices based on the module description information stored in the microservice registry according to the optimized service orchestration scheme, and generate a directed data flow pipeline.

[0139] The sentiment analysis module 304 is used to inject input text data into a directed data stream pipeline for streaming processing and generate sentiment polarity tags.

[0140] The performance monitoring module 305 is used to perform runtime monitoring and processing on the directed data flow pipeline and generate performance feedback data.

[0141] Specifically, when the configuration parsing module 301 processes the configuration data input by the user, it performs structured syntax parsing to identify the format structure of the configuration data, extracts the configuration fields and values, and generates an initial set of configuration items. Semantic dependency analysis is then performed on the initial set of configuration items to verify the logical relationships and legality between the configuration items, eliminating conflicting or invalid configuration items, and generating a validated set of configuration parameters. Based on a preset business rule template, the validated set of configuration parameters is converted into a format and content that meets the requirements of the business scenario, generating a requirement specification.

[0142] When the service orchestration module 302 performs service composition optimization on the pre-defined microservice capability knowledge graph based on the requirement specifications, it includes dependency traversal, screening service nodes in the knowledge graph and constructing service paths according to the preprocessing and feature extraction requirements in the requirement specifications, resulting in a candidate service chain set. The candidate service chain set undergoes constraint conflict detection and resolution, checking for resource and logical constraints, and resolving conflicts through node replacement or order adjustment to generate feasible service composition schemes. Based on the pre-defined optimization strategy, the topology of feasible service composition schemes is analyzed, and bottleneck nodes are adjusted through parallelization and other means to generate an optimized service orchestration scheme.

[0143] When the pipeline construction module 303 instantiates microservices based on the module description information stored in the microservice registry according to the optimized service orchestration scheme, it includes container image matching processing of the version identifiers in the optimized service orchestration scheme, querying the container image repository corresponding to the module description information in the microservice registry, matching container images that meet the version requirements, performing integrity and functional verification, and obtaining a set of versioned functional containers. Based on the data flow definition of the optimized service orchestration scheme, it configures data transmission interfaces and protocols for the containers in the set of versioned functional containers, connects the containers according to the data flow direction, constructs the topology structure for data flow, verifies connectivity and correctness, and generates a directional data flow pipeline.

[0144] When the sentiment analysis module 304 injects the input text data into the directed data stream pipeline for streaming processing, it performs adaptive preprocessing on the input text data, identifies the text's encoding, language, and other formats, and performs operations such as word segmentation, noise removal, and semantic disambiguation to obtain context-aware standardized text. Based on the feature extraction dimension constraints in the requirements specification, it scans the standardized text to identify target feature-related content, quantifies and integrates features according to rules, and generates dimension-adapted feature vectors. Using a preset formula, combined with the model complexity threshold in the requirements specification and the dimension-adapted feature vectors, it performs real-time sentiment inference calculations and outputs sentiment polarity labels.

[0145] When the performance monitoring module 305 performs runtime monitoring of the directed data flow pipeline, it deploys monitoring probes to each service node and data transmission link of the pipeline to collect performance indicators such as processing latency, resource utilization, and data throughput in real time. The collected performance indicators are aggregated and analyzed to identify performance bottlenecks or abnormal fluctuations. The analysis results are then organized and analyzed according to preset feedback formats and content requirements to generate performance feedback data.

[0146] Service orchestration module 302 is also used for:

[0147] Based on the requirements specifications, the dependency relationship traversal of the microservice capability knowledge graph is performed to obtain a set of candidate service chains.

[0148] Constraint conflict detection and resolution are performed on the candidate service chain set to generate feasible service combination schemes;

[0149] Based on preset optimization strategies, the topology of feasible service combination schemes is reconstructed to generate optimized service orchestration schemes.

[0150] Service orchestration module 302 is also used for:

[0151] Based on the text preprocessing granularity parameters in the requirements specification, the microservice capability knowledge graph is initially filtered to obtain a preprocessed service node set.

[0152] Based on the feature extraction dimension constraints in the requirement specifications, the preprocessed service node set is traversed by the associated edges to obtain the feature extraction service path set.

[0153] Based on the model complexity threshold and service quality constraints in the requirements specification, the feature extraction service path set is aggregated with inference nodes to generate a candidate service chain set.

[0154] Service orchestration module 302 is also used for:

[0155] Based on the latency optimization objective in the preset optimization strategy, critical path identification is performed in the feasible service combination scheme to obtain the bottleneck service node set.

[0156] The bottleneck service node set is processed by parallel sharding to generate parallel service unit groups;

[0157] Based on the resource constraints in the preset optimization strategy, the parallel service unit groups are integrated into the feasible service composition scheme for topology rearrangement to generate an optimized service orchestration scheme.

[0158] Configuration parsing module 301 is also used for:

[0159] The configuration data is parsed using structured syntax to obtain an initial set of configuration items;

[0160] Perform semantic dependency analysis on the initial set of configuration items to generate a validated set of configuration parameters;

[0161] Based on the preset business rule template, the verified configuration parameter set is adapted and transformed to generate the requirement specification.

[0162] The sentiment analysis module 304 is also used for:

[0163] Adaptive preprocessing is performed on the input text data to obtain context-aware standardized text;

[0164] Based on the feature extraction dimension constraints in the requirements specification, dynamic feature extraction is performed on the context-aware standardized text to generate dimension-adapted feature vectors.

[0165] Using the following formula, real-time sentiment inference is performed based on the model complexity threshold and dimensionally adapted feature vectors in the requirements specification to generate sentiment polarity labels:

[0166]

[0167] in, Indicates emotional polarity label, This represents the sentiment classification function. Indicates the first dimensional feature weights, The feature vector representing dimension adaptation. 3D eigenvalues This represents the model selection function. This represents the threshold of model complexity. Representing feature dimension The complexity threshold, This represents the number of dimensions of the feature vector.

[0168] Pipeline building module 303 is also used for:

[0169] Container image matching is performed on the version identifiers in the optimized service orchestration scheme to obtain a set of versioned functional containers.

[0170] Based on the data flow definition of the optimized service orchestration scheme, the versioned function container set is processed to construct the data flow topology and generate a directed data flow pipeline.

[0171] In one embodiment, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0172] In one embodiment, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method embodiments.

[0173] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0174] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.

Claims

1. A sentiment analysis method based on NLP, characterized in that, The method includes: The configuration data input by the user is parsed and processed to obtain the requirement specifications; Based on the aforementioned requirements specifications, the preset microservice capability knowledge graph is optimized through service composition to generate an optimized service orchestration scheme. Based on the optimized service orchestration scheme, the module description information stored in the microservice registry is processed to instantiate microservices, generating a directed data flow pipeline; The input text data is injected into the targeted data stream pipeline for streaming processing to generate sentiment polarity tags. The directional data flow pipeline is monitored during runtime to generate performance feedback data.

2. The NLP-based sentiment analysis method according to claim 1, characterized in that, The step of performing service composition optimization on the preset microservice capability knowledge graph based on the requirement specifications to generate an optimized service orchestration scheme includes: Based on the aforementioned requirement specifications, the microservice capability knowledge graph is traversed for dependency relationships to obtain a set of candidate service chains. The candidate service chain set is subjected to constraint conflict detection and resolution to generate feasible service combination schemes; Based on a preset optimization strategy, the feasible service combination scheme is restructured to generate the optimized service orchestration scheme.

3. The NLP-based sentiment analysis method according to claim 2, characterized in that, The dependency traversal of the microservice capability knowledge graph based on the requirement specification yields a candidate service chain set, including: Based on the text preprocessing granularity parameters in the requirement specification, the microservice capability knowledge graph is subjected to initial node screening to obtain a preprocessed service node set. Based on the feature extraction dimension constraints in the requirement specification, the preprocessed service node set is subjected to associated edge traversal processing to obtain the feature extraction service path set; Based on the model complexity threshold and service quality constraints in the requirement specification, the feature extraction service path set is subjected to inference node aggregation processing to generate the candidate service chain set.

4. The NLP-based sentiment analysis method according to claim 2, characterized in that, The topology reconstruction of the feasible service composition scheme based on the preset optimization strategy to generate the optimized service orchestration scheme includes: Based on the latency optimization objective in the preset optimization strategy, critical path identification processing is performed in the feasible service combination scheme to obtain a bottleneck service node set. The bottleneck service node set is processed in parallel to generate parallel service unit groups; Based on the resource constraints in the preset optimization strategy, the parallel service unit groups are integrated into the feasible service combination scheme for topology rearrangement to generate the optimized service orchestration scheme.

5. The NLP-based sentiment analysis method according to claim 1, characterized in that, The step of parsing and processing the configuration data input by the user to obtain the requirement specifications includes: The configuration data is parsed using structured syntax parsing to obtain an initial set of configuration items; Perform semantic dependency analysis on the initial set of configuration items to generate a verified set of configuration parameters; The verified configuration parameter set is adapted and converted based on a preset business rule template to generate the requirement specification.

6. The NLP-based sentiment analysis method according to claim 1, characterized in that, The step of injecting input text data into the directed data stream pipeline for streaming processing to generate sentiment polarity tags includes: Adaptive preprocessing is performed on the input text data to obtain context-aware standardized text; Based on the feature extraction dimension constraints in the requirement specification, dynamic feature extraction is performed on the context-aware standardized text to generate dimension-adapted feature vectors. The following formula is used to perform real-time sentiment inference based on the model complexity threshold in the requirement specification and the feature vector adapted to the dimension, and to generate the sentiment polarity label: in, Indicates emotional polarity label, This represents the sentiment classification function. Indicates the first dimensional feature weights, The feature vector representing dimension adaptation. 3D eigenvalues This represents the model selection function. This represents the threshold of model complexity. Representing feature dimension The complexity threshold, This represents the number of dimensions of the feature vector.

7. The NLP-based sentiment analysis method according to claim 1, characterized in that, The step of instantiating microservices based on the module description information stored in the microservice registry according to the optimized service orchestration scheme, and generating a directed data flow pipeline, includes: The version identifiers in the optimized service orchestration scheme are subjected to container image matching processing to obtain a set of versioned functional containers; Based on the data flow definition of the optimized service orchestration scheme, the versioned function container set is processed to construct the data flow topology and generate the directed data flow pipeline.

8. A sentiment analysis device based on NLP, characterized in that, The device includes: The configuration parsing module is used to parse and process the configuration data input by the user to obtain the required specifications; The service orchestration module is used to perform service composition optimization on the preset microservice capability knowledge graph based on the requirement specifications, and generate an optimized service orchestration scheme. The pipeline construction module is used to instantiate microservices based on the module description information stored in the microservice registry according to the optimized service orchestration scheme, and generate a directed data flow pipeline. The sentiment analysis module is used to inject input text data into the directed data stream pipeline for streaming processing and generate sentiment polarity tags; The performance monitoring module is used to perform runtime monitoring and processing on the directed data flow pipeline and generate performance feedback data.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the NLP-based sentiment analysis method according to any one of claims 1 to 7.

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