Domain model identification method, device, equipment and storage medium

By obtaining and analyzing the basic information of the domain objects, generating global topology structures and circle maps, and automatically identifying the domain models of open source or legacy projects, solving the problem of time-consuming and labor-intensive code understanding and achieving efficient project development.

CN113867786BActive Publication Date: 2025-08-26MIGU CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111176647.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-09
Publication Date
2025-08-26
Estimated Expiration
2041-10-09

AI Technical Summary

Technical Problem

In the prior art, the code design and structure understanding of medium and large open source or legacy projects is time-consuming and labor-intensive, and depends on the experience and business experience of developers, and lacks effective automation tools.

Method used

By obtaining basic information of domain objects, analyzing their association relationships, generating a global topology, and automatically identifying the common domain, support domain and core domain of domain models on the circle map based on bytecode processing and code dynamic tracking tools.

Benefits of technology

No manual intervention is required, domain models are automatically identified and output, reducing the time and cost of understanding code, and improving project implementation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113867786B_ABST
    Figure CN113867786B_ABST
Patent Text Reader

Abstract

The present invention discloses a domain model identification method, device, equipment and storage medium. The domain model identification method includes: obtaining basic information of domain objects in the domain model source code; analyzing the association information between domain objects based on the basic information to obtain the topological structure of the global domain object in the source code; generating a circle layer diagram extending from the inside to the outside based on the topological structure of the global domain object, and automatically identifying and outputting the general domain, support domain and core domain of the domain model on the circle layer diagram. By obtaining the basic information of the domain object and analyzing the association information between domain objects based on the basic information, the topological structure of the global domain object in the source code is obtained, and further generating a circle layer diagram extending from the inside to the outside based on the topological structure of the global domain object, the general domain, support domain and core domain of the domain model on the circle layer diagram are automatically identified. The entire process does not require manual intervention and can automatically identify the domain model in the source code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software project development, and in particular to a domain model recognition method, device, equipment and storage medium. Background Art

[0002] With the maturity and widespread adoption of Java object-oriented, distributed, and microservices technologies, more and more companies are choosing the Java language and its related ecosystem as their preferred technology stack for project implementation. In the initial stages of project implementation, developers often refer to relevant open source technology solutions, refactoring and redeveloping based on similar legacy systems or open source projects. For medium- to large-scale open source or legacy projects, the code base often exceeds hundreds of thousands of lines. Effectively and quickly understanding the code design and structure, particularly the design and topology of relevant domain models, is crucial for ensuring project personnel understand the code correctly.

[0003] In the existing technology, implementation is usually based on referring to relevant materials and code comments. On the one hand, it requires high skills and experience of developers, and a certain amount of business experience accumulation. On the other hand, when the code design is too complex, analyzing and sorting out its structure is often very time-consuming. If the code-related materials are lacking or incomplete, it may cost a lot and introduce considerable risks. Even with the assistance of IDE's UML modeling tools, it is necessary to first be familiar with the overall code structure and rely on manual sorting out of some core domain objects. Summary of the Invention

[0004] In view of the above problems, embodiments of the present invention are proposed to provide a domain model identification method, apparatus, device, and storage medium that overcome the above problems or at least partially solve the above problems.

[0005] According to one aspect of an embodiment of the present invention, a domain model identification method is provided, comprising:

[0006] Get basic information about domain objects in the domain model source code;

[0007] Analyzing the association information between domain objects based on the basic information to obtain a topological structure of the global domain objects in the source code; wherein the association information includes the association relationship between each domain object;

[0008] Generate a circle diagram extending from the inside out according to the topological structure of the global domain object, and automatically identify the general domain, supporting domain and core domain of the domain model on the circle diagram;

[0009] The topological structure of the global domain object, the general domain, the supporting domain and the core domain of the domain model are output.

[0010] Furthermore, before obtaining basic information of domain objects in the source code, the method further includes:

[0011] Use bytecode processing tools to embed bytecode enhancement logic when constructing class objects in the domain model;

[0012] The bytecode enhancement logic is executed when the bytecode is loaded into the virtual machine and a class object is generated through a code dynamic tracking tool; wherein the bytecode processing logic is used to obtain basic information of the domain object.

[0013] Furthermore, the bytecode enhancement logic is executed by the code dynamic tracking tool when the bytecode is loaded into the virtual machine and a class object is generated, including:

[0014] registering the bytecode enhancement logic in a bytecode modification method using a code dynamic tracing tool;

[0015] When the bytecode is loaded into the virtual machine and a class object is generated, calling the class object acquisition method automatically triggers the execution of the bytecode enhancement logic.

[0016] Furthermore, obtaining basic information of domain objects in the source code includes:

[0017] The basic information of the domain object is obtained according to the meta-information of the Class class corresponding to the domain object and the first analysis rule; wherein the basic information includes at least one of the parent class inherited by the domain object, the set of implemented interfaces, whether it is an abstract class, reference relationship information and dependency relationship information.

[0018] Furthermore, analyzing the association information between domain objects based on the basic information to obtain the topology structure of the global domain objects in the source code includes:

[0019] Determine an association relationship set of domain objects according to the basic information, traverse each associated domain object in the association relationship set, form an aggregated relationship set with associated domain objects that meet a first preset condition, or form a combined relationship set with associated domain objects that meet a second preset condition;

[0020] Deducing the inherited parent class of the domain object based on the basic information to determine the inheritance chain of the domain object;

[0021] The topology structure of the global domain object in the source code is determined according to at least one association information in the aggregation relationship set, the composition relationship set, and the inheritance chain.

[0022] Furthermore, generating a circle diagram extending from the inside out according to the topological structure of the global domain object includes:

[0023] Merging domain object sets with the same attributes into one domain object set; wherein the attributes include inheritance classes and / or composition relationships;

[0024] Based on the merged domain object set, a circle diagram is generated from the inside out according to the reference relationship and reference depth.

[0025] Furthermore, the automatic identification of the general domain, supporting domain, and core domain of the domain model on the circle diagram includes:

[0026] According to the characteristics of the circle diagram and the properties of the domain of the domain model, the domain objects within the preset layer in the circle diagram are used as general domains and supporting domains, and the domain objects outside the preset layer and the preset layer in the circle diagram are used as core domains; wherein, the preset layer is determined according to the number of times the nodes in each layer are referenced or dependent.

[0027] According to another aspect of an embodiment of the present invention, a domain model identification device is provided, comprising:

[0028] Basic information acquisition module, used to obtain basic information of domain objects in the domain model source code;

[0029] A deep analysis module, configured to analyze association information between domain objects based on the basic information to obtain a topological structure of global domain objects in the source code; wherein the association information includes association relationships between domain objects;

[0030] A circle diagram generation module is used to generate a circle diagram extending from the inside out according to the topological structure of the global domain object, and automatically identify the general domain, support domain and core domain of the domain model on the circle diagram;

[0031] The information output module is used to output the topological structure of the global domain object, the general domain, the supporting domain and the core domain of the domain model.

[0032] According to another aspect of an embodiment of the present invention, there is provided a computing device, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus;

[0033] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the above-mentioned domain model recognition method.

[0034] According to another aspect of an embodiment of the present invention, a computer storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a processor to perform operations corresponding to the above-mentioned domain model recognition method.

[0035] According to the solution provided by the above-mentioned embodiment of the present invention, by obtaining the basic information of the domain objects and analyzing the association information between the domain objects based on the basic information, the topological structure of the global domain objects in the source code is obtained. Further, based on the topological structure of the global domain objects, a circle diagram extending from the inside to the outside is generated, and the general domain, supporting domain, and core domain of the domain model on the circle diagram are automatically identified. The entire process does not require manual intervention and can automatically identify the domain model in the source code.

[0036] The above description is only an overview of the technical solutions of the embodiments of the present invention. In order to more clearly understand the technical means of the embodiments of the present invention, they can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiments of the present invention more obvious and easy to understand, the specific implementation methods of the embodiments of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the embodiments of the present invention. The same reference numerals are used throughout the accompanying drawings to denote the same components. In the accompanying drawings:

[0038] Figure 1 A flowchart of a domain model identification method provided by the first embodiment of the present invention is shown;

[0039] Figure 2 A schematic diagram of the circle diagram structure in the domain model identification method provided in the first embodiment of the present invention is shown;

[0040] Figure 3 A flowchart of a domain model identification method provided by the second embodiment of the present invention is shown;

[0041] Figure 4 A flowchart of a domain model identification method provided by the third embodiment of the present invention is shown;

[0042] Figure 5 A schematic diagram of the UML topology relationship of the school information system in the domain model identification method provided in the third embodiment of the present invention is shown;

[0043] Figure 6 A schematic diagram showing the structure of a domain model recognition device provided by a fourth embodiment of the present invention is shown;

[0044] Figure 7 A schematic diagram of the structure of a computing device provided in Example 6 of the present invention is shown. DETAILED DESCRIPTION

[0045] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.

[0046] Example 1

[0047] Figure 1 FIG. 1 shows a flow chart of a domain model identification method provided by the first embodiment of the present invention. Figure 1 As shown, the method includes the following steps:

[0048] Step S110: Obtain basic information of domain objects in the domain model source code.

[0049] The execution subject of this embodiment may be the domain model recognition device disclosed in the embodiment of the invention, and the device may be implemented in the form of software or hardware.

[0050] The source code can be an open source project developed using a computer language or a legacy project that the current developer is not involved in, such as a Java open source project or a legacy project, a C open source project or a legacy project, or a C++ open source project or a legacy project. Specifically, during project development, a corresponding domain model is first designed based on the business domain, and then computer languages ​​are used based on this domain model to implement the functions required by the business.

[0051] Among them, the basic information includes the parent class inherited by the domain object, the set of implemented interfaces, whether it is an abstract class, reference relationship information and dependency relationship information, etc.

[0052] Optionally, basic information about the domain object is obtained based on the metadata of the Class class corresponding to the domain object and the first analysis rule. The first analysis rule is designed by combining domain object analysis rules with object-oriented development methodology and Unified Modeling Language (UML) theory. Table 1 below shows the design of the first analysis rule set:

[0053] Table 1

[0054]

[0055] Step S120: Analyze the association information between domain objects based on the basic information to obtain the topological structure of the global domain objects in the source code.

[0056] The association information includes the associations between domain objects. For example, the aggregation relationship information, composition relationship set, and inheritance chain of the domain objects determined in Table 1 above are used to construct the topology of the global domain objects in the source code. The global domain objects include all domain objects in the source code.

[0057] Optionally, a domain object's association relationship set is determined based on basic information, and each associated domain object in the association relationship set is traversed. Associated domain objects that meet a first preset condition are formed into an aggregated relationship set, or associated domain objects that meet a second preset condition are formed into a combined relationship set. For example, for its association relationship set, each associated domain object is traversed. If one of the associated domain objects, A, is associated with other domain objects, and the associated domain objects obtained through a union-find method do not have the same inheritance class, and a regular matching method is used to determine whether it contains a large number of non-static setXX and getXX methods (generally accounting for more than 60% of the total number of ordinary fields in A), and XX has the same name as a field in A, then the first preset condition is met. If one of the associated domain objects, A, is not associated with other domain objects, or the associated domain objects obtained through a union-find method have the same inheritance class, and a regular matching method is used to determine whether it contains a large number of non-static setXX and getXX methods (generally accounting for more than 60% of the total number of ordinary fields in A), and XX has the same name as a field in A, then the second preset condition is met.

[0058] And / or, the inherited parent class of the domain object is deduced based on the basic information to determine the inheritance chain of the domain object; and the topology structure of the global domain object in the source code is determined based on at least one association information in the aggregation relationship set, the combination relationship set and the inheritance chain.

[0059] Specifically, the above-mentioned method for obtaining association information can be preformed into the second analysis rule shown in Table 2 below. Based on this second analysis rule, the association information between domain objects is obtained; and the topology structure of the global domain objects in the source code is determined based on the association information between domain objects. The second analysis rule can also be the domain object analysis rule required for this step, which is pre-designed based on the first analysis rule. The second analysis rule is shown in Table 2 below:

[0060] Table 2

[0061]

[0062]

[0063] Step S130: Generate a circle diagram extending from the inside out according to the topological structure of the global domain object, and automatically identify the general domain, support domain, and core domain of the domain model on the circle diagram.

[0064] The circle diagram reflects the distribution of the general domain, support domain, and core domain of the domain model. The core domain's source code primarily corresponds to the core business functions of the project, such as book search, book rental, and book purchase functions in a book rental system. The general domain is generally separated from the upper-level business and can be used by multiple subdomains simultaneously, with functional reusability, such as authentication, permissions, user management, and payment functions in a book rental system. The support domain generally serves as additional business functions, does not include general functions, and has enterprise-specific characteristics, such as membership points and email and SMS notification functions in a book rental system.

[0065] Optionally, it is necessary to first merge the global domain objects appropriately. The merging strategy is to merge domain object sets with the same associated attributes into one domain object set, for example, merge domain object sets of the same inheritance class into one, and / or merge domain object sets with a composition relationship into one; then generate a circle diagram from the inside out according to the referenced relationship and reference depth.

[0066] like Figure 2 The following is an example of a circle diagram, where the circle diagram has the following characteristics: Each node on the circle diagram represents a domain object (such as Figure 2 AX nodes in the circumference); there is no association or dependency (no edge connection) between nodes on the same layer (one layer represents a circle); the circles expand from the inside to the outside, and the outer circles have larger levels; each node on the i+1th layer must be associated with at least one node on the i-th layer (representing association or dependence on the node on the i-th layer) (the nodes on the outermost layer do not need to be associated with any other nodes); each node on the i+1th layer can be associated with nodes on the 1st, 2nd, ...i-1th layers (representing association or dependence on nodes on the 1st, 2nd, ...i-1th layers); from the inside to the outside, the number of citations of the nodes on the layer gradually decreases or shows an overall decreasing trend.

[0067] After obtaining a circle diagram that meets the above characteristics, the circle diagram is divided into general domain, support domain, and core domain according to the characteristics of the circle diagram and the business nature of the general domain, support domain, and core domain of the domain model. Figure 2 As shown, for the inner layer (within the preset layer, the preset layer is determined according to the number of times the nodes in each layer are referenced or relied upon, for example, generally 1-3 layers) nodes, they can be treated as general domains and support domains; among them, the general domain has nothing to do with the business, is referenced or relied upon more times, and is inevitably more likely to be referenced by nodes at different levels of the outer layer, such as the above Figure 2 Gray nodes A, B, and E in the figure; Support domains are related to businesses and target a small number of businesses. Generally, they are referenced or depended on 0-3 nodes. At the same time, they may also depend on general domain nodes, such as Figure 2The light gray nodes D, C, and F in the diagram; the outer nodes (preset layers and outside the preset layers, for example, >= 3 layers) can be treated as core domains, such as the dark gray nodes in the above figure; note that isolated nodes can appear in the outermost layer, such as node O; isolated nodes can be further identified as relatively independent domain modules in terms of business.

[0068] Alternatively, further analysis can be conducted based on the business scenario and semantic context of the code to improve recognition accuracy. For the identification of associations, aggregations, and combinations, machine learning algorithms can be combined to perform deep information mining and relationship identification. For example, supervised classification algorithms can be used to identify the features required for these types of relationships. Classification models can then be built and trained using samples of identified relationship data, and then applied to subsequent domain model identification of unknown relationships.

[0069] Step S140: Output the topological structure of the global domain object, the general domain, the supporting domain, and the core domain of the domain model.

[0070] Specifically, the output results can be visualized, for example, graphically displaying the topological structure of global domain objects, the general domain, supporting domain and core domain of the domain model, or adding more related information processing, such as Java package relationships.

[0071] This embodiment obtains the basic information of domain objects and analyzes the association information between domain objects based on this basic information to obtain the topological structure of global domain objects in the source code. It then generates a circle diagram extending from the inside out based on the topological structure of the global domain objects and automatically identifies the general domain, supporting domain, and core domain of the domain model on the circle diagram. The entire process does not require manual intervention and can automatically identify the domain model in the source code.

[0072] Example 2

[0073] Figure 3 FIG2 shows a flow chart of a domain model identification method provided by the second embodiment of the present invention. This embodiment is a further optimization of the first embodiment. Figure 3 As shown, the method includes the following steps:

[0074] Step S210: Using a bytecode processing tool, bytecode enhancement logic is implanted when constructing the class object of the domain model.

[0075] If the source code is written in Java, bytecode enhancement logic is embedded in the Java class object of the domain model using a bytecode processing tool. This bytecode processing logic is used to obtain basic information about the domain object. This step utilizes bytecode enhancement technology to modify the compiled bytecode of the open source or legacy project Java class without changing any source code, thus being non-invasive.

[0076] Step S220: Execute the bytecode enhancement logic when the bytecode is loaded into the virtual machine and a class object is generated through a code dynamic tracking tool, wherein the bytecode processing logic is used to obtain basic information of the domain object.

[0077] If the source code is written in Java, the bytecode enhancement logic is executed directly through Java's Instrument mechanism, that is, the code dynamic tracking tool, when the bytecode of the relevant Java class is loaded into the virtual machine and the class object is generated, to obtain the basic information of the domain objects in the source code.

[0078] Specifically, the bytecode enhancement logic is registered in the bytecode change method through the code dynamic tracking tool. When the bytecode is loaded into the virtual machine and a class object is generated, the class object acquisition method is called to automatically trigger the execution of the bytecode enhancement logic. Taking the above source code written in Java as an example, the timing for implanting the bytecode enhancement logic is before the Java main method, i.e., the bytecode change method, is called. Specifically, with the help of Java's Instrument mechanism, the above bytecode enhancement logic is registered in the Agent's premain method; at the same time, the added bytecode enhancement logic is automatically triggered by calling the Class.forName method, i.e., the class object acquisition method; the latter mainly utilizes the metadata of the Class class corresponding to the domain object, combined with the domain object analysis rules, i.e., the following embodiment three, to obtain the basic information of the domain object.

[0079] Step S230: Analyze the association information between domain objects based on the basic information to obtain the topological structure of the global domain objects in the source code.

[0080] Step S240: Generate a circle diagram extending from the inside out according to the topological structure of the global domain object, and automatically identify the general domain, support domain, and core domain of the domain model on the circle diagram.

[0081] Step S250: Output the topological structure of the global domain object, the general domain, the supporting domain, and the core domain of the domain model.

[0082] This embodiment generates a topological relationship structure of the source code domain object model based on bytecode enhancement and code dynamic tracking tools, which can solve the prominent drawbacks of the existing technology in assisting developers to understand and sort out the domain model of the source code. The entire process does not require human intervention and can automatically identify the domain model in the source code.

[0083] Example 3

[0084] Figure 4FIG1 shows a flow chart of the domain model identification method provided by the third embodiment of the present invention. This embodiment is a specific embodiment. Figure 4 As shown, the method includes the following steps:

[0085] Step S310: import the Java source code project and bytecode processing tools.

[0086] Step S320: Using a bytecode processing tool, bytecode enhancement logic is implanted when constructing class objects of Java classes related to the domain model.

[0087] The bytecode processing tool supports filtering selection, for example, excluding bytecode enhancement of classes under the util package.

[0088] Step S330: Register the bytecode enhancement logic in the premain method of the Agent through the Java Instrument mechanism.

[0089] Step S340: Call the Class.forName method of the Java classes under the specified directory set of the source code in sequence.

[0090] Step S350: Call the bytecode enhancement logic and obtain the basic information of the domain object in combination with the first analysis rule.

[0091] Step S360: Check whether all domain objects have been traversed.

[0092] If yes, execute step S370; otherwise, execute step S360.

[0093] Step S370: Analyze the association information between domain objects according to the basic information and the second analysis rule to obtain the topology structure of the global domain objects in the source code.

[0094] Step S380: Generate a circle diagram extending from the inside to the outside according to the topological structure of the global domain object, and automatically identify the general domain, support domain and core domain of the domain model on the circle diagram.

[0095] Step S390: Output the topological structure of the global domain object, the general domain, the supporting domain, and the core domain of the domain model.

[0096] Taking a simplified school information system as an example, the UML topological relationship of its business domain entities is as follows: Figure 5 As shown, in this embodiment, only the source code is obtained, and the relevant code is sorted and analyzed. The domain model is designed, and no prior knowledge is known. Figure 5 The topological relationship shown in FIG. 1 is shown. Inputting its source code into the domain model recognition device provided by the example of the present invention, without modifying any source code, the following recognition results will be obtained:

[0097]

[0098]

[0099]

[0100]

[0101]

[0102]

[0103] It can be seen that the above recognition results reflect Figure 5 In addition to the UML topological relationships between the school information system and business domain entities, the related by, aggregated by, and composed by relationships of the business domain entities are also provided. This shows that the method of this embodiment can effectively reduce the risks and costs associated with poor source code reading during the development phase, assist developers in understanding the design structure of the code domain model, and accelerate project implementation.

[0104] Example 4

[0105] Figure 6 FIG1 shows a structural diagram of domain model recognition provided by the fourth embodiment of the present invention. Figure 6 As shown, the device includes: a basic information acquisition module 41, a depth analysis module 42, a circle diagram generation module 43 and an information output module 44; wherein,

[0106] The basic information acquisition module 41 is used to obtain the basic information of the domain objects in the domain model source code;

[0107] The deep analysis module 42 is used to analyze the association information between domain objects based on the basic information to obtain the topological structure of the global domain objects in the source code; wherein the association information includes the association relationship between each domain object;

[0108] The circle diagram generation module 43 is used to generate a circle diagram extending from the inside out according to the topological structure of the global domain object, and automatically identify the general domain, support domain and core domain of the domain model on the circle diagram;

[0109] The information output module 44 is used to output the topological structure of the global domain object, the general domain, the supporting domain and the core domain of the domain model.

[0110] Furthermore, the basic information acquisition module 41 is also used to: implant bytecode enhancement logic when constructing the class object of the domain model through a bytecode processing tool; and execute the bytecode enhancement logic when the bytecode is loaded into the virtual machine and a class object is generated through a code dynamic tracking tool, wherein the bytecode processing logic is used to obtain the basic information of the domain object.

[0111] Furthermore, the basic information acquisition module 41 is specifically used to: register the bytecode enhancement logic in the bytecode change method through the code dynamic tracking tool; when the bytecode is loaded into the virtual machine and a class object is generated, call the class object acquisition method to automatically trigger the execution of the bytecode enhancement logic.

[0112] Furthermore, the basic information acquisition module 41 is specifically used to obtain the basic information of the domain object based on the metadata of the Class class corresponding to the domain object and the first analysis rule; wherein the basic information includes at least one of the parent class inherited by the domain object, the set of implemented interfaces, whether it is an abstract class, reference relationship information and dependency relationship information.

[0113] Furthermore, the deep analysis module 42 is specifically used to: determine the association relationship set of the domain object based on the basic information, traverse each associated domain object in the association relationship set, form an aggregate relationship set with the associated domain objects that meet the first preset condition or form a combined relationship set with the associated domain objects that meet the second preset condition; deduce the inherited parent class of the domain object based on the basic information to determine the inheritance chain of the domain object; and determine the topological structure of the global domain object in the source code based on at least one association information in the aggregate relationship set, the combined relationship set and the inheritance chain.

[0114] Furthermore, the circle diagram generation module 43 is specifically configured to merge domain object sets having the same association attributes into one domain object set, wherein the association attributes include inheritance classes and / or combination relationships.

[0115] Furthermore, the circle diagram generation module 43 is specifically used to: according to the characteristics of the circle diagram and the business nature of the domain of the domain model, the domain objects within the preset layer in the circle diagram are used as general domains and support domains, and the domain objects outside the preset layer in the circle diagram and the preset layer are used as core domains.

[0116] The domain model identification device described in the embodiment of the present invention is used to execute the domain model identification method described in the above embodiment. Its working principle and technical effect are similar and will not be repeated here.

[0117] Example 5

[0118] An embodiment of the present invention provides a non-volatile computer storage medium, wherein the computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the domain model recognition method in any of the above method embodiments.

[0119] Example 6

[0120] Figure 7 The schematic diagram of the structure of the computing device provided by the embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the computing device.

[0121] like Figure 7 As shown, the computing device may include: a processor, a communication interface, a memory, and a communication bus.

[0122] The processor, communication interface, and memory communicate with each other via a communication bus. The communication interface is used to communicate with other devices, such as clients or other server network elements. The processor is used to execute programs, specifically, the steps described in the aforementioned embodiment of the domain model identification method for a computing device.

[0123] Specifically, the program may include program codes including computer operation instructions.

[0124] The processor may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.

[0125] Memory is used to store programs. The memory may include high-speed RAM memory and may also include non-volatile memory (non-volatile memory), such as at least one disk storage.

[0126] The program can be specifically used to enable the processor to execute the domain model identification method in any of the above-mentioned method embodiments. The specific implementation of each step in the program can refer to the corresponding descriptions in the corresponding steps and units in the above-mentioned domain model identification method embodiments, and will not be repeated here. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-mentioned devices and modules can refer to the corresponding process description in the above-mentioned method embodiments, and will not be repeated here.

[0127] The algorithm or display provided herein is not inherently related to any particular computer, virtual system or other device. Various general-purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the embodiment of the present invention is not directed to any specific programming language. It should be understood that various programming languages ​​can be utilized to implement the content of the embodiment of the present invention described herein, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the embodiment of the present invention.

[0128] In the description provided herein, numerous specific details are described. However, it is understood that embodiments of the present invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description.

[0129] Similarly, it should be understood that in order to streamline the embodiments of the invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the invention, various features of the embodiments of the invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed approach should not be interpreted as reflecting an intention that the claimed embodiments of the invention require more features than are expressly recited in each claim. Rather, as reflected in the claims below, inventive aspects lie in less than all of the features of the individual embodiments disclosed above. Accordingly, the claims that follow the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of the invention.

[0130] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition may be divided into multiple submodules or subunits or subcomponents. All features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed herein may be combined in any combination, except that at least some of such features and / or processes or units are mutually exclusive. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0131] Furthermore, those skilled in the art will appreciate that although some embodiments herein include certain features included in other embodiments but not other features, combinations of features from different embodiments are intended to be within the scope of the present invention and to form different embodiments. For example, in the claims below, any of the claimed embodiments may be used in any combination.

[0132] The various component embodiments of the present invention can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components according to the embodiments of the present invention. The embodiments of the present invention can also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing an embodiment of the present invention can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0133] It should be noted that the above embodiments illustrate rather than limit the embodiments of the invention, and that a person skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between brackets should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The embodiments of the invention may be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments should not be understood as limiting the order of execution unless otherwise specified.

Claims

1. A domain model identification method, characterized in that: include: Obtaining basic information of domain objects in the domain model source code; wherein the basic information of the domain objects is obtained based on the meta information of the Class class corresponding to the domain objects and the first analysis rule; the basic information includes the parent class inherited by the domain objects, the set of implemented interfaces, whether the domain objects are abstract classes, reference relationship information, and dependency relationship information; Analyze the association information between domain objects based on the basic information to obtain the topological structure of the global domain objects in the source code; wherein, determine the association relationship set of the domain objects based on the basic information, traverse each associated domain object in the association relationship set, form an aggregate relationship set with the associated domain objects that meet a first preset condition, or form a combined relationship set with the associated domain objects that meet a second preset condition; deduce the inherited parent class of the domain object based on the basic information to determine the inheritance chain of the domain object; determine the topological structure of the global domain objects in the source code based on the aggregate relationship set, the combined relationship set, and the inheritance chain; Generate a circle layer diagram extending from the inside out based on the topological structure of the global domain object, and automatically identify the general domain, supporting domain, and core domain of the domain model on the circle layer diagram; wherein each node on the circle layer diagram represents a domain object; there is no association or dependency between nodes on the same layer; each node on the i+1th layer must be associated with at least one node on the ith layer; the number of references to nodes on the layer gradually decreases or shows an overall decreasing trend; The topological structure of the global domain object, the general domain, the supporting domain and the core domain of the domain model are output.

2. The method according to claim 1, characterized in that Before obtaining basic information of domain objects in the source code, the method further includes: Use bytecode processing tools to embed bytecode enhancement logic when constructing class objects in the domain model; The bytecode enhancement logic is executed when the bytecode is loaded into the virtual machine and a class object is generated through a code dynamic tracking tool; wherein the bytecode processing logic is used to obtain basic information of the domain object.

3. The method according to claim 2, characterized in that The bytecode enhancement logic is executed by the code dynamic tracking tool when the bytecode is loaded into the virtual machine and a class object is generated, including: registering the bytecode enhancement logic in a bytecode modification method using a code dynamic tracing tool; When the bytecode is loaded into the virtual machine and a class object is generated, calling the class object acquisition method automatically triggers the execution of the bytecode enhancement logic.

4. The method according to any one of claims 1 to 3, characterized in that Generating a circle diagram extending from the inside out according to the topological structure of the global domain object includes: Merging domain object sets with the same associated attributes into one domain object set; wherein the associated attributes include inheritance classes and / or composition relationships; Based on the merged domain object set, a circle diagram is generated from the inside out according to the reference relationship and reference depth.

5. The method according to any one of claims 1 to 3, characterized in that The automatic identification of the general domain, supporting domain, and core domain of the domain model on the circle diagram includes: According to the characteristics of the circle diagram and the business nature of the domain of the domain model, the domain objects within the preset layer in the circle diagram are used as general domains and supporting domains, and the domain objects outside the preset layer and the preset layer in the circle diagram are used as core domains; wherein, the preset layer is determined according to the number of times the nodes in each layer are referenced or dependent.

6. A domain model recognition device, characterized in that: include: A basic information acquisition module is used to obtain basic information of domain objects in domain object source code; wherein, the basic information of the domain object is obtained according to the meta information of the Class class corresponding to the domain object and the first analysis rule; the basic information includes the parent class inherited by the domain object, the set of implemented interfaces, whether it is an abstract class, reference relationship information and dependency relationship information; A deep analysis module is configured to analyze the association information between domain objects based on the basic information to obtain a topological structure of global domain objects in the source code; wherein, a set of association relationships of domain objects is determined based on the basic information, each associated domain object in the set of association relationships is traversed, and associated domain objects that meet a first preset condition are formed into an aggregated relationship set or associated domain objects that meet a second preset condition are formed into a combined relationship set; the inherited parent class of the domain object is deduced based on the basic information to determine an inheritance chain of the domain object; and the topological structure of the global domain object in the source code is determined based on the aggregated relationship set, the combined relationship set, and the inheritance chain; A circle layer diagram generation module is used to generate a circle layer diagram extending from the inside out based on the topological structure of the global domain object, and automatically identify the general domain, supporting domain, and core domain of the domain model on the circle layer diagram; wherein each node on the circle layer diagram represents a domain object; there is no association or dependency between nodes on the same layer; each node on the i+1th layer must be associated with at least one node on the ith layer; the number of references to nodes on the layer gradually decreases or shows an overall decreasing trend; The information output module is used to output the topological structure of the global domain object, the general domain, the supporting domain and the core domain of the domain model.

7. A computing device comprising: A processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the domain model identification method according to any one of claims 1 to 5.

8. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to perform operations corresponding to the domain model identification method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Modeling method based on electric communication field capable of performing meta language

    CN101303646A