WO2023279752A1 - 数据库模型的版本管理方法、装置及相关设备 - Google Patents

数据库模型的版本管理方法、装置及相关设备 Download PDF

Info

Publication number
WO2023279752A1
WO2023279752A1 PCT/CN2022/080325 CN2022080325W WO2023279752A1 WO 2023279752 A1 WO2023279752 A1 WO 2023279752A1 CN 2022080325 W CN2022080325 W CN 2022080325W WO 2023279752 A1 WO2023279752 A1 WO 2023279752A1
Authority
WO
WIPO (PCT)
Prior art keywords
version
user equipment
database model
server
further configured
Prior art date
Application number
PCT/CN2022/080325
Other languages
English (en)
French (fr)
Inventor
罗标
凌云
何国平
杨少兵
Original Assignee
华为云计算技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为云计算技术有限公司 filed Critical 华为云计算技术有限公司
Publication of WO2023279752A1 publication Critical patent/WO2023279752A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Definitions

  • the present application relates to the technical field of databases, in particular to a database model version management method, device and related equipment.
  • the version of the database model can facilitate retrospective modification.
  • the current database design software cannot provide a retrospective function after modifying the database model structure.
  • the script file of the database model can be version managed through the code repository.
  • the code warehouse can only record code and data modifications, and the dependencies between various elements of the database are often complicated. It is difficult to trace back the version of the database model by recording script files, and unstructured text is not conducive to users viewing the database. Modification of structure, poor user experience.
  • the embodiment of the present application provides a database model version management method, device and related equipment, which can manage the structured data of the database model, so that users can conveniently view the model information of each version of the database design.
  • the embodiment of the present application provides a database model version management method, including:
  • the structural data of the database model of the first version is provided to the user equipment, the structural data of the database model includes the elements constituting the database model of the first version and the links between the elements.
  • the above method can be applied to a server and executed by the server or components inside the server (such as a chip, a software module or an integrated circuit). Or the above method can be applied to the database design system, for example, executed by the server side of the database design system (the server side can be realized by a server, a cloud platform, etc.).
  • the server can manage multiple versions of the database model, and each version of the database model includes elements of the database and relationships between elements, so that multiple versions of the database model can be easily traced back. Users can choose to view a certain version of the database model according to their own needs from the information of multiple versions of the database model.
  • the server provides the user with the structural data of the database model corresponding to the version. Since the structural data contains elements of multiple databases and the links between elements, users can easily view the structure of the current version of the database, which improves the user experience.
  • the elements of the database model of the first version include at least one of the following: library, table, index, field, entity, attribute, foreign key, trigger, view , stored procedure, function, or sequence, etc.
  • the method further includes:
  • a change record of the first element in the second version is provided to the user equipment.
  • the updating includes adding the first element, deleting the first element, and modifying information of the first element.
  • the update of the first element by the user equipment can be recorded in the above manner, so that the user can view the change of the element.
  • the change record in the second version includes the first element before update and/or the first element after update.
  • the change record can be presented on the user device, enabling the user to intuitively view the state of the first element before and after the update, facilitating comparison of changes of the first element in different versions, and improving user experience.
  • the change record further includes the information of the first element, the user who updated the first element, the time when the first element was updated, and so on.
  • the method further includes:
  • the change records of multiple elements in the database model in multiple versions can be managed through the server, which facilitates the process of creating, modifying, and deleting elements in the database model.
  • the user can conveniently view the changes experienced by the specified element in previous versions by interacting with the user device. For example, the user adds table A in the first version, adds a certain field B to table A in the second version, and modifies field B to field C in the third version.
  • vertically backtracking table A you can know in which version table A was created and in which version it was updated, so as to intuitively obtain the life cycle of elements and improve user experience.
  • the method further includes:
  • the embodiment of the present application provides a database model version management method, including:
  • the structural data of the database model of the first version provided by the server is received, and the structural data of the database model includes the elements constituting the database model of the first version and the links between the elements.
  • the above method can be applied to the user equipment, and is executed by the user equipment or components inside the user equipment (such as a chip, a software module or an integrated circuit). Or the above method can be applied to a database design system, for example, executed by a client of the database design system.
  • the elements of the database model of the first version include at least one of the following: library, table, index, field, entity, attribute, foreign key, trigger, view , stored procedure, function, or sequence, etc.
  • the method further includes:
  • a change record of the first element in the second version provided by the server is received.
  • the change record in the second version includes the first element before the update and the first element after the update.
  • the method further includes:
  • the change records of the first element in the database model provided by the server in multiple versions are received.
  • the embodiment of the present application provides a version management method of a database model, including:
  • the above method can be applied to a server and executed by the server or components inside the server (such as a chip, a software module or an integrated circuit). Or the above method can be applied to the database design system, for example, executed by the server of the database design system.
  • the server can manage the change records of multiple elements in the database model in multiple versions, so as to facilitate the process of creating, modifying, and deleting elements in the database model.
  • the user can conveniently view the changes experienced by the specified element in previous versions by interacting with the user device. For example, the user adds table A in the first version, adds a certain field B to table A in the second version, and modifies field B to field C in the third version.
  • vertically backtracking table A you can know in which version table A was created and in which version it was updated, so as to intuitively obtain the life cycle of elements and improve user experience.
  • the one or more elements include at least one of the following: library, table, index, field, entity, attribute, foreign key, trigger, view, stored procedure , function, or sequence, etc.
  • the method further includes:
  • the user device is provided with structural data of the first version of the database model, the one or more elements belonging to the structural data.
  • the method further includes:
  • a change record of the first element in the second version is provided to the user equipment.
  • the change record in the second version includes the first element before the update and the first element after the update.
  • the embodiment of the present application provides a version management method of a database model, including:
  • the one or more elements include at least one of the following: library, table, index, field, entity, attribute, foreign key, trigger, view, stored procedure , function, or sequence, etc.
  • the method further includes:
  • the method further includes:
  • a change record of the first element in the second version provided by the server is received.
  • the change record in the second version includes the first element before the update and the first element after the update.
  • the embodiment of the present application further provides a system, the system includes a user equipment and a server; wherein:
  • the server is configured to provide information of multiple versions of the database model to the user equipment;
  • the user equipment is configured to receive information of multiple versions of database models provided by the server;
  • the user equipment is further configured to send the first version selected by the user equipment to a server;
  • the server is further configured to receive the first version selected by the user equipment
  • the server is further configured to provide the user equipment with the structural data of the database model of the first version, the structural data of the database model includes the elements that make up the database model of the first version and the elements between the elements contact;
  • the user equipment is further configured to receive the structural data of the first version of the database model provided by the server;
  • the user equipment is further configured to present the structural data of the first version of the database model.
  • the one or more elements include at least one of the following: library, table, index, field, entity, attribute, foreign key, trigger, view, stored procedure , function, or sequence, etc.
  • the user equipment is further configured to send an update of the first element in the database model by the user equipment in the second version to the server ;
  • Said server is also used to:
  • the user equipment is further configured to receive a change record of the first element in the second version provided by the server.
  • the change record in the second version includes the first element before the update and the first element after the update.
  • the server is further configured to provide the user equipment with change records of the first element in the database model in multiple versions;
  • the user equipment is further configured to receive change records in multiple versions of the first element in the database model provided by the server.
  • the embodiment of the present application further provides a system, the system includes a user equipment and a server; wherein:
  • the server is configured to provide one or more elements in the database model to the user equipment;
  • the user equipment is configured to receive one or more elements provided by the server;
  • the user equipment is further configured to send the first element selected by the user equipment to a server;
  • the server is further configured to receive the first element selected by the user equipment
  • the server is further configured to provide the user equipment with change records of the first element in multiple versions
  • the user equipment is further configured to receive change records of the first element in multiple versions provided by the server;
  • the user equipment is further configured to present change records of the first element in multiple versions.
  • the one or more elements include at least one of the following: library, table, index, field, entity, attribute, foreign key, trigger, view, stored procedure , function, or sequence, etc.
  • the server is further configured to provide users with information of multiple versions of the database model
  • the user equipment is further configured to receive the information of the multiple versions of the database model provided by the server;
  • the user equipment is further configured to send the first version selected by the user equipment to the server;
  • the server is further configured to receive the first version selected by the user equipment sent by the user equipment;
  • the server is further configured to provide the first version of the structural data of the database model to the user equipment;
  • the user equipment is further configured to receive the structural data of the first version of the database model provided by the server;
  • the user equipment is further configured to present the structural data of the database model of the first version.
  • the user equipment is further configured to send an update of the first element in the database model by the user equipment in the second version to the server ;
  • the server is further configured to receive an update of the first element in the database model by the user equipment in the second version;
  • the server is further configured to provide the user equipment with a change record of the first element in the second version
  • the user equipment is further configured to receive a change record of the first element in the second version provided by the server.
  • the change record in the second version includes the first element before the update and the first element after the update.
  • the embodiment of the present application provides a version management device, the version management device includes a processing unit and a communication unit, and the version management device is used to implement the first aspect or any possible implementation manner described in the first aspect. method.
  • the processing unit and the communication unit are configured to provide the user equipment with information of multiple versions of the database model
  • the communication unit is further configured to receive the first version selected by the user equipment
  • the processing unit and the communication unit are further configured to provide the user equipment with structural data of the database model of the first version, where the structural data of the database model includes elements constituting the database model of the first version and the connections between said elements.
  • the device belongs to a database design system.
  • the elements of the database model of the first version include at least one of the following: library, table, index, field, entity, attribute, foreign key, trigger, Views, stored procedures, functions, or sequences, etc.
  • the communication unit is further configured to receive an update of the first element in the database model by the user equipment in the second version;
  • the processing unit and the communication unit are further configured to provide the user equipment with a change record of the first element in the second version.
  • the change record in the second version includes the first element before the update and the first element after the update.
  • processing unit and the communication unit are further configured to:
  • the change records of the first element in the database model in multiple versions are provided to the user equipment.
  • the embodiment of the present application provides a version management device, the version management device includes a processing unit and a communication unit, and the version management device is used to implement the second aspect or any possible implementation manner described in the second aspect. method.
  • the embodiment of the present application provides a version management device, the version management device includes a processing unit and a communication unit, and the version management device is used to implement the third aspect or any possible implementation manner described in the third aspect. method.
  • the processing unit and the communication unit are configured to provide the user equipment with one or more elements in the database model;
  • the communication unit is further configured to receive the first element selected by the user equipment
  • the processing unit and the communication unit are further configured to provide the user equipment with change records of the first element in multiple versions.
  • the device belongs to a database design system.
  • the one or more elements include at least one of the following: library, table, index, field, entity, attribute, foreign key, trigger, view, storage procedure, function, or sequence, etc.
  • processing unit and the communication unit are further configured to provide users with information of multiple versions of the database model
  • the communication unit is further configured to receive the first version selected by the user equipment
  • the processing unit and the communication unit are further configured to provide the structural data of the database model of the first version to the user equipment, the one or more elements belonging to the structural data.
  • the communication unit is further configured to receive an update of the first element in the database model by the user equipment in the second version;
  • the processing unit and the communication unit are further configured to provide the user equipment with a change record of the first element in the second version.
  • the change record in the second version includes the first element before the update and the first element after the update.
  • the embodiment of the present application provides a version management device, the version management device includes a processing unit and a communication unit, and the version management device is used to implement the fourth aspect or any possible implementation manner described in the fourth aspect. method.
  • the embodiment of the present application provides a computing device, the computing device includes a processor and a memory; a computer program is stored in the memory; when the processor executes the computer program, the computing device executes any one of the aforementioned first to fourth aspects method described.
  • the processor contained in the data transmission device described in the eleventh aspect above may be a processor dedicated to executing these methods (referred to as a dedicated processor for easy distinction), or it may be A processor, such as a general-purpose processor, to execute these methods.
  • at least one processor may also include both a special-purpose processor and a general-purpose processor.
  • the above computer programs may be stored in memory.
  • the memory can be a non-transitory (non-transitory) memory, such as a read-only memory (Read Only Memory, ROM), which can be integrated with the processor on the same device, or can be respectively arranged on different devices , the embodiment of the present application does not limit the type of the memory and the arrangement of the memory and the processor.
  • ROM Read Only Memory
  • the at least one memory is located outside the computing device.
  • the at least one memory is located within the computing device.
  • part of the memory of the at least one memory is located inside the computing device, and another part of the memory is located outside the computing device.
  • processor and the memory may also be integrated into one device, that is, the processor and the memory may also be integrated together.
  • the embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores instructions, and when the instructions are run on at least one processor, the aforementioned first to fourth aspects are realized any of the methods described.
  • the present application provides a computer program product, which includes computer instructions, and when the instructions are run on at least one processor, implement the method described in any one of the first to fourth aspects.
  • the computer program product may be a software installation package, and the computer program product may be downloaded and executed on a computing device if the foregoing method needs to be used.
  • FIG. 1 is a schematic diagram of a database model provided by an embodiment of the present application.
  • Fig. 2 is a schematic diagram of the architecture of a database design system provided by the embodiment of the present application.
  • Fig. 3 is a schematic flowchart of a version management method provided by an embodiment of the present application.
  • Fig. 4 is a schematic interface diagram of information of a database model of multiple versions provided by the embodiment of the present application.
  • FIG. 5A is a schematic diagram of an interface showing structural data of a database model provided by an embodiment of the present application.
  • Fig. 5B is a schematic diagram of another interface showing the structural data of the database model provided by the embodiment of the present application.
  • Fig. 5C is another schematic diagram of an interface showing structural data of a database model provided by the embodiment of the present application.
  • Fig. 5D is a schematic diagram of another interface showing the structural data of the database model provided by the embodiment of the present application.
  • Fig. 6 is a schematic diagram of a vertical backtracking interface provided by the embodiment of the present application.
  • Fig. 7 is a schematic flowchart of another version management method provided by the embodiment of the present application.
  • Fig. 8 is a schematic interface diagram of an element list provided by the embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a version management device provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a computing device provided by an embodiment of the present application.
  • a database (database, DB) is a warehouse that organizes, stores and manages data according to the data structure, and is an organized and shareable collection of large amounts of data stored in a computer.
  • a table is a structured file used to store specific types of data, such as student information, department directories, and so on.
  • Data in a database is usually stored in the form of tables, and each table has a unique identifier, such as a table name.
  • a table includes one or more columns, each column is a field in the table, and each column stores information of a certain part of the table.
  • the database may contain a table indicating a student, one column stores the student identification number (student identification, or called, student ID), and one column stores the student's name (name).
  • Database design modeling When designing a database, the real world is analyzed, abstracted, and internal connections are found, and then the structure of the database is determined. This process is called database design modeling. It mainly includes two parts: determining the most basic data structure and modeling constraints. Database models can include: conceptual models, logical models, physical models, etc.
  • Conceptual model also known as information model, it is based on the user's point of view to model data and information.
  • the conceptual model is used to describe some concepts of the user's business needs.
  • the concept does not contain attributes, but has an analysis structure of entity set and relationship set. Such as “student” and “college” in the school database.
  • the logical model is to concretize the conceptual model. To achieve what the conceptual model describes, those specific functions and processing of those specific information are required, which is the stage of refinement of requirements analysis.
  • the logical model mainly includes structures such as entities, attributes, and relationships.
  • entities are transactions that exist objectively and can be distinguished from each other. For example specific students, orders, items, etc.
  • a combination of entities of the same type is called an entity set.
  • An attribute is a characteristic of an entity.
  • An entity is characterized by several attributes. Relationship, also known as connection, the connection within an entity usually refers to the connection between the attributes that make up the entity, and the connection between entities usually refers to the connection between different entity sets.
  • the "student” entity includes attributes such as student number, name, gender, date of birth, and ID of the college to which it belongs;
  • the "college” entity includes attributes such as: college ID, college name, address, and dean's name ;
  • Student and "College” can be associated, and a student belongs to at least one college.
  • the logical model describes the business to be realized by the system through the Entity-Relationship (E-R) diagram, and describes the relationship between various entities in the business process.
  • E-R Entity-Relationship
  • the physical model refers to the content of the above-mentioned logical model, which is implemented on a specific physical database engine.
  • a specific physical database engine For example, on databases such as MySQL, Oracle, and MongoDB, the logical model entity relationship is implemented with physical tables, fields, primary and foreign keys, etc.
  • the database design system is a visual database design and management tool for designing, building, using and maintaining databases. Users can create (or edit) in the database design system design views including charts and the relationship between charts, and the database design system can store the database design views created (or edited) by users, and can establish database models (or also include store data in the database).
  • the user in this application refers to the user of the database design system, including the designer or developer of the database.
  • Version management refers to the management of data changes such as codes, documents, and model designs during the software development process. It is one of the core ideas of process management in software development iterations.
  • FIG. 1 is a schematic diagram of a possible database model provided by an embodiment of the present application.
  • the student database model is shown in Figure 1.
  • the student table (tb_student), college table (tb_dept) and course table (tb_course) are added to the student database, corresponding to the student entity, college entity, and course entity, respectively.
  • the student table can contain the following fields (attributes): student number (sutdent_ID), student name (sutdent_name), gender (sex), age (age), college number (dept_ID), college table (college entity) Can contain the following fields (attributes): college number (dept_ID), college name (dept_name), address (location), dean’s name (dean), course table (course entity) can contain the following fields (attributes): course number (course_ID ), course name (course_name), credits (ccredit), course number (dept_ID).
  • the college number in the student table is associated with the college number in the college table.
  • the requirements for the database may change at any time, so the database model will be modified. For example, it is currently necessary to add a course grade entity so that students can view the grades of the corresponding course. For another example, since the age of the students can change at any time, the age field in the above student table needs to be updated many times, which is inconvenient to use. So the age field can be updated to the date of birth field, so that the age can be calculated from the current date and the date of birth without updating the data in the database multiple times.
  • Changes to the database model as shown above may occur multiple times during the database design process. Therefore, it is necessary to manage the version of the database model to facilitate retrospective modification.
  • the current database design software cannot provide a retrospective function after modifying the database model structure.
  • the script file of the database model can be version managed through the code repository.
  • the code warehouse can only record code and data modifications, and the dependencies between various elements of the database are often complicated. It is difficult to trace back the version of the database model by recording script files, and unstructured text is not conducive to users viewing the database. Modification of structure, poor user experience.
  • the embodiments of the present application provide a database model version management method, device and related equipment, which can manage the structured data of the database model, so that users can conveniently view the model information of each version of the database design.
  • the database model version management method provided in the embodiment of the present application may be implemented based on a database design system.
  • the database design system may include hardware modules, or software modules (such as application programs, components, etc.), or a combination of hardware modules and software modules, and the like.
  • the database design system may include a client and a server.
  • the client can be used to present interfaces, selection boxes, input boxes and other components that interact with users, and the server can be used to provide the client with the structural data of the database model or respond to user requests.
  • FIG. 2 is a schematic diagram of a possible database design system provided by an embodiment of the present application.
  • the system shown in FIG. 2 includes at least one user equipment 201 and at least one server 202 .
  • the user equipment 201 is an electronic equipment capable of data processing and data sending and receiving, and can realize the aforementioned functions of the client.
  • it may include independent devices such as handheld terminals, wearable devices, vehicles, and robots, and may also be components (such as chips or integrated circuits) included in independent devices.
  • the terminal device when the terminal device is a handheld terminal, it may be a mobile phone (mobile phone), a tablet computer (pad), a computer (such as a notebook computer, a palmtop computer, etc.) and the like.
  • the server 202 is a device capable of data processing and data sending and receiving, and can realize the aforementioned functions of the server. It should be understood that it is referred to as a server for convenience of description here, and its specific form may be a physical device such as a server or a host, or a virtual device such as a virtual machine or a container. Optionally, the server 202 can be independently deployed in one device, or distributed in multiple devices.
  • the server 202 can manage multiple versions of the database model, and each version of the database model includes elements of the database and relationships between elements, so that it is convenient to trace back multiple versions of the database model.
  • the user equipment 201 or the user using the user equipment 201 ) needs to view a database model of a certain version, the structural data corresponding to the version is provided to the user equipment 201 . Since the structural data contains multiple elements in the database model and the connections between elements, users can easily view the structure of the current version of the database, which improves the user experience.
  • the server 202 can manage change records of elements in the database model in multiple versions, so as to facilitate the process of creating, modifying, and deleting elements in the database model.
  • the user device 201 can interact with the user, and the user can conveniently view the changes of the specified element in previous versions through the user device 201 .
  • the user adds table A in the first version, adds a certain field B to table A in the second version, and modifies field B to field C in the third version.
  • By vertically backtracking table A you can know in which version table A was created and in which version it was updated, so as to intuitively obtain the life cycle of elements and improve user experience.
  • the communication link between the server 202 and the user equipment 201 may be a wired link, a wireless link, or a combination of a wired link and a wireless link. Further optionally, communication may also be implemented through one or more network technologies. This application does not limit the communication manner between the server and the user equipment 201 .
  • the server 202 shown in FIG. 2 may be a cloud platform.
  • the cloud platform includes a large number of basic resources provided by the cloud service provider (including but not limited to computing resources, storage resources, or network resources, etc.), where the computing resources can be a large number of computing devices (such as servers, virtual machines).
  • the above database design system can be abstracted into a database design cloud service by a cloud service provider on a cloud platform and provided to users.
  • the cloud platform responds to the database design system instance creation operation triggered by the user, creates the database design system instance on the resources provided by the cloud service provider, and then provides the user with database model version management services.
  • the user equipment used by the user can present an interface and use the version management service.
  • the method of purchasing the database design cloud service may include: pre-charging first and then making settlement according to the actual usage of the final resources, or making settlement according to the time of using the cloud service or according to the functions or resources of the purchased cloud service.
  • the cloud platform may be a cloud platform of the central cloud, a cloud platform of the edge cloud, or a cloud platform including the central cloud and the edge cloud, which is not specifically limited in the embodiment of the present application.
  • the database design system may be partially deployed on the edge cloud cloud platform and partially deployed on the central cloud cloud platform.
  • FIG. 3 is a schematic flowchart of a method for version management provided by an embodiment of the present application.
  • the method may apply the database design system shown in FIG. 2 .
  • the version management method shown in FIG. 3 includes at least step S301 to step S304.
  • Step S301 the server provides information of database models of multiple versions to the user equipment.
  • the user equipment receives information of multiple versions of the database model provided by the server.
  • the information of a version of the database model may include one or more of the version number of the version, the name of the database model, a summary of changes, submission instructions, submitters, creation time, executable operations, and the like.
  • FIG. 4 is a schematic diagram of an interface of a possible database model information of multiple versions provided by an embodiment of the present application.
  • the area 401 is used to illustrate the information of which database model is indicated by the current page, for example, the name of the database model can be "student database model", and the branch can be the main branch (can be passed as shown in the figure select component selects a different branch).
  • Area 402 is used to filter, filter or search different versions according to conditions.
  • Area 403 displays the information of four versions of the database model, namely version 1.1, version 1.2, version 1.3 and the version currently being edited but not yet submitted for saving.
  • the "review status” can be editing (the database model is in the state of being edited), reviewing (the update of the database model has been submitted by the user, and the update is in the pending review state), completed (the update has passed, and the schedule is ready.
  • the "change summary” is used to describe the change of the database model, for example, table change, table addition, function addition, view change and so on.
  • the “commit description” indicates a description of the version, either filled in by the user when submitting the update or generated by the server.
  • “Submitter” is the user who submitted the update.
  • “Created Time” indicates when the update was submitted or when a new version was formed.
  • “Operation” is used to indicate the operations that can be performed on the database model of this book.
  • the components shown in area 404 are used for the rollback version or used to indicate an interface that presents the rollback version.
  • the current version is 1.4, and the user can roll back to version 1.3 by clicking the rollback button corresponding to version 1.3.
  • the components shown in area 405 are used to view one or more versions or instruct to present an interface for viewing one or more versions, so as to view a specified version. For example, clicking on the component shown in area 405 may present the interface of the structure of the database model of version 1.4.
  • the components shown in area 406 are used to view the process information of a specified version, for example, view the review process information of version 1.4. Wherein, the review process information may include one or more items of the reviewer, the change difference visualization, or the database schema definition language (Data Definition Language. DDL).
  • the various components shown in area 407 can be used to determine the entries for each page and adjust the current page.
  • the user equipment may send request information (referred to as request information M1 for convenience of distinction) to the server, where the request information M1 is used to request information of multiple versions of the database model.
  • the server responds to the request information M1 and provides one or more elements of the database model to the user equipment.
  • Step S302 the user equipment sends the first version selected by the user equipment to the server.
  • the server receives that the user equipment selects the first version.
  • the user equipment may choose to view version 1.2, and the user equipment sends the version 1.2 selected by the user to the server.
  • the selection operation may be selected by the user equipment, or may be selected by the user using the user equipment on the user equipment.
  • the user equipment may receive a selection operation of the first version input by the user, so as to send the first version selected by the user equipment to the server.
  • the user using the user equipment can click the control shown in area 406 , and the user equipment sends the version 1.4 selected by the user equipment to the server.
  • Step S303 the server provides the structural data of the first version of the database model to the user equipment.
  • the user equipment receives the structural data of the first version of the database model provided by the server.
  • the structural data includes the elements constituting the first version of the database model and the links between the elements.
  • the element may be one or more of the following: database table, table, field, index, view, entity, attribute, relationship, function, trigger, or stored procedure.
  • the connection between elements includes the arrangement position of the elements, association relationship and so on. For example, one or more of the arrangement position of the table, the field name and data type contained in the table, the foreign key of the table, the table associated with the function, etc.
  • Step S304 the user equipment presents the structural data of the first version of the database model.
  • FIG. 5A is a schematic diagram of a possible interface for displaying structural data of a database model provided by an embodiment of the present application.
  • FIG. 5A shows the display interface of the structural data of the database model of version 1.1, which shows the arrangement position of tables, the relationship between tables and fields, and the relationship between tables.
  • the student table (tb_student) contains multiple fields, such as: student number (sutdent_ID), student name (sutdent_name), gender (sex), age (age), college number (dept_ID ) and other fields
  • the interface shown in FIG. 5A also presents the data type of the field.
  • the college table (tb_dept) contains multiple fields, such as: college number (dept_ID), college name (dept_name), address (location), dean’s name (dean) and other fields.
  • the interface shown in Figure 5A also presents The data type of the field. In the relationship between tables, the student's college number is associated with the college number in the college table, and the college number the student belongs to is the college number contained in the college table.
  • FIG. 5B is a schematic diagram of a possible interface for displaying structural data of a database model provided by an embodiment of the present application.
  • FIG. 5B shows the display interface of the structural data of the database model of version 1.2.
  • the database model of version 1.2 adds two new tables, course table (tb_course) and grade table (tb_grade). Among them, the relationship between tables and fields and the relationship between tables are shown in FIG. 5B , which will not be repeated here.
  • FIG. 5C is a schematic diagram of a possible interface for displaying structural data of a database model provided by an embodiment of the present application.
  • FIG. 5C shows the display interface of the structural data of the database model of version 1.3.
  • the database model of version 1.3 modifies the student table, changing the gender field (sex) to the birth date field (birth).
  • the relationship between tables and fields and the relationship between tables are shown in FIG. 5C , which will not be repeated here.
  • FIG. 5D is a schematic diagram of a possible interface for displaying structural data of a database model provided by an embodiment of the present application.
  • FIG. 5D shows the display interface of the structural data of the database model of version 1.4.
  • the database model of version 1.4 has modified the student table, college table, course table and grade table.
  • student_ID update the student ID field (student_ID) from a 12-digit integer (INT(12)) to a 12-digit character (CHAR(12)).
  • CHAR(12) a 12-digit character
  • dept_ID college ID field
  • course_ID course ID field
  • grade_ID course number field
  • student_ID student number field
  • the server returns the structural data of the database model of the corresponding version, and the user device can present the structural data of the database model of the corresponding version, so that the user can intuitively view the structure of the database model and facilitate backtracking.
  • the server may provide the user with change records of the first element in multiple versions, so as to realize vertical traceback.
  • the change record includes one or more items of the update operation, the information of the first element, the user who updated the first element, and the time when the first element was updated.
  • the update operation may further include one or more of adding the first element, deleting the first element, modifying information of the first element, and the like.
  • the server can manage the change records of multiple elements in the database model in multiple versions, so as to facilitate the process of creating, modifying, and deleting elements in the database model.
  • the user equipment may send request information (referred to as request information M2 for convenience of distinction) to the server, where the request information M2 is used to request to acquire change records of the first element in multiple versions.
  • the server responds to the request information M1, and provides the user equipment with change records of the first element in multiple versions.
  • the user can conveniently check the change status of the specified element in previous versions by interacting with the user device.
  • FIG. 6 is a schematic diagram of a possible vertical backtracking interface provided by an embodiment of the present application.
  • it is the table update record of the student table.
  • the user has added a student table in version 0.2, the table name is tb_student, and the corresponding entity is the student entity.
  • Area 601 also displays the contents of "table details" and "fields" updated this time.
  • the table details are used to display the detailed information of the table, for example, may include one or more of table name, comment, entity name, type, usage classification, label, or virtual table.
  • the "field” content is used to display the detailed information of the updated field in the change record, which may include one or more items of field name, field type, primary key, attribute details, or action, etc., for example.
  • the component shown in area 602 is used to indicate whether to display the content of "table details” and “field”, and the user can click the component shown in area 602 to expand or collapse the content of "table details” and “field” .
  • the user updated the student table in version 1.3. Specifically updated the age field (age) in the student table.
  • the change record can display the pre-update state and the post-update state of a field in a certain version. For example, in version 1.3, the user updates the field name from age to birth, and area 604 displays the status of the updated field name and the status of the updated field name.
  • field type indicates the data type of the field
  • primary key is used to identify whether the field is a primary key field, and since the birth field is not a field in the student table, the value is empty
  • attribute details It is used to describe other detailed attributes of the field
  • “Action” is used to describe the update operation on the field, for example, it can be adding, changing, or deleting. In one design, the user can display the attribute details of the field through the component shown in area 605 .
  • the user updates the student table in version 1.4. Specifically updated the field type in the student table. Please refer to area 607.
  • the field type of the student ID field (student_ID) is a 12-bit integer
  • the field type of the student_ID is a 12-bit character type.
  • the server may receive an update of the first element in the database model by the user equipment in the second version, and provide the user equipment with a change record of the first element in the second version. Further, the change record in the second version includes the first element before the update and/or the first element after the update.
  • the server can manage multiple versions of the database model, and each version of the database model includes elements of the database and relationships between elements, so that multiple versions of the database model can be easily traced back. Users can choose to view a certain version of the database model according to their own needs from the information of multiple versions of the database model.
  • the server provides the user with the structural data of the database model corresponding to the version. Since the structural data contains elements of multiple databases and the links between elements, users can easily view the structure of the current version of the database, which improves the user experience.
  • FIG. 7 is a schematic flowchart of a version management method provided by an embodiment of the present application.
  • the method may apply the database design system shown in FIG. 2 .
  • the version management method shown in FIG. 7 includes at least step S701 to step S704.
  • Step S701 the server provides one or more elements in the database model to the user equipment.
  • the user equipment receives one or more elements provided by the server.
  • the element may be one or more of the following: database table, table, field, index, view, entity, attribute, relationship, function, trigger, or stored procedure.
  • the server provides one or more elements in the database model to the user device, and there are two possible designs:
  • Design 1 The server provides the structural data of the database model to the user equipment, and the structural data includes one or more elements.
  • the structural data of the database model as shown in FIG. 5A contains one or more elements.
  • the structural data of the database model may contain multiple versions.
  • the server provides information of multiple versions of the database model to the user equipment, the user equipment sends the selected first version to the server, and the server provides the user with structural data of the database model of the first version.
  • the structural data of the database model includes (one or more) elements, and may further include (one or more) links between elements. For detailed description, refer to related descriptions in steps S303 and S304.
  • Design 2 The server can directly provide the element list to the user equipment, and the element list contains one or more elements.
  • the server provides one or more elements to the user equipment, and the user equipment can present the one or more elements.
  • FIG. 8 is a schematic interface diagram of a possible element list provided by an embodiment of the present application.
  • the server provides one or more elements to the user equipment, and the user equipment may present the one or more elements in the interface shown in area 801 .
  • one or more elements exemplarily include tables, views, stored procedures and functions.
  • the table may exemplarily include one or more of student table, college table, course table, or grade table.
  • Step S702 the user equipment sends the first element selected by the user equipment to the server.
  • the server receives the first element selected by the user equipment sent by the user equipment.
  • the user equipment may choose to view the student table (tb_student), and the user equipment sends the student table (tb_student) selected by the user equipment to the server.
  • the selection operation may be selected by the user equipment, or may be selected by the user using the user equipment on the user equipment.
  • the user equipment may receive a selection operation of the first element input by the user, so as to send the first element selected by the user equipment to the server.
  • the user using the user device can click to present "tb_student (student table)", and the user device sends request information to the server (referred to as request information M3 for convenience of description), and the request information M3 indicates the student selected by the user device surface.
  • request information M3 for convenience of description
  • the user using the user device can click to present "tb_student (student table)", and the user selects "details", "location” or " Modify record”, the user equipment sends a request M3 to the server, and the request information M3 indicates the student list selected by the user equipment and the required service.
  • tb_student student table
  • the user equipment sends a request M3 to the server, and the request information M3 indicates the student list selected by the user equipment and the required service.
  • Step S703 the server provides the user equipment with change records of the first element in multiple versions.
  • the user equipment receives the change records of the first element in multiple versions provided by the server.
  • the change record includes one or more items of the update operation, the information of the first element, the user who updated the first element, and the time when the first element was updated.
  • the update operation may further include one or more of adding the first element, deleting the first element, modifying information of the first element, and the like.
  • the user equipment may send request information (referred to as request information M2 for convenience of distinction) to the server, where the request information M2 is used to request to acquire change records of the first element in multiple versions.
  • the server responds to the request information M1, and provides the user equipment with change records of the first element in multiple versions.
  • the user can conveniently check the change status of the specified element in previous versions by interacting with the user device.
  • Step S704 The user equipment presents the change records of the first element in multiple versions.
  • the server may receive the update of the first element in the database model by the user equipment in the second version, and provide the user equipment with the update of the first element in the second version.
  • Changelog in Further, the change record in the second version includes the first element before the update and/or the first element after the update.
  • the server can manage the change records of multiple elements in the database model in multiple versions, so as to facilitate the process of creating, modifying, and deleting elements in the database model.
  • the user can conveniently view the changes experienced by the specified element in previous versions by interacting with the user device. For example, the user adds table A in the first version, adds a certain field B to table A in the second version, and modifies field B to field C in the third version.
  • vertically backtracking table A you can know in which version table A was created and in which version it was updated, so as to intuitively obtain the life cycle of elements and improve user experience.
  • FIG. 9 is a schematic structural diagram of a version management device 90 provided by an embodiment of the present application.
  • the version management device 90 may be a server or user equipment, or a device in the server or user equipment, such as a chip , software modules, integrated circuits, etc.
  • the version management device 90 is used to implement the aforementioned version management method, such as the version management method in the embodiment shown in FIG. 3 or FIG. 7 .
  • the version management apparatus 90 may include a communication unit 901 and a processing unit 902 .
  • the above-mentioned version management apparatus 90 may be the server in the foregoing embodiments.
  • processing unit 902 and the communication unit 901 are configured to provide the user equipment with information of multiple versions of the database model;
  • the communication unit 901 is further configured to receive the first version selected by the user equipment;
  • the processing unit 902 and the communication unit 901 are further configured to provide the user equipment with the structural data of the database model of the first version, where the structural data of the database model includes the database model constituting the first version elements and the connections between said elements.
  • the device 90 belongs to a database design system.
  • a database design system For example, the system shown in Figure 2.
  • the elements of the database model of the first version include at least one of the following: library, table, index, field, entity, attribute, foreign key, trigger, view, stored procedure , function, or sequence, etc.
  • the communication unit 901 is further configured to receive an update of the first element in the database model by the user equipment in the second version;
  • the processing unit 902 and the communication unit 901 are further configured to provide the user equipment with a change record of the first element in the second version.
  • the change record in the second version includes the first element before the update and the first element after the update.
  • processing unit 902 and the communication unit 901 are further configured to:
  • the change records of the first element in the database model in multiple versions are provided to the user equipment.
  • the above-mentioned version management apparatus 90 may be the user equipment in the foregoing embodiments.
  • the communication unit 901 is configured to receive information of multiple versions of the database model provided by the server;
  • the communication unit 901 is further configured to send the first version selected by the user equipment to a server;
  • the communication unit 901 is further configured to receive the structural data of the first version of the database model provided by the server, the structural data of the database model includes the elements that make up the database model of the first version and the elements between the elements. contact.
  • the processing unit 902 is further configured to present the structural data of the first version of the database model.
  • the one or more elements include at least one of the following: library, table, index, field, entity, attribute, foreign key, trigger, view, stored procedure, function, or sequence etc.
  • the communication unit 901 is further configured to:
  • a change record of the first element in the second version provided by the server is received.
  • the change record in the second version includes the first element before the update and the first element after the update.
  • the communication unit 901 is further configured to receive change records in multiple versions of the first element in the database model provided by the server.
  • the above-mentioned version management apparatus 90 may be the server in the foregoing embodiments.
  • processing unit 902 and the communication unit 901 are configured to provide one or more elements in the database model to the user equipment;
  • the communication unit 901 is further configured to receive the first element selected by the user equipment;
  • the processing unit 902 and the communication unit 901 are further configured to provide the user equipment with change records of the first element in multiple versions.
  • the device belongs to a database design system.
  • the one or more elements include at least one of the following: library, table, index, field, entity, attribute, foreign key, trigger, view, stored procedure, function, or sequence etc.
  • processing unit 902 and the communication unit 901 are further configured to provide users with information of multiple versions of the database model
  • the communication unit 901 is further configured to receive the first version selected by the user equipment;
  • the processing unit 902 and the communication unit 901 are further configured to provide the structural data of the database model of the first version to the user equipment, and the one or more elements belong to the structural data.
  • the communication unit 901 is further configured to receive an update of the first element in the database model by the user equipment in the second version;
  • the processing unit 902 and the communication unit 901 are further configured to provide the user equipment with a change record of the first element in the second version.
  • the change record in the second version includes the first element before the update and the first element after the update.
  • the above-mentioned version management apparatus 90 may be the user equipment in the foregoing embodiments.
  • the communication unit 901 is configured to receive one or more elements provided by the server;
  • the communication unit 901 is further configured to send the first element selected by the user equipment to a server;
  • the communication unit 901 is further configured to receive change records of the first element in multiple versions provided by the server;
  • the processing unit 902 is configured to present change records of the first element in multiple versions.
  • the one or more elements include at least one of the following: library, table, index, field, entity, attribute, foreign key, trigger, view, stored procedure, function, or sequence etc.
  • the communication unit 901 is further configured to:
  • the processing unit 902 is further configured to present the structural data of the database model of the first version.
  • the change record in the second version includes the first element before the update and the first element after the update.
  • FIG. 10 is a schematic structural diagram of a computing device 100 provided by an embodiment of the present application.
  • the computing device 100 may be an independent device (such as one or more of a server, or a user device, etc.), or may be It is an internal component of an independent device (such as a chip, a software module or a hardware module, etc.).
  • the computing device 100 may include at least one processor 1001 .
  • at least one memory 1003 may also be included.
  • the computing device 100 may further include a communication interface 1002 .
  • a bus 1004 may also be included, wherein the processor 1001 , the communication interface 1002 and the memory 1003 are connected through the bus 1004 .
  • the processor 1001 is a module for performing arithmetic operations and/or logic operations, specifically, a central processing unit (central processing unit, CPU), a picture processing unit (graphics processing unit, GPU), a microprocessor (microprocessor unit, MPU) ), Application Specific Integrated Circuit (ASIC), Field Programmable Logic Gate Array (Field Programmable Gate Array, FPGA), Complex Programmable Logic Device (Complex programmable logic device, CPLD), coprocessor (assisting central processing One or more combinations of processing modules such as processors to complete corresponding processing and applications), Microcontroller Unit (MCU) and other processing modules.
  • a central processing unit central processing unit, CPU
  • a picture processing unit graphics processing unit, GPU
  • microprocessor microprocessor unit, MPU
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • FPGA Field Programmable Gate Array
  • CPLD Complex Programmable Logic Device
  • coprocessor assisting central processing
  • MCU Microcontroller Unit
  • Communication interface 1002 may be used to provide information input or output to the at least one processor. And/or, the communication interface 1002 can be used to receive data sent from the outside and/or send data to the outside, and can be a wired link interface such as an Ethernet cable, or a wireless link (Wi-Fi, Bluetooth, general wireless transmission, vehicle short-range communication technology and other short-range wireless communication technologies, etc.) interface. Optionally, the communication interface 1002 may further include a transmitter (such as a radio frequency transmitter, an antenna, etc.) or a receiver coupled with the interface.
  • a transmitter such as a radio frequency transmitter, an antenna, etc.
  • the memory 1003 is used to provide a storage space, in which data such as operating systems and computer programs can be stored.
  • Memory 1003 can be random access memory (random access memory, RAM), read-only memory (read-only memory, ROM), erasable programmable read-only memory (erasable programmable read only memory, EPROM), or portable read-only memory One or more combinations of memory (compact disc read-only memory, CD-ROM), etc.
  • At least one processor 1001 in the computing device 100 is configured to execute the aforementioned version management method, for example, the version management method described in the embodiment shown in FIG. 3 or FIG. 7 .
  • the processor 1001 may be a processor dedicated to executing these methods (referred to as a dedicated processor for convenience), or a processor that executes these methods by invoking computer programs, such as a general-purpose processor.
  • at least one processor may also include both a special-purpose processor and a general-purpose processor.
  • the above computer programs may be stored in the memory 1003 .
  • the foregoing computing device 100 may be the server in the foregoing embodiments.
  • At least one processor 1001 in the computing device 100 is configured to execute calling computer instructions to perform the following operations:
  • the structural data of the database model of the first version is provided to the user equipment through the communication interface 1002, and the structural data of the database model includes the elements constituting the database model of the first version and the links between the elements.
  • the computing device 100 belongs to a database design system.
  • a database design system For example, the system shown in Figure 2.
  • the elements of the database model of the first version include at least one of the following: library, table, index, field, entity, attribute, foreign key, trigger, view, stored procedure , function, or sequence, etc.
  • the processor 1001 is further configured to:
  • a change record of the first element in the second version is provided to the user equipment through the communication interface 1002 .
  • the change record in the second version includes the first element before the update and the first element after the update.
  • the processor 1001 is further configured to provide the user equipment with change records of the first element in the database model in multiple versions through the communication interface 1002 .
  • the foregoing computing device 100 may be the user device in the foregoing embodiments.
  • At least one processor 1001 in the computing device 100 is configured to execute calling computer instructions to perform the following operations:
  • the structural data of the database model of the first version provided by the server is received through the communication interface 1002, and the structural data of the database model includes the elements constituting the database model of the first version and the links between the elements.
  • the one or more elements include at least one of the following: library, table, index, field, entity, attribute, foreign key, trigger, view, stored procedure, function, or sequence etc.
  • the processor 1001 is further configured to:
  • the change record of the first element in the second version provided by the server is received through the communication interface 1002 .
  • the change record in the second version includes the first element before the update and the first element after the update.
  • the processor 1001 is further configured to receive change records in multiple versions of the first element in the database model provided by the server through the communication interface 1002 .
  • the foregoing computing device 100 may be the server in the foregoing embodiments.
  • At least one processor 1001 in the computing device 100 is configured to execute calling computer instructions to perform the following operations:
  • the change records of the first element in multiple versions are provided to the user equipment through the communication interface 1002 .
  • the computing device 100 belongs to a database design system.
  • the one or more elements include at least one of the following: library, table, index, field, entity, attribute, foreign key, trigger, view, stored procedure, function, or sequence etc.
  • the processor 1001 is further configured to:
  • the structural data of the first version of the database model, the one or more elements belonging to the structural data, is provided to the user equipment via the communication interface 1002 .
  • the processor 1001 is further configured to:
  • a change record of the first element in the second version is provided to the user equipment through the communication interface 1002 .
  • the change record in the second version includes the first element before the update and the first element after the update.
  • the foregoing computing device 100 may be the user device in the foregoing embodiments.
  • At least one processor 1001 in the computing device 100 is configured to execute calling computer instructions to perform the following operations:
  • the one or more elements include at least one of the following: library, table, index, field, entity, attribute, foreign key, trigger, view, stored procedure, function, or sequence etc.
  • the processor 1001 is further configured to:
  • the change record in the second version includes the first element before the update and the first element after the update.
  • the present application also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are run on at least one processor, the aforementioned version management method is implemented, such as FIG. 3, Or the version management method shown in FIG. 7 .
  • the present application also provides a computer program product, which includes computer instructions, and when executed by a computing device, implements the aforementioned version management method, such as the version management method shown in FIG. 3 or FIG. 7 .
  • words such as “exemplary” or “for example” are used as examples, illustrations or descriptions. Any embodiment or design described herein as “exemplary” or “for example” is not to be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as “exemplary” or “such as” is intended to present related concepts in a concrete manner.
  • At least one refers to one or more, and the “multiple” refers to two or more.
  • At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items.
  • at least one item (piece) of a, b, or c may represent: a, b, c, (a and b), (a and c), (b and c), or (a and b and c), where a, b, c can be single or multiple.
  • first and second use ordinal numerals such as "first" and “second” to distinguish multiple objects, and are not used to limit the order, timing, priority or importance of multiple objects degree.
  • first user equipment and the second user equipment are only for the convenience of description, and do not represent the differences in structure, importance, etc. between the first user equipment and the second user equipment.
  • the first user equipment The device and the second user device may also be the same device.
  • the program can be stored in a computer-readable storage medium.
  • the above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请实施例提供一种数据库模型的版本管理方法、装置及相关设备,应用于数据库技术领域。本申请实施例中,服务端可以管理数据库模型的多个版本,每个版本的数据库模型都包含数据库的元素以及元素之间的联系,便于回溯数据库模型的多个版本。用户可以从多个版本的数据库模型的信息中,根据自身的需求选择查看某一版本的数据库模型。相应的,服务器向用户提供该版本对应的数据库模型的结构数据。由于结构数据中包含多个数据库的元素,以及元素之间的联系,用户可以方便地查看当前版本的数据库的结构,提升了用户的使用体验。

Description

数据库模型的版本管理方法、装置及相关设备
本申请要求于2021年07月06日提交中国专利局、申请号为202110764640.X、申请名称为“数据库模型的版本管理方法、装置及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据库技术领域,尤其涉及数据库模型的版本管理方法、装置及相关设备。
背景技术
数据库的设计部署过程中,随着业务调整、需求变更,通常需要对数据库进行多次修改、版本迭代才能设计完成。因此对于数据库模型的版本进行管理,可以便于回溯修改。但是目前的数据库设计软件,在修改数据库模型结构后,无法提供回溯功能。一些场景中,通过代码仓,可以对数据库模型的脚本文件进行版本管理。但是代码仓只能记录代码、数据的修改,而数据库的各个元素之间的依赖关系往往较为复杂,通过记录脚本文件难以对数据库模型的版本进行回溯,非结构化的文本也不利于用户查看数据库结构的修改,用户体验较差。
因此,如何解决上述问题,是本领域人员正在研究的热点。
发明内容
本申请实施例提供了数据库模型的版本管理方法、装置及相关设备,能够管理数据库模型的结构化数据,使得用户可以方便地查看到各个版本地数据库设计的模型信息。
第一方面,本申请实施例提供了一种数据库模型的版本管理方法,包括:
向用户设备提供多个版本的数据库模型的信息;
接收所述用户设备选择的第一版本;
向所述用户设备提供所述第一版本的数据库模型的结构数据,所述数据库模型的结构数据包含组成所述第一版本的数据库模型的元素以及所述元素之间的联系。
上述方法可以应用于服务器,由服务器或者服务器内部的部件(例如芯片、软件模块或集成电路)来执行。或者上述方法可以应用于数据库设计系统,例如由数据库设计系统的服务端(服务端可以通过服务器、云平台等来实现)来执行。
本申请实施例中,服务器可以管理数据库模型的多个版本,每个版本的数据库模型都包含数据库的元素以及元素之间的联系,便于回溯数据库模型的多个版本。用户可以从多个版本的数据库模型的信息中,根据自身的需求选择查看某一版本的数据库模型。相应的,服务器向用户提供该版本对应的数据库模型的结构数据。由于结构数据中包含多个数据库的元素,以及元素之间的联系,用户可以方便地查看当前版本的数据库的结构,提升了用户的使用体验。
在第一方面的一种可能的实施方式中,所述第一版本的数据库模型的元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、或序列等。
在第一方面的一种可能的实施方式中,所述方法还包括:
接收所述用户设备在第二版本中对数据库模型中的所述第一元素的更新;
向所述用户设备提供所述第一元素在所述第二版本中的变更记录。
其中,所述更新包括添加所述第一元素、删除所述第一元素、修改所述第一元素的信息。
通过上述方式可以记录用户设备对第一元素的更新,以使得用户可以查看该元素的变更情况。
在第一方面的一种可能的实施方式中,所述在所述第二版本中的变更记录包含更新前的所述第一元素和/或更新后的第一元素。
该变更记录可以在用户设备上呈现,可以使得用户直观的查看到第一元素更新前后的状态,便于对比不同版本的第一元素的变更,提升用户体验。
可选的,所述变更记录还包括所述第一元素的信息、更新所述第一元素的用户、更新所述第一元素的时间等等。
在第一方面的一种可能的实施方式中,所述方法还包括:
向所述用户设备提供中所述数据库模型中的第一元素在多个版本的变更记录。
可以看出,通过服务端可以管理数据库模型中的多个元素在多个版本内的变更记录,便于回溯数据库模型中的元素的创建、或者以及修改、删除过程。相应的,用户通过用户设备进行交互,即可可以方便地查看指定元素在历次版本中经历的变更情况。例如,用户在第一个版本中新增了表A,在第二个版本中在表A添加了某一字段B,在第三个版本中将字段B修改为字段C。而通过对表A进行纵向回溯,可以了解表A是在哪个版本进行创建、在哪个版本进行了更新,从而直观地获取元素的生命周期,提升了用户体验。
在第一方面的一种可能的实施方式中,所述方法还包括:
接收所述用户设备发送的请求信息,所述请求信息用于请求获取所述第一元素的变更记录。
第二方面,本申请实施例提供了一种数据库模型的版本管理方法,包括:
接收服务器提供的多个版本的数据库模型的信息;
向服务器发送所述用户设备选择的第一版本;
接收所述服务器提供的第一版本的数据库模型的结构数据,所述数据库模型的结构数据包含组成所述第一版本的数据库模型的元素以及所述元素之间的联系。
呈现所述第一版本的数据库模型的结构数据。
上述方法可以应用于用户设备,由用户设备或者用户设备内部的部件(例如芯片、软件模块或集成电路)来执行。或者上述方法可以应用于数据库设计系统,例如由数据库设计系统的客户端来执行。
在第二方面的一种可能的实施方式中,所述第一版本的数据库模型的元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、或序列等。
在第二方面的又一种可能的实施方式中,所述方法还包括:
向所述服务器发送所述用户设备在第二版本中对所述数据库模型中的所述第一元素的更新;
接收所述服务器提供的所述第一元素在所述第二版本中的变更记录。
在第二方面的又一种可能的实施方式中,所述在所述第二版本中的变更记录包含更新前 的所述第一元素和更新后的第一元素。
在第二方面的又一种可能的实施方式中,所述方法还包括:
接收所述服务器提供的所述数据库模型中的第一元素在多个版本的变更记录。
第三方面,本申请实施例提供了一种数据库模型的版本管理方法,包括:
向用户设备提供数据库模型中的一个或者多个元素;
接收所述用户设备选择的第一元素;
向所述用户设备提供所述第一元素在多个版本的变更记录。
上述方法可以应用于服务器,由服务器或者服务器内部的部件(例如芯片、软件模块或集成电路)来执行。或者上述方法可以应用于数据库设计系统,例如由数据库设计系统的服务端来执行。
本申请实施例中,服务端可以管理数据库模型中的多个元素在多个版本内的变更记录,便于回溯数据库模型中的元素的创建、或者以及修改、删除过程。相应的,用户通过用户设备进行交互,即可可以方便地查看指定元素在历次版本中经历的变更情况。例如,用户在第一个版本中新增了表A,在第二个版本中在表A添加了某一字段B,在第三个版本中将字段B修改为字段C。而通过对表A进行纵向回溯,可以了解表A是在哪个版本进行创建、在哪个版本进行了更新,从而直观地获取元素的生命周期,提升了用户体验。
在第三方面的一种可能的实施方式中,所述一个或者多个元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、或序列等。
在第三方面的又一种可能的实施方式中,所述方法还包括:
向用户提供多个版本的所述数据库模型的信息;
接收所述用户设备选择的第一版本;
向所述用户设备提供所述第一版本的所述数据库模型的结构数据,所述一个或者多个元素属于所述结构数据。
在第三方面的又一种可能的实施方式中,所述方法还包括:
接收所述用户设备在第二版本中对所述数据库模型中的所述第一元素的更新;
向所述用户设备提供所述第一元素在所述第二版本中的变更记录。
在第三方面的又一种可能的实施方式中,所述在所述第二版本中的变更记录中包含更新前的所述第一元素和更新后的第一元素。
第四方面,本申请实施例提供了一种数据库模型的版本管理方法,包括:
接收所述服务器提供的一个或者多个元素;
向服务器发送所述用户设备选择的第一元素;
接收所述服务器提供的所述第一元素在多个版本的变更记录;
呈现所述第一元素在多个版本的变更记录。
在第四方面的一种可能的实施方式中,所述一个或者多个元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、或序列等。
在第四方面的又一种可能的实施方式中,所述方法还包括:
接收所述服务器提供的所述多个版本的所述数据库模型的信息;
向所述服务器发送所述用户设备选择的第一版本;
接收所述服务器提供的所述第一版本的所述数据库模型的结构数据;
呈现所述第一版本的所述数据库模型的结构数据。
在第四方面的又一种可能的实施方式中,所述方法还包括:
向所述服务器发送所述用户设备在第二版本中对所述数据库模型中的所述第一元素的更新;
接收所述服务器提供的所述第一元素在所述第二版本中的变更记录。
在第四方面的又一种可能的实施方式中,所述在所述第二版本中的变更记录包含更新前的所述第一元素和更新后的第一元素。
第五方面,本申请实施例还提供一种系统,所述系统包括用户设备和服务器;其中:
所述服务器,用于向用户设备提供多个版本的数据库模型的信息;
所述用户设备,用于接收所述服务器提供的多个版本的数据库模型的信息;
所述用户设备,还用于向服务器发送所述用户设备选择的第一版本;
所述服务器,还用于接收所述用户设备选择的所述第一版本;
所述服务器,还用于向所述用户设备提供所述第一版本的数据库模型的结构数据,所述数据库模型的结构数据包含组成所述第一版本的数据库模型的元素以及所述元素之间的联系;
所述用户设备,还用于接收所述服务器提供的所述第一版本的数据库模型的结构数据;
所述用户设备,还用于呈现所述第一版本的数据库模型的结构数据。
在第五方面的一种可能的实施方式中,所述一个或者多个元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、或序列等。
在第五方面的又一种可能的实施方式中,所述用户设备,还用于向所述服务器发送所述用户设备在第二版本中对所述数据库模型中的所述第一元素的更新;
所述服务器,还用于:
接收所述用户设备在第二版本中对数据库模型中的所述第一元素的更新;
向所述用户设备提供所述第一元素在所述第二版本中的变更记录;
所述用户设备,还用于接收所述服务器提供的所述第一元素在所述第二版本中的变更记录。
在第五方面的又一种可能的实施方式中,所述在所述第二版本中的变更记录包含更新前的所述第一元素和更新后的第一元素。
在第五方面的又一种可能的实施方式中,所述服务器,还用于向所述用户设备提供所述数据库模型中的第一元素在多个版本的变更记录;
所述用户设备,还用于接收所述服务器提供的所述数据库模型中的第一元素在多个版本的变更记录。
第六方面,本申请实施例还提供一种系统,所述系统包括用户设备和服务器;其中:
所述服务器,用于向用户设备提供数据库模型中的一个或者多个元素;
所述用户设备,用于接收所述服务器提供的一个或者多个元素;
所述用户设备,还用于向服务器发送所述用户设备选择的第一元素;
所述服务器,还用于接收所述用户设备选择的所述第一元素;
所述服务器,还用于向所述用户设备提供的所述第一元素在多个版本的变更记录;
所述用户设备,还用于接收所述服务器提供的所述第一元素在多个版本的变更记录;
所述用户设备,还用于呈现所述第一元素在多个版本的变更记录。
在第六方面的一种可能的实施方式中,所述一个或者多个元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、或序列等。
在第六方面的又一种可能的实施方式中,所述服务器,还用于向用户提供多个版本的所述数据库模型的信息;
所述用户设备,还用于接收所述服务器提供的所述多个版本的所述数据库模型的信息;
所述用户设备,还用于向所述服务器发送所述用户设备选择的第一版本;
所述服务器,还用于接收所述用户设备发送的所述用户设备选择的第一版本;
所述服务器,还用于向所述用户设备提供所述第一版本的所述数据库模型的结构数据;
所述用户设备,还用于接收所述服务器提供的所述第一版本的所述数据库模型的结构数据;
所述用户设备,还用于呈现所述第一版本的所述数据库模型的结构数据。
在第六方面的又一种可能的实施方式中,所述用户设备,还用于向所述服务器发送所述用户设备在第二版本中对所述数据库模型中的所述第一元素的更新;
所述服务器,还用于接收所述用户设备在第二版本中对数据库模型中的所述第一元素的更新;
所述服务器,还用于向所述用户设备提供所述第一元素在所述第二版本中的变更记录;
所述用户设备,还用于接收所述服务器提供的所述第一元素在所述第二版本中的变更记录。
在第六方面的又一种可能的实施方式中,所述在所述第二版本中的变更记录包含更新前的所述第一元素和更新后的第一元素。
第七方面,本申请实施例提供一种版本管理装置,该版本管理装置包括处理单元和通信单元,该版本管理装置用于实现第一方面或第一方面任一种可能的实施方式所描述的方法。
在第七方面的一种可能的实施方式,处理单元和通信单元,用于向用户设备提供多个版本的数据库模型的信息;
所述通信单元,还用于接收所述用户设备选择的第一版本;
所述处理单元和所述通信单元,还用于向所述用户设备提供所述第一版本的数据库模型的结构数据,所述数据库模型的结构数据包含组成所述第一版本的数据库模型的元素以及所述元素之间的联系。
在第七方面的又一种可能的实施方式中,所述装置属于数据库设计系统。
在第七方面的又一种可能的实施方式中,所述第一版本的数据库模型的元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、或序列等。
在第七方面的又一种可能的实施方式中,所述通信单元,还用于接收所述用户设备在第二版本中对数据库模型中的所述第一元素的更新;
所述处理单元和所述通信单元,还用于向所述用户设备提供所述第一元素在所述第二版本中的变更记录。
在第七方面的又一种可能的实施方式中,所述在所述第二版本中的变更记录包含更新前 的所述第一元素和更新后的第一元素。
在第七方面的又一种可能的实施方式中,所述处理单元和所述通信单元,还用于:
向所述用户设备提供所述数据库模型中的第一元素在多个版本的变更记录。
第八方面,本申请实施例提供一种版本管理装置,该版本管理装置包括处理单元和通信单元,该版本管理装置用于实现第二方面或第二方面任一种可能的实施方式所描述的方法。
第九方面,本申请实施例提供一种版本管理装置,该版本管理装置包括处理单元和通信单元,该版本管理装置用于实现第三方面或第三方面任一种可能的实施方式所描述的方法。
在第九方面的一种可能的实施方式中,处理单元和通信单元,用于向用户设备提供数据库模型中的一个或者多个元素;
所述通信单元,还用于接收所述用户设备选择的第一元素;
所述处理单元和所述通信单元,还用于向所述用户设备提供所述第一元素在多个版本的变更记录。
在第九方面的又一种可能的实施方式中,所述装置属于数据库设计系统。
在第九方面的又一种可能的实施方式中,所述一个或者多个元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、或序列等。
在第九方面的又一种可能的实施方式中,所述处理单元和所述通信单元,还用于向用户提供多个版本的所述数据库模型的信息;
所述通信单元,还用于接收所述用户设备选择的第一版本;
所述处理单元和所述通信单元,还用于向所述用户设备提供所述第一版本的所述数据库模型的结构数据,所述一个或者多个元素属于所述结构数据。
在第九方面的又一种可能的实施方式中,所述通信单元,还用于接收所述用户设备在第二版本中对所述数据库模型中的所述第一元素的更新;
所述处理单元和所述通信单元,还用于向所述用户设备提供所述第一元素在所述第二版本中的变更记录。
在第九方面的又一种可能的实施方式中,所述在所述第二版本中的变更记录中包含更新前的所述第一元素和更新后的第一元素。
第十方面,本申请实施例提供一种版本管理装置,该版本管理装置包括处理单元和通信单元,该版本管理装置用于实现第四方面或第四方面任一种可能的实施方式所描述的方法。
第十一方面,本申请实施例提供一种计算设备,该计算设备包括处理器和存储器;存储器中存储有计算机程序;处理器执行计算机程序时,计算设备执行前述第一至四方面任一项所描述的方法。
需要说明的是,上述第十一方面所描述的数据传输装置所包含的处理器,可以是专门用于执行这些方法的处理器(便于区别称为专用处理器),也可以是通过调用计算机程序来执行这些方法的处理器,例如通用处理器。可选的,至少一个处理器还可以既包括专用处理器也包括通用处理器。
可选的,上述计算机程序可以存在存储器中。示例性的,存储器可以为非瞬时性(non-transitory)存储器,例如只读存储器(Read Only Memory,ROM),其可以与处理器集成在同一块器件上,也可以分别设置在不同的器件上,本申请实施例对存储器的类型以及存储器与处理器的设置方式不做限定。
在一种可能的实施方式中,上述至少一个存储器位于上述计算设备之外。
在又一种可能的实施方式中,上述至少一个存储器位于上述计算设备之内。
在又一种可能的实施方式之中,上述至少一个存储器的部分存储器位于上述计算设备之内,另一部分存储器位于上述计算设备之外。
本申请中,处理器和存储器还可能集成于一个器件中,即处理器和存储器还可以被集成在一起。
第十二方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在至少一个处理器上运行时,实现前述第一至四方面任一项所描述的方法。
第十三方面,本申请提供了一种计算机程序产品,计算机程序产品包括计算机指令,当所述指令在至少一个处理器上运行时,实现前述第一至四方面任一项所描述的方法。该计算机程序产品可以为一个软件安装包,在需要使用前述方法的情况下,可以下载该计算机程序产品并在计算设备上执行该计算机程序产品。
本申请第二至第十方面所提供的技术方法,其有益效果可以参考第一方面的技术方案的有益效果,此处不再赘述。
附图说明
下面将对实施例描述中所需要使用的附图作简单的介绍。
图1是本申请实施例提供的一种据库模型的示意图;
图2是本申请实施例提供的一种数据库设计系统的架构示意图;
图3是本申请实施例提供的一种版本管理方法的流程示意图;
图4是本申请实施例提供的一种多个版本的数据库模型的信息的界面示意图;
图5A是本申请实施例提供的一种展示数据库模型的结构数据的界面示意图;
图5B是本申请实施例提供的又一种展示数据库模型的结构数据的界面示意图;
图5C是本申请实施例提供的又一种展示数据库模型的结构数据的界面示意图;
图5D是本申请实施例提供的又一种展示数据库模型的结构数据的界面示意图;
图6是本申请实施例提供的一种纵向回溯的界面示意图;
图7是本申请实施例提供的又一种版本管理方法的流程示意图;
图8是本申请实施例提供的一种元素列表的界面示意图;
图9是本申请实施例提供的一种版本管理装置的结构示意图;
图10是本申请实施例提供的一种计算设备的结构示意图。
具体实施方式
下面结合附图对本申请实施例进行详细介绍。
为了便于理解,以下示意性地给出了部分与本申请实施例相关概念的说明以供参考。
1.数据库、表、字段
数据库(database,DB)是按照数据结构来组织、存储和管理数据的仓库,是一个存储在计算机内的有组织的、可共享的大量数据的集合。
表是一种结构化的文件,用于存储特定类型的数据,例如学生信息、院系目录等。数据库中的数据通常以表的形式存储,每个表都有一个唯一的标识,例如表名。
一个表包括一个或者多个列(column),每列是表中的一个字段,每列中存储着表中某部分的信息。例如数据库中可以包含表明为学生的表,一个列存储学生的学号(studentidentification,或称为,学生ID),一个列存储学生的名字(name)。
2.数据库模型
在设计数据库时,对现实世界进行分析、抽象、并从中找出内在联系,进而确定数据库的结构,这一过程就称为数据库设计建模。它主要包括两部分内容:确定最基本的数据结构、对约束建模。数据库模型可以包括:概念模型、逻辑模型、物理模型等。
概念模型(Conceptual model),也称为信息模型,它是按照用户的观点来对数据和信息建模。概念模型用以描述用户业务需求的一些概念,概念不包含属性,有实体集、联系集的分析结构。如学校数据库中的“学生”和“学院”等。
逻辑模型是将概念模型具体化。要实现概念模型所描述的东西,需要那些具体的功能和处理那些具体的信息,这就到了需求分析的细化阶段。逻辑模型主要包含实体、属性、关系等结构。
其中,实体是客观存在并可相互区别的事务。例如具体的学生、订单、物品等。同一类型的实体的结合称为实体集。属性是实体所具有的某一特性。一个实体通过若干个属性来刻画。关系,也称为联系,实体内部的联系通常是指组成实体的各属性之间的联系,实体之间的联系通常是指不同实体集之间的联系。以学生数据为例:“学生”实体包括:学号、姓名、性别、出生年月、所属学院的ID等属性;“学院”实体包括:学院的ID,学院名称,地址,院长名称等属性;“学生”和“学院”可以进行关联,一个学生隶属于至少一个学院。逻辑模型通过实体-联系(Entity-Relationship,E-R)图,描述系统要实现什么业务,描述该业务流程中,各个实体之间的关联关系。
物理模型就是针对上述逻辑模型所说的内容,在具体的物理数据库引擎上实现出来。如在MySQL、Oracle、MongoDB等数据库上,将逻辑模型实体关系,以物理表、字段、主外键等实现。
3.数据库设计系统
数据库设计系统是一种可视化的数据库设计与管理的工具,用于设计、建立、使用和维护数据库。用户可以在数据库设计系统中创建(或编辑)包括图表以及图表之间关联关系的设计视图,数据库设计系统能够存储用户创建(或编辑)的数据库设计视图,并可以建立数据库的模型(或者还包括存储数据库的数据)。
应理解,本申请中的用户指示的是数据库设计系统的用户,包括数据库的设计者或开发者。
4.版本管理、横向回溯、纵向回溯
版本管理是指对软件开发过程中代码、文档、模型设计等数据变更的管理,是软件开发迭代中过程管理的核心思想之一。
在管理的多个版本中,随意选取任意一个历史版本,获取该版本的全量数据,为横向回溯。
在被管理的多个对象(可以是任一版本中的对象)中,随意选取某一个对象,获取对象(及该对象的子对象)在整个版本管理生命周期内的变更情况,为纵向回溯。
上述对概念的示例性说明可以应用在下文的实施例中。
数据库的设计部署过程中,随着业务调整、需求变更,通常需要对数据库进行多次修改、版本迭代才能设计完成。示例性地,请参见图1,如图1所示是本申请实施例提供的一种可能的数据库模型的示意图。如图1所示为学生数据库模型,在一个设计阶段,学生数据库中添加了学生表(tb_student)、学院表(tb_dept)和课程表(tb_course),分别对应学生实体、学院实体和课程实体。其中,学生表(学生实体)可以包含以下字段(属性):学号(sutdent_ID)、学生名称(sutdent_name)、性别(sex)、年龄(age)、学院号(dept_ID),学院表(学院实体)可以包含以下字段(属性):学院号(dept_ID)、学院名称(dept_name)、地址(location)、院长名称(dean),课程表(课程实体)可以包含以下字段(属性):课程号(courset_ID)、课程名称(course_name)、学分(ccredit)、开课学院号(dept_ID)。其中,学生表中的学院号与学院表中的学院号关联。
在数据库设计过程中,对于数据库的需求可能随时会变更,因此会对数据库模型进行修改。例如,当前需要新增加一个课程成绩实体,使得学生可以查看对应课程的成绩。再如,由于学生的年龄随时会变化,因此上述学生表中年龄字段需要进行多次更新,使用不方便。因此可以将年龄字段更新为出生日期字段,这样可以通过当前日期和出生日期计算年龄,而无需多次更新数据库中的数据。
如上所示的对数据库模型的变更可能会在数据库设计过程中发生多次,因此,需要对数据库模型的版本进行管理,便于回溯修改。但是目前的数据库设计软件,在修改数据库模型结构后,无法提供回溯功能。一些场景中,通过代码仓,可以对数据库模型的脚本文件进行版本管理。但是代码仓只能记录代码、数据的修改,而数据库的各个元素之间的依赖关系往往较为复杂,通过记录脚本文件难以对数据库模型的版本进行回溯,非结构化的文本也不利于用户查看数据库结构的修改,用户体验较差。
为了解决上述问题,本申请实施例提供一种数据库模型的版本管理方法、装置及相关设备,能够管理数据库模型的结构化数据,使得用户可以方便地查看到各个版本地数据库设计的模型信息。
下面对本身申请实施例的架构进行描述。
可选的,本申请实施例提供的数据库模型的版本管理方法可以基于数据库设计系统来实现。其中,数据库设计系统可以包含硬件模块、或软件模块(如应用程序、组件等)、或硬件模块与软件模块的组合等。
一种可能的设计中,数据库设计系统可以包括客户端和服务端。客户端可以用于呈现界面、选择框、输入框等与用户交互的组件,服务端用于向客户端提供数据库模型的结构数据、或响应用户的请求等。
请参见图2,图2是本申请实施例提供的一种可能的数据库设计系统的架构示意图。如图2所示的系统包括至少一个用户设备201和至少一个服务器202。
其中,用户设备201是具有数据处理、数据收发能力的电子设备,可以实现前述客户端的功能。例如可以包括手持终端、可穿戴设备、车辆、机器人等独立设备,也可以是包含在独立设备中的部件(例如芯片或集成电路)。示例性地,当终端装置为手持终端时,可以是手机(mobile phone)、平板电脑(pad)、电脑(如笔记本电脑、掌上电脑等)等。
服务器202是具有数据处理、数据收发能力的装置,可以实现前述服务端的功能。应理解,此处便于描述称为服务器,其具体形式可以为实体装置如服务器、或主机等,也可以是虚拟装置如虚拟机、或容器等。可选的,服务器202可以独立的部署在一个设备中,也可以 分布式的部署在多个设备上。
服务器202可以管理数据库模型的多个版本,每个版本的数据库模型都包含数据库的元素以及元素之间的联系,便于回溯数据库模型的多个版本。在用户设备201(或者使用用户设备201的用户)需要查看某一版本的数据库模型时,向用户设备201提供该版本对应的结构数据。由于结构数据中包含数据库模型中的多个元素,以及元素之间的联系,用户可以方便地查看当前版本的数据库的结构,提升了用户的使用体验。
可选的,服务器202可以管理数据库模型中的元素在多个版本内的变更记录,便于回溯数据库模型中的元素的创建、或者以及修改、删除过程。相应的,用户设备201可以与用户进行交互,用户通过用户设备201即可方便地查看指定元素在历次版本中经历的变更情况。例如,用户在第一个版本中新增了表A,在第二个版本中在表A添加了某一字段B,在第三个版本中将字段B修改为字段C。而通过对表A进行纵向回溯,可以了解表A是在哪个版本进行创建、在哪个版本进行了更新,从而直观地获取元素的生命周期,提升了用户体验。
应理解,上述服务器202与用户设备201之间通信的链路可以是有线链路、无线链路或者有线链路与无线链路的组合等方式。进一步可选的,通信还可以通过一种或者多种网络技术实现。本申请对于服务器与用户设备201之间的通信方式不做限定。
在一种可能的设计中,如图2所示的服务器202可以为云平台。其中,云平台包含云服务提供商提供的大量基础资源(包括但不限于计算资源、存储资源、或网络资源等),其中计算资源可以是大量的计算设备(例如服务器、虚拟机)。
在一种可能的实施场景中,上述数据库设计系统能够由云服务提供商在云平台抽象成一种数据库设计的云服务提供给用户。例如,用户购买数据库设计云服务之后,云平台响应于用户触发的数据库设计系统实例创建操作,在云服务提供商提供的资源上创建数据库设计系统实例,然后向用户提供数据库模型的版本管理服务。相应的,用户所使用的用户设备可以呈现界面、使用版本管理服务。
其中,购买数据库设计云服务的方式可以包括:先预充值再根据最终资源的实际使用情况进行结算,或者,按使用云服务的时间或者按照购买的云服务的功能或资源结算。
需要说明的是,在本申请实施例中,云平台可以是中心云的云平台、边缘云的云平台或包括中心云和边缘云的云平台,本申请实施例对其不做具体限定。并且,当云平台为包括中心云和边缘云的云平台时,该数据库设计系统可以部分部署在边缘云的云平台中,部分部署在中心云的云平台中。
下面对本申请实施例的方法进行详细介绍。
请参见图3,图3是本申请实施例提供的一种版本管理方法的流程示意图。可选的,该方法可以应用图2所示的数据库设计系统。
如图3所示的版本管理方法至少包括步骤S301至步骤S304。
步骤S301:服务器向用户设备提供多个版本的数据库模型的信息。相应的,用户设备接收服务器提供的多个版本的数据库模型的信息。
其中,一个版本的数据库模型的信息可以包含该版本的版本号、数据库模型的名称、变更摘要、提交说明、提交者、创建时间、可执行的操作等中的一项或者多项。
示例性的,请参见图4,图4是本申请实施例提供的一种可能的多个版本的数据库模型的信息的界面示意图。如图4所示,区域401用于说明当前页面指示哪一个数据库模型的信 息,例如该数据库模型的名称可以为“学生数据库模型”,所处分支可以为主分支(可以通过如图所示的选择组件选择不同的分支)。区域402用于根据条件筛选、过滤或者查找不同的版本等。区域403展示了4个版本的数据库模型的信息,分别为版本1.1、版本1.2、版本1.3以及当前正在编辑还未提交保存的版本。其中,“审核状态”可以为编辑中(数据库模型的处于在被编辑的状态)、审核中(用户对数据库模型的更新已经提交,更新处于待审核状态)、已完成(更新已经通过,行程了新的版本)等中的一项或者多项。“变更摘要”用于描述数据库模型的变更的情况,例如可以为表改变、表新增、函数新增、视图改变等。“提交说明”指示对该版本的描述,由用户在提交更新时填写或者由服务器生成。“提交者”为提交更新的用户。“创建时间”说明提交更新的时间或者形成新版本的时间。“操作”用于指示可对该本的数据库模型执行的操作。例如,区域404所示的组件用于回退版本或者用于指示呈现回退版本的界面。例如,当前版本为1.4,用户点击版本1.3对应的回退按钮,可以回退到1.3版本。区域405所示的组件用于查看一个或多个版本或者指示呈现查看一个或者多个版本的界面,便于查看指定版本。例如,点击区域405所示的组件,可以呈现版本1.4的数据库模型的结构的界面。区域406所示的组件用于查看指定版本的流程信息,例如查看版本1.4的审核流程信息。其中,审核流程信息可以包含审核人、变更差异可视化、或数据库模式定义语言(Data Definition Language。DDL)等中的一项或者多项。区域407中所示的各个组件可以用于确定每一页的条目,以及调整当前的页面。
可选的,用户设备可以向服务器发送请求信息(便于区分称为请求信息M1),该请求信息M1用于请求多个版本的数据库模型的信息。相应的,服务器响应该请求信息M1,向用户设备提供数据库模型的一个或者多个元素。
步骤S302:用户设备向服务器发送用户设备选择的第一版本。相应的,服务器接收用户设备选择第一版本。
示例性地,用户设备可以选择查看版本1.2,则用户设备向服务器发送用户选择的版本1.2。
需要说明的,选择操作可以是用户设备选择的,也可以是使用用户设备的用户在用户设备上选择的。一种可能的设计中,用户设备可以接收用户输入的对第一版本的选择操作,从而向服务器发送用户设备选择的第一版本。示例性的,参见图4,使用用户设备的用户可以点击区域406所示的控件,用户设备向服务器发送用户设备选择的版本1.4。
步骤S303:服务器向用户设备提供第一版本的数据库模型的结构数据。相应的,用户设备接收服务器提供的第一版本的数据库模型的结构数据。
其中,结构数据包含组成所述第一版本的数据库模型的元素以及所述元素之间的联系。其中,元素可以以下中的一项或者多项:数据库表、表、字段、索引、视图、实体、属性、关系、函数、触发器、或存储过程等。元素之间的联系包括元素的排布位置、关联关系等。例如,表的排布位置、表中所包含的字段名称和数据类型、表的外键、函数所关联的表等中的一项或者多项。
步骤S304:用户设备呈现所述第一版本的数据库模型的结构数据。
示例性地,请参见图5A,图5A为本申请实施例提供的一种可能的展示数据库模型的结构数据的界面示意图。图5A所示为版本1.1的数据库模型的结构数据的展示界面,其展示了表的排布位置、表和字段之间的联系以及表与表之间的联系。在表和字段之间的联系上,学生表(tb_student)中包含了多个字段,例如:学号(sutdent_ID)、学生名称(sutdent_name)、 性别(sex)、年龄(age)、学院号(dept_ID)等字段,如图5A所示的界面还呈现了字段的数据类型。学院表(tb_dept)中包含了多个字段,例如:学院号(dept_ID)、学院名称(dept_name)、地址(location)、院长名称(dean)等字段,如图5A所示的界面还呈现了字段的数据类型。在表和表之间的联系上,学生的学院号与学院表中的学院号存在关联,学生所属的学院号为学院表中包含的学院号。
示例性地,请参见图5B,图5B为本申请实施例提供的一种可能的展示数据库模型的结构数据的界面示意图。图5B所示为版本1.2的数据库模型的结构数据的展示界面。相比版本1.1,版本1.2的数据库模型新增了两个表,课程表(tb_course)和成绩表(tb_grade)。其中,表与字段的联系和表与表之间的联系如图5B所示,此处不再赘述。
示例性地,请参见图5C,图5C为本申请实施例提供的一种可能的展示数据库模型的结构数据的界面示意图。图5C所示为版本1.3的数据库模型的结构数据的展示界面。相比版本1.2,版本1.3的数据库模型修改了学生表,将性别字段(sex)更改为出生日期字段(birth)。其中,表与字段的联系和表与表之间的联系如图5C所示,此处不再赘述。
示例性地,请参见图5D,图5D为本申请实施例提供的一种可能的展示数据库模型的结构数据的界面示意图。图5D所示为版本1.4的数据库模型的结构数据的展示界面。相比版本1.3,版本1.4的数据库模型修改了学生表、学院表、课程表和成绩表。在学生表中,将学号字段(student_ID)从12位的整型(INT(12))更新为12位的字符型(CHAR(12))。类似的,在学院表中,将学院号字段(dept_ID)从12位的整型更新为12位的字符型。在课程表中,将课程号字段(courset_ID)从12位的整型更新为12位的字符型。在成绩表中,将课程号字段(courset_ID)、学号字段(student_ID)从12位的整型更新为12位的字符型。其中,表与字段的联系和表与表之间的联系如图5D所示,此处不再赘述。
用户选择任意一个版本,则服务器返回对应版本的数据库模型的结构数据,用户设备可以呈现对应版本的数据库模型的结构数据,以便用户直观的查看到数据库模型的结构,便于回溯。
上述查看多个版本中任意版本的数据库模型,称为横向回溯。在一种可能设计中,服务器可以向用户提供的第一元素在多个版本中的变更记录,实现纵向回溯。其中,变更记录包括更新操作、所述第一元素的信息、更新所述第一元素的用户、更新所述第一元素的时间等中的一项或者多项。其中,更新操作又可以包括添加所述第一元素、删除所述第一元素、修改所述第一元素的信息等中的一项或者多项。通过本申请实施例,服务端可以管理数据库模型中的多个元素在多个版本内的变更记录,便于回溯数据库模型中的元素的创建、或者以及修改、删除过程。
可选的,用户设备可以向服务器发送请求信息(便于区分称为请求信息M2),该请求信息M2用于请求获取第一元素在多个版本中变更记录。相应的,服务器响应该请求信息M1,向用户设备提供第一元素在多个版本中变更记录。进一步可选的,用户通过用户设备进行交互,即可可以方便地查看指定元素在历次版本中经历的变更情况。
示例性地,请参见图6,图6是本申请实施例提供的一种可能的纵向回溯的界面示意图。如图6所示为学生表的表更记录。请参见区域601,用户在版本0.2中新增了学生表,表名为tb_student,对应的实体为学生实体。区域601还展示该次更新的“表详情”内容和“字段”内容。其中,表详情用于展示该表的详细信息,示例性地可以包括表名、注释、实体名、类型、用途分类、标签、或虚拟表中的一项或者多项。“字段”内容用于展示该项变更记录中, 所更新的字段的详细信息,示例性地可以包括字段名称、字段类型、主键、属性详情、或动作等中的一项或者多项。可选的,如区域602所示的组件用于指示是否展示“表详情”内容和“字段”内容,用户点击区域602所示的组件可以展开或收起“表详情”内容和“字段”内容。
示例性地,请参见区域603,用户在版本1.3中更新了学生表。具体更新了学生表中的年龄字段(age)。在一种可能的设计中,变更记录可以展示字段在某一个版本中的更新前的状态和更新后的状态。例如,在1.3版本中,用户将字段名称由age更新为birth,如区域604则展示更新的字段名称的状态和更新后的字段名称的状态。如区域603所示,“字段类型”说明该字段的数据类型;“主键”用于标识该字段是否为主键字段,由于birth字段不是学生表中的字段,因此取值为空;“属性详情”用于说明该字段的其他详细属性;“动作”用于说明对字段的更新操作,例如可以为新增、变更、或删除等。一种设计中,用户可以通过如区域605所示的组件,可以呈现该字段的属性详情。
类似的,请参见区域606,用户在版本1.4中更新学生表。具体更新了学生表中的字段类型。请参见区域607,在更新之前,学号字段(student_ID)的字段类型为12位的整型,在更新之后,student_ID的字段类型为12位的字符型。
通过如图6所示的更新记录,实现了学生表的纵向回溯,可以了解学生表是在哪个版本进行新增、在哪个版本进行了更新,从而直观地获取学生表的生命周期,提升了用户体验。
在一种可能的设计中,服务器可以接收用户设备在第二版本中对数据库模型中的第一元素的更新,向所述用户设备提供第一元素在第二版本中的变更记录。进一步的,在第二版本中的变更记录包含更新前的第一元素和/或更新后的第一元素。
可选的,在新增元素的情况下,则没有更新前的第一元素。类似地,在删除元素的情况下,则没有更新后的第一元素。
在图3所示的实施例中,服务端可以管理数据库模型的多个版本,每个版本的数据库模型都包含数据库的元素以及元素之间的联系,便于回溯数据库模型的多个版本。用户可以从多个版本的数据库模型的信息中,根据自身的需求选择查看某一版本的数据库模型。相应的,服务器向用户提供该版本对应的数据库模型的结构数据。由于结构数据中包含多个数据库的元素,以及元素之间的联系,用户可以方便地查看当前版本的数据库的结构,提升了用户的使用体验。
请参见图7,图7是本申请实施例提供的一种版本管理方法的流程示意图。可选的,该方法可以应用图2所示的数据库设计系统。
如图7所示的版本管理方法至少包括步骤S701至步骤S704。
步骤S701:服务器向用户设备提供数据库模型中的一个或者多个元素。相应的,用户设备接收服务器提供的一个或者多个元素。
其中,元素可以以下中的一项或者多项:数据库表、表、字段、索引、视图、实体、属性、关系、函数、触发器、或存储过程等。
服务器向用户设备提供数据库模型中的一个或者多个元素,可以有以下两种可能的设计:
设计1:服务器向用户设备提供数据库模型的结构数据,结构数据中包含一个或者多个元素。例如,如图5A所示数据库模型的结构数据中包含一个或者多个元素。
可选的,该数据库模型的结构数据可以包含多个版本。一种可能的场景中,服务器向用户设备提供多个版本的数据库模型的信息,用户设备向服务器发送选择的第一版本,服务器则向用户提供第一版本的数据库模型的结构数据。数据库模型的结构数据中包含(一个或者多个)元素,进一步的还可以包含(一个或者多个)元素之间的联系。详细描述可以参考步骤S303、S304中的相关描述。
设计2:服务器可以直接向用户设备提供元素列表,在元素列表中包含一个或者多个元素。
可选的,服务器向用户设备提供一个或者多个元素,用户设备可以呈现该一个或者多个元素。示例性地,请参见图8,图8是本申请实施例提供的一种可能的元素列表的界面示意图。服务器向用户设备提供一个或者多个元素,用户设备可以将一个或者多个元素呈现在如区域801所示的界面中。其中,一个或者多个元素中示例性地包括表、视图、存储过程和函数。表可以示例性地包含学生表、学院表、课程表、或成绩表等中的一项或者多项。
步骤S702:用户设备向服务器发送用户设备选择的第一元素。相应的,服务器接收用户设备发送的用户设备选择的第一元素。
示例性地,用户设备可以选择查看学生表(tb_student),则用户设备向服务器发送用户设备选择的学生表(tb_student)。
需要说明的,选择操作可以是用户设备选择的,也可以是使用用户设备的用户在用户设备上选择的。一种可能的设计中,用户设备可以接收用户输入的对第一元素的选择操作,从而向服务器发送用户设备选择的第一元素。
示例性的,使用用户设备的用户可以点击呈现“tb_student(学生表)”,用户设备则向服务器发送请求信息(便于描述称为请求信息M3),请求信息M3中则指示了用户设备选择的学生表。
或者可选的,参见图8,使用用户设备的用户可以点击呈现“tb_student(学生表)”,用户在菜单(菜单中不同的选项对应了不同的服务)中选择“详情”“定位”或“修改记录”,用户设备向服务器发送请求M3,请求信息M3中则指示了用户设备选择的学生表以及所需的服务。
步骤S703:服务器向所述用户设备提供第一元素在多个版本的变更记录。相应的,用户设备接收服务器所提供的第一元素在多个版本的变更记录。
其中,变更记录包括更新操作、所述第一元素的信息、更新所述第一元素的用户、更新所述第一元素的时间等中的一项或者多项。其中,更新操作又可以包括添加所述第一元素、删除所述第一元素、修改所述第一元素的信息等中的一项或者多项。通过本申请实施例,服务端可以管理数据库模型中的多个元素在多个版本内的变更记录,便于回溯数据库模型中的元素的创建、或者以及修改、删除过程。
可选的,用户设备可以向服务器发送请求信息(便于区分称为请求信息M2),该请求信息M2用于请求获取第一元素在多个版本中变更记录。相应的,服务器响应该请求信息M1,向用户设备提供第一元素在多个版本中变更记录。进一步可选的,用户通过用户设备进行交互,即可可以方便地查看指定元素在历次版本中经历的变更情况。
步骤S704:用户设备呈现第一元素在多个版本的变更记录。
相关描述可以参见前述实施例中的相关描述,例如图3所示实施例中,图6相关的描述,此处不在赘述。
在一种可能的设计中,服务器可以接收所述用户设备在第二版本中对数据库模型中的所述第一元素的更新,向所述用户设备提供所述第一元素在所述第二版本中的变更记录。进一步的,在所述第二版本中的变更记录包含更新前的所述第一元素和/或更新后的第一元素。
可选的,在新增元素的情况下,则没有更新前的第一元素。类似地,在删除元素的情况下,则没有更新后的第一元素。
图7所示的实施例中,服务端可以管理数据库模型中的多个元素在多个版本内的变更记录,便于回溯数据库模型中的元素的创建、或者以及修改、删除过程。相应的,用户通过用户设备进行交互,即可可以方便地查看指定元素在历次版本中经历的变更情况。例如,用户在第一个版本中新增了表A,在第二个版本中在表A添加了某一字段B,在第三个版本中将字段B修改为字段C。而通过对表A进行纵向回溯,可以了解表A是在哪个版本进行创建、在哪个版本进行了更新,从而直观地获取元素的生命周期,提升了用户体验。
上述详细阐述了本申请实施例的方法,下面提供本申请实施例的装置。
请参见图9,图9是本申请实施例提供的一种版本管理装置90的结构示意图,该版本管理装置90可以为服务器或用户设备,也可以为服务器或用户设备中的一个器件,例如芯片、软件模块、集成电路等。该版本管理装置90用于实现前述的版本管理方法,例如图3、或者以及图7所示实施例中的版本管理方法。
一种可能的实施方式中,该版本管理装置90可以包括通信单元901和处理单元902。
一种可能的设计中,上述版本管理装置90可以为前述实施例中的服务器。
在一种可能的实施方式中,处理单元902和通信单元901,用于向用户设备提供多个版本的数据库模型的信息;
所述通信单元901,还用于接收所述用户设备选择的第一版本;
所述处理单元902和所述通信单元901,还用于向所述用户设备提供所述第一版本的数据库模型的结构数据,所述数据库模型的结构数据包含组成所述第一版本的数据库模型的元素以及所述元素之间的联系。
在又一种可能的实施方式中,所述装置90属于数据库设计系统。例如,如图2所示的系统。
在又一种可能的实施方式中,所述第一版本的数据库模型的元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、或序列等。
在又一种可能的实施方式中,所述通信单元901,还用于接收所述用户设备在第二版本中对数据库模型中的所述第一元素的更新;
所述处理单元902和所述通信单元901,还用于向所述用户设备提供所述第一元素在所述第二版本中的变更记录。
在又一种可能的实施方式中,所述在所述第二版本中的变更记录包含更新前的所述第一元素和更新后的第一元素。
在又一种可能的实施方式中,所述处理单元902和所述通信单元901,还用于:
向所述用户设备提供所述数据库模型中的第一元素在多个版本的变更记录。
应理解,相关描述还可以参见图3或者以及图7所示实施例中的描述,此处不再赘述。
又一种可能的设计中,上述版本管理装置90可以为前述实施例中的用户设备。
在一种可能的实施方式中,通信单元901,用于接收服务器提供的多个版本的数据库模型的信息;
所述通信单元901,还用于向服务器发送所述用户设备选择的第一版本;
所述通信单元901,还用于接收所述服务器提供的第一版本的数据库模型的结构数据,所述数据库模型的结构数据包含组成所述第一版本的数据库模型的元素以及所述元素之间的联系。
所述处理单元902,还用于呈现所述第一版本的数据库模型的结构数据。
在又一种可能的实施方式中,所述一个或者多个元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、或序列等。
在又一种可能的实施方式中,所述通信单元901,还用于:
向所述服务器发送所述用户设备在第二版本中对所述数据库模型中的所述第一元素的更新;
接收所述服务器提供的所述第一元素在所述第二版本中的变更记录。
在又一种可能的实施方式中,所述在所述第二版本中的变更记录包含更新前的所述第一元素和更新后的第一元素。
在又一种可能的实施方式中,所述通信单元901,还用于接收所述服务器提供的所述数据库模型中的第一元素在多个版本的变更记录。
应理解,相关描述还可以参见图3或者以及图7所示实施例中的描述,此处不再赘述。
又一种可能的设计中,上述版本管理装置90可以为前述实施例中的服务器。
在又一种可能的实施方式中,处理单元902和通信单元901,用于向用户设备提供数据库模型中的一个或者多个元素;
所述通信单元901,还用于接收所述用户设备选择的第一元素;
所述处理单元902和所述通信单元901,还用于向所述用户设备提供所述第一元素在多个版本的变更记录。
在又一种可能的实施方式中,所述装置属于数据库设计系统。
在又一种可能的实施方式中,所述一个或者多个元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、或序列等。
在又一种可能的实施方式中,所述处理单元902和所述通信单元901,还用于向用户提供多个版本的所述数据库模型的信息;
所述通信单元901,还用于接收所述用户设备选择的第一版本;
所述处理单元902和所述通信单元901,还用于向所述用户设备提供所述第一版本的所述数据库模型的结构数据,所述一个或者多个元素属于所述结构数据。
在又一种可能的实施方式中,所述通信单元901,还用于接收所述用户设备在第二版本中对所述数据库模型中的所述第一元素的更新;
所述处理单元902和所述通信单元901,还用于向所述用户设备提供所述第一元素在所述第二版本中的变更记录。
在又一种可能的实施方式中,所述在所述第二版本中的变更记录中包含更新前的所述第一元素和更新后的第一元素。
应理解,相关描述还可以参见图3或者以及图7所示实施例中的描述,此处不再赘述。
又一种可能的设计中,上述版本管理装置90可以为前述实施例中的用户设备。
在一种可能的实施方式中,所述通信单元901,用于接收所述服务器提供的一个或者多个元素;
所述通信单元901,还用于向服务器发送所述用户设备选择的第一元素;
所述通信单元901,还用于接收所述服务器提供的所述第一元素在多个版本的变更记录;
所述处理单元902,用于呈现所述第一元素在多个版本的变更记录。
在又一种可能的实施方式中,所述一个或者多个元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、或序列等。
在又一种可能的实施方式中,所述通信单元901,还用于:
接收所述服务器提供的所述多个版本的所述数据库模型的信息;
向所述服务器发送所述用户设备选择的第一版本;
接收所述服务器提供的所述第一版本的所述数据库模型的结构数据;
所述处理单元902,还用于呈现所述第一版本的所述数据库模型的结构数据。
在又一种可能的实施方式中,所述在所述第二版本中的变更记录包含更新前的所述第一元素和更新后的第一元素。
应理解,相关描述还可以参见图3或者以及图7所示实施例中的描述,此处不再赘述。
请参见图10,图10是本申请实施例提供的一种计算设备100的结构示意图,该计算设备100可以为独立设备(例如服务器、或用户设备等等中的一个或者多个),也可以为独立设备内部的部件(例如芯片、软件模块或者硬件模块等)。该计算设备100可以包括至少一个处理器1001。可选的还可以包括至少一个存储器1003。进一步可选的,计算设备100还可以包括通信接口1002。更进一步可选的,还可以包含总线1004,其中,处理器1001、通信接口1002和存储器1003通过总线1004相连。
其中,处理器1001是进行算术运算和/或逻辑运算的模块,具体可以是中央处理器(central processing unit,CPU)、图片处理器(graphics processing unit,GPU)、微处理器(microprocessor unit,MPU)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程逻辑门阵列(Field Programmable Gate Array,FPGA)、复杂可编程逻辑器件(Complex programmable logic device,CPLD)、协处理器(协助中央处理器完成相应处理和应用)、微控制单元(Microcontroller Unit,MCU)等处理模块中的一种或者多种的组合。
通信接口1002可以用于为所述至少一个处理器提供信息输入或者输出。和/或,所述通信接口1002可以用于接收外部发送的数据和/或向外部发送数据,可以为包括诸如以太网电缆等的有线链路接口,也可以是无线链路(Wi-Fi、蓝牙、通用无线传输、车载短距通信技术以及其他短距无线通信技术等)接口。可选的,通信接口1002还可以包括与接口耦合的发射器(如射频发射器、天线等),或者接收器等。
存储器1003用于提供存储空间,存储空间中可以存储操作系统和计算机程序等数据。存储器1003可以是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM)等等中的一种 或者多种的组合。
该计算设备100中的至少一个处理器1001用于执行前述的版本管理方法,例如图3或者以及图7所示实施例所描述的版本管理方法。
可选的,处理器1001,可以是专门用于执行这些方法的处理器(便于区别称为专用处理器),也可以是通过调用计算机程序来执行这些方法的处理器,例如通用处理器。可选的,至少一个处理器还可以既包括专用处理器也包括通用处理器。可选的,在计算设备包括至少一个处理器1001的情况下,上述计算机程序可以存在存储器1003中。
一种可能的设计中,上述计算设备100可以为前述实施例中的服务器。
在一种可能的实施方式中,该计算设备100中的至少一个处理器1001用于执行调用计算机指令,以执行以下操作:
通过通信接口1002向用户设备提供多个版本的数据库模型的信息;
通过通信接口1002接收所述用户设备选择的第一版本;
通过通信接口1002向所述用户设备提供所述第一版本的数据库模型的结构数据,所述数据库模型的结构数据包含组成所述第一版本的数据库模型的元素以及所述元素之间的联系。
在又一种可能的实施方式中,所述计算设备100属于数据库设计系统。例如,如图2所示的系统。
在又一种可能的实施方式中,所述第一版本的数据库模型的元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、或序列等。
在又一种可能的实施方式中,所述处理器1001,还用于:
通过通信接口1002接收所述用户设备在第二版本中对数据库模型中的所述第一元素的更新;
通过通信接口1002向所述用户设备提供所述第一元素在所述第二版本中的变更记录。
在又一种可能的实施方式中,所述在所述第二版本中的变更记录包含更新前的所述第一元素和更新后的第一元素。
在又一种可能的实施方式中,所述处理器1001,还用于通过通信接口1002向所述用户设备提供所述数据库模型中的第一元素在多个版本的变更记录。
又一种可能的设计中,上述计算设备100可以为前述实施例中的用户设备。
在一种可能的实施方式中,该计算设备100中的至少一个处理器1001用于执行调用计算机指令,以执行以下操作:
通过通信接口1002接收服务器提供的多个版本的数据库模型的信息;
通过通信接口1002向服务器发送所述用户设备选择的第一版本;
通过通信接口1002接收所述服务器提供的第一版本的数据库模型的结构数据,所述数据库模型的结构数据包含组成所述第一版本的数据库模型的元素以及所述元素之间的联系。
呈现所述第一版本的数据库模型的结构数据。
在又一种可能的实施方式中,所述一个或者多个元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、或序列等。
在又一种可能的实施方式中,所述处理器1001,还用于:
通过通信接口1002向所述服务器发送所述用户设备在第二版本中对所述数据库模型中 的所述第一元素的更新;
通过通信接口1002接收所述服务器提供的所述第一元素在所述第二版本中的变更记录。
在又一种可能的实施方式中,所述在所述第二版本中的变更记录包含更新前的所述第一元素和更新后的第一元素。
在又一种可能的实施方式中,所述处理器1001,还用于通过通信接口1002接收所述服务器提供的所述数据库模型中的第一元素在多个版本的变更记录。
应理解,相关描述还可以参见图3或者以及图7所示实施例中的描述,此处不再赘述。
又一种可能的设计中,上述计算设备100可以为前述实施例中的服务器。
在一种可能的实施方式中,该计算设备100中的至少一个处理器1001用于执行调用计算机指令,以执行以下操作:
通过通信接口1002向用户设备提供数据库模型中的一个或者多个元素;
通过通信接口1002接收所述用户设备选择的第一元素;
通过通信接口1002向所述用户设备提供所述第一元素在多个版本的变更记录。
在又一种可能的实施方式中,所述计算设备100属于数据库设计系统。
在又一种可能的实施方式中,所述一个或者多个元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、或序列等。
在又一种可能的实施方式中,所述处理器1001,还用于:
通过通信接口1002向用户提供多个版本的所述数据库模型的信息;
通过通信接口1002接收所述用户设备选择的第一版本;
通过通信接口1002向所述用户设备提供所述第一版本的所述数据库模型的结构数据,所述一个或者多个元素属于所述结构数据。
在又一种可能的实施方式中,所述处理器1001,还用于:
通过通信接口1002接收所述用户设备在第二版本中对所述数据库模型中的所述第一元素的更新;
通过通信接口1002向所述用户设备提供所述第一元素在所述第二版本中的变更记录。
在又一种可能的实施方式中,所述在所述第二版本中的变更记录中包含更新前的所述第一元素和更新后的第一元素。
应理解,相关描述还可以参见图3或者以及图7所示实施例中的描述,此处不再赘述。
又一种可能的设计中,上述计算设备100可以为前述实施例中的用户设备。
在一种可能的实施方式中,该计算设备100中的至少一个处理器1001用于执行调用计算机指令,以执行以下操作:
通过通信接口1002接收所述服务器提供的一个或者多个元素;
通过通信接口1002向服务器发送所述用户设备选择的第一元素;
通过通信接口1002接收所述服务器提供的所述第一元素在多个版本的变更记录;
呈现所述第一元素在多个版本的变更记录。
在又一种可能的实施方式中,所述一个或者多个元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、或序列等。
在又一种可能的实施方式中,所述处理器1001,还用于:
通过通信接口1002接收所述服务器提供的所述多个版本的所述数据库模型的信息;
通过通信接口1002向所述服务器发送所述用户设备选择的第一版本;
通过通信接口1002接收所述服务器提供的所述第一版本的所述数据库模型的结构数据;
呈现所述第一版本的所述数据库模型的结构数据。
在又一种可能的实施方式中,所述在所述第二版本中的变更记录包含更新前的所述第一元素和更新后的第一元素。
应理解,相关描述还可以参见图3或者以及图7所示实施例中的描述,此处不再赘述。
本申请还提供了一种算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在至少一个处理器上运行时,实现前述的版本管理方法,例如图3、或图7所示的版本管理方法。
本申请还提供了一种计算机程序产品,该计算机程序产品包括计算机指令,在被计算设备执行时,实现前述的版本管理方法,例如图3、或图7所示的版本管理方法。
本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
本申请中实施例提到的“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a、b、或c中的至少一项(个),可以表示:a、b、c、(a和b)、(a和c)、(b和c)、或(a和b和c),其中a、b、c可以是单个,也可以是多个。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A、同时存在A和B、单独存在B这三种情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。
以及,除非有相反的说明,本申请实施例使用“第一”、“第二”等序数词是用于对多个对象进行区分,不用于限定多个对象的顺序、时序、优先级或者重要程度。例如,第一用户设备和第二用户设备,只是为了便于描述,而并不是表示这第一用户设备和第二用户设备的结构、重要程度等的不同,在某些实施例中,第一用户设备和第二用户设备还可以是同样的设备。
上述实施例中所用,根据上下文,术语“当……时”可以被解释为意思是“如果……”或“在……后”或“响应于确定……”或“响应于检测到……”。以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的构思和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。

Claims (37)

  1. 一种数据库模型的版本管理方法,其特征在于,包括:
    向用户设备提供多个版本的数据库模型的信息;
    接收所述用户设备选择的第一版本;
    向所述用户设备提供所述第一版本的数据库模型的结构数据,所述数据库模型的结构数据包含组成所述第一版本的数据库模型的元素以及所述元素之间的联系。
  2. 根据权利要求1所述的方法,其特征在于,所述方法应用于数据库设计系统。
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一版本的数据库模型的元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、序列。
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述方法还包括:
    接收所述用户设备在第二版本中对数据库模型中的所述第一元素的更新;
    向所述用户设备提供所述第一元素在所述第二版本中的变更记录。
  5. 根据权利要求4所述的方法,其特征在于,所述在所述第二版本中的变更记录包含更新前的所述第一元素和/或更新后的第一元素。
  6. 根据权利要求1-5中任一项所述的方法,其特征在于,所述方法还包括:
    向所述用户设备提供中所述数据库模型中的第一元素在多个版本的变更记录。
  7. 一种数据库模型的版本管理方法,其特征在于,包括:
    向用户设备提供数据库模型中的一个或者多个元素;
    接收所述用户设备选择的第一元素;
    向所述用户设备提供所述第一元素在多个版本的变更记录。
  8. 根据权利要求7所述的方法,其特征在于,所述方法应用于数据库设计系统。
  9. 根据权利要求7或8所述的方法,其特征在于,所述一个或者多个元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、序列。
  10. 根据权利要求7-9任一项所述的方法,其特征在于,所述方法还包括:
    向用户提供多个版本的所述数据库模型的信息;
    接收所述用户设备选择的第一版本;
    向所述用户设备提供所述第一版本的所述数据库模型的结构数据,所述一个或者多个元素属于所述结构数据。
  11. 根据权利要求7-10中任一项所述的方法,其特征在于,所述方法还包括:
    接收所述用户设备在第二版本中对所述数据库模型中的所述第一元素的更新;
    向所述用户设备提供所述第一元素在所述第二版本中的变更记录。
  12. 根据权利要求7-11中任一项所述的方法,其特征在于,所述在所述第二版本中的变更记录中包含更新前的所述第一元素和更新后的第一元素。
  13. 一种系统,其特征在于,包括服务器和用户设备,其中:
    所述服务器,用于向用户设备提供多个版本的数据库模型的信息;
    所述用户设备,用于接收所述服务器提供的多个版本的数据库模型的信息;
    所述用户设备,还用于向服务器发送所述用户设备选择的第一版本;
    所述服务器,还用于接收所述用户设备选择的所述第一版本;
    所述服务器,还用于向所述用户设备提供所述第一版本的数据库模型的结构数据,所述数据库模型的结构数据包含组成所述第一版本的数据库模型的元素以及所述元素之间的联系;
    所述用户设备,还用于接收所述服务器提供的所述第一版本的数据库模型的结构数据;
    所述用户设备,还用于呈现所述第一版本的数据库模型的结构数据。
  14. 根据权利要求13所述的系统,其特征在于,所述第一版本的数据库模型的元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、序列。
  15. 根据权利要求13或14所述的系统,其特征在于,所述用户设备,还用于向所述服务器发送所述用户设备在第二版本中对所述数据库模型中的所述第一元素的更新;
    所述服务器,还用于:
    接收所述用户设备在第二版本中对数据库模型中的所述第一元素的更新;
    向所述用户设备提供所述第一元素在所述第二版本中的变更记录;
    所述用户设备,还用于接收所述服务器提供的所述第一元素在所述第二版本中的变更记录。
  16. 根据权利要求15所述的系统,其特征在于,所述在所述第二版本中的变更记录包含更新前的所述第一元素和更新后的第一元素。
  17. 根据权利要求13-16中任一项所述的系统,其特征在于,所述服务器,还用于向所述用户设备提供所述数据库模型中的第一元素在多个版本的变更记录;
    所述用户设备,还用于接收所述服务器提供的所述数据库模型中的第一元素在多个版本的变更记录。
  18. 一种系统,其特征在于,包括服务器和用户设备,其中:
    所述服务器,用于向用户设备提供数据库模型中的一个或者多个元素;
    所述用户设备,用于接收所述服务器提供的一个或者多个元素;
    所述用户设备,还用于向服务器发送所述用户设备选择的第一元素;
    所述服务器,还用于接收所述用户设备选择的所述第一元素;
    所述服务器,还用于向所述用户设备提供的所述第一元素在多个版本的变更记录;
    所述用户设备,还用于接收所述服务器提供的所述第一元素在多个版本的变更记录;
    所述用户设备,还用于呈现所述第一元素在多个版本的变更记录。
  19. 根据权利要求18所述的系统,其特征在于,所述一个或者多个元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、序列。
  20. 根据权利要求18或19所述的系统,其特征在于,所述服务器,还用于向用户提供多个版本的所述数据库模型的信息;
    所述用户设备,还用于接收所述服务器提供的所述多个版本的所述数据库模型的信息;
    所述用户设备,还用于向所述服务器发送所述用户设备选择的第一版本;
    所述服务器,还用于接收所述用户设备发送的所述用户设备选择的第一版本;
    所述服务器,还用于向所述用户设备提供所述第一版本的所述数据库模型的结构数据;
    所述用户设备,还用于接收所述服务器提供的所述第一版本的所述数据库模型的结构数据;
    所述用户设备,还用于呈现所述第一版本的所述数据库模型的结构数据。
  21. 根据权利要求18-20任一项所述的系统,其特征在于,所述用户设备,还用于向所述服务器发送所述用户设备在第二版本中对所述数据库模型中的所述第一元素的更新;
    所述服务器,还用于接收所述用户设备在第二版本中对数据库模型中的所述第一元素的更新;
    所述服务器,还用于向所述用户设备提供所述第一元素在所述第二版本中的变更记录;
    所述用户设备,还用于接收所述服务器提供的所述第一元素在所述第二版本中的变更记录。
  22. 根据权利要求21所述的系统,其特征在于,所述在所述第二版本中的变更记录包含更新前的所述第一元素和更新后的第一元素。
  23. 一种版本管理装置,其特征在于,包括:
    处理单元和通信单元,用于向用户设备提供多个版本的数据库模型的信息;
    所述通信单元,还用于接收所述用户设备选择的第一版本;
    所述处理单元和所述通信单元,还用于向所述用户设备提供所述第一版本的数据库模型的结构数据,所述数据库模型的结构数据包含组成所述第一版本的数据库模型的元素以及所述元素之间的联系。
  24. 根据权利要求23所述的装置,其特征在于,所述装置属于数据库设计系统。
  25. 根据权利要求23或24所述的装置,其特征在于,所述第一版本的数据库模型的元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、序列。
  26. 根据权利要求23-25任一项所述的装置,其特征在于,所述通信单元,还用于接收所述用户设备在第二版本中对数据库模型中的所述第一元素的更新;
    所述处理单元和所述通信单元,还用于向所述用户设备提供所述第一元素在所述第二版本中的变更记录。
  27. 根据权利要求23-26任一项所述的装置,其特征在于,所述在所述第二版本中的变更记录包含更新前的所述第一元素和更新后的第一元素。
  28. 根据权利要求23-27中任一项所述的装置,其特征在于,所述处理单元和所述通信单元,还用于:
    向所述用户设备提供所述数据库模型中的第一元素在多个版本的变更记录。
  29. 一种版本管理装置,其特征在于,包括:
    处理单元和通信单元,用于向用户设备提供数据库模型中的一个或者多个元素;
    所述通信单元,还用于接收所述用户设备选择的第一元素;
    所述处理单元和所述通信单元,还用于向所述用户设备提供所述第一元素在多个版本的变更记录。
  30. 根据权利要求29所述的装置,其特征在于,所述装置属于数据库设计系统。
  31. 根据权利要求29或30所述的装置,其特征在于,所述一个或者多个元素包含以下中的至少一项:库、表、索引、字段、实体、属性、外键、触发器、视图、存储过程、函数、序列。
  32. 根据权利要求29-31任一项所述的装置,其特征在于,
    所述处理单元和所述通信单元,还用于向用户提供多个版本的所述数据库模型的信息;
    所述通信单元,还用于接收所述用户设备选择的第一版本;
    所述处理单元和所述通信单元,还用于向所述用户设备提供所述第一版本的所述数据库模型的结构数据,所述一个或者多个元素属于所述结构数据。
  33. 根据权利要求29-32中任一项所述的装置,其特征在于,
    所述通信单元,还用于接收所述用户设备在第二版本中对所述数据库模型中的所述第一元素的更新;
    所述处理单元和所述通信单元,还用于向所述用户设备提供所述第一元素在所述第二版本中的变更记录。
  34. 根据权利要求29-33中任一项所述的装置,其特征在于,所述在所述第二版本中的变更记录中包含更新前的所述第一元素和更新后的第一元素。
  35. 一种计算设备,其特征在于,所述计算设备包括处理器和存储器;
    所述存储器中存储有计算机程序;
    所述处理器执行所述计算机程序时,所述计算设备执行前述权利要求1至6中任一项所述的方法。
  36. 一种计算设备,其特征在于,所述计算设备包括处理器和存储器;
    所述存储器中存储有计算机程序;
    所述处理器执行所述计算机程序时,所述计算设备执行前述权利要求7至12中任一项所述的方法。
  37. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当所述指令在至少一个处理器上运行时,实现如权利要求1至12中任一项所述的方法。
PCT/CN2022/080325 2021-07-06 2022-03-11 数据库模型的版本管理方法、装置及相关设备 WO2023279752A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110764640.XA CN115586916A (zh) 2021-07-06 2021-07-06 数据库模型的版本管理方法、装置及相关设备
CN202110764640.X 2021-07-06

Publications (1)

Publication Number Publication Date
WO2023279752A1 true WO2023279752A1 (zh) 2023-01-12

Family

ID=84771648

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/080325 WO2023279752A1 (zh) 2021-07-06 2022-03-11 数据库模型的版本管理方法、装置及相关设备

Country Status (2)

Country Link
CN (1) CN115586916A (zh)
WO (1) WO2023279752A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102890720A (zh) * 2012-10-16 2013-01-23 南京通达海信息技术有限公司 数据库检查维护方法
US20190102258A1 (en) * 2015-09-16 2019-04-04 Richard Banister System and Method for Procedure for Point-in-Time Recovery of Cloud or Database Data and Records in Whole or in Part
CN110088746A (zh) * 2016-12-14 2019-08-02 华为技术有限公司 用于数据更新通知的系统、设备和方法
CN110968569A (zh) * 2019-12-19 2020-04-07 广州品唯软件有限公司 数据库的管理方法、数据库的管理装置及存储介质
CN112579568A (zh) * 2020-12-15 2021-03-30 中国建设银行股份有限公司 数据库版本处理方法及系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102890720A (zh) * 2012-10-16 2013-01-23 南京通达海信息技术有限公司 数据库检查维护方法
US20190102258A1 (en) * 2015-09-16 2019-04-04 Richard Banister System and Method for Procedure for Point-in-Time Recovery of Cloud or Database Data and Records in Whole or in Part
CN110088746A (zh) * 2016-12-14 2019-08-02 华为技术有限公司 用于数据更新通知的系统、设备和方法
CN110968569A (zh) * 2019-12-19 2020-04-07 广州品唯软件有限公司 数据库的管理方法、数据库的管理装置及存储介质
CN112579568A (zh) * 2020-12-15 2021-03-30 中国建设银行股份有限公司 数据库版本处理方法及系统

Also Published As

Publication number Publication date
CN115586916A (zh) 2023-01-10

Similar Documents

Publication Publication Date Title
US10827036B2 (en) Version control machine
US9519701B2 (en) Generating information models in an in-memory database system
EP3321825A1 (en) Validating data integrations using a secondary data store
US10423392B2 (en) Systems and methods for transactional applications in an unreliable wireless network
JP6200384B2 (ja) データをモデリングするためのシステム及び方法
US9223549B1 (en) User interface generation using a model layer
WO2023051125A1 (zh) 结构化数据的版本管理方法、装置及相关设备
US10726040B2 (en) Lossless conversion of database tables between formats
US8413109B2 (en) Systems and methods for metamodel transformation
CN105518669A (zh) 数据模型改变管理
EP3486798A1 (en) Reporting and data governance management
CN111427577A (zh) 代码处理方法、装置及服务器
CN110889013A (zh) 一种基于xml的数据关联方法、装置、服务器及存储介质
CN112667598B (zh) 基于业务需求变化的数据模型快速构建系统
US10942732B1 (en) Integration test framework
CN117453980A (zh) 元数据管理、配置页面生成方法、服务器及存储介质
US20180165068A1 (en) Generation and usage of language-converted script
WO2023279752A1 (zh) 数据库模型的版本管理方法、装置及相关设备
US10534588B2 (en) Data processing simulator with simulator module and data elements
US10318524B2 (en) Reporting and data governance management
CN114692055A (zh) 表单处理方法、装置、存储介质与电子设备
JP5685205B2 (ja) プログラム、情報処理装置およびアクセス支援方法
WO2023273410A1 (zh) 规范设计方法、装置及相关设备
US11847134B2 (en) Computerized system for programmatic mapping of record lineage based on data flow through data storage components
US11900085B2 (en) System and method for semantic aware data science

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22836512

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE