Master data version management method and device, computer equipment and storage medium
By creating a master data version management table and receiving change instructions to generate target master data version records, multiple problems in data asset life cycle management in the existing technology are solved, flexible master data version management is realized, system development and maintenance costs are reduced, and storage space is saved.
Patent Information
- Application Number
- CN202411996025.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-02
AI Technical Summary
The existing technology has many problems in the life cycle management of data assets, including the need to establish historical tables for each data model, the complex relationship between the main table and the subtable, the low efficiency of data changes in historical storage, and the high cost of system development and maintenance.
By creating a master data version management table, including pre- and post-change expansion fields, receiving change instructions and generating target master data version records, flexible version management of master data is achieved and duplicate code modifications are avoided.
It realizes flexible management of master data information without modifying the code, reduces system development costs and maintenance difficulties, and saves historical record storage space.
Smart Images

Figure CN119917485A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a master data version management method, device, computer equipment and storage medium, belonging to the technical field of data management. Background Art
[0002] With the popularization and promotion of information systems and digital transformation, data assets are becoming more and more important in the production and operation process of enterprises, and have become an indispensable part of the core competitiveness of enterprises. How to effectively manage data assets, and even maintain and manage data assets throughout their life cycle, is also a key issue that all types of information systems or platforms need to solve.
[0003] At present, the management of data asset lifecycle is mostly done by information systems implementing data historical version management. For example, a common practice is to establish a corresponding historical table for each data model. When the data is changed, the data before the change can be backed up. The disadvantages of this approach are as follows:
[0004] 1. Each data model needs to establish a corresponding history table. If the data model deletes the data table fields later, the history table must also be modified accordingly. This is a huge workload for system developers and maintenance personnel. In some cases, the initialization of new fields must also be considered;
[0005] 2. In a relational data model, there is often a relationship between a main table and a sub-table. If the sub-table also needs to record change history, then the sub-table also needs to have a corresponding history table;
[0006] 3. For the storage of data change history, usually a complete backup of the data before modification is stored. If only a certain field is changed, the data of the entire model needs to be stored, resulting in a waste of storage space;
[0007] 4. For the comparison before and after the change, it is also necessary to implement code for different data models, which increases the system development cost. Summary of the invention
[0008] In order to solve the above technical problems, the present invention provides a master data version management method, device, computer equipment and storage medium. Without modifying the code, master data information can be flexibly managed according to business needs. Business systems do not need to be implemented repeatedly, which greatly reduces system development costs and maintenance difficulties, and can also save historical record storage space.
[0009] In one aspect, the present invention provides a master data version management method, comprising:
[0010] Creating a master data version management table; the master data version management table includes a first extension field and a second extension field; the first extension field is used to store the extended attribute before the change; the second extension field is used to store the extended attribute after the change;
[0011] Receive change instructions for target master data;
[0012] A target master data version record is generated according to the change instruction.
[0013] The definition and creation of the "master data version management table" in the present invention application are the same as the logic of the "master data table" in the Chinese invention patent (patent name: Master data version management method, device, computer equipment and storage medium, patent application number: CN202310301822.2). Those skilled in the art can create the "master data version management table" in the present invention according to the text content of the aforementioned Chinese invention patent.
[0014] The extended attribute before change is the previous version of the extended attribute after the change operation is performed according to the change instruction; the extended attribute after change is the extended attribute after the change operation is performed according to the change instruction.
[0015] In the present invention, when the master data version management table manages only one version record of master data, a target master data version record needs to be generated according to the specific content of the change instruction.
[0016] When the change instruction includes the latest full version extended attribute of the target master data; generating the target master data version record according to the change instruction includes:
[0017] Acquire the current full version extended attribute of the target master data from the master data version management table;
[0018] Compare the latest full-version extended attributes with the current full-version extended attributes to obtain the extended attributes before and after the change;
[0019] Generate a target master data version record according to the extended attributes before and after the change;
[0020] or;
[0021] The change instruction includes the target extended attribute of the target master data and its modification instruction; and generating the target master data version record according to the change instruction includes:
[0022] Acquire the current full version extended attribute of the target master data from the master data version management table;
[0023] Compare the target extended attribute and its modification instruction with the current full-version extended attribute to obtain the extended attribute before change and the extended attribute after change;
[0024] Generate a target master data version record according to the extended attributes before and after the change;
[0025] or;
[0026] The change instruction includes the target extended attribute of the target master data and its deletion instruction; and generating the target master data version record according to the change instruction includes:
[0027] According to the target extended attribute and its deletion instruction, the extended attribute before change and the extended attribute after change are obtained; the extended attribute after change is empty;
[0028] Generate a target master data version record according to the extended attributes before and after the change;
[0029] or;
[0030] The change instruction includes the target extension attribute of the target master data and its new addition instruction; and generating the target master data version record according to the change instruction includes:
[0031] According to the target extended attribute and the newly added instruction, the extended attribute before the change and the extended attribute after the change are obtained; the extended attribute before the change is empty;
[0032] A target master data version record is generated according to the pre-change extended attributes and the post-change extended attributes.
[0033] In the present invention, when the master data version management table is used to manage version records of one or more master data, the master data version management table also includes an identification code; at this time, the target master data version record still needs to be generated according to the specific content of the change instruction.
[0034] When the change instruction includes the identification code of the target master data and the latest full version extended attribute of the target master data; generating the target master data version record according to the change instruction includes:
[0035] Acquire the current full version extended attribute of the target master data from the master data version management table according to the identification code;
[0036] Compare the latest full-version extended attributes with the current full-version extended attributes to obtain the extended attributes before and after the change;
[0037] A target master data version record is generated according to the identification code, the extended attributes before the change, and the extended attributes after the change.
[0038] When the change instruction includes the identification code of the target master data, the target extended attribute of the target master data and the modification instruction thereof; generating the target master data version record according to the change instruction includes:
[0039] Acquire the current full version extended attribute of the target master data from the master data version management table according to the identification code;
[0040] Compare the target extended attribute and its modification instruction with the current full-version extended attribute to obtain the extended attribute before change and the extended attribute after change;
[0041] Generate a target master data version record according to the identification code, the extended attributes before the change, and the extended attributes after the change;
[0042] or;
[0043] The change instruction includes the identification code of the target master data, the target extended attribute of the target master data and the deletion instruction thereof;
[0044] Generating a target master data version record according to the change instruction includes:
[0045] According to the target extended attribute and its deletion instruction, the extended attribute before change and the extended attribute after change are obtained; the extended attribute after change is empty;
[0046] Generate a target master data version record according to the identification code, the extended attributes before the change, and the extended attributes after the change;
[0047] or;
[0048] The change instruction includes the identification code of the target master data, the target extended attributes of the target master data and the new addition instruction;
[0049] Generating a target master data version record according to the change instruction includes:
[0050] According to the target extended attribute and the newly added instruction, the extended attribute before the change and the extended attribute after the change are obtained; the extended attribute before the change is empty;
[0051] A target master data version record is generated according to the identification code, the extended attributes before the change, and the extended attributes after the change.
[0052] In addition, in other embodiments of the present invention, the master data version management table further includes the change personnel and / or the change time; the change instruction includes the change content, the change personnel and / or the change time; and the generating of the target master data version record according to the change instruction includes:
[0053] A target master data version record is generated according to the changed content, changed personnel and / or changed time.
[0054] In one aspect, the present invention provides a method for obtaining a master data version, comprising:
[0055] The master data version management method as described above is used to manage the master data version record;
[0056] Receive a version acquisition instruction of target master data;
[0057] The target version of the target master data is returned according to the version acquisition instruction.
[0058] In another aspect, the present invention provides a master data version management device, comprising:
[0059] A creation unit, used to create a master data version management table; the master data version management table includes a first extension field and a second extension field; the first extension field is used to store the extended attribute before the change; the second extension field is used to store the extended attribute after the change;
[0060] A first receiving unit, used for receiving a change instruction of target master data;
[0061] A generating unit is used to generate a target master data version record according to the change instruction.
[0062] In another aspect, the present invention provides a master data version acquisition device, comprising:
[0063] A management unit, used to manage the master data version record by using the master data version management method as described above;
[0064] A second receiving unit, configured to receive a version acquisition instruction for target master data;
[0065] The returning unit is used to return the target version of the target master data according to the version acquisition instruction.
[0066] On the other hand, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the master data version management method as described above when executing the computer program.
[0067] On the other hand, the present invention provides a computer-readable storage medium storing one or more computer programs, which can be executed by one or more processors to implement the master data version management method as described above.
[0068] The beneficial effects of the present invention are:
[0069] 1. Define the master data version management table through the master data model, and use the flexibility of extended fields to store the changes of master data; different types of master data change history can be stored to facilitate the analysis of the differences before and after the master data changes and realize master data version management.
[0070] 2. In addition to storing the change history of master data, it can also provide the following capabilities for business systems:
[0071] 2.1 After obtaining the change time of executing the change instruction, it is possible to obtain the historical version information at a specific time point;
[0072] 2.2 View all change records of a certain extended attribute;
[0073] 2.3 The difference information before and after the master data of different historical versions are changed, etc.
[0074] 3. The master data version management method provided by the present invention can realize refined management of data assets, and all these implementations are provided by the method and device, and the business system does not need to be implemented repeatedly, which greatly reduces the system development cost and maintenance difficulty.
[0075] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0077] Figure 1 A schematic flow chart of a master data version management method provided by an embodiment of the present invention;
[0078] Figure 2 This is a schematic sub-flow chart of the master data version management method according to an embodiment of the present invention;
[0079] Figure 3 A schematic block diagram of a master data version management device provided by an embodiment of the present invention;
[0080] Figure 4 A schematic block diagram of a generation unit of a master data version management device provided in an embodiment of the present invention;
[0081] Figure 5 A schematic flow chart of a method for obtaining a master data version provided by an embodiment of the present invention;
[0082] Figure 6A schematic block diagram of a master data version acquisition device provided by an embodiment of the present invention;
[0083] Figure 7 A schematic diagram of the structural composition of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0084] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0085] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0086] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0087] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0088] Example
[0089] The embodiment of the present application provides a master data version management method for managing information such as materials, personnel, and production equipment in the manufacturing industry, wherein the database providing data storage may be a mainstream OLTP relational database such as Oracle, Sql Server, Mysql, and PostgreSQL; in addition, the executor of the method may be a computer, server, or other device, which is not limited in this embodiment.
[0090] See also Figure 1 , Figure 1 A schematic flow chart of a master data version management method provided by an embodiment of the present invention. Figure 1 As shown, a master data version management method specifically includes the following steps S1-S3:
[0091] S1, create a master data version management table. The master data version management table includes a first extension field and a second extension field; the first extension field is used to store the extended attribute before the change; the second extension field is used to store the extended attribute after the change.
[0092] The content of the master data version management table is specifically set according to the actual application scenario and exists in various forms. For example, the present application embodiment creates a master data version management table as shown in Table 1 below, including an identification code, a change person, a change time, a first extension field, and a second extension field; wherein the first extension field is used to store the extended attributes before the master data is changed, and the second extension field is used to store the extended attributes after the master data is changed.
[0093] Table 1
[0094] Identification code Change of personnel Change time First extension field Second extension field
[0095] In other embodiments, if the master data version management table is only used to manage the version record of one master data, the identification code column may not be set.
[0096] In other embodiments, if the changed personnel do not need to be stored, the corresponding column in the master data version management table does not need to be set.
[0097] In other embodiments, if the change time does not need to be stored, the corresponding column in the master data version management table does not need to be set.
[0098] S2, receiving the change instruction of the target master data.
[0099] Since the content of the master data version management table is specifically set according to the actual application scenario, the change instruction will also specifically adapt to the content of the master data version management table and exist in a variety of different forms.
[0100] For example, combined with the content of Table 1, in an embodiment of the present application, Table 1 is used to manage version records of one or more master data; the change instruction 1 (as shown in Table 2) includes the identification code of the target master data, the change person, the change time and the latest full version extended attributes of the target master data.
[0101] As shown in Table 2, the specific content of change instruction 1 is: Zhang San changed the target master data "A01" at 2024-07-29 10:00:00. After the change, the target master data "A01" has four extended attributes, namely: the metadata name is "category", the value is "lens ring"; the metadata name is "lens ring model", the value is "G70"; the metadata name is "model number", the value is " / 1"; the metadata name is "lens ring color", the value is "white".
[0102] Table 2
[0103]
[0104]
[0105] In other embodiments, the change instruction includes the identification code of the target master data, the change personnel, the change time, the target extended attributes of the target master data and its modification instructions; or; the change instruction includes the identification code of the target master data, the change personnel, the change time, the target extended attributes of the target master data and its deletion instructions; or; the change instruction includes the identification code of the target master data, the change personnel, the change time, the target extended attributes of the target master data and its addition instructions.
[0106] In other embodiments, if the changed personnel do not need to be stored, that is, the changed personnel column is not set in the master data version management table, the changed personnel are not included in the change instruction.
[0107] In other embodiments, if the change time does not need to be stored, that is, the change time column is not set in the master data version management table, the change instruction does not include the change time.
[0108] In other embodiments, when the master data version management table is used only to manage the version record of one master data, the identification code column does not need to be set in the master data version management table, and of course the change instruction does not need to include the identification code of the target master data.
[0109] S3, generating a target master data version record according to the change instruction.
[0110] The content of the master data version management table is specifically set according to the actual application scenario, and the change instruction will also specifically adapt to the content of the master data version management table, and there are many different forms. In different actual application scenarios, the content of the change instruction is different, so the specific steps of S3 also have many different specific forms.
[0111] For the purpose of illustration, and in combination with the contents of Table 1 and Table 2, in an embodiment of the present application, the processor receives a change instruction 1; the specific content of the change instruction 1 is: Zhang San changed the target master data "A01" at 2024-07-29 10:00:00, and after the change, the target master data "A01" has four extended attributes, namely: the metadata name is "category", the value is "lens ring"; the metadata name is "lens ring model", the value is "G70"; the metadata name is "model number", the value is " / 1"; the metadata name is "lens ring color", the value is "white".
[0112] See also Figure 2 , step S3 includes the following specific steps:
[0113] S31 obtains the current full version extended attribute of the target master data from the master data version management table according to the identification code.
[0114] After receiving the change instruction 1, the processor searches the master data version management table according to the identification code "A01" to see whether the target master data "A01" has a change history. If not, it means that the target master data "A01" is created for the first time, that is, the current full version extended attribute is empty.
[0115] S32 compares the latest full-version extended attributes with the current full-version extended attributes to obtain the extended attributes before and after the change. Since the current full-version extended attributes of the target master data "A01" are empty, the extended attributes before the change are empty. The extended attributes after the change are the four extended attributes in the change instruction 1:
[0116] [{"fieldName":"Category","extra":{"dataValue":"Mirror ring"}},
[0117] {"fieldName":"Mirror ring model","extra":{"dataValue":"G70"}},
[0118] {"fieldName":"Model","extra":{"dataValue":" / 1"}},
[0119] {"fieldName":"Mirror ring color","extra":{"dataValue":"white"}}]]
[0120] S33 obtains the change personnel who executes the change instruction.
[0121] S34 obtains the change time for executing the change instruction.
[0122] S35 generates a target master data version record according to the identification code, the change person, the change time, the extended attributes before the change, and the extended attributes after the change.
[0123] At this time, the master data version management table after executing change instruction 1 is as shown in Table 3.
[0124] Table 3
[0125]
[0126] Of course, the execution steps will be adjusted accordingly according to the content of the change instruction. For the purpose of illustration, the following example is given in conjunction with the content of Table 3.
[0127] After executing change instruction 1, the processor receives change instruction 2; the specific content of change instruction 2 is: Zhang San changed the master data "A01" at 2024-07-29 11:00:00; the change content is: add a new extended attribute: the metadata name is "carving" and the value is "QR code". See Table 4 below for details.
[0128] Table 4
[0129]
[0130] Execute change instruction 2. At this time, the extended attribute before the change is "empty", and the extended attribute after the change is the target extended attribute " {"fieldName":"雕刻","extra":{"dataValue":"二维码"}} ”.
[0131] At this time, the master data version management table after executing change instruction 2 is as shown in Table 5.
[0132] Table 5
[0133]
[0134] After executing change instruction 2, the processor receives change instruction 3; the specific content of change instruction 3 is: Zhang San changed the master data "A01" at 2024-07-29 14:00:00; the change content is: delete the extended attribute: the metadata name is "carving" and the value is "QR code". See Table 4 below for details.
[0135] Table 6
[0136]
[0137]
[0138] Execute change instruction 3. The extended attribute before the change is now the target extended attribute. { " fieldName " : " 雕刻","extra":{"dataValue":"二维码"}} ", the extended attribute is changed to "empty".
[0139] At this time, the master data version management table after executing change instruction 3 is as shown in Table 7.
[0140] Table 7
[0141]
[0142] After executing change instruction 3, the processor receives change instruction 4; the specific content of change instruction 4 is: Zhang San changed the master data "A01" at 2024-07-29 19:00:00; the change content is: modify the value of the extended attribute metadata named "lens ring color" to "red". See Table 8 below for details.
[0143] Table 8
[0144]
[0145]
[0146] Execute change instruction 4. The extended attribute before the change is now the target extended attribute. { " fieldName " : " 镜圈颜色","extra":{"dataValue":"白色"}} ", the extended attribute after the change is " {"fieldName":"镜圈颜色 " , " extra " :{ " dataValue " : " 红色 " }} ”.
[0147] At this time, the master data version management table after executing change instruction 4 is as shown in Table 9 below.
[0148] Table 9
[0149]
[0150] Afterwards, the processor receives change instruction 5; the specific content of change instruction 5 is: Li Si changed the master data "A01" at 2024-07-30 08:00:00; the change content is:
[0151] a) Add new extended attributes: metadata name is "carving", value is "QR code";
[0152] b) Modify the extended attribute of the existing metadata named "lens ring color" and change the value to "black and white";
[0153] c) Delete the extended attribute named "module number" in the metadata. See Table 10 below for details.
[0154] Table 10
[0155]
[0156] After receiving the change instruction 5, the processor still searches the master data version management table for the change record of the target master data with the identification code "A01", sorts the found change records in ascending order by change time, and processes them one by one from early to late to obtain the latest version Vn of the master data. The specific process is as follows:
[0157] 1. Set the extended attribute of the second extended field of the first change record as version V1;
[0158] 2. Take the contents of the first and second extension fields of the second change record, and overwrite the extended attributes of the second extension field with the V1 version according to the metadata name: if the V1 version does not have an extended attribute with the metadata name, then it is a newly added extended attribute, and it is appended; if V1 has an extended attribute with the same metadata name, then the value of the second extension field is updated; if the first extension field already has an extended attribute, but the second extension field does not, it means that the extended attribute was deleted during the second change, then the extended attribute with the same metadata name in the V1 version is removed, and finally the V2 version is obtained;
[0159] 3. Similarly, for the third change record, the contents of the first extension field and the second extension field of the second change record are also taken out, and processed in combination with version V2 to obtain version V3.
[0160] 4. This process continues in this way until the change history of the target master data "A01" is traversed and the latest version Vn is obtained.
[0161] Compare the extended attributes of the Vn version with those of the change instruction 5 to obtain the extended attributes before and after the change. The specific process is as follows:
[0162] First, from the above example, the target master data "A01" has four change histories, so the content of the latest full version extended attribute is:
[0163] [{"fieldName":"Category","extra":{"dataValue":"Mirror ring"}},
[0164] {"fieldName":"Mirror ring model","extra":{"dataValue":"G70"}},
[0165] {"fieldName":"Model","extra":{"dataValue":" / 1"}},
[0166] {"fieldName":"Mirror ring color","extra":{"dataValue":"red"}}]
[0167] The extended attributes in change instruction 5 are:
[0168] [{"fieldName":"Category","extra":{"dataValue":"Mirror ring"}},
[0169] {"fieldName":"Mirror ring model","extra":{"dataValue":"G70"}},
[0170] {"fieldName":"Engraving","extra":{"dataValue":"QR code"}},
[0171] {"fieldName":"Mirror ring color","extra":{"dataValue":"Black"}}]
[0172] Through comparison, the following conclusions are drawn:
[0173] 1. The attribute values of the metadata named "category" and "lens ring model" are the same, indicating that there is no change.
[0174] 2. The metadata name "lens ring color" exists on both sides, but the values are different, indicating that the value of the extended attribute has been modified. The two extended attributes are stored in the first extended field and the second extended field of the version management table respectively.
[0175] 3. The extended attribute with the metadata name "carving" is only available in the change instruction, indicating that it is a newly added extended attribute, which is stored in the second extended field of the version management table; the extended attribute does not exist in the corresponding first extended field.
[0176] 4. The extended attribute with the metadata name "module number" does not exist in the change instruction, but exists in the Vn version, which means that the extended attribute has been deleted in this change, so it is stored in the first extended field of the version management table; the extended attribute does not exist in the corresponding second extended field.
[0177] After comparison, the extended attributes that need to be stored in the first extended field and the second extended field are obtained, and a new change record is created in the version management table as shown in Table 11.
[0178] Table 11
[0179]
[0180]
[0181] It can be seen from the fifth change record in the master data version management table that Li Si only changed the extended attributes corresponding to the three metadata "lens ring color", deleted the "model number", and added "engraving", and other extended attributes were not changed. Therefore, the historical record only needs to contain the extended attributes related to this change, and other extended attributes do not need to be stored redundantly. If the master data has dozens or hundreds of extended attributes, it can greatly save the historical record storage space.
[0182] At the same time, when retrieving a change record, you can intuitively see the difference of this change, such as the content of the fifth change of the target master data "A01":
[0183] The metadata in both the first and second extension fields indicates that the value has changed, and the "lens ring color" has changed from "red" to "black";
[0184] The metadata of the first extension field exists but the second extension field does not exist indicates that this change has been deleted, "Model Number" -> None
[0185] The metadata of the first extended attribute does not exist, but the second extended attribute exists indicates that it is a newly added extended attribute. None -> "Engraving" is "QR Code";
[0186] Similarly, if you want to get the change history of the metadata named "lens rim color" in the target master data "A01", you only need to query the master data version management table according to the target master data code "A01". If there is a change record with the metadata named "lens rim color" in the first extension field or the metadata named "lens rim color" in the second extension field, it is the change history of all the metadata.
[0187] In other embodiments, if the changed personnel do not need to be stored, that is, the changed personnel column is not set in the master data version management table, and the changed personnel are not included in the change instruction, then the changed personnel do not need to be stored accordingly.
[0188] In other embodiments, if the change time does not need to be stored, that is, the change time column is not set in the master data version management table, and the change instruction does not include the change time, then the change time does not need to be stored accordingly.
[0189] In other embodiments, when the master data version management table is only used to manage the version record of one master data, the identification code column does not need to be set in the master data version management table, and of course the change instruction does not need to include the identification code of the target master data, so the identification code does not need to be stored accordingly.
[0190] See also Figure 3 Corresponding to the master data version management method described above, an embodiment of the present invention further proposes a master data version management device 100 , which includes: a creation unit 110 , a first receiving unit 120 and a generation unit 130 .
[0191] The creation unit 110 is used to create a master data version management table; the master data version management table includes a first extension field and a second extension field; the first extension field is used to store the extended attribute before the change; the second extension field is used to store the extended attribute after the change;
[0192] A first receiving unit 120, configured to receive a change instruction for target master data;
[0193] The generating unit 130 is configured to generate a target master data version record according to the change instruction.
[0194] See also Figure 4 In this embodiment, the generating unit 130 includes:
[0195] A first acquisition module 131 is used to acquire the current full version extended attribute of the target master data from the master data version management table according to the identification code;
[0196] The comparison module 132 is used to compare the latest full-version extended attributes with the current full-version extended attributes to obtain the extended attributes before and after the change.
[0197] The second acquisition module 133 is used to acquire the change personnel who executes the change instruction.
[0198] The third acquisition module 134 is used to acquire the change time of executing the change instruction.
[0199] The generation module 135 is used to generate a target master data version record according to the identification code, the change person, the change time, the extended attributes before the change and the extended attributes after the change.
[0200] The above-mentioned master data version management device 100 corresponds one-to-one to the above-mentioned master data version management method. Its specific principles and processes are the same as those of the method described in the above embodiment, and will not be repeated here.
[0201] Similarly, in other embodiments, according to different specific application scenarios and corresponding to specific master data version management methods, the master data version management device 100 also includes corresponding units.
[0202] See also Figure 5 The embodiment of the present invention further provides a method for obtaining a master data version, including:
[0203] R1 uses the master data version management method as described above to manage master data version records;
[0204] R2 receives the version acquisition instruction of the target master data;
[0205] R3 returns the target version of the target master data according to the version acquisition instruction.
[0206] See also Figure 6 Corresponding to the master data version acquisition method described above, the embodiment of the present invention further proposes a master data version acquisition device 200 , which includes: a management unit 210 , a second receiving unit 220 and a returning unit 230 .
[0207] Wherein, the management unit 210 is used to manage the master data version record by using the master data version management method as described above;
[0208] The second receiving unit 220 is used to receive a version acquisition instruction of the target master data;
[0209] The returning unit 230 is configured to return the target version of the target master data according to the version acquisition instruction.
[0210] The master data version management device 100 can be implemented in the form of a computer program. Figure 7 Runs on the computer device shown.
[0211] Figure 7 The present invention is a schematic diagram of the structure of a computer device. The device can be a terminal or a server, wherein the terminal can be a smart phone, a tablet computer, a laptop or a desktop computer. The server can be an independent server or a server cluster composed of multiple servers.
[0212] See also Figure 7 The computer device 500 includes a processor 502, a non-volatile storage medium 503, an internal memory 504 and a network interface 505 connected via a system bus 501. The non-volatile storage medium 503 of the computer device 500 can store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 can execute a master data version management method. The processor 502 of the computer device 500 is used to provide computing and control capabilities to support the operation of the entire computer device 500. The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program is executed by the processor, the processor 502 can execute a master data version management method. The network interface 505 of the computer device 500 is used for network communication. Those skilled in the art can understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0213] The processor 502 is used to run the computer program stored in the memory 504 to implement the above-mentioned master data version management method.
[0214] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0215] The present invention also provides a computer-readable storage medium, which stores one or more computer programs. The one or more computer programs can be executed by one or more processors to implement the above-mentioned master data version management method.
[0216] The aforementioned storage medium of the present invention includes: a magnetic disk, an optical disk, a read-only memory (ROM) and other media that can store program codes.
[0217] The units in all embodiments of the present invention can be implemented by a general purpose integrated circuit, such as a CPU (Central Processing Unit).
[0218] The CPU may be implemented by a central processing unit (CPU), or by an ASIC (Application Specific Integrated Circuit).
[0219] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A master data version management method, characterized in that: include: Creating a master data version management table; the master data version management table includes a first extension field and a second extension field; The first extension field is used to store the extended attribute before the change; The second extension field is used to store the changed extended attribute; Receive change instructions for target master data; A target master data version record is generated according to the change instruction.
2. The master data version management method according to claim 1, characterized in that: The master data version management table only manages one master data; The change instruction includes the latest full version extended attribute of the target master data; and generating the target master data version record according to the change instruction includes: Acquire the current full version extended attribute of the target master data from the master data version management table; Compare the latest full-version extended attributes with the current full-version extended attributes to obtain the extended attributes before and after the change; Generate a target master data version record according to the extended attributes before and after the change; or; The change instruction includes the target extended attribute of the target master data and its modification instruction; and generating the target master data version record according to the change instruction includes: Acquire the current full version extended attribute of the target master data from the master data version management table; Compare the target extended attribute and its modification instruction with the current full-version extended attribute to obtain the extended attribute before change and the extended attribute after change; Generate a target master data version record according to the extended attributes before and after the change; or; The change instruction includes the target extended attribute of the target master data and its deletion instruction; and generating the target master data version record according to the change instruction includes: According to the target extended attribute and its deletion instruction, the extended attribute before change and the extended attribute after change are obtained; the extended attribute after change is empty; Generate a target master data version record according to the extended attributes before and after the change; or; The change instruction includes the target extension attribute of the target master data and its new addition instruction; and generating the target master data version record according to the change instruction includes: According to the target extended attribute and the newly added instruction, the extended attribute before the change and the extended attribute after the change are obtained; the extended attribute before the change is empty; A target master data version record is generated according to the pre-change extended attributes and the post-change extended attributes.
3. The master data version management method according to claim 1, characterized in that: The master data version management table also includes an identification code; the change instruction includes the identification code of the target master data and the latest full version extended attribute of the target master data; and generating the target master data version record according to the change instruction includes: Acquire the current full version extended attribute of the target master data from the master data version management table according to the identification code; Compare the latest full-version extended attributes with the current full-version extended attributes to obtain the extended attributes before and after the change; A target master data version record is generated according to the identification code, the extended attributes before the change, and the extended attributes after the change.
4. The master data version management method according to claim 1, characterized in that: The master data version management table also includes an identification code; the change instruction includes an identification code of the target master data, a target extended attribute of the target master data and a modification instruction thereof; and generating a target master data version record according to the change instruction includes: Acquire the current full version extended attribute of the target master data from the master data version management table according to the identification code; Compare the target extended attribute and its modification instruction with the current full-version extended attribute to obtain the extended attribute before change and the extended attribute after change; Generate a target master data version record according to the identification code, the extended attributes before the change, and the extended attributes after the change; or; The change instruction includes the identification code of the target master data, the target extended attribute of the target master data and the deletion instruction thereof; Generating a target master data version record according to the change instruction includes: According to the target extended attribute and its deletion instruction, the extended attribute before change and the extended attribute after change are obtained; the extended attribute after change is empty; Generate a target master data version record according to the identification code, the extended attributes before the change, and the extended attributes after the change; or; The change instruction includes the identification code of the target master data, the target extended attributes of the target master data and the new addition instruction; Generating a target master data version record according to the change instruction includes: According to the target extended attribute and the newly added instruction, the extended attribute before the change and the extended attribute after the change are obtained; the extended attribute before the change is empty; A target master data version record is generated according to the identification code, the extended attributes before the change, and the extended attributes after the change.
5. The master data version management method according to any one of claims 1 to 4, characterized in that: The master data version management table also includes the change personnel and / or change time; The change instruction includes the change content, change personnel and / or change time; Generating a target master data version record according to the change instruction includes: A target master data version record is generated according to the changed content, changed personnel and / or changed time.
6. A method for obtaining a master data version, characterized in that: include: Using the master data version management method as described in any one of claims 1 to 5 to manage the master data version record; Receive a version acquisition instruction of target master data; The target version of the target master data is returned according to the version acquisition instruction.
7. A master data version management device, characterized in that: include: A creating unit, used to create a master data version management table; the master data version management table includes a first extension field and a second extension field; The first extension field is used to store the extended attribute before the change; The second extension field is used to store the changed extended attribute; A first receiving unit, used for receiving a change instruction of target master data; A generating unit is used to generate a target master data version record according to the change instruction.
8. The master data version acquisition device is characterized by: include: A management unit, configured to manage master data version records by using the master data version management method according to any one of claims 1 to 5; A second receiving unit, configured to receive a version acquisition instruction for target master data; The returning unit is used to return the target version of the target master data according to the version acquisition instruction.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the master data version management method according to any one of claims 1 to 5 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more computer programs, and the one or more computer programs can be executed by one or more processors to implement the master data version management method according to any one of claims 1-5.
Citation Information
Patent Citations
Master data management method and device, computer equipment and storage medium device
CN116340320A