Service semantic processing method based on AI and DDD fusion
By integrating AI with DDD, business semantics are automatically identified and processed, solving the problems of unsystematic semantic parsing and subjective architectural division in existing technologies. This achieves efficient semantic conversion and code generation, improving the accuracy of business semantic processing and development efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUANENG ZHAOCAI DIGITAL TECHNOLOGY CO LTD
- Filing Date
- 2025-12-05
- Publication Date
- 2026-05-08
AI Technical Summary
Existing business semantic processing methods lack a systematic and automated semantic parsing mechanism, making it difficult to identify semantic differences in different business scenarios. The system architecture design module division is highly subjective, and the code generation has a low degree of consistency with business intent, making it difficult to flexibly respond to different business needs.
By adopting an approach that integrates AI and DDD (Domain-Driven Design), structured data is generated by acquiring business data, semantic units are identified and multidimensional semantic data is constructed, aggregation correlation is calculated to divide bounded contexts, code framework is generated and verified, and automatic identification of semantic differences and code construction are achieved.
An automatic semantic recognition architecture was constructed, which intelligently identifies semantic differences in different contexts, improves the accuracy of business semantic conversion, reduces development costs and maintenance difficulty, and improves software development efficiency.
Smart Images

Figure CN121996773A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of semantic processing technology, and in particular to a business semantic processing method based on the fusion of AI and DDD. Background Technology
[0002] Business semantic processing uses natural language processing (NLP) technology to transform natural language queries in enterprise business scenarios into executable analytical tasks, enabling data-driven intelligent decision support. NLP technology is a branch of artificial intelligence that aims to enable computers to understand and process human language, extracting useful information to help humans handle various tasks more efficiently.
[0003] Existing business semantic processing methods suffer from the following technical shortcomings: First, business concept identification relies on human experience and lacks a systematic, comprehensive, and automated semantic parsing mechanism. Furthermore, the semantics of the same business concept differ across different business scenarios, often requiring manual identification and failing to be automatically and accurately recognized, making accurate differentiation and expression difficult. Second, the system architecture design lacks reasonable division, with highly subjective module partitioning and no clear, executable basis for division. Third, the code generation has a low degree of alignment with business intent, making it difficult to flexibly respond to different business needs and quickly utilize existing code for organizational architecture design. Summary of the Invention
[0004] To address the aforementioned technical issues, this application provides a business semantic processing method based on the fusion of AI and DDD, aiming to obtain a technical solution that can automatically and accurately build architecture, automatically identify semantic discrepancies in different contexts, and flexibly build organizational architecture based on existing code.
[0005] In some embodiments of this application, a business semantic processing method based on the fusion of AI and DDD is provided, characterized by including:
[0006] Obtain business data;
[0007] Identify the business data and generate structured data;
[0008] Multiple aggregations are defined based on structured data;
[0009] Obtain the aggregation correlation degree for each aggregation, and divide multiple bounded contexts based on the aggregation correlation degree;
[0010] A code framework is generated based on a bounded context, and the code framework is validated. In some embodiments of this application, the generation of structured data includes:
[0011] Identify semantic units in business data;
[0012] Obtain multidimensional semantic data and location data for each semantic unit;
[0013] The multidimensional semantic data corresponding to the same semantic unit in different locations are set as a single semantic information database.
[0014] In some embodiments of this application, the step of setting multiple aggregations based on structured data includes:
[0015] Select the semantic units corresponding to each aggregation based on the preset semantic network;
[0016] Calculate the fit of each semantic unit;
[0017] Based on the aforementioned fit, corresponding multidimensional semantic data is selected from the semantic information database of the semantic unit.
[0018] In some embodiments of this application, calculating the fit of each semantic unit includes:
[0019] Construct a semantic unit sequence Y, Y=(Y1,Y2…Yi…Yn), where Y1 is the first semantic unit in the aggregate; Yi is the i-th semantic unit in the aggregate; and n is the total number of semantic units in the aggregate.
[0020] A first vocabulary is constructed for each multidimensional semantic data of the semantic unit within the aggregation;
[0021] A second vocabulary is constructed for each semantic unit within the aggregation, and all second vocabularies within the aggregation are set as a third vocabulary.
[0022] Calculate the association fit between each of the first vocabulary and the third vocabulary for the i-th semantic unit;
[0023] Calculate the frequency fit of each of the first lexicon for the i-th semantic unit;
[0024] The fit degree S is calculated based on the correlation fit degree and the frequency fit degree;
[0025] S=K1*S 关 +K2*S 频 ;
[0026] Where K1 is the first coefficient, K2 is the second coefficient, and S 关 For the degree of correlation fit, S 频 For frequency adaptability.
[0027] In some embodiments of this application, the step of calculating the association fit between each of the first lexicon and the third lexicon for the i-th semantic unit includes:
[0028] Let Yi be a sequence of first vocabularies Ti, Ti = (Ti1, Ti2, ..., Tim, ..., Tiq), where Ti1 is the first vocabulary corresponding to the first multidimensional semantic data of the i-th semantic unit in the aggregation; Tim is the first vocabulary corresponding to the m-th multidimensional semantic data of the i-th semantic unit in the aggregation; and q is the number of first vocabularies corresponding to the i-th semantic unit in the aggregation.
[0029] Assign weight coefficients to each word in Tim;
[0030] Calculate the number of times each word in Tim appears in the third vocabulary database;
[0031] The association fit S is calculated based on the frequency of occurrence and the weighting coefficient. 关 ;
[0032] ;
[0033] in, Let i be the number of times the i-th word appears. Let be the weight coefficient of the i-th word, and p be the total number of words in Tim.
[0034] In some embodiments of this application, the step of calculating the frequency fit of each first vocabulary of the i-th semantic unit includes:
[0035] Obtain historical business data;
[0036] Calculate the number of times each word in the first vocabulary database appears in historical business data;
[0037] Obtain the semantic similarity between each primary vocabulary database and historical business data;
[0038] The frequency fit S is calculated based on the semantic similarity and the number of times the numbers appear in historical business data. 频 ;
[0039] S 频 =k 语 * 历 ;
[0040] in, 历 The number of times it appears in historical business data. This represents semantic similarity.
[0041] In some embodiments of this application, obtaining the aggregation correlation degree of each aggregation includes:
[0042] Let J be an aggregate sequence, J = (J1, J2, ..., Jf, ..., Jg, ..., Jr), where J1 is the first aggregate; J2 is the second aggregate; Jf is the f-th aggregate; Jg is the g-th aggregate; and Jr is the r-th aggregate.
[0043] Retrieve aggregate root call data between various aggregates;
[0044] The first degree of association is generated based on the aggregate root call data;
[0045] Obtain data transfer between various aggregates;
[0046] An aggregate correlation degree is generated based on the data transmitted and the first correlation degree.
[0047] In some embodiments of this application, generating a first correlation degree based on the aggregate root call data includes:
[0048] Construct a sequence Cf, where Cf = (Cf1, Cf2, ..., Cfg, ..., Cfr), representing the number of times Jf calls the aggregate root corresponding to other aggregates in the aggregate sequence J within a preset time period. Here, Cf1 represents the number of times Jf calls the aggregate root corresponding to the first aggregate in J; Cf2 represents the number of times Jf calls the aggregate root corresponding to the second aggregate in J; Cfg represents the number of times Jf calls the aggregate root corresponding to the g-th aggregate in J; and Cfr represents the number of times Jf calls the aggregate root corresponding to the r-th aggregate in J.
[0049] Generate the first association degree G1(f, g) between the f-th aggregate and the g-th aggregate;
[0050] G1(f,g) = Cfg / Cfmax;
[0051] Where Cfg is the number of times Jf calls the aggregate root corresponding to the g-th aggregate in J; Cfmax is the maximum value in the sequence Cf.
[0052] In some embodiments of this application, generating the aggregation correlation degree includes:
[0053] Identify all entities and value objects within the aggregate Jf;
[0054] Construct a sequence Df, where Df = (Df1, Df2, ..., Dfg, ..., Dfr), representing the number of times Jf calls the entity and value object corresponding to other aggregates in the aggregate sequence J within a preset time period. Here, Df1 represents the number of times Jf calls the entity and value object corresponding to the first aggregate in J; Df2 represents the number of times Jf calls the entity and value object corresponding to the second aggregate in J; Dfg represents the number of times Jf calls the entity and value object corresponding to the g-th aggregate in J; and Dfr represents the number of times Jf calls the entity and value object corresponding to the r-th aggregate in J.
[0055] Generate the first correlation correction factor G2(f, g) between the f-th aggregate and the g-th aggregate;
[0056] G2(f,g)=1+λ*Dfg / (Cfg+ε);
[0057] Where G2(f, g) is the first correlation correction factor between the f-th aggregate and the g-th aggregate; λ is the first correction strength; and ε is the second correction strength.
[0058] Generate the aggregation correlation G(f, g) between the f-th aggregation and the g-th aggregation;
[0059] G(f,g)=G2(f,g)*G1(f,g).
[0060] In some embodiments of this application, the division of multiple bounded contexts includes:
[0061] Set a first correlation threshold and a second correlation threshold;
[0062] Obtain the aggregation correlation degree between all aggregations and set it as a correlation degree matrix;
[0063] Traverse all aggregation correlations in the aforementioned correlation matrix, and classify aggregations whose aggregation correlation reaches the first correlation threshold into the same bounded context;
[0064] For each unbounded context, the aggregations that satisfy the partitioning conditions will be further partitioned into secondary aggregations.
[0065] Compared with existing technologies, the business semantic processing method based on the fusion of AI and DDD in this application has the following advantages:
[0066] A unified business semantic processing system was constructed to automatically build a semantic recognition architecture, intelligently identify semantic differences in different contexts, and automatically build code frameworks. This method, by integrating natural language processing technology and domain-driven design, can achieve the understanding and structured transformation of unstructured business data. After semantic parsing, the system can not only identify the core semantics of business concepts, but also comprehensively grasp various semantic information of words and sentences in different contexts through the established semantic information database. Simultaneously, it can accurately determine the precise meaning of each business concept in different contexts, greatly improving the accuracy of the conversion from business semantics to technical implementation.
[0067] Meanwhile, this method enables intelligent design of the semantic recognition architecture and automatic code construction. Based on the semantic features and change characteristics of each business concept, the system intelligently delineates bounded context boundaries, ensuring that the system architecture conforms to both the business essence and technical implementation requirements. Through multi-layered code generation and verification mechanisms, it significantly improves software development efficiency and minimizes development costs and maintenance difficulty. Attached Figure Description
[0068] Figure 1 This is a flowchart illustrating a business semantic processing method based on the fusion of AI and DDD in an embodiment of this application. Detailed Implementation
[0069] The specific embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate this application, but are not intended to limit the scope of this application.
[0070] In the description of this application, it should be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0071] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0072] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0073] like Figure 1 As shown in the figure, an embodiment of this application provides a business semantic processing method based on the fusion of AI and DDD, comprising:
[0074] Obtain business data;
[0075] Identify business data and generate structured data;
[0076] Multiple aggregations are defined based on structured data;
[0077] Obtain the aggregation correlation degree for each aggregation, and divide multiple bounded contexts based on the aggregation correlation degree;
[0078] A code framework is generated based on a bounded context, and the code framework is then validated.
[0079] Specifically, business data refers to various unstructured text documents generated during daily operations, including but not limited to meeting minutes, bidding documents, requirement documents, and product manuals. This data contains a wealth of business knowledge but lacks a unified format and structure.
[0080] Specifically, structured data is the sum of semantic information data and semantic structure data obtained after processing business data, bounded contexts, aggregations, etc. Examples include: the entire bounded context, its various aggregations, the semantic units within each aggregation, the relationships, rules, and meanings between semantic units, the location of each semantic unit, the aggregation root of each aggregation, different bounded contexts, the amount of data exchanged between aggregations, and the data exchange format.
[0081] Specifically, an aggregation refers to a collection of semantic units with strong business relationships. When you need to modify information, you need to enter from the unique aggregation root and make the modification to ensure the consistency of the entire aggregation.
[0082] Specifically, bounded contexts divide your complex business system into relatively independent modules, each of which can have its own language system, its own rules, and its own functions.
[0083] Specifically, the code framework is the code that implements the semantic analysis selection process in the software, such as: the code for the meaning of each semantic unit, the code for the relationship between it and other semantic units and the code for the semantic units included in the entire aggregation.
[0084] Specifically, the code framework is generated based on bounded contexts, and the code framework is validated as follows: Based on a pre-defined code template library, corresponding code templates are selected for each bounded context; aggregate roots, entities, and value objects in the bounded contexts are identified and mapped to corresponding first-class code frameworks; a third-class vocabulary for each aggregate is identified and mapped to corresponding second-class code frameworks; data transmission information between aggregates is obtained, and third-class code frameworks are generated; based on the first-class, second-class, and third-class code frameworks, the overall code framework is assembled. Different bounded contexts have different update frequencies, contents, and functional focuses, leading to different emphasis in code writing. The first-class code framework is a mapping that intuitively describes information such as each entity, value object, and aggregate root. It includes: an aggregate root class containing a unique identifier (ID); entities and value objects within its jurisdiction as attributes; core business methods that enforce business rules internally; and entity classes: objects with independent identities. For example, in the "bidding aggregate," a BidDocument (bid document) class is generated, which has its own version number, but its lifecycle is managed by the Bid aggregate root. In the "Bidding Aggregator," a `Bid` (Bidding) class is generated, containing methods such as `submit()` and `modify()`, which validate rules such as "whether the bid is submitted before the deadline." The second type of code framework organizes and uses the core domain model to complete specific business tasks, while also defining the system's external interfaces. This includes: application service classes, interface (API) definitions, and domain events. For example, `BiddingApplicationService` is generated, containing the `createBiddingProject()` (create bidding project) method, which internally calls the constructor of the `BiddingProject` (bidding project) aggregate root and publishes a "project created" domain event. A `BidSubmittedEvent` (bid submission event) class is generated, containing data such as the bid ID and submission time. The third type of code framework addresses technical details and communication between different system modules (bounded contexts). It includes code responsible for saving or retrieving domain objects from the database, enabling communication between different bounded contexts, and publishing and subscribing to domain events. This includes: message passing / event handling code, configuration files, such as generating the BidRepository interface and its implementation class (e.g., JdbcBidRepository), including methods like save() and findById(). It also generates a DomainEventPublisher and its corresponding event handler, BidSubmittedEventHandler; database connection configuration, API gateway routing configuration, and message queue configuration.
[0085] Specifically, code framework validation includes: static analysis of the code for each aggregate to identify and modify defective code; and dynamic analysis of the modified code based on performance benchmarking. Static analysis involves examining the code of each aggregate in a non-running state to identify and modify defective code. Static analysis includes code style checks, architectural principle verification, and dependency analysis. Dynamic analysis involves performing performance benchmarking on the modified code, performing dynamic detection and modification. The preferred response time for performance benchmarking is less than 100 milliseconds.
[0086] In some embodiments of this application, the generation of structured data includes:
[0087] Identify semantic units in business data;
[0088] Obtain multidimensional semantic data and location data for each semantic unit;
[0089] The multidimensional semantic data corresponding to the same semantic unit in different locations are set as a single semantic information database.
[0090] Specifically, a semantic unit is the smallest business concept with independent meaning in business data. For example, in a procurement system, "supplier," "tender project," "bid document," and "evaluation expert" are all semantic units.
[0091] Specifically, multidimensional semantic data represents the core definitions of corresponding semantic units in all situations and locations, and the standard meaning of semantic units in business. For example, the core definition of "supplier" is "a commercial entity that provides goods or services to an enterprise." The specific meaning of the same semantic unit in different business scenarios is as follows: in a bidding scenario, "supplier" refers to "a legal entity with bidding qualifications"; in a contract scenario, "supplier" refers to "a supplier with a signed cooperation agreement."
[0092] Relational data, the position of semantic units in the business classification system, such as "supplier" being a type of "business partner", the business relationship network of semantic units.
[0093] Rule data, business rules, verification rules, calculation rules such as: "Supplier comprehensive score = quality score × 0.4 + delivery score × 0.3 + service score × 0.3" "Suppliers must pass the qualification review".
[0094] Lifecycle data and corresponding business context data.
[0095] Specifically, the semantic information database is a semantic concept and the various types of information derived from it, such as: "supplier" refers to "a legal entity with bidding qualifications" and its corresponding information; "supplier" refers to "the entity that receives accounts payable" and its corresponding information.
[0096] Specifically, location data refers to the position of the corresponding semantic unit within the text or data.
[0097] In some embodiments of this application, multiple aggregations are defined based on structured data, including:
[0098] Select the semantic units corresponding to each aggregation based on the preset semantic network;
[0099] Calculate the fit of each semantic unit;
[0100] Based on the fit, corresponding multidimensional semantic data is selected from the semantic information database of the semantic unit.
[0101] Specifically, fit is the semantic unit's meaning that best matches the current usage scenario among different meanings. Fit is divided into frequency fit and association fit.
[0102] In some embodiments of this application, the adaptation degree of each semantic unit is calculated, including:
[0103] Construct a semantic unit sequence Y, Y=(Y1,Y2…Yi…Yn), where Y1 is the first semantic unit in the aggregate; Yi is the i-th semantic unit in the aggregate; and n is the total number of semantic units in the aggregate.
[0104] A first vocabulary is constructed for each multidimensional semantic data of the semantic unit within the aggregation;
[0105] A second vocabulary is constructed for each semantic unit within the aggregation, and all second vocabularies within the aggregation are set as the third vocabulary.
[0106] Calculate the association fit between the first vocabulary and the third vocabulary for each semantic unit of the i-th semantic unit;
[0107] Calculate the frequency fit of each of the first lexicon for the i-th semantic unit;
[0108] The fitness degree S is calculated based on the correlation fitness degree and the frequency fitness degree;
[0109] S=K1*S 关 +K2*S 频 ;
[0110] Where K1 is the first coefficient, K2 is the second coefficient, and S 关 For the degree of correlation fit, S 频 For frequency adaptability.
[0111] Specifically, the first vocabulary corpus contains keywords unique to the semantic unit corresponding to the semantic data. For example, the first vocabulary corpus for the candidate meaning of "document" as "technical solution document" might be {technical parameters, design drawings, implementation plan}.
[0112] Specifically, the second vocabulary consists of keywords common to all semantic units.
[0113] Specifically, the third vocabulary database is a vocabulary database generated by aggregating all the second vocabulary databases.
[0114] Specifically, K1 is the first coefficient, representing the weighting coefficient of association fit, and K2 is the second coefficient, representing the weighting coefficient of frequency fit. K1 and K2 respectively indicate the degree of influence of association fit and frequency fit on the final fit, i.e., whether more emphasis is placed on the relevance to words within the aggregation or on the universality of candidate meanings. The sum of K1 and K2 is 1. Among them, K1 is preferably 0.7; K2 is preferably 0.3.
[0115] Specifically, the association fit assessment evaluates whether a candidate meaning of a semantic unit can be perfectly integrated into the microenvironment within its aggregate and its association with other words within that aggregate.
[0116] Specifically, frequency fit assesses the prevalence and maturity of a candidate meaning. A meaning that is widely and long-term used generally has higher stability and acceptability.
[0117] In some embodiments of this application, the association fit degree between each first vocabulary and the third vocabulary of the i-th semantic unit is calculated, including:
[0118] Let Yi be a sequence of first vocabularies Ti, Ti = (Ti1, Ti2, ..., Tim, ..., Tiq), where Ti1 is the first vocabulary corresponding to the first multidimensional semantic data of the i-th semantic unit in the aggregation; Tim is the first vocabulary corresponding to the m-th multidimensional semantic data of the i-th semantic unit in the aggregation; and q is the number of first vocabularies corresponding to the i-th semantic unit in the aggregation.
[0119] Assign weight coefficients to each word in Tim;
[0120] Calculate the number of times each word in Tim appears in the third vocabulary database;
[0121] The association fit S is calculated based on the frequency of occurrence and the weighting coefficient. 关 ;
[0122] ;
[0123] in, Let i be the number of times the i-th word appears. Let be the weight coefficient of the i-th word, and p be the total number of words in Tim.
[0124] Specifically, the weighting coefficient is determined based on the frequency of each word in historical data. The weighting coefficient is the total number of times a single word appears divided by the total number of times all words in the vocabulary appear.
[0125] In some embodiments of this application, the frequency fit of each first vocabulary of the i-th semantic unit is calculated, including:
[0126] Obtain historical business data;
[0127] Calculate the number of times each word in the first vocabulary database appears in historical business data;
[0128] Obtain the semantic similarity between each primary vocabulary database and historical business data;
[0129] Frequency fit S is calculated based on semantic similarity and the number of times it appears in historical business data. 频 ;
[0130] S 频 =k 语 * 历 ;
[0131] in, 历 The number of times it appears in historical business data. This represents semantic similarity.
[0132] In some embodiments of this application, obtaining the aggregation correlation degree of each aggregation includes:
[0133] Let J be an aggregate sequence, J = (J1, J2, ..., Jf, ..., Jg, ..., Jr), where J1 is the first aggregate; J2 is the second aggregate; Jf is the f-th aggregate; Jg is the g-th aggregate; and Jr is the r-th aggregate.
[0134] Retrieve aggregate root call data between various aggregates;
[0135] The first degree of association is generated based on the aggregate root call data;
[0136] Obtain data transfer between various aggregates;
[0137] An aggregate correlation degree is generated based on the data transmitted and the first correlation degree.
[0138] Specifically, the aggregate root call data is the number of times each aggregate calls other aggregate roots.
[0139] Specifically, the data transmitted is the number of times each aggregate calls value objects and entities in other aggregates.
[0140] Specifically, the first degree of correlation is the approximate degree of correlation between the aggregates determined based on the aggregate root.
[0141] Specifically, aggregation correlation is a more accurate correlation that is refined and precise based on the data within each aggregation.
[0142] In some embodiments of this application, generating a first correlation degree based on the aggregate root call data includes:
[0143] Construct a sequence Cf, where Cf = (Cf1, Cf2, ..., Cfg, ..., Cfr), representing the number of times Jf calls the aggregate root corresponding to other aggregates in the aggregate sequence J within a preset time period. Here, Cf1 represents the number of times Jf calls the aggregate root corresponding to the first aggregate in J; Cf2 represents the number of times Jf calls the aggregate root corresponding to the second aggregate in J; Cfg represents the number of times Jf calls the aggregate root corresponding to the g-th aggregate in J; and Cfr represents the number of times Jf calls the aggregate root corresponding to the r-th aggregate in J.
[0144] Generate the first association degree G1(f, g) between the f-th aggregate and the g-th aggregate;
[0145] G1(f,g) = Cfg / Cfmax;
[0146] Where Cfg is the number of times Jf calls the aggregate root corresponding to the g-th aggregate in J; Cfmax is the maximum value in the sequence Cf.
[0147] Specifically, the preset time period is preferably 90 days.
[0148] In some embodiments of this application, generating the aggregation correlation degree includes:
[0149] Identify all entities and value objects within the aggregate Jf;
[0150] Construct a sequence Df, where Df = (Df1, Df2, ..., Dfg, ..., Dfr), representing the number of times Jf calls the entity and value object corresponding to other aggregates in the aggregate sequence J within a preset time period. Here, Df1 represents the number of times Jf calls the entity and value object corresponding to the first aggregate in J; Df2 represents the number of times Jf calls the entity and value object corresponding to the second aggregate in J; Dfg represents the number of times Jf calls the entity and value object corresponding to the g-th aggregate in J; and Dfr represents the number of times Jf calls the entity and value object corresponding to the r-th aggregate in J.
[0151] Generate the first correlation correction factor G2(f, g) between the f-th aggregate and the g-th aggregate;
[0152] G2(f,g)=1+λ*Dfg / (Cfg+ε);
[0153] Where G2(f, g) is the first correlation correction factor between the f-th aggregate and the g-th aggregate; λ is the first correction strength; and ε is the second correction strength.
[0154] Generate the aggregation correlation G(f, g) between the f-th aggregation and the g-th aggregation;
[0155] G(f,g)=G2(f,g)*G1(f,g).
[0156] Specifically, λ is preferably 0.8.
[0157] Specifically, ε is preferably 0.01.
[0158] In some embodiments of this application, the division of multiple bounded contexts includes:
[0159] Set a first correlation threshold and a second correlation threshold;
[0160] Obtain the aggregation correlation degree between all aggregations and set it as a correlation degree matrix;
[0161] Traverse all aggregation correlations in the aforementioned correlation matrix, and classify aggregations whose aggregation correlation reaches the first correlation threshold into the same bounded context;
[0162] For each unbounded context, the aggregations that satisfy the partitioning conditions will be further partitioned into secondary aggregations.
[0163] Specifically, the secondary aggregation partitioning includes calculating the average association degree: for each aggregation that has not yet been partitioned, calculate the average aggregation association degree between it and all aggregations in each existing bounded context. When the average association degree is greater than the second association degree threshold, the aggregation is merged into the corresponding bounded context. When an aggregation satisfies the second association degree threshold with multiple bounded contexts, the aggregation is assigned to the bounded context with the highest average aggregation association degree. If the average association degree does not satisfy the second association degree threshold, the aggregation is partitioned into a separate bounded context.
[0164] Specifically, the first correlation threshold is preferably 0.85, and the second correlation threshold is preferably 0.55.
[0165] The above are merely preferred embodiments of this application. It should be noted that, for those skilled in the art, several improvements and substitutions can be made without departing from the technical principles of this application, and these improvements and substitutions should also be considered within the scope of protection of this application.
Claims
1. A business semantic processing method based on the fusion of AI and DDD, characterized in that, include: Obtain business data; Identify the business data and generate structured data; Multiple aggregations are defined based on structured data; Obtain the aggregation correlation degree for each aggregation, and divide multiple bounded contexts based on the aggregation correlation degree; A code framework is generated based on a bounded context, and the code framework is then validated.
2. The business semantic processing method based on the fusion of AI and DDD as described in claim 1, characterized in that, The generation of structured data includes: Identify semantic units in business data; Obtain multidimensional semantic data and location data for each semantic unit; The multidimensional semantic data corresponding to the same semantic unit in different locations are set as a single semantic information database.
3. The business semantic processing method based on the fusion of AI and DDD as described in claim 2, characterized in that, The setting of multiple aggregations based on structured data includes: Select the semantic units corresponding to each aggregation based on the preset semantic network; Calculate the fit of each semantic unit; Based on the aforementioned fit, corresponding multidimensional semantic data is selected from the semantic information database of the semantic unit.
4. The business semantic processing method based on the fusion of AI and DDD as described in claim 3, characterized in that, The calculation of the fit of each semantic unit includes: Construct a semantic unit sequence Y, Y=(Y1,Y2…Yi…Yn), where Y1 is the first semantic unit in the aggregate; Yi is the i-th semantic unit in the aggregate; and n is the total number of semantic units in the aggregate. A first vocabulary is constructed for each multidimensional semantic data of the semantic unit within the aggregation; A second vocabulary is constructed for each semantic unit within the aggregation, and all second vocabularies within the aggregation are set as a third vocabulary. Calculate the association fit degree between each of the first vocabulary and the third vocabulary for the i-th semantic unit; Calculate the frequency fit of each of the first lexicon for the i-th semantic unit; The fit degree S is calculated based on the correlation fit degree and the frequency fit degree; S=K1*S 关 +K2*S 频 ; Where K1 is the first coefficient, K2 is the second coefficient, and S 关 For the degree of correlation fit, S 频 For frequency adaptability.
5. The business semantic processing method based on the fusion of AI and DDD as described in claim 4, characterized in that, The step of calculating the association fit between each of the first lexicon and the third lexicon for the i-th semantic unit includes: Let Yi be a sequence of first vocabularies Ti, Ti = (Ti1, Ti2, ..., Tim, ..., Tiq), where Ti1 is the first vocabulary corresponding to the first multidimensional semantic data of the i-th semantic unit in the aggregation; Tim is the first vocabulary corresponding to the m-th multidimensional semantic data of the i-th semantic unit in the aggregation; and q is the number of first vocabularies corresponding to the i-th semantic unit in the aggregation. Assign weight coefficients to each word in Tim; Calculate the number of times each word in Tim appears in the third vocabulary database; The association fit S is calculated based on the frequency of occurrence and the weighting coefficient. 关 ; ; in, Let i be the number of times the i-th word appears. Let be the weight coefficient of the i-th word, and p be the total number of words in Tim.
6. The business semantic processing method based on the fusion of AI and DDD as described in claim 4, characterized in that, The step of calculating the frequency fit of each first vocabulary for the i-th semantic unit includes: Obtain historical business data; Calculate the number of times each word in the first vocabulary database appears in historical business data; Obtain the semantic similarity between each primary vocabulary database and historical business data; The frequency fit S is calculated based on the semantic similarity and the number of times the numbers appear in historical business data. 频 ; S 频 =k 语 * 历 ; in, 历 The number of times it appears in historical business data. This represents semantic similarity.
7. The business semantic processing method based on the fusion of AI and DDD as described in claim 6, characterized in that, The process of obtaining the aggregation correlation degree for each aggregation includes: Let J be an aggregate sequence, J = (J1, J2, ..., Jf, ..., Jg, ..., Jr), where J1 is the first aggregate; J2 is the second aggregate; Jf is the f-th aggregate; Jg is the g-th aggregate; and Jr is the r-th aggregate. Retrieve aggregate root call data between various aggregates; The first degree of association is generated based on the aggregate root call data; Obtain data transfer between various aggregates; An aggregate correlation degree is generated based on the data transmitted and the first correlation degree.
8. The business semantic processing method based on the fusion of AI and DDD as described in claim 7, characterized in that, The step of generating the first correlation degree based on the aggregate root call data includes: Construct a sequence Cf, where Cf = (Cf1, Cf2, ..., Cfg, ..., Cfr), representing the number of times Jf calls the aggregate root corresponding to other aggregates in the aggregate sequence J within a preset time period. Here, Cf1 represents the number of times Jf calls the aggregate root corresponding to the first aggregate in J; Cf2 represents the number of times Jf calls the aggregate root corresponding to the second aggregate in J; Cfg represents the number of times Jf calls the aggregate root corresponding to the g-th aggregate in J; and Cfr represents the number of times Jf calls the aggregate root corresponding to the r-th aggregate in J. Generate the first association degree G1(f, g) between the f-th aggregate and the g-th aggregate; G1(f,g) = Cfg / Cfmax; Where Cfg is the number of times Jf calls the aggregate root corresponding to the g-th aggregate in J; Cfmax is the maximum value in the sequence Cf.
9. A business semantic processing method based on the fusion of AI and DDD as described in claim 8, characterized in that, The generation of aggregation correlation degree includes: Identify all entities and value objects within the aggregate Jf; Construct a sequence Df, where Df = (Df1, Df2, ..., Dfg, ..., Dfr), representing the number of times Jf calls the entity and value object corresponding to other aggregates in the aggregate sequence J within a preset time period. Here, Df1 represents the number of times Jf calls the entity and value object corresponding to the first aggregate in J; Df2 represents the number of times Jf calls the entity and value object corresponding to the second aggregate in J; Dfg represents the number of times Jf calls the entity and value object corresponding to the g-th aggregate in J; and Dfr represents the number of times Jf calls the entity and value object corresponding to the r-th aggregate in J. Generate the first correlation correction factor G2(f, g) between the f-th aggregate and the g-th aggregate; G2(f,g)=1+λ*Dfg / (Cfg+ε); Where G2(f, g) is the first correlation correction factor between the f-th aggregate and the g-th aggregate; λ is the first correction strength; and ε is the second correction strength. Generate the aggregation correlation G(f, g) between the f-th aggregation and the g-th aggregation; G(f,g)=G2(f,g)*G1(f,g).
10. A business semantic processing method based on the fusion of AI and DDD as described in claim 9, characterized in that, The division of multiple bounded contexts includes: Set a first correlation threshold and a second correlation threshold; Obtain the aggregation correlation degree between all aggregations and set it as a correlation degree matrix; Traverse all aggregation correlations in the aforementioned correlation matrix, and classify aggregations whose aggregation correlation reaches the first correlation threshold into the same bounded context; For each unbounded context, the aggregations that satisfy the partitioning conditions will be further partitioned into secondary aggregations.