Upgrading method and device based on EIT equipment software database
By obtaining the database version number of the current database of the EIT device and automatically upgrading, problems such as changing requirements and user data security during the upgrade of EIT device software are solved, efficient and stable database upgrades are achieved, and maintenance costs are reduced.
Patent Information
- Application Number
- CN202411753947.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-21
AI Technical Summary
During the upgrade process of EIT equipment software, there are requirements and restrictions such as changing demands, inability to use the network, ensuring user data security, compatibility with new versions of software, and inability to determine the user software version.
By obtaining the database version number of the EIT device's current database, querying the corresponding upgrade operations, and upgrading the database based on these operations, the database is automatically upgraded, reducing manual intervention, and improving upgrade efficiency.
Accurate management of database versions is realized, ensuring that each upgrade operation is based on the correct steps of the current database version, reducing the risk of errors during the upgrade process, improving the stability and reliability of database upgrades, reducing maintenance costs, and improving equipment maintenance efficiency.
Smart Images

Figure CN119668648A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of software upgrade, and in particular to an upgrade method and device based on an EIT equipment software database. Background Art
[0002] In the current software technology field, there are many solutions to the problem of upgrading local databases. However, these solutions have certain limitations when applied to EIT equipment software.
[0003] The following are several existing technical solutions similar to the present invention and their shortcomings: 1) Update the user's local database through the network: rely on network connection to achieve database update. However, current EIT devices and devices under development generally do not support network functions. Since network functions are not a rigid demand for EIT devices, and medical devices will face complex network security regulatory challenges if network functions are added, this solution cannot be applied to EIT device software. 2) Overwrite and upgrade the original database: directly replace the original database with a new version of the database. However, EIT devices process important user data, and simple overwrite upgrades may cause data loss. Even if the data is exported and imported into the new version of the database before overwriting, it cannot be guaranteed that the database version and the software version are completely matched, which may cause software operation errors. 3) Rebuild the database and import the original user data when the EIT device software is running: rebuild the database structure when the software is running, and import the original user data into the new database. However, if the database is large or the user data is numerous, this process will be very time-consuming. In addition, this solution increases the complexity of the business process and requires handling various exceptions during database reconstruction or data import, which increases the risk of software defects. More importantly, in order to ensure that the rebuilt database is always up to date, each software version needs to modify the database reconstruction function, which is not in line with the open-closed principle in software development and is not conducive to software maintenance and expansion. Summary of the invention
[0004] An object of an embodiment of the present invention is to provide an upgrade method and device based on an EIT device software database, which is used to solve technical problems such as changing requirements, inability to use the network, ensuring user data security, compatibility with new versions of software, and inability to determine user software versions during the upgrade process of the host computer software of EIT equipment products.
[0005] In a first aspect, an embodiment of the present invention provides an upgrade method based on an EIT device software database, the method comprising:
[0006] Obtaining a database version number of a current database of an EIT device, wherein the EIT device has a database upgrade function;
[0007] According to the database version number, query the operation corresponding to the database version number;
[0008] The database of the EIT device is upgraded according to the operation corresponding to the database version number.
[0009] In a second aspect, an embodiment of the present invention provides an upgrade device based on an EIT device software database, the device comprising:
[0010] An acquisition unit, used to acquire a database version number of a current database of an EIT device, wherein the EIT device has a database upgrade function;
[0011] A query unit, configured to query the operation corresponding to the database version number according to the database version number;
[0012] An upgrading unit is used to upgrade the database of the EIT device according to the operation corresponding to the database version number.
[0013] In a third aspect, an embodiment of the present invention provides a computer device, including:
[0014] at least one processor; and,
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the first aspect.
[0017] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method as described in the first aspect.
[0018] In the above-mentioned scheme implemented by the upgrade method, device, equipment and storage medium based on the EIT equipment software database, this method can accurately manage the database version in the EIT equipment by obtaining the database version number of the current database of the EIT equipment, ensuring that each version of the database can be accurately identified and processed; according to the database version number, the corresponding upgrade operation is queried, and the database is upgraded according to these operations, which can realize the automatic upgrade process of the database, reduce manual intervention, and improve the upgrade efficiency; further, by querying the operation corresponding to the database version number, it can be ensured that each upgrade operation is based on the correct steps of the current database version, thereby reducing the risk of errors in the upgrade process and ensuring the stability and reliability of the database upgrade; further, the corresponding operations can be performed according to different database version numbers, so that the EIT equipment can flexibly respond to different versions of databases and ensure the compatibility and scalability of the equipment. Therefore, this method can reduce the workload of maintenance personnel, reduce maintenance costs, and can quickly respond to database version update requirements and improve equipment maintenance efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0020] Figure 1A It is a flowchart of an upgrade method based on an EIT device software database in one embodiment of the present invention;
[0021] Figure 1B It is a schematic diagram of a database upgrade process in one embodiment of the present invention;
[0022] Figure 2 It is a structural schematic diagram of an upgrade device based on an EIT device software database in one embodiment of the present invention;
[0023] Figure 3 It is a schematic diagram of the structure of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0025] It should be noted that, if there is no conflict, the various features in the embodiments of the present invention can be combined with each other, all within the scope of protection of the present invention. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in the present invention do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.
[0026] The technical solution of the present application can be applied to software upgrade scenarios of various EIR devices.
[0027] In view of this, the present application proposes an upgrade method based on the EIT device software database to solve the above problems, which is described in detail below.
[0028] See also Figure 1A , Figure 1A A flowchart of an upgrade method based on an EIT device software database provided by an embodiment of the present invention, the method comprising the following steps:
[0029] S10: Obtain a database version number of a current database of an EIT device, wherein the EIT device has a database upgrade function.
[0030] Among them, EIT (Electrical Impedance Tomography) equipment is a biomedical device that uses electrical impedance tomography technology for monitoring and imaging. It usually includes a hardware part for data acquisition and a software part for data processing and storage.
[0031] Therefore, this solution proposes an EIT device with database upgrade function, which can update the database in its software system. Such updates may include but are not limited to changes in table structure, addition or deletion of data fields, optimization of indexes, modification of stored procedures, etc.
[0032] The database version number is information used to identify the current status and version of the database. The database version number can be a number, a string, or any identifier that can indicate the version difference. Different versions of databases may contain different data structures, tables, indexes, and stored procedures. The EIT device obtains the version number of the current database through a specific query command or API interface.
[0033] It can be seen that the database upgrade function of the EIT device in this embodiment ensures that the device can keep the data structure up to date as the software is updated, thereby supporting the use of new functions while maintaining stability and data security.
[0034] S20. According to the database version number, query the operation corresponding to the database version number.
[0035] Each database version number corresponds to a specific set of operations. These operations may include the execution of SQL scripts, data migration, table structure changes, index creation or deletion, etc. These operations are designed to convert the database from an old version to a new version.
[0036] Among them, the version number of the current database is obtained through a specific query command or API interface. According to the obtained version number, a query statement is constructed or the API interface is called to retrieve the corresponding operation list from the operation library; the operation steps and instructions corresponding to the current version number are obtained. These operation steps are usually arranged in sequence to ensure the orderly progress of the upgrade or maintenance process; the query results are parsed to generate a specific operation instruction list. Each operation instruction contains detailed execution steps and parameters to ensure the accuracy of the operation.
[0037] It can be seen that in this embodiment, by querying the operation corresponding to the database version number, it is ensured that each upgrade or maintenance operation is based on the correct steps of the current database version, avoiding database problems caused by improper operation, and being able to flexibly respond to different versions of databases, ensuring the compatibility and scalability of the device in different version environments.
[0038] S30: Upgrade the database of the EIT device according to the operation corresponding to the database version number.
[0039] Among them, an upgrade is a series of predefined steps that may include SQL statements, program code, configuration changes, etc., aimed at modifying the structure, content or configuration of the database to make it compatible with the latest version of the software.
[0040] Among them, the upgrade process is started according to the difference between the current version number of the database and the target version number.
[0041] Optionally, after the upgrade operation completes successfully, the database version number is updated to reflect the new database state.
[0042] Optionally, before performing a database upgrade, you can back up the current database to prevent data loss due to unexpected situations during the upgrade process. This can be achieved through database backup tools or commands.
[0043] It can be seen that in this embodiment, the automated upgrade process reduces human operation errors and improves upgrade efficiency and accuracy.
[0044] It should be noted that the process of S10-S30 of this solution does not require a network communication connection, that is, the process of this solution can still be executed without a network.
[0045] By acquiring the database version number of the current database of the EIT device, the method can accurately manage the database version in the EIT device to ensure that each version of the database can be accurately identified and processed; according to the database version number, the corresponding upgrade operation is queried, and the database is upgraded according to these operations, which can realize the automatic upgrade process of the database, reduce manual intervention, and improve the upgrade efficiency; further, by querying the operation corresponding to the database version number, it can be ensured that each upgrade operation is based on the correct steps of the current database version, thereby reducing the risk of errors in the upgrade process and ensuring the stability and reliability of the database upgrade; further, corresponding operations can be performed according to different database version numbers, so that the EIT device can flexibly respond to different versions of the database and ensure the compatibility and scalability of the device. Therefore, the method can reduce the workload of maintenance personnel, reduce maintenance costs, and can quickly respond to the update requirements of the database version, thereby improving the maintenance efficiency of the device.
[0046] In one embodiment, before obtaining the database version number of the current database of the EIT device, the method further includes: querying whether a version field exists in the structure corresponding to the database in the EIT device, and the version field is used to record the version number of the current database; if the version field does not exist, adding a target version field according to a preset operation, and the target version field indicates an identification of the starting version of the current database.
[0047] The version field is a special field in the database that stores an identifier that represents the version number of the database. The version field is usually a column containing version number information and is located in a specific table in the database (for example, the metadata table or the version_info table).
[0048] The specific process of the query may be to check the structure of the database (usually metadata or system tables) to determine whether there is a version field. For example, in a SQL database, query INFORMATION_SCHEMA.COLUMNS or other system views to find the version field.
[0049] The preset operations are usually database migration scripts or update statements, which define how to add a new version field to the existing database structure.
[0050] When performing a database upgrade operation, the current database version number can be determined by querying the value of the version field.
[0051] Optionally, after adding the version field, set the starting version number for it. The starting version number usually indicates the starting version of the database and can be set according to the actual situation. For example, if the database is initially V1.0.0, the system will add a version field and set its value to '1.0.0'.
[0052] The operation of adding the version field should be performed in a transaction to ensure the atomicity of the operation and avoid errors in the process that may cause inconsistent database status.
[0053] It can be seen that in this embodiment, the above process can ensure that each database instance has a clear version number.
[0054] In one embodiment, obtaining the database version number of the current database of the EIT device includes: querying a corresponding version field in the current database of the EIT device; and determining the database version number of the current database according to the version field.
[0055] The query may be performed by executing an SQL query. For example, in an SQL database, a statement similar to SELECT version_field FROM system_table may be used to obtain the value of the version field.
[0056] Once the version field is found, the value of the field is read, and this value is the version number of the current database.
[0057] Optionally, if it is found during the query process that the version field does not exist or the version number format is incorrect, the abnormal situation is handled according to the error handling mechanism, such as prompting the user with an error message or trying to restore to the last known good version.
[0058] The version number usually follows a certain format, such as "major version number.minor version number.revision number" (for example, 1.0.0). This format helps to compare the new and old versions and determine the upgrade path.
[0059] It can be seen that, in this embodiment, by managing the version field, the consistency and reliability of the database structure and data can be ensured, and problems caused by version inconsistency can be reduced.
[0060] In one embodiment, querying the operation corresponding to the database version number based on the database version number includes: determining whether the database version number matches the version number of the version class object stored in the data structure; if not, setting the current version number of the database as the target version number; based on the target version number, traversing the data structure in the EIT device to obtain at least one target operation, the target operation being an operation corresponding to a version number higher than the target version number, the data structure representing a collection of version class objects stored in the EIT device, and the arrangement order in the data structure being in ascending order according to the version numbers in the version class objects stored in the EIT device; wherein the version class object is a version class and a corresponding information set, the version class corresponds to a version number, the version class is used to implement a version interface, and the version interface includes all steps implemented by the database version class.
[0061] The data structure is a collection that contains multiple version objects, each of which represents a specific version of the database and its related upgrade operations. The data structure can be a list, array, stack, queue, etc., which organizes version objects according to version numbers or in a specific order.
[0062] If the version number of the current database does not match the version number of any version class object in the data structure, the version number of the current database is set as the target version number.
[0063] Among them, the version interface (Version Interface) defines one or more methods, which are standards for implementing the version control function. Usually, these methods include upgrade (upgrade), downgrade (downgrade) and obtaining the version number (version). The version interface is abstract. It does not contain any specific implementation code, but only declares the protocol that must be followed to implement version control. In the present invention, the version interface includes the steps implemented by all database version classes. For example, define a database version interface, such as: DatabaseVersion.
[0064] The Version Class is a concrete implementation of the Version Interface. Each Version Class corresponds to a specific version number and implements all methods defined in the Version Interface. The Version Class contains the upgrade logic for a specific version number and the possible downgrade logic.
[0065] Specifically, each version class needs to implement the version interface and upgrade. Version is used to identify the database version, and upgrade is used to implement the upgrade behavior of this version of the database. For example, for version V1.0.1, it is necessary to add ROI (region of interest) settings for the EIT software, and a data table corresponding to ROI needs to be added to the database. The upgrade interface pseudocode implemented by the database class corresponding to version V1.0.1 is as follows: void upgrade(){database.addTable("create tableROI");}; V1.0.2 adds the need to record the electrical impedance of EIT at a certain moment, and it is necessary to add an impedance field to a data table. The upgrade interface pseudocode implemented by the database class corresponding to version V1.0.2 is as follows: void upgrade(){database.addField("Impedance")}; Arrange in ascending order by version (the interface requires the implementation of version to determine the version), and store these objects in a data structure that guarantees order.
[0066] For reference Figure 1B , Figure 1B The three versions of database version class objects are described in , all arranged in ascending order of version numbers.
[0067] Among them, the Version Class Instance is the instantiation result of the Version Class. Each object represents a specific version and contains all the information and logic of this version. When an upgrade or downgrade operation is required, a Version Class object is created and its methods are called.
[0068] Therefore, in the above description, the version interface is a template that specifies the methods that the version class should implement; the version class is the specific implementation of the version interface, and each class corresponds to a specific version number; the version class object is an instance of the version class, representing the operations and data of a specific version; the data structure is a container for the version class objects, responsible for organizing and managing these objects to ensure that they are executed in the correct order.
[0069] The target operation is the operation corresponding to a version number higher than the target version number, indicating the specific steps that need to be performed during the database upgrade process, such as adding a new table, modifying the table structure, inserting initial data, etc.
[0070] Wherein, in the specific implementation of traversing the data structure in the EIT device based on the target version number to obtain at least one target operation, the target operation is an operation corresponding to a version number higher than the target version number, based on the target version number, traversing the data structure to obtain all operations corresponding to version numbers higher than the target version number. These operations represent the steps required to upgrade the database from the current version to the target version.
[0071] Among them, the version class objects in the data structure are arranged in ascending order according to the version number, ensuring that the upgrade operation can be performed in sequence according to the version number during the traversal process. Arranging the version class objects in ascending order according to the version number can ensure that the upgrade operation is performed in sequence according to the version number during the traversal process, avoiding omission or duplication of certain operations.
[0072] Furthermore, starting from the current version number, the operations defined in each version class object higher than the current version number are executed in sequence until the operation corresponding to the highest version number in the data structure is reached.
[0073] It can be seen that in this embodiment, the consistency and correctness of the database upgrade are ensured according to the version number, and a structured method is provided to manage and execute complex upgrade tasks.
[0074] In one embodiment, querying the operation corresponding to the database version number based on the database version number includes: determining whether the database version number matches the version number of the version class object stored in the data structure; if so, obtaining the data structure in the EIT device, the data structure representing a set of version class objects stored in the EIT device, the arrangement order in the data structure being in ascending order according to the version numbers in the version class objects stored in the EIT device; wherein the version class object is a version class and a corresponding information set, the version class corresponds to a version number, the version class is used to implement a version interface, and the version interface includes all steps implemented by the database version class; determining the operation corresponding to the database version number based on the database version number and the data structure in the EIT device.
[0075] If the database version number matches the version number of a version class object in the data structure, it means that the database is already in the version state represented by the version class object. At this point, you need to prepare for possible further upgrade operations.
[0076] In the process of determining the operation corresponding to the database version number according to the database version number and the data structure in the EIT device, the first version class object with a version number higher than the current database version number in the data structure is searched, and the upgrade steps defined in the version class object are executed.
[0077] It ensures that the upgrade is performed along the correct path (order in the data structure), that is, starting from the current version number, the operations of each subsequent version class object are performed in sequence until the latest version number is reached.
[0078] For example, see Figure 1B ,exist Figure 1B The middle figure shows a collection of version database class objects. These objects are arranged from low to high by version number. Each version database class object represents a specific database version and the upgrade operation corresponding to that version. Compare the current database version number with the V1.0.1 version number. If the current database version number is higher than or equal to V1.0.1, skip the upgrade operation of this version. The figure shows the "skip" operation. Compare the current database version number with the V1.0.2 version number. If the current database version number is lower than V1.0.2, perform the upgrade operation of the V1.0.2 version. The figure shows the "execute upgrade" operation. Compare the current database version number with the V1.0.3 version number. If the current database version number is lower than V1.0.3, perform the upgrade operation of the V1.0.3 version. The figure shows the "execute upgrade" operation. Therefore, it can be guaranteed that the upgrade is not repeated or missed.
[0079] If the current database version number is higher than or equal to a certain version number, the upgrade operation of the version is skipped. If the current database version number is lower than a certain version number, the upgrade operation of the version is performed.
[0080] It can be seen that this embodiment ensures that the upgrade operation of the database is carried out in a planned, orderly and safe manner, thereby avoiding omissions or repeated operations during the version upgrade process.
[0081] In one embodiment, determining the operation corresponding to the database version number based on the database version number and the data structure in the EIT device includes: comparing the database version number with the version number in the data structure to determine that the database version number is in a first version class object corresponding to the data structure; in the data structure, obtaining a second version class object whose version number is higher than the first version class object; based on the second version class object, determining the version class corresponding to the second version class object; and based on the version class, determining a target operation, the target operation including all operations required to upgrade the database version number to the next version number.
[0082] Among them, through comparison, a version class object matching the current database version number is found, and this object is the "first version class object". It represents the current state of the database and the implemented upgrade operations.
[0083] Once the first version class object is determined, the next version number will continue to be searched in the data structure, that is, the first version class object with a version number higher than the current database version, which is the "second version class object".
[0084] Among them, the second version class object contains all the information required to upgrade to the next version, including the SQL script to be executed, data migration steps, configuration changes, etc. Use this information to determine the specific version class, that is, the specific class that implements the version interface.
[0085] The target operation refers to all operations required to upgrade the database from the current version number to the version number represented by the second version class object. These operations usually include: updating the database structure (for example, adding a new table, modifying the existing table structure, etc.); data migration or conversion to ensure the correctness and integrity of the data in the new structure; applying any necessary business logic changes or functional enhancements.
[0086] The upgrade operation must be performed in ascending order of the version numbers to ensure that the changes in each version can be applied correctly.
[0087] It can be seen that this embodiment ensures the consistency and correctness of the database upgrade, and at the same time provides a clear upgrade path from the current version to the next version.
[0088] In one embodiment, after determining the target operation according to the version class, the method further includes: upgrading the database in sequence according to the data structure until the version class object corresponding to the highest version number in the data structure is reached, and then stopping the upgrade.
[0089] Among them, the database is upgraded in sequence: according to the version class objects arranged in ascending order of version numbers in the data structure, the upgrade operations defined by each version class object are executed one by one. This process is incremental, that is, each time it is upgraded to the next version number. After executing the operation of a version class object, it is necessary to verify whether the upgrade is successful, including checking the database structure, data integrity and system functions.
[0090] Optionally, record detailed information for each upgrade, including version number, operations performed, execution time, results, etc., to facilitate tracking and auditing.
[0091] The upgrade process will continue until the last version class object in the data structure, that is, the version class object corresponding to the highest version number, is processed. This version class object represents the latest version of the database. That is, once the highest version number in the data structure is reached and the corresponding upgrade operation is performed, the upgrade process will stop. At this point, the database should have been updated to the latest version and include all necessary changes and new features.
[0092] It can be seen that this embodiment ensures that the database smoothly transitions from one version to another, eventually reaching the latest version state, while maintaining the stability of the database and the integrity of the data.
[0093] It should be noted that, in each of the above-mentioned embodiments, there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present application, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.
[0094] As another aspect of the embodiment of the present application, the embodiment of the present application provides an upgrade device based on an EIT device software database. The upgrade device based on the EIT device software database can be a software module, and the software module includes a number of instructions stored in a memory. The processor can access the memory and call the instructions for execution to complete the upgrade method based on the EIT device software database described in the above various embodiments.
[0095] See also Figure 2 , Figure 2 Schematic diagram of the structure of an upgrade device based on an EIT device software database provided in an embodiment of the present application. Figure 2 As shown, the upgrading device 200 based on the EIT device software database includes:
[0096] An acquisition unit 201 is used for acquiring a database version number of a current database of an EIT device, wherein the EIT device has a database upgrade function;
[0097] A query unit 202, configured to query the operation corresponding to the database version number according to the database version number;
[0098] The upgrading unit 203 is used to upgrade the database of the EIT device according to the operation corresponding to the database version number.
[0099] By acquiring the database version number of the current database of the EIT device, the method can accurately manage the database version in the EIT device to ensure that each version of the database can be accurately identified and processed; according to the database version number, the corresponding upgrade operation is queried, and the database is upgraded according to these operations, which can realize the automatic upgrade process of the database, reduce manual intervention, and improve the upgrade efficiency; further, by querying the operation corresponding to the database version number, it can be ensured that each upgrade operation is based on the correct steps of the current database version, thereby reducing the risk of errors in the upgrade process and ensuring the stability and reliability of the database upgrade; further, corresponding operations can be performed according to different database version numbers, so that the EIT device can flexibly respond to different versions of the database and ensure the compatibility and scalability of the device. Therefore, the method can reduce the workload of maintenance personnel, reduce maintenance costs, and can quickly respond to the update requirements of the database version, thereby improving the maintenance efficiency of the device.
[0100] In one embodiment, before obtaining the database version number of the current database of the EIT device, the acquisition unit 201 is further used to: query whether there is a version field in the structure corresponding to the database in the EIT device, and the version field is used to record the version number of the current database; if the version field does not exist, add a target version field according to a preset operation, and the target version field indicates the starting version of the current database.
[0101] In one embodiment, in the step of obtaining the database version number of the current database of the EIT device, the obtaining unit 201 is further used to: query the corresponding version field in the current database of the EIT device; and determine the database version number of the current database according to the version field.
[0102] In one embodiment, in the operation of querying the database version number corresponding to the database version number according to the database version number, the query unit 202 is also used to: determine whether the database version number matches the version number of the version class object stored in the data structure; if not, set the current version number of the database as the target version number; based on the target version number, traverse the data structure in the EIT device to obtain at least one target operation, the target operation is an operation corresponding to a version number higher than the target version number, the data structure represents a set of version class objects stored in the EIT device, and the arrangement order in the data structure is in ascending order according to the version numbers in the version class objects stored in the EIT device; wherein the version class object is a version class and a corresponding information set, the version class corresponds to a version number, the version class is used to implement a version interface, and the version interface includes all steps implemented by the database version class.
[0103] In one embodiment, in the operation of querying the database version number corresponding to the database version number according to the database version number, the query unit 202 is also used to: determine whether the database version number matches the version number of the version class object stored in the data structure; if it matches, obtain the data structure in the EIT device, the data structure represents a set of version class objects stored in the EIT device, and the arrangement order in the data structure is in ascending order according to the version numbers in the version class objects stored in the EIT device; wherein the version class object is a version class and a corresponding information set, the version class corresponds to a version number, the version class is used to implement a version interface, and the version interface includes all steps implemented by the database version class; determine the operation corresponding to the database version number according to the database version number and the data structure in the EIT device.
[0104] In one embodiment, in the operation of determining the database version number corresponding to the database version number based on the database version number and the data structure in the EIT device, the query unit 202 is further used to: compare the database version number with the version number in the data structure to determine that the database version number is in the first version class object corresponding to the data structure; obtain a second version class object in the data structure whose version number is higher than the first version class object; determine the version class corresponding to the second version class object based on the second version class object; and determine the target operation based on the version class, wherein the target operation includes all operations required to upgrade the database version number to the next version number.
[0105] In one embodiment, after determining the target operation according to the version class, the query unit 202 is further used to: upgrade the database in sequence according to the data structure until the version class object corresponding to the highest version number in the data structure is reached, and then stop upgrading.
[0106] It should be noted that the above-mentioned upgrade device based on the EIT device software database can execute the upgrade method based on the EIT device software database provided in the embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the embodiment of the upgrade device based on the EIT device software database, please refer to the upgrade method based on the EIT device software database provided in the embodiment of the present application.
[0107] See also Figure 3 , Figure 3 3 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device includes one or more processors 31 and a memory 32. The memory 32 is connected to the one or more processors 31, for example, connected to the processor 31 via a bus.
[0108] The processor 31 is configured to support the computer device to perform the corresponding functions in the method in the above method embodiment. The processor 31 can be a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof. The above hardware chip can be an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0109] The memory 32 is used to store program codes, etc. The memory 32 may include a volatile memory (VM), such as a random access memory (RAM); the memory 32 may also include a non-volatile memory (NVM), such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 32 may also include a combination of the above-mentioned types of memories.
[0110] The memory 32 can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the upgrade method based on the EIT device software database in the embodiment of the present application. The processor 31 executes the various functional applications and data processing of the upgrade method based on the EIT device software database and the upgrade device based on the EIT device software database by running the non-volatile software programs, instructions and modules stored in the memory 32, that is, to realize the functions of the upgrade method based on the EIT device software database and the upgrade device based on the EIT device software database provided by the above method embodiment.
[0111] The memory 32 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function. The data storage area may store data created according to the use of the upgrade device based on the EIT device software database, etc. In some embodiments, the memory 32 may optionally include a memory 32 remotely arranged relative to the processor 31, and these remote memories 32 may be connected to the upgrade device based on the EIT device software database via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0112] The one or more modules are stored in the memory 32, and when executed by the one or more processors 31, the upgrade method based on the EIT equipment software database in any of the above method embodiments is executed, for example, the method steps described in the above method embodiments are executed to realize the functions of the modules described in the above device embodiments.
[0113] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method described in the above embodiment.
[0114] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0115] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. An upgrade method based on EIT equipment software database, characterized in that: include: Obtaining a database version number of a current database of an EIT device, wherein the EIT device has a database upgrade function; According to the database version number, query the operation corresponding to the database version number; The database of the EIT device is upgraded according to the operation corresponding to the database version number.
2. The method according to claim 1, characterized in that Before obtaining the database version number of the current database of the EIT device, the method further includes: Query whether there is a version field in the structure corresponding to the database in the EIT device, where the version field is used to record the version number of the current database; If the version field does not exist, a target version field is added according to a preset operation, and the target version field indicates an identification of the starting version of the current database.
3. The method according to claim 1, characterized in that The step of obtaining the database version number of the current database of the EIT device includes: Query the corresponding version field in the current database of the EIT device; According to the version field, the database version number of the current database is determined.
4. The method according to claim 1, characterized in that: The step of querying the operation corresponding to the database version number according to the database version number includes: Determining whether the database version number matches the version number of the version class object stored in the data structure; If they do not match, the version number of the current database is set as the target version number; Based on the target version number, traverse the data structure in the EIT device to obtain at least one target operation, where the target operation is an operation corresponding to a version number higher than the target version number, the data structure represents a set of version class objects stored in the EIT device, and the arrangement order in the data structure is in ascending order according to the version numbers in the version class objects stored in the EIT device; The version class object is a version class and a corresponding information set, the version class corresponds to a version number, the version class is used to implement a version interface, and the version interface includes all steps implemented by the database version class.
5. The method according to claim 1, characterized in that The step of querying the operation corresponding to the database version number according to the database version number includes: Determining whether the database version number matches the version number of the version class object stored in the data structure; If there is a match, a data structure in the EIT device is obtained, wherein the data structure represents a set of version class objects stored in the EIT device, and the arrangement order in the data structure is in ascending order according to the version numbers in the version class objects stored in the EIT device; The version class object is a version class and a corresponding information set, the version class corresponds to a version number, the version class is used to implement a version interface, and the version interface includes all steps implemented by the database version class; An operation corresponding to the database version number is determined according to the database version number and a data structure in the EIT device.
6. The method according to claim 5, characterized in that The step of determining the operation corresponding to the database version number according to the database version number and the data structure in the EIT device includes: Compare the database version number with the version number in the data structure to determine that the database version number is in the first version class object corresponding to the data structure; In the data structure, obtain a second version class object having a higher version number than the first version class object; Determine, according to the second version class object, a version class corresponding to the second version class object; According to the version class, a target operation is determined, where the target operation includes all operations required to upgrade the database version number to the next version number.
7. The method according to claim 6, characterized in that After determining the target operation according to the version class, the method further includes: According to the data structure, the database is upgraded in sequence until the version class object corresponding to the highest version number in the data structure is reached, and the upgrade is stopped.
8. An upgrade device based on an EIT device software database, the device comprising: An acquisition unit, used to acquire a database version number of a current database of an EIT device, wherein the EIT device has a database upgrade function; A query unit, configured to query the operation corresponding to the database version number according to the database version number; An upgrading unit is used to upgrade the database of the EIT device according to the operation corresponding to the database version number.
9. A computer device, comprising a memory and a processor, wherein the memory is connected to the processor, and the processor is used to execute one or more computer programs stored in the memory, and when the processor executes the one or more computer programs, the computer device implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 7.