Database Schema version management method and device, computer equipment and storage medium
By generating the merged Schema tree structure and traversing and comparing the tree nodes, distinguishing the tree nodes are determined, and the modified Schema file is stored using the semantic version identity number, the problems of inefficiency and confusing version management in traditional methods are solved, and efficient and accurate Schema version management is achieved.
Patent Information
- Application Number
- CN202510327987.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-07-22
AI Technical Summary
Traditional database Schema version management methods are inefficient and chaotic, making it difficult to effectively control the version and evolution of low-code applications.
By generating the merged Schema tree structure, traversal comparison of tree nodes, determining the distinction tree nodes, and storing the modified Schema file according to the semantic version identity number, improving management efficiency and accuracy.
Improves the efficiency and accuracy of multi-person collaboration, avoids version management chaos, and ensures the accuracy of tracking and managing changes between versions.
Smart Images

Figure CN120353775A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of database management, and in particular, to a method, device, computer device, and storage medium for managing database Schema versions. Background Art
[0002] In low-code development, Schema is usually used to describe information such as the structure, layout, and component configuration of an application. It is a data structure that defines the relationships between various elements of a low-code application and their attributes. For example, the component tree structure in a low-code page and the attributes of each component can be represented by Schema. By managing Schema, the versions and evolutions of low-code applications can be effectively controlled. Among them, changing the Schema file of a database table or testing with production environment data are common requirements.
[0003] However, traditional methods for managing database Schema versions have problems such as low efficiency or chaotic version management. Summary of the Invention
[0004] Based on this, in order to solve the above technical problems, it is necessary to provide a method, device, computer device, and storage medium for managing database Schema versions that can improve efficiency and avoid chaotic version management.
[0005] In a first aspect, a method for managing database Schema versions is provided. The method includes:
[0006] In response to receiving the target Schema tree structures sent by each user terminal, generate a merged target Schema tree structure according to each target Schema tree structure, and obtain a modified Schema file after format conversion of the merged target Schema tree structure; wherein, the target Schema tree structure is the Schema tree structure generated by the corresponding user terminal performing a modification operation on the Schema tree structure to be modified of the target version;
[0007] Traverse and compare the tree nodes according to the merged target Schema tree structure and the Schema tree structure to be modified to obtain the corresponding different tree nodes; the different tree nodes are the tree nodes on the merged target Schema tree structure that are different from the Schema tree structure to be modified;
[0008] Determine the version modification type of the modified Schema file according to each different tree node, generate a semantic version identity number of the modified Schema file according to the version modification type, and store the modified Schema file in the database according to the semantic version identity number.
[0009] In one embodiment, generating a merged target Schema tree structure according to each target Schema tree structure includes: performing a merging process on each target Schema tree structure to obtain a merged target Schema tree structure; traversing and comparing tree nodes based on the merged target Schema tree structure and the Schema tree structure to be modified to obtain corresponding differentia tree nodes; the differentia tree nodes being tree nodes on the merged target Schema tree structure that have two or more differences from the Schema tree structure to be modified; in response to a modification confirmation operation being performed on each differentia tree node, determining corresponding modified and confirmed differentia tree nodes; and updating the merged target Schema tree structure according to each modified and confirmed differentia tree node.
[0010] In one embodiment, the method further includes: when traversing and comparing tree nodes based on the merged target Schema tree structure and the Schema tree structure to be modified to obtain corresponding differentia tree nodes, recording a change log of the Schema tree structure to be modified.
[0011] In one embodiment, the method further includes: in response to a Schema file query operation being performed in a database according to a semantic version identity number, determining a modified Schema file; and differentially displaying the Schema tree structure to be modified and each differentia tree node on a display interface of the modified Schema file.
[0012] In one embodiment, the method further includes: in response to a forward compatibility operation being performed on the modified Schema file, generating a forward compatibility processed modified Schema file; and in response to a backward compatibility operation being performed on the modified Schema file, generating a backward compatibility processed modified Schema file.
[0013] In one embodiment, the method further includes: in response to a version rollback operation being performed on the modified Schema file, deleting each differentia tree node in the merged target Schema tree structure to obtain a Schema file corresponding to the Schema tree structure to be modified; and in response to a version migration operation being performed on the Schema file corresponding to the Schema tree structure to be modified, adding each differentia tree node to the Schema tree structure to be modified to obtain a modified Schema file.
[0014] In one embodiment, the modified Schema file is stored in the database according to the semantic version identification number, including: performing a version test on the modified Schema file to obtain a test result; generating a debugged modified Schema file in response to a debugging operation on the modified Schema file according to the test result; and storing the debugged modified Schema file in the database according to the semantic version identification number.
[0015] In a second aspect, a database Schema version management device is provided. The device includes a structure merging module, a node traversing module, and a file storage module.
[0016] Among them, the structure merging module is configured to generate a merged target Schema tree structure according to the target Schema tree structures sent by each user terminal in response to receiving the target Schema tree structures, and obtain a modified Schema file after converting the format of the merged target Schema tree structure; where the target Schema tree structure is a Schema tree structure generated by the corresponding user terminal performing a modification operation on the Schema tree structure to be modified of the target version; the node traversing module is configured to perform tree node traversal comparison according to the merged target Schema tree structure and the Schema tree structure to be modified to obtain corresponding different tree nodes; the different tree nodes are tree nodes on the merged target Schema tree structure that are different from the Schema tree structure to be modified; the file storage module is configured to determine the version modification type of the modified Schema file according to each different tree node, generate a semantic version identification number of the modified Schema file according to the version modification type, and store the modified Schema file in the database according to the semantic version identification number.
[0017] In a third aspect, a computer device is provided. The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of any one of the methods in the above method embodiments are implemented.
[0018] In a fourth aspect, a computer-readable storage medium is provided. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of any one of the methods in the above method embodiments are implemented.
[0019] The above database Schema version management method, device, computer device, and storage medium respond to receiving the target Schema tree structures sent by each user terminal, generate a merged target Schema tree structure based on each target Schema tree structure, and obtain a modified Schema file after format conversion of the merged target Schema tree structure. Among them, the target Schema tree structure is the Schema tree structure generated by the corresponding user terminal performing a modification operation on the Schema tree structure to be modified of the target version. Then, traverse and compare the tree nodes based on the merged target Schema tree structure and the Schema tree structure to be modified to obtain the corresponding different tree nodes. The different tree nodes are the tree nodes on the merged target Schema tree structure that are different from the Schema tree structure to be modified. Next, determine the version modification type of the modified Schema file according to each different tree node, generate a semantic version identity number for the modified Schema file according to the version modification type, and store the modified Schema file in the database according to the semantic version identity number, improving the management efficiency and accuracy, avoiding version management chaos, improving the efficiency and accuracy of multi-person collaboration, and facilitating understanding of the changes between versions. Brief Description of the Drawings
[0020] Figure 1 It is an application environment diagram of the database Schema version management method in an embodiment;
[0021] Figure 2 It is a first process schematic diagram of the database Schema version management method in an embodiment;
[0022] Figure 3 It is a process schematic diagram of generating a merged target Schema tree structure based on each target Schema tree structure in an embodiment;
[0023] Figure 4 It is a second process schematic diagram of the database Schema version management method in an embodiment;
[0024] Figure 5 It is a third process schematic diagram of the database Schema version management method in an embodiment;
[0025] Figure 6 It is a fourth process schematic diagram of the database Schema version management method in an embodiment;
[0026] Figure 7 It is a process schematic diagram of storing the modified Schema file in the database according to the semantic version identity number in an embodiment;
[0027] Figure 8 is a structural block diagram of a database Schema version management device in an embodiment;
[0028] Figure 9 is an internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0029] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0030] To facilitate the understanding of the present application, the present application will be described more comprehensively below with reference to the relevant accompanying drawings. Embodiments of the present application are shown in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, these embodiments are provided so that the disclosure of the present application is more thorough and comprehensive.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present application belongs. The terms used in the specification of the present application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application.
[0032] It can be understood that the terms "first", "second", etc. used in the present application can be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the present application, the first resistor can be called the second resistor, and similarly, the second resistor can be called the first resistor. Both the first resistor and the second resistor are resistors, but they are not the same resistor.
[0033] It can be understood that "connection" in the following embodiments should be understood as "electrical connection", "communication connection", etc. if there is an electrical signal or data transmission between the connected circuits, modules, units, etc.
[0034] As used herein, the singular forms "a", "an" and "the" may also include the plural forms unless the context clearly indicates otherwise. It should also be understood that the terms "comprise / include" or "have" etc. specify the presence of the stated features, wholes, steps, operations, components, parts or combinations thereof, but do not preclude the presence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof.
[0035] The database Schema version management method provided by the present application can be applied to, for exampleFigure 1 In the application environment shown. Among them, the user terminal 102 communicates with the server 104 through the network. Among them, the user terminal 102 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0036] In the first aspect, as Figure 2 shown, a method for database Schema version management is provided. Taking the server 104 in Figure 1 as an example, the following steps 201 to 203 are included.
[0037] Step 201, in response to receiving the target Schema tree structures sent by each user terminal, generate a merged target Schema tree structure according to each target Schema tree structure, and perform format conversion on the merged target Schema tree structure to obtain a modified Schema file.
[0038] Among them, the target Schema tree structure is the Schema tree structure generated by the corresponding user terminal performing a modification operation on the Schema tree structure to be modified of the target version. The target version is any version of the Schema file to be modified in the database selected by each user terminal. The Schema tree structure to be modified is obtained by performing format conversion on the Schema file to be modified. Specifically, the server 104, in response to receiving the target Schema tree structures sent by each user terminal, generates a merged target Schema tree structure according to each target Schema tree structure, and performs format conversion on the merged target Schema tree structure to obtain a modified Schema file, thereby facilitating each user terminal 102 to perform a modification operation on the Schema tree structure to be modified corresponding to the Schema file to be modified at the same time, improving the efficiency and accuracy of multi-person collaboration.
[0039] In a specific example, the permissions of different client terminals 102 to perform modification operations on the Schema tree structure to be modified of the target version are not the same. The permissions of the client terminal 102 for modification operations include App administrator permissions, interface administrator permissions, and ordinary R & D personnel permissions. The App administrator permissions include the creation, deletion, and modification of version records for all interfaces; the interface administrator permissions include the creation, deletion, and modification of version records for the managed interfaces; the ordinary R & D personnel permissions include viewing and modifying the versions of the Schema files they are responsible for. The above are only specific examples and are flexibly applied according to user requirements in actual applications and are not limited here.
[0040] In one embodiment, as Figure 3 shown, generating a merged target Schema tree structure according to each target Schema tree structure includes steps 301 to 304.
[0041] Step 301, performing a merging process on each target Schema tree structure to obtain a merged target Schema tree structure;
[0042] Step 302, traversing and comparing tree nodes according to the merged target Schema tree structure and the Schema tree structure to be modified to obtain corresponding abnormal difference tree nodes;
[0043] Step 303, in response to a modification confirmation operation on each abnormal difference tree node, determining a corresponding modified and confirmed abnormal difference tree node;
[0044] Step 304, updating the merged target Schema tree structure according to each modified and confirmed abnormal difference tree node.
[0045] Among them, the abnormal difference tree node is a tree node on the merged target Schema tree structure that has more than two differences from the Schema tree structure to be modified. Specifically, the server 104 performs a merging process on each target Schema tree structure to obtain a merged target Schema tree structure; then, traverses and compares tree nodes according to the merged target Schema tree structure and the Schema tree structure to be modified to obtain corresponding abnormal difference tree nodes; then, in response to a modification confirmation operation on each abnormal difference tree node, determines a corresponding modified and confirmed abnormal difference tree node; finally, updates the merged target Schema tree structure according to each modified and confirmed abnormal difference tree node, reducing the error rate of the merged target Schema tree structure, and thus improving the accuracy, convenience, and efficiency of the merged target Schema tree structure.
[0046] In this embodiment, perform a merging process on each target Schema tree structure to obtain a merged target Schema tree structure; then, traverse and compare tree nodes according to the merged target Schema tree structure and the Schema tree structure to be modified to obtain corresponding abnormal difference tree nodes; then, in response to a modification confirmation operation on each abnormal difference tree node, determine a corresponding modified and confirmed abnormal difference tree node; finally, update the merged target Schema tree structure according to each modified and confirmed abnormal difference tree node, reducing the error rate of the merged target Schema tree structure, and thus improving the accuracy, convenience, and efficiency of the merged target Schema tree structure.
[0047] Step 202: Traverse and compare the tree nodes based on the merged target Schema tree structure and the Schema tree structure to be modified, and obtain the corresponding different tree nodes.
[0048] Among them, the different tree nodes are the tree nodes on the merged target Schema tree structure that are different from the Schema tree structure to be modified. Specifically, the server 104 traverses and compares the tree nodes based on the merged target Schema tree structure and the Schema tree structure to be modified, and obtains the corresponding different tree nodes, which is convenient for understanding the changes between versions.
[0049] In a specific example, the changes of the different tree nodes include structural changes and / or attribute value changes. Structural changes include adding components or deleting components. The above are only specific examples and can be flexibly applied according to user needs in actual applications, and are not limited here.
[0050] In one embodiment, the method further includes:
[0051] When traversing and comparing the tree nodes based on the merged target Schema tree structure and the Schema tree structure to be modified to obtain the corresponding different tree nodes, record the change log of the Schema tree structure to be modified.
[0052] Specifically, when the server 104 traverses and compares the tree nodes based on the merged target Schema tree structure and the Schema tree structure to be modified to obtain the corresponding different tree nodes, record the change log of the Schema tree structure to be modified, so as to facilitate querying the differences and evolution processes between versions through the change log.
[0053] In this embodiment, when traversing and comparing the tree nodes based on the merged target Schema tree structure and the Schema tree structure to be modified to obtain the corresponding different tree nodes, record the change log of the Schema tree structure to be modified, so as to facilitate querying the differences and evolution processes between versions through the change log.
[0054] Step 203: Determine the version modification type of the modified Schema file according to each different tree node, generate the semantic version identity number of the modified Schema file according to the version modification type, and store the modified Schema file in the database according to the semantic version identity number.
[0055] Specifically, the server 104 determines the version modification type of the modified Schema file according to each difference tree node, generates a semantic version identity number of the modified Schema file according to the version modification type, and stores the modified Schema file in the database according to the semantic version identity number, improving the management efficiency and accuracy, avoiding version management chaos, improving the efficiency and accuracy of multi-person collaboration, and facilitating understanding of the changes between versions.
[0056] In a specific example, generating the semantic version identity number of the modified Schema file according to the version modification type includes: obtaining the current time and generating a timestamp according to the current time; generating the semantic version identity number of the modified Schema file according to the timestamp and the version modification type, which is more conducive to file positioning. The above is only a specific example and can be flexibly applied according to user needs in actual applications, and will not be limited here.
[0057] In a specific example, storing the modified Schema file in the database according to the semantic version identity number includes: determining the database type according to the data type of the modified Schema file; the database type includes a relational database or a non-relational database; in response to the database type being a relational database, storing the modified Schema file in the relational database according to the semantic version identity number; in response to the database type being a non-relational database, storing the modified Schema file in the non-relational database according to the semantic version identity number. The above is only a specific example and can be flexibly applied according to user needs in actual applications, and will not be limited here.
[0058] In a specific example, the method further includes: in response to a release operation of the modified Schema file, releasing the modified Schema file on the application platform. The above is only a specific example and can be flexibly applied according to user needs in actual applications, and will not be limited here.
[0059] In the above database Schema version management method, in response to receiving the target Schema tree structures sent by each user terminal, a merged target Schema tree structure is generated according to each target Schema tree structure, and the modified Schema file is obtained after formatting the merged target Schema tree structure; wherein, the target Schema tree structure is the Schema tree structure generated by the corresponding user terminal performing a modification operation on the Schema tree structure to be modified of the target version; then, the tree nodes of the merged target Schema tree structure and the Schema tree structure to be modified are traversed and compared to obtain the corresponding different tree nodes; the different tree nodes are the tree nodes on the merged target Schema tree structure that are different from the Schema tree structure to be modified; then, the version modification type of the modified Schema file is determined according to each different tree node, the semantic version identity number of the modified Schema file is generated according to the version modification type, and the modified Schema file is stored in the database according to the semantic version identity number, which improves the management efficiency and accuracy, avoids version management chaos, improves the efficiency and accuracy of multi-person collaboration, and is convenient for understanding the changes between versions.
[0060] In one embodiment, as Figure 4 shown, the method further includes step 401 and step 402.
[0061] Step 401, in response to performing a Schema file query operation in the database according to the semantic version identity number, determine the modified Schema file;
[0062] Step 402, perform a differentiated display of the Schema tree structure to be modified and each different tree node on the display interface of the modified Schema file according to the modified Schema file.
[0063] Specifically, the server 104, in response to performing a Schema file query operation in the database according to the semantic version identity number, determines the modified Schema file; then, performs a differentiated display of the Schema tree structure to be modified and each different tree node on the display interface of the modified Schema file, which improves the visualization effect of the modified Schema file and the convenience of version comparison.
[0064] In this embodiment, in response to querying the Schema file in the database according to the semantic version identification number, the modified Schema file is determined; then, according to the modified Schema file, the Schema tree structure to be modified and each differential tree node are differentially displayed on the display interface of the modified Schema file, improving the visualization effect of the modified Schema file and the convenience of version comparison.
[0065] In one embodiment, as Figure 5 shown, the method further includes step 501 and step 502.
[0066] Step 501, in response to performing a forward compatibility operation on the modified Schema file, generating a modified Schema file after forward compatibility processing;
[0067] Step 502, in response to performing a backward compatibility operation on the modified Schema file, generating a modified Schema file after backward compatibility processing.
[0068] Specifically, the server 104 responds to performing a forward compatibility operation on the modified Schema file, generating a modified Schema file after forward compatibility processing, thereby ensuring the compatibility of the low-code application with the old version data; then, in response to performing a backward compatibility operation on the modified Schema file, generating a modified Schema file after backward compatibility processing, thereby preventing the definitions in the new version of the Schema file, i.e., the modified Schema file, from disrupting the normal operation of the old version application.
[0069] In a specific example, if a new field is added to the new version of the Schema file, when the old version application loads data, it should be able to correctly handle this new field, and the default value can be set or the field can be ignored. For situations involving changes in the data structure, a data migration tool or script is provided. For example, when the type of a certain field in the Schema of a component changes, the data migration script can convert the old data into a data format that meets the requirements of the new type.
[0070] When designing the new version of the Schema file, it is necessary to consider the possible old version components or functional dependencies in the low-code platform. Avoid new Schema definitions from disrupting the normal operation of the old version application. For example, if a certain function in the new version of the Schema file depends on a new API, it is necessary to ensure that in the old version of the LowCodeEngine, if this API does not exist, there is a corresponding fallback processing strategy. The above are only specific examples, which are flexibly applied according to user requirements in actual applications and are not limited here.
[0071] In this embodiment, in response to performing a forward compatibility operation on the modified Schema file, a modified Schema file after forward compatibility processing is generated, thereby ensuring the compatibility of the low-code application with the old version data; then, in response to performing a backward compatibility operation on the modified Schema file, a modified Schema file after backward compatibility processing is generated, thereby preventing the definitions in the new version of the Schema file, i.e., the modified Schema file, from disrupting the normal operation of the old version application.
[0072] In one of the embodiments, as Figure 6 shown, the method further includes step 601 and step 602.
[0073] Step 601, in response to performing a version rollback operation on the modified Schema file, delete each differential tree node in the merged target Schema tree structure to obtain the Schema file corresponding to the Schema tree structure to be modified;
[0074] Step 602, in response to performing a version migration operation on the Schema file corresponding to the Schema tree structure to be modified, add each differential tree node to the Schema tree structure to be modified to obtain the modified Schema file.
[0075] Specifically, the server 104, in response to performing a version rollback operation on the modified Schema file, deletes each differential tree node in the merged target Schema tree structure to obtain the Schema file corresponding to the Schema tree structure to be modified, thereby implementing the version rollback function of the Schema file; then, in response to performing a version migration operation on the Schema file corresponding to the Schema tree structure to be modified, adds each differential tree node to the Schema tree structure to be modified to obtain the modified Schema file, thereby implementing the version migration function of the Schema file.
[0076] In a specific example, the version rollback function of the Schema file is implemented based on the version record and the change log. When it is necessary to roll back to a certain historical version, the corresponding Schema data is retrieved from the version storage, and then the current Schema of the low-code application is replaced with the Schema of the rollback version. During the rollback process, it is necessary to pay attention to handling possible dependency issues. For example, if a certain component does not exist in the rollback version but has dependencies in the current version, appropriate cleaning or adjustment needs to be carried out. When the low-code application is upgraded from one version to another, version migration operations may be required. For example, if the Schema structure of the new version has changed, a migration script needs to be written to convert the Schema data of the old version into the format of the new version. The migration script can determine how to convert the data based on the change log and the differences between versions to ensure the integrity and consistency of the data during the upgrade process. The above is only a specific example and should be flexibly applied according to user requirements in actual applications, and no restrictions are imposed here.
[0077] In this embodiment, in response to a version rollback operation on the modified Schema file, each differential tree node in the merged target Schema tree structure is deleted to obtain the Schema file corresponding to the Schema tree structure to be modified, thereby implementing the version rollback function of the Schema file; then, in response to a version migration operation on the Schema file corresponding to the Schema tree structure to be modified, each differential tree node is added to the Schema tree structure to be modified to obtain the modified Schema file, thereby implementing the version migration function of the Schema file.
[0078] In one embodiment, as Figure 7 shown, the modified Schema file is stored in the database according to the semantic version identification number, including steps 701 to 702.
[0079] Step 701, perform version testing on the modified Schema file to obtain a test result;
[0080] Step 702, in response to debugging the modified Schema file according to the test result, generate the debugged modified Schema file;
[0081] Step 703, store the debugged modified Schema file in the database according to the semantic version identification number.
[0082] Among them, version testing includes unit testing, integration testing, and end-to-end testing. Unit testing is used to separately test the functions of each component and attribute definition in the modified Schema file; integration testing is used to test whether the interaction between different components based on the modified Schema file is normal; end-to-end testing is used to verify the functional integrity of the entire low-code application under the modified Schema file from the perspective of user operations.
[0083] Specifically, the server 104 performs version testing on the modified Schema file to obtain a test result; then, in response to a debugging operation on the modified Schema file based on the test result, a debugged modified Schema file is generated; next, the debugged modified Schema file is stored in the database according to the semantic version identification number, thereby improving the accuracy of the debugged modified Schema file.
[0084] In a specific example, storing the modified Schema file in the database according to the semantic version identification number further includes: obtaining the validation rules of the Schema file; calling a validation tool to validate the debugged modified Schema file according to the validation rules of the Schema file to obtain a validation result, thereby ensuring the execution accuracy of the debugged modified Schema file. The above is only a specific example and can be flexibly applied according to user requirements in actual applications, and is not limited here.
[0085] In this embodiment, version testing is performed on the modified Schema file to obtain a test result; then, in response to a debugging operation on the modified Schema file based on the test result, a debugged modified Schema file is generated; next, the debugged modified Schema file is stored in the database according to the semantic version identification number, thereby improving the accuracy of the debugged modified Schema file.
[0086] It should be understood that although Figure 2-7 the steps in the flowchart of Figure 2-7 are displayed in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover,
[0087] In a second aspect, as Figure 8 shown, a database Schema version management device is provided, and the device includes a structure merging module 810, a node traversing module 820, and a file storage module 830.
[0088] Among them, the structure merging module 810 is configured to, in response to receiving the target Schema tree structures sent by each user terminal, generate a merged target Schema tree structure according to each target Schema tree structure, and perform format conversion on the merged target Schema tree structure to obtain a modified Schema file; wherein, the target Schema tree structure is a Schema tree structure generated by the corresponding user terminal performing a modification operation on the Schema tree structure to be modified of the target version; the node traversing module 820 is configured to perform tree node traversal comparison according to the merged target Schema tree structure and the Schema tree structure to be modified, and obtain corresponding different tree nodes; the different tree nodes are tree nodes on the merged target Schema tree structure that are different from the Schema tree structure to be modified; the file storage module 830 is configured to determine the version modification type of the modified Schema file according to each different tree node, generate a semantic version identity number of the modified Schema file according to the version modification type, and store the modified Schema file in the database according to the semantic version identity number.
[0089] In one embodiment, the structure merging module 810 includes a structure merging unit.
[0090] Among them, the structure merging unit is configured to perform merging processing on each target Schema tree structure to obtain a merged target Schema tree structure; the structure merging unit is configured to perform tree node traversal comparison according to the merged target Schema tree structure and the Schema tree structure to be modified, and obtain corresponding abnormal different tree nodes; the abnormal different tree nodes are tree nodes on the merged target Schema tree structure that have more than two differences from the Schema tree structure to be modified; the structure merging unit is configured to, in response to performing a modification confirmation operation on each abnormal different tree node, determine the corresponding abnormal different tree node after modification confirmation; the structure merging unit is configured to update the merged target Schema tree structure according to each abnormal different tree node after modification confirmation.
[0091] In one embodiment, the device further includes a log recording module.
[0092] Among them, the log recording module is used to record the change log of the Schema tree structure to be modified when traversing and comparing tree nodes according to the merged target Schema tree structure and the Schema tree structure to be modified, and obtaining the corresponding different tree nodes.
[0093] In one embodiment, the device further includes a file query module.
[0094] Among them, the file query module is used to determine the modified Schema file in response to a Schema file query operation in the database according to the semantic version identification number; the file query module is used to differentially display the Schema tree structure to be modified and each different tree node on the display interface of the modified Schema file.
[0095] In one embodiment, the device further includes a compatibility operation module.
[0096] Among them, the compatibility operation module is used to generate a modified Schema file after forward compatibility processing in response to a forward compatibility operation on the modified Schema file; the compatibility operation module is used to generate a modified Schema file after backward compatibility processing in response to a backward compatibility operation on the modified Schema file.
[0097] In one embodiment, the device further includes a version switching module.
[0098] Among them, the version switching module is used to delete each different tree node in the merged target Schema tree structure in response to a version rollback operation on the modified Schema file, and obtain the Schema file corresponding to the Schema tree structure to be modified; the version switching module is used to add each different tree node to the Schema tree structure to be modified in response to a version migration operation on the Schema file corresponding to the Schema tree structure to be modified, and obtain the modified Schema file.
[0099] In one embodiment, the file storage module 830 includes a file testing unit.
[0100] Among them, the file testing unit is used to perform version testing on the modified Schema file to obtain a test result; the file testing unit is used to generate a debugged modified Schema file in response to a debugging operation on the modified Schema file according to the test result; the file testing unit is used to store the debugged modified Schema file in the database according to the semantic version identification number.
[0101] For the specific limitations of the database Schema version management device, reference can be made to the limitations of the database Schema version management method in the foregoing text, which will not be elaborated here. Each module in the above database Schema version management device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the computer device in hardware form or be independent of it, or be stored in the memory in the computer device in software form, so as to facilitate the processor to call and execute the operations corresponding to the above modules.
[0102] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 9 shown. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data of each target Schema tree structure. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a database Schema version management method.
[0103] Those skilled in the art can understand that Figure 9 the structure shown in
[0104] is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0105] In a third aspect, a computer device is provided. The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, it implements the steps of any one of the methods in the above method embodiments.
[0106] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0107] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, 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, it should be considered as the scope recorded in this specification.
[0108] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.
Claims
1. A method for database Schema version management, the method comprising: Responding to receiving the target Schema tree structures sent by each user terminal, generating a merged target Schema tree structure according to each of the target Schema tree structures, and obtaining a modified Schema file after performing format conversion on the merged target Schema tree structure; wherein, the target Schema tree structure is a Schema tree structure generated by the corresponding user terminal performing a modification operation on the Schema tree structure to be modified of the target version; Performing tree node traversal comparison according to the merged target Schema tree structure and the Schema tree structure to be modified, and obtaining corresponding different tree nodes; the different tree nodes are tree nodes on the merged target Schema tree structure that are different from the Schema tree structure to be modified; Determining the version modification type of the modified Schema file according to each of the different tree nodes, generating a semantic version identity number of the modified Schema file according to the version modification type, and storing the modified Schema file in the database according to the semantic version identity number.
2. The method according to claim 1, wherein The generating a merged target Schema tree structure according to each of the target Schema tree structures includes: Performing a merging process on each of the target Schema tree structures to obtain the merged target Schema tree structure; Performing tree node traversal comparison according to the merged target Schema tree structure and the Schema tree structure to be modified, and obtaining corresponding abnormal different tree nodes; the abnormal different tree nodes are tree nodes on the merged target Schema tree structure that have more than two differences from the Schema tree structure to be modified; Responding to performing a modification confirmation operation on each of the abnormal different tree nodes, and determining the corresponding modified abnormal different tree nodes; Updating the merged target Schema tree structure according to each of the modified abnormal different tree nodes.
3. The method according to claim 1, characterized in that, The method further includes: When performing tree node traversal comparison according to the merged target Schema tree structure and the Schema tree structure to be modified to obtain corresponding different tree nodes, recording the change log of the Schema tree structure to be modified.
4. The method according to claim 1, wherein The method further includes: Responding to performing a Schema file query operation in the database according to the semantic version identity number, and determining the modified Schema file; Performing differential display on the Schema tree structure to be modified and each of the different tree nodes on the display interface of the modified Schema file according to the modified Schema file.
5. The method according to claim 1, wherein The method further includes: Responding to performing a forward compatibility operation on the modified Schema file, and generating the modified Schema file after forward compatibility processing. In response to performing a backward compatibility operation on the modified Schema file, a backward compatibility processed modified Schema file is generated.
6. The method according to claim 1, wherein The method further includes: In response to performing a version rollback operation on the modified Schema file, each of the difference tree nodes in the merged target Schema tree structure is deleted to obtain the Schema file corresponding to the Schema tree structure to be modified; In response to performing a version migration operation on the Schema file corresponding to the Schema tree structure to be modified, each of the difference tree nodes is added to the Schema tree structure to be modified to obtain the modified Schema file.
7. The method according to claim 1, wherein storing the modified Schema file into the database according to the semantic version identity number includes: Performing version testing on the modified Schema file to obtain a test result; In response to performing a debugging operation on the modified Schema file according to the test result, a debugged modified Schema file is generated; Storing the debugged modified Schema file into the database according to the semantic version identity number.
8. A database Schema version management device, characterized in that The apparatus includes: A structure merging module, configured to, in response to receiving the target Schema tree structures sent by each user terminal, generate a merged target Schema tree structure according to each of the target Schema tree structures, and perform format conversion on the merged target Schema tree structure to obtain a modified Schema file; wherein the target Schema tree structure is a Schema tree structure generated by a corresponding user terminal performing a modification operation on the Schema tree structure to be modified of a target version; A node traversing module, configured to perform tree node traversal comparison according to the merged target Schema tree structure and the Schema tree structure to be modified to obtain corresponding difference tree nodes; the difference tree nodes are tree nodes on the merged target Schema tree structure that are different from the Schema tree structure to be modified; A file storage module, configured to determine the version modification type of the modified Schema file according to each of the difference tree nodes, generate a semantic version identity number of the modified Schema file according to the version modification type, and store the modified Schema file into the database according to the semantic version identity number.
9. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Data change detection method and device, medium and program product
CN121255822A
Industrial logic intelligent control method and system based on semantic processing
CN121956767A