Data resource model applied to enterprise management system
By designing data resource models in the enterprise management system, the commonality and similarity of abstract documents are encapsulated to form an interface factory, which solves the problem of duplicate code caused by the variety of document types, realizes unified processing and display of documents, and reduces the difficulty of development and maintenance .
Patent Information
- Application Number
- CN202410875160.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-11-22
AI Technical Summary
In enterprise management systems, due to the diverse types of documents, the existing technology leads to a large number of duplicate codes, which reduces the system operation efficiency and increases the difficulty of development, debugging and implementation.
A data resource model was designed, including multiple model interfaces, main interface factories, entry interface factories and document item interface factories. Through abstract commonality and similarity, the main body and entry fields of various documents are defined, encapsulated and formed an interface factory to realize Unified processing and operation of documents.
Reduces duplicate code, simplifies development and testing, reduces maintenance difficulty when business scenario changes, and realizes unified logical processing and display of documents.
Smart Images

Figure CN119003329A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data resource models, and in particular to a data resource model applied in an enterprise management system. Background Art
[0002] In an enterprise management system (such as an ERP system), there are various documents, such as sales orders, purchase orders, work orders, quotations, etc. The number of document types may be as many as hundreds or even thousands of them. The existing technical implementation method is to use one algorithm and business logic for each document or a set of algorithms and business logic for certain documents. Because there are similarities between documents, such as sales orders and purchase orders have information subjects such as partner entities, consignee entities, and payer entities, when processing these similar or identical documents, the UI display layer and the business logic layer will have a lot of similarities or identical codes, and when the business scenario changes, each UI display layer and business logic layer often need to be modified. The repeated code occupies memory space and reduces the operating efficiency of the system, which is a big challenge for development, debugging, and implementation. Summary of the invention
[0003] The purpose of the present invention is to solve at least one of the technical problems existing in the prior art and to provide a data resource model for application in an enterprise management system that can reduce duplicate code and facilitate development, debugging and implementation.
[0004] According to an embodiment of the present invention, a data resource model applied in an enterprise management system includes a plurality of model interfaces, a subject interface factory, an item interface factory, and a document item interface factory. The model interfaces are abstracted based on the commonality, similarity, or independence of different types of business documents. Each of the model interfaces defines one or more related fields. The model interfaces are divided into a subject model interface (for solving the value acquisition and assignment of the subject fields of the business document) and an item model interface (for solving the value acquisition and assignment of the item fields of the business document) according to the data structure of the business document. The subject of each business document implements one or more of the subject model interfaces, and the item of each business document implements one or more of the item model interfaces, thereby determining the fields of the document subject or the document item. The subject interface factory is composed of all the The subject model interface is encapsulated, and the subject interface factory defines multiple subject model methods for obtaining the corresponding subject model interface. The subject model interface corresponds to the subject model method one by one, and the subject interface factory also defines the execution order of the subject model method; the item interface factory is encapsulated by all the item model interfaces, and the item interface factory defines multiple item model methods for obtaining the corresponding item model interface. The item model interface corresponds to the item model method one by one, and the item interface factory also defines the execution order of the item model method; the document item interface factory inherits from the subject interface factory, has all the capabilities of the subject interface factory, and defines an item collection attribute to realize the acquisition and modification of all items of the corresponding business document.
[0005] The data resource model applied in the enterprise management system according to the embodiment of the present invention has at least the following beneficial effects: the processing of documents includes the processing of the document body and the processing of the document items. The document body and the document items are two interface systems. Not only can the document body realize any operation through the subject interface factory, but the document item can realize any operation through the item interface factory. Moreover, for business documents with both document body and document items, the document item interface factory can process both the document item and the document body, thereby realizing that any document can realize any operation as long as it is placed in this data resource model. Each business document realizes one or more model interfaces, so that the document instance has the fields of these interfaces. For example, if the purchase order realizes the "partner" model interface, then the purchase order has the fields of "partner number", "partner group number", "partner person in charge", "partner email" and so on; then the corresponding interface factory is used to encapsulate the document entity, so that the document instance has the ability to process all interfaces encapsulated by the interface factory, so that all documents can share one business logic and one set of UI display. In this way, during the development process, you only need to declare a document instance, and then use the interface factory to encapsulate it to display and logically process any document. This greatly reduces code duplication, and testing only needs to test one document to find logical problems. When the business scenario changes, you only need to change the method and logic of the interface factory, which greatly reduces the difficulty of development, testing, maintenance, and implementation.
[0006] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] The specific embodiments of the present invention will be further described below in conjunction with the accompanying drawings;
[0008] Figure 1 It is a schematic diagram of the main interface factory of the data resource model;
[0009] Figure 2 It is a schematic diagram of the entry interface factory of the data resource model;
[0010] Figure 3 It is a schematic diagram of the document item interface factory of the data resource model. DETAILED DESCRIPTION
[0011] This section will describe in detail the specific embodiments of the present invention. The preferred embodiments of the present invention are shown in the accompanying drawings. The purpose of the accompanying drawings is to supplement the description of the text part of the specification with graphics, so that people can intuitively and vividly understand each technical feature and the overall technical solution of the present invention, but it cannot be understood as a limitation on the scope of protection of the present invention.
[0012] In the description of the present invention, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., and orientations or positional relationships indicated are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0013] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0014] Reference Figures 1 to 3 The present invention discloses a data resource model used in an enterprise management system, including multiple model interfaces, a subject interface factory, an item interface factory, and a document item interface factory. The model interface is obtained by abstracting the commonality, similarity, or independence of different types of business documents. Each model interface defines one or more related fields, that is, each model interface defines fields of commonality or characteristics of business documents. For example, a "purchase order" has a partner subject, but an "engineering change order" is initiated within the enterprise and has no partner subject. In this case, the document subject of the "partner subject" is abstracted to make a model interface, which defines fields such as "partner number", "partner group number", "partner person in charge", and "partner email address". And according to the data structure of the business document (for example, some documents only have a subject but no details, and some documents have both a subject and details), these model interfaces are divided into Figure 1 The main model interface shown (solves the value acquisition and assignment of the main field of the business document) and Figure 2 The item model interface shown in the figure (solves the problem of getting and assigning values to the item fields of business documents), the main model interface includes the partner model interface, the basic quantity model interface, etc., and the item model interface includes the product model interface, the basic quantity model interface, the price model interface, etc. The main body of each business document implements one or more main model interfaces, and the items of each business document implement one or more item model interfaces, thereby determining the fields of the document main body or document item. Figure 1 The subject interface factory is formed by encapsulating all subject model interfaces. The subject interface factory defines multiple subject model methods for obtaining corresponding subject model interfaces. The subject model interfaces correspond to the subject model methods one by one. The subject interface factory also defines the execution order of the subject model methods; Figure 2, the entry interface factory is formed by encapsulating all entry model interfaces. The entry interface factory defines multiple entry model methods to obtain the corresponding entry model interfaces. The entry model interfaces correspond to the entry model methods one by one. The entry interface factory also defines the execution order of the entry model methods (the logical operations of the model interface have a sequence. For example, if we want to calculate the total amount of the document, we need to process the quantity, unit price, currency and exchange rate before calculating the amount. Therefore, we need to define the execution order of each model method); Figure 3 The document item interface factory inherits from the main interface factory and has all the capabilities of the main interface factory. At the same time, it defines an item collection attribute to achieve the acquisition and modification of all items of the corresponding business document.
[0015] The processing of documents includes the processing of document subjects and document items. Document subjects and document items are two interface systems. Not only can document subjects be operated through the subject interface factory, but document items can also be operated through the item interface factory. Moreover, for business documents that have both document subjects and document items, both document items and document subjects can be processed through the document item interface factory, so that any document can be operated as long as it is placed in this data resource model. Each business document implements one or more model interfaces, so that the document instance has the fields of these interfaces. For example, if a purchase order implements the "partner" model interface, then the purchase order has fields such as "partner number", "partner group number", "partner person in charge", and "partner email". Then, the corresponding interface factory is used to encapsulate the document entity, so that the document instance has the ability to process all interfaces encapsulated by this interface factory, so that all documents can share a business logic and a set of UI displays. In this way, during the development process, you only need to declare a document instance, and then use the interface factory to encapsulate it to display and logically process any document. This greatly reduces code duplication, and testing only needs to test one document to find logical problems. When the business scenario changes, you only need to change the method and logic of the interface factory, which greatly reduces the difficulty of development, testing, maintenance, and implementation.
[0016] Furthermore, the subject model interface and the item model interface respectively include the most basic model interface, the most basic model interface includes fields of creator, creation time, modifier, and modification time, and the subject model method and the item model method respectively include the most basic model method for processing the fields in the most basic model interface. The subject model interface includes the basic document model interface, the subject model method includes the basic document model method for processing the fields in the basic document model interface; the item model interface includes the basic item model interface, and the item model method includes the basic item model method for processing the fields in the basic item model interface.
[0017] Furthermore, three superclasses are included, and these three superclasses can instantiate the subject interface factory, the item interface factory, and the document item interface factory one by one.
[0018] Furthermore, it also includes multiple interface controls, which correspond one-to-one to multiple model interfaces. The interface controls are formed by controlling the fields in the main model interface and the item model interface. One or more controls are set for each field in the model interface. In this way, the defined controls can be directly used in various occasions, and the controls can be defined and obtained according to different application types such as detail pages and editing.
[0019] Furthermore, the UI layer includes a document body area, a document item area, and a creation information area. The document body area includes interface controls corresponding to multiple main model interfaces. The document item area is used to display item data. The creation information area defines the most basic interface of the business document. The most basic interface is the model interface common to all business documents.
[0020] Furthermore, it includes a business logic model, which is used to perform operations on business documents, including document addition, document modification, document delivery and receipt, document approval, and document approval after modification. The logic unit includes a validator, a generator, and a logic executor. The validator is responsible for verifying the field value, the generator is for assigning the field value, and the logic executor is for executing operations on the logical business. The generator includes a primary key generator and a common value generator. The primary key generator is responsible for generating numbers for various business documents according to the number generation rules, and the common generator is responsible for assigning values to other data.
[0021] It is easy for those skilled in the art to understand that the above preferred embodiments can be freely combined and superimposed without conflict.
[0022] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. All equivalent structural changes made using the contents of the present invention's specification and drawings under the inventive concept of the present invention, or directly or indirectly applied in other related technical fields, are included in the patent protection scope of the present invention.
Claims
1. A data resource model applied in an enterprise management system, characterized in that: include: A plurality of model interfaces, wherein the model interfaces are abstracted from the commonalities, similarities or independence of different types of business documents, each of which defines one or more related fields, and these model interfaces are divided into a main model interface (for resolving the value acquisition and assignment of the main field of the business document) and an item model interface (for resolving the value acquisition and assignment of the item field of the business document) according to the data structure of the business document; the main body of each business document implements one or more of the main model interfaces, and the item of each business document implements one or more of the item model interfaces, so as to determine the fields possessed by the document main body or the document item; A subject interface factory, formed by encapsulating all the subject model interfaces, the subject interface factory defines a plurality of subject model methods for obtaining corresponding subject model interfaces, the subject model interfaces correspond to the subject model methods one by one, and the subject interface factory also defines the execution order of the subject model methods; An entry interface factory, formed by encapsulating all the entry model interfaces, the entry interface factory defines a plurality of entry model methods for obtaining corresponding entry model interfaces, the entry model interfaces correspond to the entry model methods one by one, and the entry interface factory also defines the execution order of the entry model methods; The document item interface factory inherits from the main interface factory and has all the capabilities of the main interface factory. It also defines an item collection attribute to achieve the acquisition and modification of all items of the corresponding business document.
2. The data resource model used in an enterprise management system according to claim 1, characterized in that: The subject model interface and the entry model interface respectively include the most basic model interface, which contains fields of creator, creation time, modifier, and modification time, and the subject model method and the entry model method respectively include the most basic model method used to process the fields in the most basic model interface.
3. The data resource model for use in an enterprise management system according to claim 2, characterized in that: The subject model interface includes a basic document model interface, and the subject model method includes a basic document model method for processing fields in the basic document model interface; The item model interface includes a basic item model interface, and the item model method includes a basic item model method for processing fields in the basic item model interface.
4. The data resource model for use in an enterprise management system according to claim 3, characterized in that: include: The three superclasses can instantiate the subject interface factory, the item interface factory, and the document item interface factory in a one-to-one correspondence.
5. The data resource model for use in an enterprise management system according to claim 4, characterized in that: include: Multiple interface controls correspond one-to-one to the multiple model interfaces. The interface controls are formed by controlling the fields in the main model interface and the entry model interface. One or more controls are set for each field in the model interface. In this way, the defined controls can be directly used in various occasions, and controls can be defined and obtained according to different application types such as detail pages and editing.
6. The data resource model for use in an enterprise management system according to claim 5, characterized in that: The UI layer includes a document body area, a document item area, and a creation information area. The document body area includes multiple interface controls corresponding to the main model interface. The document item area is used to display item data. The creation information area defines the most basic interface of the business document. The most basic interface is a model interface common to all business documents.
7. The data resource model system for use in an enterprise management system according to claim 6, characterized in that: It includes a business logic model, which is used to add, delete and modify business documents, including document addition, document modification, document material delivery, document approval, and document approval after modification. The logic unit includes a validator, a generator and a logic executor. The validator is responsible for verifying the field value, the generator is for assigning the field value, and the logic executor is for executing operations on the logic business.
8. The data resource model for use in an enterprise management system according to claim 7, characterized in that: The generator includes a primary key generator and a common value generator. The primary key generator is responsible for generating order numbers for various business documents according to order number generation rules, and the common generator is responsible for assigning values to other data.
