Method, device and computer equipment for automatic update development of business entity of MES system

CN122672822BActive Publication Date: 2026-10-27PENGXI SEMICONDUCTOR TECHNOLOGY (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611171575.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-04
Publication Date
2026-10-27
Estimated Expiration
2046-08-04

AI Technical Summary

Technical Problem

[0003]现有技术中,业务系统的领域实体在实体对象变化后的变更追踪、字段对比、持久化(新增/更新/删除)操作,均需开发人员手动编码实现,这样会使开发量呈指数级增长、代码的一致性与稳定性难以保障,也不利于后期的扩展性与适配性,从而导致对业务系统的领域实体的更新开发效率较低

Benefits of technology

[0050]上述MES系统的业务实体自动化更新开发方法、装置和计算机设备,通过在业务系统创建领域实体时,通过多维度克隆策略对所述领域实体进行深度克隆,得到所述领域实体的初始状态快照,并采集所述领域实体的当前实体状态;将所述初始状态快照、与所述当前实体状态进行变更对比,得到所述领域实体的变更清单,并基于所述变更清单,生成持久化开发策略;基于所述持久化开发策略,对所述领域实体进行自动更新开发处理,得到所述领域实体的自动化开发结果。本方案,通过实体初始化与快照生成、无侵入式变更追踪、递归变更对比、智能级联持久化及快照释放,实现从实体状态变化到数据持久化的全流程自动化处理,并且无需人工编写代码的情况下,实现领域实体的实体状态精准更新,从而通过“实体变更自动追踪-全量对比-智能持久化”的一体化机制,无需开发人员手动编写任何变更追踪、对比及持久化相关代码,仅需开发人员聚焦实体对象的业务逻辑变化(如新增实体、修改实体字段、删除实体),系统自动完成后续所有技术操作,有效提升了对业务系统的领域实体的更新开发效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122672822B_ABST
    Figure CN122672822B_ABST
Patent Text Reader

Abstract

The application relates to a MES system business entity automatic update development method and device and computer equipment. The method comprises the following steps: when a domain entity is created in a business system, the domain entity is deeply cloned through a multi-dimensional cloning strategy to obtain an initial state snapshot of the domain entity, and a current entity state of the domain entity is collected; the initial state snapshot is compared with the current entity state to obtain a change list of the domain entity, and a persistence development strategy is generated based on the change list; and the domain entity is automatically updated and developed based on the persistence development strategy to obtain an automatic development result of the domain entity. The method can improve the update and development efficiency of the domain entity of the business system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software development technology, and in particular to a method, apparatus and computer equipment for the automated update development of business entities in an MES system. Background Technology

[0002] In Domain-Driven Design (DDD) and traditional business system development, developers should focus on implementing business logic, specifically on the state changes (addition, modification, and deletion) of domain entity objects. In the manufacturing MES (Manufacturing Execution System) scenario, entities such as production orders, process routes, material batches, equipment parameters, process reporting, and quality inspection exhibit deep hierarchies, multiple nesting, strong associations, and frequent changes: a single production order can nest multiple processes, and a single process can be associated with multiple materials, multiple pieces of equipment, and multiple quality inspection items; operations such as engineering changes, emergency order insertions, process adjustments, and equipment parameter modifications can trigger cascading changes to entities and their sub-entities, and sets of sub-entities.

[0003] In existing technologies, the tracking of changes, field comparison, and persistence (add / update / delete) operations of domain entities in business systems after changes to entity objects all require developers to manually code these operations. This leads to an exponential increase in development workload, makes it difficult to guarantee code consistency and stability, and is also detrimental to later scalability and adaptability, resulting in low development efficiency for updating domain entities in business systems. Summary of the Invention

[0004] Based on this, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for the automated update development of business entities in an MES system to address the aforementioned technical problems.

[0005] Firstly, this application provides a method for developing automated updates of business entities in an MES system, including:

[0006] When creating a domain entity in the business system, a multi-dimensional cloning strategy is used to perform a deep clone of the domain entity to obtain an initial state snapshot of the domain entity and collect the current entity state of the domain entity.

[0007] The initial state snapshot is compared with the current entity state to obtain a change list of the domain entity, and a persistent development strategy is generated based on the change list.

[0008] Based on the persistent development strategy, the domain entities are automatically updated and developed to obtain the automated development results of the domain entities.

[0009] Optionally, when creating a domain entity in the business system, performing a deep clone of the domain entity using a multi-dimensional cloning strategy to obtain an initial state snapshot of the domain entity includes:

[0010] When a domain entity is created in the business system, the sub-entity data of each entity type of the domain entity is obtained, and based on the sub-entity data of each entity type, the entity field information of each entity type is collected through a field collection strategy.

[0011] Deep cloning is performed on the entity field information of each entity type to obtain sub-snapshot objects of each entity type, and all sub-snapshot objects of the entity types are used as the initial state snapshot of the domain entity.

[0012] Optionally, collecting the current entity state of the domain entity includes:

[0013] By employing a seamless entity change interception strategy, the change information of each current entity field of the domain entity is intercepted;

[0014] Based on the change information of each current entity field, identify the entity status change information of the domain entity, and generate an entity status change list of the domain entity based on the entity status change information of the domain entity.

[0015] The entity state change list is used as the current entity state of the domain entity.

[0016] Optionally, the step of comparing the initial state snapshot with the current entity state to obtain a change list for the domain entity includes:

[0017] By using a change comparison algorithm, the initial state snapshot is compared field by field with the entity state change list to obtain the field change information of each change type of the domain entity;

[0018] The field change information of each change type is numerically sorted to obtain the change list of the domain entity.

[0019] Optionally, generating a persistent development strategy based on the change list includes:

[0020] Based on the field change information of each change type in the change list, generate entity field update information for each entity type of the domain entity;

[0021] Update the entity field information for each of the aforementioned entity types as a persistence development strategy.

[0022] Optionally, the automatic update development process for the domain entities based on the persistent development strategy to obtain the automated development result of the domain entities includes:

[0023] Based on the entity field update information of each entity type, the field information of the initial state snapshot of the domain entity in the database is automatically updated in the order of the preset update of each entity type through the automatic update framework, so as to obtain the initial update result of each entity type.

[0024] When there is an entity type with an abnormal initial update result, the field information in the database is rolled back, and the entity field update information based on each entity type is returned. Through the automatic update framework, the initial state snapshot of the domain entity is automatically updated according to the preset update order of each entity type to obtain the initial update result steps of each entity type, until there is no entity type with an abnormal initial update result.

[0025] The updated database is used as the result of automated development of the domain entities.

[0026] Secondly, this application also provides an automated update development apparatus for business entities in an MES system, comprising:

[0027] The cloning module is used to perform deep cloning of the domain entity when the business system creates the domain entity, using a multi-dimensional cloning strategy to obtain an initial state snapshot of the domain entity and collect the current entity state of the domain entity.

[0028] The generation module is used to compare the initial state snapshot with the current entity state to obtain a change list of the domain entity, and generate a persistent development strategy based on the change list;

[0029] The development module is used to automatically update the domain entities based on the persistent development strategy, and obtain the automated development results of the domain entities.

[0030] Optionally, the cloning module is specifically used for:

[0031] When a domain entity is created in the business system, the sub-entity data of each entity type of the domain entity is obtained, and based on the sub-entity data of each entity type, the entity field information of each entity type is collected through a field collection strategy.

[0032] Deep cloning is performed on the entity field information of each entity type to obtain sub-snapshot objects of each entity type, and all sub-snapshot objects of the entity types are used as the initial state snapshot of the domain entity.

[0033] Optionally, the cloning module is specifically used for:

[0034] By employing a seamless entity change interception strategy, the change information of each current entity field of the domain entity is intercepted;

[0035] Based on the change information of each current entity field, identify the entity status change information of the domain entity, and generate an entity status change list of the domain entity based on the entity status change information of the domain entity.

[0036] The entity state change list is used as the current entity state of the domain entity.

[0037] Optionally, the generation module is specifically used for:

[0038] By using a change comparison algorithm, the initial state snapshot is compared field by field with the entity state change list to obtain the field change information of each change type of the domain entity;

[0039] The field change information of each change type is numerically sorted to obtain the change list of the domain entity.

[0040] Optionally, the generation module is specifically used for:

[0041] Based on the field change information of each change type in the change list, generate entity field update information for each entity type of the domain entity;

[0042] Update the entity field information for each of the aforementioned entity types as a persistence development strategy.

[0043] Optionally, the development module is specifically used for:

[0044] Based on the entity field update information of each entity type, the field information of the initial state snapshot of the domain entity in the database is automatically updated in the order of the preset update of each entity type through the automatic update framework, so as to obtain the initial update result of each entity type.

[0045] When there is an entity type with an abnormal initial update result, the field information in the database is rolled back, and the entity field update information based on each entity type is returned. Through the automatic update framework, the initial state snapshot of the domain entity is automatically updated according to the preset update order of each entity type to obtain the initial update result steps of each entity type, until there is no entity type with an abnormal initial update result.

[0046] The updated database is used as the result of automated development of the domain entities.

[0047] Thirdly, this application provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described in any one of the first aspects.

[0048] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method described in any one of the first aspects.

[0049] Fifthly, this application provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the method described in any one of the first aspects.

[0050] The aforementioned MES system's business entity automated update development method, apparatus, and computer equipment, when creating a domain entity in the business system, perform deep cloning of the domain entity using a multi-dimensional cloning strategy to obtain an initial state snapshot of the domain entity, and collect the current entity state of the domain entity; compare the initial state snapshot with the current entity state to obtain a change list of the domain entity, and generate a persistent development strategy based on the change list; based on the persistent development strategy, perform automatic update development processing on the domain entity to obtain the automated development result of the domain entity. This solution automates the entire process from entity state changes to data persistence through entity initialization and snapshot generation, non-intrusive change tracking, recursive change comparison, intelligent cascading persistence, and snapshot release. Furthermore, it achieves accurate updates to the entity state of domain entities without requiring manual coding. Through an integrated mechanism of "automatic entity change tracking - full comparison - intelligent persistence," developers are not required to manually write any change tracking, comparison, or persistence-related code. Developers only need to focus on changes in the business logic of entity objects (such as adding entities, modifying entity fields, or deleting entities), and the system automatically completes all subsequent technical operations, effectively improving the development efficiency for updating domain entities in business systems. Attached Figure Description

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

[0052] Figure 1This is a flowchart illustrating the development method for automated updating of business entities in an MES system, as shown in one embodiment.

[0053] Figure 2 This is a flowchart illustrating an example of the development of automated updates for business entities in an MES system, as shown in one embodiment.

[0054] Figure 3 A structural block diagram of a business entity automated update development device for an MES system in one embodiment;

[0055] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0057] The automated update development method for business entities in an MES system provided in this application embodiment can be applied to an automated update development system for business entities in an MES system. This system can be applied to a terminal, which can be, but is not limited to, various personal computers, laptops, mid-range computers, etc. The terminal achieves fully automated processing from entity state changes to data persistence through entity initialization and snapshot generation, non-intrusive change tracking, recursive change comparison, intelligent cascading persistence, and snapshot release. Furthermore, it achieves accurate updates of the entity state of domain entities without requiring manual coding. Through an integrated mechanism of "automatic entity change tracking - full comparison - intelligent persistence," developers do not need to manually write any change tracking, comparison, or persistence-related code. Developers only need to focus on the business logic changes of entity objects (such as adding entities, modifying entity fields, and deleting entities), and the system automatically completes all subsequent technical operations, effectively improving the efficiency of updating and developing domain entities in the business system.

[0058] In one exemplary embodiment, such as Figure 1 As shown, a method for automatically updating business entities in an MES system is provided. Taking the application of this method to a terminal as an example, the method includes the following steps S101 to S103. Wherein:

[0059] Step S101: When creating a domain entity in the business system, the domain entity is deeply cloned using a multi-dimensional cloning strategy to obtain an initial state snapshot of the domain entity and collect the current entity state of the domain entity.

[0060] In this embodiment, when the terminal creates a domain entity in the business system, it clones the initial state snapshot of the domain entity using the JAVA reflection mechanism and deep recursive cloning technology constructed in this application. This solution is also applicable to scenarios where the business system loads a domain entity; that is, the terminal can also clone the initial state snapshot of the domain entity using the JAVA reflection mechanism and deep recursive cloning technology constructed in this application when the business system loads the domain entity. This multi-dimensional cloning strategy includes a JAVA reflection mechanism and deep recursive cloning technology. The entity state includes sub-snapshot objects of various entity types. These entity types include, but are not limited to, the Order aggregate root entity, which nests OrderItem sub-entity collections, ProductSku sub-entities, Receiver address sub-entities, etc. Then, based on Spring dynamic proxy / AOP bytecode enhancement, the terminal intercepts entity field assignments and collection add / delete / modify operations, sensing entity state changes in real time without inheritance, annotations, or manual marking, thereby obtaining real-time change information of the domain entity, i.e., the current entity state. The specific interception and cloning processes will be explained in detail later. The entity types mentioned above include, for example, production work orders (core aggregate root entity); processes (sub-entities of work orders); material batches (sub-entities of processes); equipment parameters (sub-entities of equipment); and orders / order items / product SKUs (Stock Keeping Units) (other entities). The key characteristics of each entity type are: unique identity: it must have one ID (order number, work order number, personal information ID), which will not be repeated; a set of attributes: for example, orders have amount, status, and recipient; work orders have production quantity and start time; and its status can change: it can be modified, added, and deleted.

[0061] Step S102: Compare the initial state snapshot with the current entity state to obtain a change list of the domain entity, and generate a persistent development strategy based on the change list.

[0062] In this embodiment, the terminal compares the initial state snapshot with the current entity state to obtain a change list of domain entities, and generates a persistent development strategy based on the change list. The change comparison method uses a depth-first recursive algorithm to compare each field. This persistent development strategy includes entity state update information for each entity type. The specific comparison and generation processes will be described in detail later.

[0063] Step S103: Based on the persistent development strategy, perform automatic update development processing on the domain entities to obtain the automated development results of the domain entities.

[0064] In this embodiment, the terminal, based on a persistent development strategy, performs automatic update development processing on domain entities to obtain automated development results for the domain entities. This automatic update development processing combines the entity state update information of each entity type, executing cascading operations in the master-slave order of aggregate root → child entity → collection entity. Integrating the Spring transaction manager ensures atomicity, and automated update development processing is performed on the state updates of each entity type within the domain entity, eliminating the need for manual code writing. After completing the update development for all entity types, the updated entity types are presented as the automated development results. Finally, after the update, the terminal clears the snapshot data in the current thread's ThreadLocal, releasing memory resources; snapshot cleanup is completed through a Spring post-processor, eliminating the need for developers to manually call the release method; simultaneously, a change log is automatically recorded, including the changed entity, changed content, and operation time, supporting data traceability. For example, after order data is successfully persisted to the database, the system automatically updates the latest status of the Order entity; clears the OrderSnapshot in the current thread's ThreadLocal to release memory; and automatically generates an operation log: "Order ID: 12345, Changes: Amount Modification, Product Unit Price Modification, Add Order Item, Operation Time: 2026-06-02 10:00:00"; the entire process ends with no residual data and no memory leaks.

[0065] Based on the above solution, through entity initialization and snapshot generation, non-intrusive change tracking, recursive change comparison, intelligent cascading persistence, and snapshot release, the entire process from entity state changes to data persistence is automated. Moreover, without the need for manual coding, the system achieves accurate updates of the entity state of domain entities. Through the integrated mechanism of "automatic entity change tracking - full comparison - intelligent persistence," developers do not need to manually write any change tracking, comparison, and persistence-related code. Developers only need to focus on the business logic changes of entity objects (such as adding entities, modifying entity fields, and deleting entities), and the system automatically completes all subsequent technical operations, effectively improving the development efficiency of updating domain entities in business systems.

[0066] Optionally, when creating a domain entity in the business system, a multi-dimensional cloning strategy is used to perform deep cloning on the domain entity to obtain an initial state snapshot of the domain entity. This includes: when creating a domain entity in the business system, obtaining sub-entity data of each entity type of the domain entity, and based on the sub-entity data of each entity type, collecting entity field information of each entity type through a field collection strategy; performing deep cloning processing on the entity field information of each entity type to obtain sub-snapshot objects of each entity type, and using all sub-snapshot objects of all entity types as the initial state snapshot of the domain entity.

[0067] In this embodiment, when the terminal creates a domain entity in the business system, it obtains the sub-entity data of each entity type of the domain entity, and based on the sub-entity data of each entity type, it collects the entity field information of each entity type through a field collection strategy. The sub-entity data is the identification information of each entity type, used to identify the location of each entity type within the domain entity. The field collection strategy involves the terminal obtaining all declaration fields of the aggregate root entity through Java reflection, and then traversing all business fields of the nested sub-entity set, sub-entities, and address sub-entities using deep recursion to obtain the entity field information of each entity type.

[0068] Next, the terminal performs deep cloning on the entity field information of each entity type to obtain sub-snapshot objects for each entity type, and uses all sub-snapshot objects of all entity types as the initial state snapshot of the domain entity. Each sub-snapshot object includes, but is not limited to, all business states such as order ID, order amount, order item number, product unit price, and delivery address. Then, the terminal stores all sub-snapshot objects of all entity types in the current thread's ThreadLocal to obtain the initial state snapshot of the domain entity.

[0069] Based on the above solution, the aggregate root, multi-level nested sub-entities, sub-entity collections (List / Set / Map), and generic sub-entities are cloned in all dimensions through JAVA reflection mechanism and deep recursive cloning, generating an immutable initial state snapshot; the snapshot is stored in thread-local storage (ThreadLocal), bound to the current business thread, and does not affect the original structure of the entity; the cloning process automatically skips static fields, transient fields, and system built-in fields, and only retains the valid state of the business entity.

[0070] Optionally, the current entity state of the domain entity is collected, including: intercepting the change information of each current entity field of the domain entity through a seamless entity change interception strategy; identifying the entity state change information of the domain entity based on the change information of each current entity field, and generating an entity state change list of the domain entity based on the entity state change information of the domain entity; and using the entity state change list as the current entity state of the domain entity.

[0071] In this embodiment, the terminal uses a seamless entity change interception strategy to capture the change information of each current entity field of the domain entity. This seamless entity change interception strategy is based on Spring dynamic proxy / AOP bytecode enhancement to achieve entity state change awareness, without requiring entities to inherit parent classes, add annotations, or manually mark changes. The proxy intercepts entity field assignments and collection add / delete / modify operations, marking the entity as "changed" in real time. The tracking scope covers basic fields, nested sub-entity fields, and collection element addition / deletion / modification / clearing, with no business code intrusion throughout, and is compatible with all DDD aggregate root entity structures. For example, if a developer writes business code like `order.setOrderAmount(1999.00)`, `orderItem.setProductPrice(399.00)`, and `order.getOrderItems().add(newOrderItem)`, Spring dynamic proxy automatically intercepts the above assignment and collection addition operations, without requiring the developer to add any tracking code. The terminal marks the Order aggregate root, OrderItem sub-entities, and ProductSku sub-entities as changed in real time, obtaining the sub-state change information of each entity type, completing non-intrusive tracking.

[0072] Then, based on the change information of each current entity field, the terminal identifies the entity status change information of the domain entities and generates a list of entity status changes for the domain entities. The change information of each current entity field includes the field information corresponding to the addition / modification / deletion status of the main entity / sub-entity / collection. This current entity field change information contains sub-status change information for each entity type. The terminal arranges and fills the list template according to the sub-status change information for each entity type to obtain the list of entity status changes for the domain entities. This list of entity status changes includes the changed entity status of each domain entity; that is, the list stores multiple changed domain entities. Since the initial state snapshot represents the field information of each domain entity, directly comparing the sub-state change information of each domain entity with the field information of the domain entity requires first searching and locating the field, and then making the field change. This method is complex and requires a large number of auxiliary programs to assist in the subsequent field change comparison. The entity state change list constructed in this solution marks the field change information of each current entity in the field information of the corresponding domain entity for each entity type, thus obtaining the entity state change list. Then, when the terminal compares the initial state snapshot with the current entity state, it can directly compare the position of each sub-state change information in the field information of the domain entity in the change list with the corresponding field information in the initial state snapshot to efficiently complete the comparison operation without performing the pre-processing, thereby greatly reducing the workload and effectively improving the comparison efficiency of subsequent field comparison.

[0073] Finally, the terminal uses the entity state change list as the current entity state of the domain entity.

[0074] Based on the above solution, the seamless entity change interception strategy built using this solution eliminates the need to write change tracking, field comparison, and persistence code, significantly reducing repetitive workload.

[0075] Optionally, the initial state snapshot is compared with the current entity state to obtain a change list of the domain entity, including: using a change comparison algorithm to compare the initial state snapshot with the entity state change list field by field to obtain field change information for each change type of the domain entity; and performing numerical sorting on the field change information for each change type to obtain a change list of the domain entity.

[0076] In this embodiment, the terminal uses a change comparison algorithm to compare the initial state snapshot with the entity state change list field by field to obtain the field change information for each change type of the domain entity. This change comparison algorithm is a depth-first recursive algorithm. Specifically, the terminal uses this algorithm to compare the location of the changed sub-state information in the entity state change list with the field information at the same location in the corresponding initial snapshot, field by field. It automatically identifies changes such as main entity modification, sub-entity modification, addition / modification / deletion of collection elements, and nested entity level changes (i.e., field change information), as well as the corresponding change type. The comparison logic automatically ignores system fields, null fields, and unchanged fields. Then, the terminal numerically sorts the field change information for each change type to obtain the domain entity change list. This change list includes the changed field name, old value, new value, change type, and changed entity level (i.e., the entity type of the domain entity to which it belongs). The change types include, but are not limited to, addition, modification, and deletion changes. This change list only contains field changes of different change types, and does not contain all field content of the domain entity to which each field change belongs. That is, the difference between this change list and the above-mentioned entity status change list is that the change list only contains the field information of each domain entity that has changed, while the entity status change list contains all field information of each domain entity, and the sub-state change information is marked in all field information.

[0077] For example, in the above comparison process, the terminal first extracts the field information of each current Order entity from the entity state change list, and identifies the location information of each sub-state change information in the field information. Then, the terminal retrieves the field content with the same location information in the OrderSnapshot snapshot in ThreadLocal and performs a recursive comparison with each sub-state change information in the current Order entity.

[0078] Recognition results:

[0079] Main entity Order: Order amount old value 1500.00 → new value 1999.00 (modified);

[0080] Sub-entity ProductSku: Product unit price old value 299.00 → new value 399.00 (modified);

[0081] OrderItem collection: Add 1 new order item (New);

[0082] Automatically filters system fields such as createTime and updateTime to generate a change list.

[0083] Based on the above scheme, by using a depth-first recursive algorithm, the change information between the changed state and the stored initial state snapshot is compared field by field, which greatly reduces the repetitive workload of field comparison for staff and effectively improves the accuracy and efficiency of identifying change lists of domain entities.

[0084] Optionally, based on the change list, a persistent development strategy is generated, including: generating entity field update information for each entity type of the domain entity according to the field change information of each change type in the change list; and using the entity field update information of each entity type as the persistent development strategy.

[0085] In this embodiment, the terminal generates entity field update information for each entity type of the domain entity based on the field change information of each change type in the change list. Then, the terminal uses the entity field update information for each entity type as a persistence development strategy. Specifically, the terminal breaks down the field change information for different change types into sub-field change information for each entity type. Then, the terminal uses the sub-field change information for each change type corresponding to each entity type as the entity field update information for that entity type.

[0086] Based on the above scheme, by refining the update information of each entity type into subfield change information of each change type, the accuracy of updating the update information of different entity types is improved.

[0087] Optionally, based on a persistent development strategy, the domain entities are automatically updated to obtain automated development results. This includes: updating entity field information based on each entity type; using an automatic update framework, according to a preset update order for each entity type, automatically updating the field information of the initial state snapshot of the domain entity in the database to obtain the initial update results for each entity type; when there are entity types with abnormal initial update results, the field information in the database is rolled back, and the process of updating entity field information based on each entity type, using an automatic update framework, according to a preset update order for each entity type, is repeated to obtain the initial update results for each entity type, until there are no entity types with abnormal initial update results; the updated database is then used as the automated development result of the domain entities.

[0088] In this embodiment, the terminal updates information based on the entity fields of each entity type. Through an automatic update framework, it automatically updates the initial state snapshots of the domain entities according to a preset update order for each entity type, obtaining the initial update results for each entity type. Specifically, the update order is the master-slave dependency order of the aggregate root → child entity → collection entity. The terminal executes cascading operations according to the master-slave dependency order of the aggregate root → child entity → collection entity, updating the field information in the database where the sub-snapshot objects of each entity type reside, and monitoring the update status of each update stage in real time. The real-time monitoring is achieved using the Spring transaction framework built in this solution.

[0089] When an update step encounters an exception or error, the terminal rolls back the field information in the database and returns the execution of entity field update information based on each entity type. Through the automatic update framework, following a preset update order for each entity type, it automatically updates the initial state snapshot of the domain entities, obtaining the initial update result steps for each entity type, until no entity type has an abnormal initial update result. Finally, the terminal uses the updated database as the automated development result of the domain entities. For example, based on the change list, the terminal generates a cascading persistence strategy: First step: Update the order amount of the Order main entity; Second step: Update the unit price of the ProductSku sub-entity; Third step: Add elements to the OrderItem collection; Start a Spring transaction, execute SQL / ORM operations (Structured Query Language / Object Relational Mapping) sequentially, and automatically maintain the foreign key relationship between Order and OrderItem; If any step fails, the transaction is rolled back globally to ensure data consistency; Developers do not need to call persistence methods such as save(), update(), and insert().

[0090] Based on the above solution, there is no need for staff to manually write code to update the database. Instead, the system intelligently updates and sorts the initial update results of each entity type and automatically develops the update code to complete the field information update operation of the database, effectively improving the efficiency of updating domain entities in the business system.

[0091] This application also provides a development example for the automated update of business entities in an MES system, such as... Figure 2 As shown, the specific processing procedure includes the following steps:

[0092] Step S201: When creating a domain entity in the business system, obtain the sub-entity data of each entity type of the domain entity, and collect the entity field information of each entity type based on the sub-entity data of each entity type through the field collection strategy.

[0093] Step S202: Perform deep cloning on the entity field information of each entity type to obtain sub-snapshot objects of each entity type, and use all sub-snapshot objects of the entity types as the initial state snapshot of the domain entity.

[0094] Step S203: Using a seamless entity change interception strategy, intercept the change information of each current entity field of the domain entity.

[0095] Step S204: Based on the change information of each current entity field, identify the entity status change information of the domain entity, and generate an entity status change list of the domain entity based on the entity status change information of the domain entity.

[0096] Step S205: The entity state change list is used as the current entity state of the domain entity.

[0097] Step S206: By using a change comparison algorithm, the initial state snapshot and the entity state change list are compared field by field to obtain the field change information of each change type of the domain entity.

[0098] Step S207: Perform numerical sorting of the field change information for each change type to obtain the change list of the domain entity.

[0099] Step S208: Based on the field change information of each change type in the change list, generate the entity field update information of each entity type of the domain entity.

[0100] Step S209: Update the entity field information for each entity type as a persistence development strategy.

[0101] Step S210: Based on the entity field update information of each entity type, the field information of the initial state snapshot of the domain entity in the database is automatically updated and processed according to the preset update order of each entity type through the automatic update framework to obtain the initial update result of each entity type.

[0102] Step S211: When there is an entity type with an abnormal initial update result, rollback processing is performed on the field information in the database, and the process returns to step S210 until there is no entity type with an abnormal initial update result.

[0103] Step S212: The updated database is used as the result of automated development of domain entities.

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

[0105] Based on the same inventive concept, this application also provides an automated business entity update and development apparatus for an MES system to implement the above-described automated business entity update and development method for the MES system. The solution provided by this apparatus is similar to the implementation scheme described in the above method. Therefore, the specific limitations in one or more embodiments of the automated business entity update and development apparatus for an MES system provided below can be found in the limitations of the automated business entity update and development method for the MES system described above, and will not be repeated here.

[0106] In one exemplary embodiment, such as Figure 3 As shown, an automated update development device for business entities in an MES system is provided, comprising: a cloning module 310, a generation module 320, and a development module 330, wherein:

[0107] The cloning module 310 is used to perform deep cloning of the domain entity through a multi-dimensional cloning strategy when the business system creates the domain entity, obtain an initial state snapshot of the domain entity, and collect the current entity state of the domain entity.

[0108] The generation module 320 is used to compare the initial state snapshot with the current entity state to obtain a change list of the domain entity, and generate a persistent development strategy based on the change list;

[0109] The development module 330 is used to perform automatic update development processing on the domain entities based on the persistent development strategy, so as to obtain the automated development result of the domain entities.

[0110] Optionally, the cloning module 310 is specifically used for:

[0111] When creating a domain entity in the business system, the sub-entity data of each entity type of the domain entity is obtained, and based on the sub-entity data of each entity type, the entity field information of each entity type is collected through a field collection strategy.

[0112] Deep cloning is performed on the entity field information of each entity type to obtain sub-snapshot objects of each entity type, and all sub-snapshot objects of the entity types are used as the initial state snapshot of the domain entity.

[0113] Optionally, the cloning module 310 is specifically used for:

[0114] By employing a seamless entity change interception strategy, the change information of each current entity field of the domain entity is intercepted;

[0115] Based on the change information of each current entity field, identify the entity status change information of the domain entity, and generate an entity status change list of the domain entity based on the entity status change information of the domain entity.

[0116] The entity state change list is used as the current entity state of the domain entity.

[0117] Optionally, the generation module 320 is specifically used for:

[0118] By using a change comparison algorithm, the initial state snapshot is compared field by field with the entity state change list to obtain the field change information of each change type of the domain entity;

[0119] The field change information of each change type is numerically sorted to obtain the change list of the domain entity.

[0120] Optionally, the generation module 320 is specifically used for:

[0121] Based on the field change information of each change type in the change list, generate entity field update information for each entity type of the domain entity;

[0122] Update the entity field information for each of the aforementioned entity types as a persistence development strategy.

[0123] Optionally, the development module 330 is specifically used for:

[0124] Based on the entity field update information of each entity type, the field information of the initial state snapshot of the domain entity in the database is automatically updated in the order of the preset update of each entity type through the automatic update framework, so as to obtain the initial update result of each entity type.

[0125] When there is an entity type with an abnormal initial update result, the field information in the database is rolled back, and the entity field update information based on each entity type is returned. Through the automatic update framework, the initial state snapshot of the domain entity is automatically updated according to the preset update order of each entity type to obtain the initial update result steps of each entity type, until there is no entity type with an abnormal initial update result.

[0126] The updated database is used as the result of automated development of the domain entities.

[0127] The modules in the aforementioned MES system's automated update development device for business entities can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can invoke and execute the corresponding operations of each module.

[0128] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a method for automating the update and development of business entities in a MES (Manufacturing Execution System). The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0129] Those skilled in the art will understand that Figure 4The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0130] In one exemplary embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of a business entity automated update development method for an MES system.

[0131] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program being executed by a processor to implement the steps of a business entity automated update development method for an MES system.

[0132] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of a business entity automated update development method for an MES system.

[0133] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0134] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0135] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

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

Claims

1. A method for automating the update of business entities in a MES system, characterized in that, The method includes: When a domain entity is created in the business system, a multi-dimensional cloning strategy is used to perform a deep clone of the domain entity to obtain an initial state snapshot of the domain entity, and the current entity state of the domain entity is collected; the current entity state of the domain entity includes an entity state change list; By using a change comparison algorithm, the initial state snapshot is compared field by field with the entity state change list to obtain the field change information of each change type of the domain entity; The field change information of each change type is numerically sorted to obtain the change list of the domain entity; Based on the field change information of each change type in the change list, generate entity field update information for each entity type of the domain entity; Update the entity field information for each of the aforementioned entity types as a persistence development strategy; Based on the entity field update information of each entity type, the field information of the initial state snapshot of the domain entity in the database is automatically updated in the order of the preset update of each entity type through the automatic update framework, so as to obtain the initial update result of each entity type. When there is an entity type with an abnormal initial update result, the field information in the database is rolled back, and the entity field update information based on each entity type is returned. Through the automatic update framework, the initial state snapshot of the domain entity is automatically updated according to the preset update order of each entity type to obtain the initial update result steps of each entity type, until there is no entity type with an abnormal initial update result. The updated database is used as the result of automated development of the domain entities.

2. The method according to claim 1, characterized in that, When creating a domain entity in the business system, the domain entity is deeply cloned using a multi-dimensional cloning strategy to obtain an initial state snapshot of the domain entity, including: When creating a domain entity in the business system, the sub-entity data of each entity type of the domain entity is obtained, and based on the sub-entity data of each entity type, the entity field information of each entity type is collected through a field collection strategy. Deep cloning is performed on the entity field information of each entity type to obtain sub-snapshot objects of each entity type, and all sub-snapshot objects of the entity types are used as the initial state snapshot of the domain entity.

3. The method according to claim 1, characterized in that, The process of collecting the current entity state of the domain entity includes: By employing a seamless entity change interception strategy, the change information of each current entity field of the domain entity is intercepted; Based on the change information of each current entity field, identify the entity status change information of the domain entity, and generate an entity status change list of the domain entity based on the entity status change information of the domain entity. The entity state change list is used as the current entity state of the domain entity.

4. An automated update development device for business entities in an MES system, characterized in that, The device includes: The cloning module is used to perform deep cloning of the domain entity when the business system creates the domain entity, using a multi-dimensional cloning strategy to obtain an initial state snapshot of the domain entity and collect the current entity state of the domain entity; the current entity state of the domain entity includes an entity state change list; The generation module is used to compare the initial state snapshot with the entity state change list field by field using a change comparison algorithm to obtain field change information for each change type of the domain entity; to perform numerical sorting processing on the field change information for each change type to obtain a change list of the domain entity; and to generate entity field update information for each entity type of the domain entity based on the field change information for each change type in the change list. Update the entity field information for each of the aforementioned entity types as a persistence development strategy; The development module is used to update information based on entity fields of each entity type. Through an automatic update framework, it automatically updates the field information of the initial state snapshot of the domain entity in the database according to a preset update order for each entity type, obtaining the initial update result for each entity type. If there is an entity type with an abnormal initial update result, the module rolls back the field information in the database and returns to the previous step of automatically updating the entity field information based on each entity type, following the preset update order for each entity type, until no entity type has an abnormal initial update result. The updated database is then used as the automated development result for the domain entity.

5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.

7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method, system and equipment for automatically updating interface control based on data source difference and medium

    CN120723279A

  • Business object change identification and log generation system and method based on annotation driving

    CN121764889A