Component upgrading method, device and electronic equipment for collaborative project
By automatically obtaining and using component upgrade information in collaborative projects, adaptive upgrade of components under collaborative projects is achieved, and the problem of poor component upgrade flexibility in the existing technology is solved, and the automation and flexibility of the upgrade process is improved.
Patent Information
- Application Number
- CN202210273111.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-18
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2042-03-18
AI Technical Summary
The component upgrade method under existing collaborative projects is poor in flexibility, and the project leader needs to manually operate and coordinate team members. During the upgrade process, work needs to be suspended and the local copy is deleted, resulting in uncommitted modifications being discarded.
Provide a component upgrade method for collaborative projects. By responding to the selection operation of the target work unit, obtaining the current version and target version, and automatically obtaining the component information and modification information to be upgraded. Based on this information, the target work unit is automatically upgraded and the upgrade results are updated to ensure that the upgraded components retain the modification information.
Adaptive upgrade of components under collaborative projects has been achieved, no manual participation has been involved throughout the process, and each work unit is automatically upgraded without affecting each other, which has improved the flexibility of component upgrade.
Smart Images

Figure CN114594986B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer-aided design, and in particular to a component upgrading method, device and electronic equipment for collaborative projects. Background Art
[0002] Collaborative design is a design mode for multi-person collaboration. A collaborative project includes a project library shared by project members, project configuration, and work units that each member is responsible for independently. Components are reusable models created for elements that usually need to be installed and delivered on site. They can be directly loaded and used during the modeling process, such as water supply and drainage equipment and valve accessories in electromechanical. In collaborative projects, components have a three-level management system of public component library, project library, and work unit. Among them, when the published components need to be modified, the corresponding components that the user has added to the project library and applied to the work unit need to be upgraded.
[0003] The existing component upgrade method in a collaborative project includes: before upgrading, instructing all team members to synchronize local modifications with cloud project files and close their respective local copies of project files; upgrading the project files; instructing team members to recreate local copies using the upgraded project files and start working.
[0004] The existing technical solution requires the project leader to operate manually and coordinate all team members to cooperate. Before upgrading, all team members need to suspend their work and delete their local copies at the same time, and uncommitted local modifications will be discarded. Therefore, the entire upgrade process requires precise coordination by the person in charge and high cooperation among team members, and has poor flexibility. Summary of the invention
[0005] In view of this, the embodiments of the present invention provide a method, device and electronic device for upgrading components of a collaborative project to solve the problem of poor flexibility in upgrading components in a collaborative project.
[0006] According to a first aspect, an embodiment of the present invention provides a component upgrade method for a collaborative project, comprising:
[0007] In response to a selection operation on a target work unit of the collaborative project, obtaining a current version and a target version corresponding to a component in the target work unit;
[0008] When the current version is lower than the target version, obtaining the component information to be upgraded corresponding to the target version and the modification information of each component in the target work unit, wherein the component information to be upgraded includes the component to be upgraded and the upgrade method of the component to be upgraded;
[0009] Upgrading the corresponding component in the target working unit based on the component information to be upgraded;
[0010] The upgrade result is updated based on the modification information of each component, an upgraded target working unit is determined, and the version of the component in the upgraded target working unit is determined as the target version.
[0011] The component upgrade method of a collaborative project provided by an embodiment of the present invention triggers automatic upgrade of a target work unit when editing the target work unit of the collaborative project, records modification information of the target work unit before the upgrade, and uses the modification information to update the upgrade result after the upgrade, so that the upgraded component can retain the modification information before the upgrade, thereby realizing adaptive upgrade. There is no human intervention in the whole process, and each work unit is automatically upgraded without affecting each other, thereby improving the flexibility of component upgrades in collaborative projects.
[0012] In combination with the first aspect, in a second implementation of the first aspect, upgrading the corresponding component in the target work unit based on the component information to be upgraded includes:
[0013] Comparing the identification of the component to be upgraded with the identification of each component in the target working unit to determine the target component to be upgraded in the target working unit;
[0014] Determine an upgrade method for the target component based on the upgrade method in the to-be-upgraded component information and the target component;
[0015] The target component is upgraded based on the upgrade mode of the target component.
[0016] The component upgrade method of the collaborative project provided by the embodiment of the present invention determines the target component to be upgraded in the target work unit by using the identifier of the component to be upgraded in the component information to be upgraded, and then upgrades it by using the corresponding upgrade method, thereby improving the reliability of the upgrade.
[0017] In combination with the first implementation manner of the first aspect, in the second implementation manner of the first aspect, the upgrade method in the to-be-upgraded component information includes an identifier of the upgrade method, and determining the upgrade method of the target component based on the upgrade method in the to-be-upgraded component information and the target component includes:
[0018] Based on the identifier of the target component, query the upgrade method in the component information to be upgraded to determine the target identifier of the upgrade method corresponding to the target component;
[0019] Using the target identifier of the upgrade method to query the upgrade mapping relationship, determine the target upgrader creation function corresponding to the target identifier, the upgrade mapping relationship is used to represent the corresponding relationship between the identifier of the upgrade method and the upgrader creation function;
[0020] An upgrader object is created based on the target upgrader creation function, and an upgrade mode of each target component is determined.
[0021] The component upgrade method of the collaborative project provided by the embodiment of the present invention stores the correspondence between the identifier of the upgrade method and the upgrader creation function in the upgrade mapping relationship. If the upgrade method is the same, the same upgrader object can be used to upgrade different components, avoiding the creation of the same upgrader object and improving the component upgrade efficiency.
[0022] In combination with the first aspect, in a third implementation of the first aspect, when the current version is lower than the target version, obtaining the component information to be upgraded corresponding to the target version and the modification information of each component in the target working unit includes:
[0023] When the current version is lower than the target version, and there are versions to be upgraded between the current version and the target version, the target version and the component information to be upgraded corresponding to each version to be upgraded are obtained to upgrade the target working unit version by version.
[0024] The component upgrade method of the collaborative project provided by the embodiment of the present invention upgrades the target component by upgrading version by version, thereby ensuring the reliability of the component upgrade.
[0025] In combination with the first aspect, in a fourth implementation of the first aspect, updating the upgrade result based on the modification information of each component, determining the upgraded target work unit and determining the version of the component in the upgraded target work unit as the target version includes:
[0026] Based on the modification information of the component, the upgrade result of the corresponding component is updated, and the target upgrade result corresponding to the target component is determined to determine the upgraded target work unit;
[0027] The version of the component in the upgraded target work unit is updated to the target version.
[0028] In combination with the first aspect or any one of the first to third implementations, in a fifth implementation of the first aspect, upgrading the corresponding component in the target work unit based on the configuration file includes:
[0029] When the corresponding component in the target work unit fails to be upgraded, the state of the component that fails to be upgraded is restored to the state before the upgrade.
[0030] The component upgrade method of the collaborative project provided by the embodiment of the present invention restores the state of the component that failed to upgrade to the original state when the upgrade fails, skips the current upgrade, so as to improve the upgrade method later and ensure the reliability of the component upgrade.
[0031] According to a second aspect, an embodiment of the present invention further provides a component upgrade device for a collaborative project, comprising:
[0032] A first acquisition module, configured to respond to a selection operation on a target work unit of the collaborative project to acquire a current version and a target version corresponding to a component in the target work unit;
[0033] A second acquisition module is used to acquire, when the current version is lower than the target version, the component information to be upgraded corresponding to the target version and the modification information of each component in the target working unit, wherein the component information to be upgraded includes the component to be upgraded and the upgrade method of the component to be upgraded;
[0034] An upgrading module, used for upgrading the corresponding component in the target working unit based on the component information to be upgraded;
[0035] The updating module is used to update the upgrading result based on the modification information of each component, determine the upgraded target working unit and determine the version of the component in the upgraded target working unit as the target version.
[0036] According to the third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the component upgrading method of the collaborative project described in the first aspect or any one of the embodiments of the first aspect by executing the computer instructions.
[0037] According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer instructions for causing the computer to execute the component upgrade method for a collaborative project described in the first aspect or any one of the embodiments of the first aspect.
[0038] According to a fifth aspect, an embodiment of the present invention further provides a component upgrade system for a collaborative project, including:
[0039] The server is used to obtain the configuration file corresponding to the target version of the target software when the target software is released, and query the component project library of all collaborative projects based on the configuration file to update the component project library. The configuration file is used to record the component to be upgraded and the upgrade method of the component to be upgraded;
[0040] At least one terminal is connected to the server, and the terminal is used to execute the component upgrading method of the collaborative project described in the first aspect or any implementation manner of the first aspect.
[0041] The component upgrade system of the collaborative project provided by the embodiment of the present invention upgrades the component project library and the components respectively without affecting each other. The component project library is automatically upgraded when the software is released, and the target work unit is automatically upgraded when it is edited, thereby improving the flexibility of component upgrades at all levels. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 is a structural block diagram of a component upgrade system for a collaborative project according to an embodiment of the present invention;
[0044] Figure 2 is a schematic diagram of a component upgrade method for a collaborative project according to an embodiment of the present invention;
[0045] Figure 3 is a flow chart of a component upgrade method for a collaborative project according to an embodiment of the present invention;
[0046] Figure 4 is a flow chart of a component upgrade method for a collaborative project according to an embodiment of the present invention;
[0047] Figure 5a It is a schematic diagram of the component properties in the project library before the component upgrade;
[0048] Figure 5b It is a schematic diagram of the component instance attributes in the work unit before the component upgrade;
[0049] Figure 6a is corresponding to Figure 5a A schematic diagram of component properties in the project library after the component is upgraded;
[0050] Figure 6b is corresponding to Figure 5b A schematic diagram of component instance attributes in a work unit after component upgrade;
[0051] Figure 7 is a flow chart of a component upgrading device for a collaborative project according to an embodiment of the present invention;
[0052] Figure 8 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0054] For the convenience of the following description, the terms involved in the embodiments of the present invention are explained as follows:
[0055] Public component library: a platform for storing and managing all published components, hereinafter referred to as the public library.
[0056] Project component library: Users can load components from the public component library into the project component library for use in the project, hereinafter referred to as the project library.
[0057] Work Unit: A collaborative project can be divided into multiple work units. Each team member performs modeling work in the work unit he is responsible for, and finally combines them into a complete project model. Users can use the components in the project library to perform instantiation modeling in the work unit.
[0058] Component instantiation: In a work unit, using components loaded in the project library to create elements is called component instantiation. The created elements are called component instances. A component can create multiple instances in a work unit, and users can also modify the properties of each instance according to design requirements.
[0059] Component upgrade: When a released component needs to be modified, the corresponding components that the user has added to the project library and applied to the work unit need to be upgraded.
[0060] In the embodiment of the present invention, the component upgrade of the collaborative project is divided into two processing flows, one for upgrading the components in the project library, and the other for upgrading the corresponding components in each work unit of the terminal. Among them, the upgrade of the project library is automatically upgraded with the release of the target software; the upgrade of each work unit is automatically triggered when the user opens the work unit to upgrade its version.
[0061] The embodiment of the present invention provides a component upgrade system for a collaborative project, such as Figure 1As shown, the system includes a server 10 and at least one terminal 20. The server 10 includes a public library and a project library of at least one collaborative project; the terminal 20 is connected to the server 10, and the terminal 20 obtains the work unit corresponding to the collaborative project from the server 10, performs collaborative editing on it, and uploads the editing result to the server 10 so that other terminals can share the editing result. Among them, the server 10 can be deployed in the cloud, etc., and there is no limitation on it here.
[0062] Specifically, since the server 10 includes a public library and a project library, when the software is released, the corresponding public library will be upgraded accordingly. That is, the server is used to obtain the configuration file corresponding to the target version of the target software when the target software is released, and query the component project library of all collaborative projects based on the configuration file to update the component project library. The configuration file is used to record the component information to be upgraded corresponding to each version, and the component information to be upgraded includes the component to be upgraded and the upgrade method of the component to be upgraded. For example, the configuration file includes a list of component information to be upgraded for each version, and the component information to be upgraded for each version can be obtained through the list of component information to be upgraded. Correspondingly, the project library of each collaborative project is updated on the server 10. The upgrade of the project library is carried out synchronously when the new version of the software is released, traversing the project libraries of all collaborative projects, and filtering out the components that need to be upgraded by comparing with the configuration file, and replacing them with the components in the new version of the public library to upgrade them to the latest version. This process is carried out in the background without manual operation by the user. For each collaborative project on the server side, the project libraries of each collaborative project may be updated sequentially or simultaneously, and the specific updating method is not limited here.
[0063] It should be noted that although the upgrade process of components in the project library and the upgrade process of components in the work unit are both upgraded through configuration files, the upgrade process of components in the project library directly uses configuration files to determine the components to be upgraded and replaces the components in the project library with the upgraded components. The upgrade process of components in the work unit needs to retain user-defined modifications, etc., which will be described in detail in the upgrade process of components in the work unit below.
[0064] For the terminal, it is used to edit the work unit in the collaborative project. The work unit here refers to one or more work units in the collaborative project. When the user opens an existing work unit for the first time with a new version of the software, the component upgrade of the work unit is automatically triggered, and the upgraded components in the project library are used to update the created instance in the work unit. Each work unit in this process is independent and does not affect each other. When the user closes the work unit, if you choose to save the changes, you will not need to upgrade the next time you open it; if you choose not to save, the work unit will be upgraded again the next time you open it.
[0065] The component upgrade system of the collaborative project provided in this embodiment upgrades the component project library and the components respectively without affecting each other. The component project library is automatically upgraded when the software is released, and the target work unit is automatically upgraded when it is edited, thereby improving the flexibility of component upgrades at all levels.
[0066] In a specific application example, Figure 2 As shown in the figure, component upgrades are generally carried out simultaneously with software releases. In each release, if a component needs to be upgraded, the component information to be upgraded needs to be written into the configuration file and released together with the software, and the new component is published to the public library of the new version. Subsequently, according to different business levels, component upgrades are divided into two independent stages: project library upgrade and work unit upgrade, corresponding to Figure 2 For example, for phase 1, the software version is upgraded from 0.18 to 0.19 and then to 0.20. For each upgrade, the public library is automatically updated with the release of the software; the project library is upgraded accordingly to determine the corresponding version. For phase 2, when the components in the work unit are upgraded, they are also upgraded in combination with the user modifications of each component in the work unit to achieve automatic upgrade of the components in the work unit.
[0067] According to an embodiment of the present invention, an embodiment of a component upgrade method for a collaborative project is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0068] In this embodiment, a method for upgrading a component of a collaborative project is provided, which can be used in the above-mentioned terminals, such as computers, tablet computers, etc. Figure 3 is a flowchart of a component upgrade method for a collaborative project according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0069] S11, in response to a selection operation on a target work unit of a collaborative project, obtaining a current version and a target version corresponding to a component in the target work unit.
[0070] As described above, the target work unit is an old work unit that the user opens in the terminal using the new version of the software. When the user selects the target work unit to open, the electronic device upgrades the components in the target work unit in response to the user's selection operation. Accordingly, after determining the target work unit, the electronic device obtains the current version and target version of the components in the target work unit. Among them, the current version is the version of the component in the target work unit, and the target version is the upgraded version. For example, if the component version of the target work unit is V1 after the last upgrade, and the software version is V2 at this time, then, for the components in the target work unit, its current version is V1 and the target version is V2. Of course, the current version and the target version can also be discontinuous. For example, the current version is V1 and the target version is V4. Then, at this time, the components in the target work unit need to be upgraded from V1 to V4.
[0071] The current version of the component in the target work unit can be stored in the target work unit. For each target work unit, there is a corresponding component upgrade manager for recording the current version of the component in the work unit. The component upgrade manager is established when a new work unit is created and will be kept in the work unit thereafter. The component upgrade manager stores a piece of data, namely the component version (CurrentVersion) in the current work unit. This CurrentVersion is not the version of each component, but the common version of all components in the work unit, because after an upgrade is completed, all components will reach the same version. When a new work unit is created, the component version of the current release will be assigned to the CurrentVersion. After that, each time this work unit is opened, after the new version of the software is released, if a component upgrade is required, after the upgrade is completed, the CurrentVersion value will be updated to the latest version upgraded.
[0072] In addition to the stored data CurrentVersion, the component upgrade manager also defines a series of methods required for the upgrade process, such as reading the configuration file to construct an upgrade version list, screening the components that need to be upgraded in the work unit, constructing the upgrader, running the upgrader to complete the upgrade, etc. It can be understood as the role of the manager in the component upgrade process.
[0073] S12, when the current version is lower than the target version, obtain the to-be-upgraded component information corresponding to the target version and the modification information of each component in the target work unit.
[0074] The information of the component to be upgraded includes the component to be upgraded and the upgrade method of the component to be upgraded.
[0075] The electronic device compares the current version of the version in the target working unit with the target version. If the current version is lower than the target version, it means that the components in the target working unit need to be upgraded. At this time, the electronic device obtains the component information to be upgraded corresponding to the target version and the modification information of each component in the target working unit. Specifically, as described above, the configuration file is released with the software, and the electronic device obtains the component information to be upgraded corresponding to the target version from the configuration file of the server. Among them, for the update of the software version, one or some components may be upgraded each time, and these components that need to be upgraded are called components to be upgraded, and for each component to be upgraded, it corresponds to the corresponding upgrade mechanism, that is, how to upgrade the component to be upgraded from the current version to the target version. Based on this, the corresponding relationship between the components to be upgraded corresponding to each version and the upgrade method of the components to be upgraded is stored in the configuration file, that is, there is a mapping relationship between the components to be upgraded and the upgrade method of the components to be upgraded. After determining the components to be upgraded, the corresponding upgrade method can be determined using the mapping relationship.
[0076] The modification information of each component in the target work unit is saved before the upgrade. For example, if a butterfly valve upgrade changes the water inlet pipe diameter attribute to the nominal diameter, then in the upgrade of this version of the butterfly valve, the water inlet pipe diameter value is recorded before the upgrade, and then the upgrade process is carried out. After the upgrade is completed, the previously recorded value is assigned to the attribute nominal diameter.
[0077] S13, upgrading the corresponding component in the target work unit based on the configuration file.
[0078] The electronic device upgrades the corresponding component in the target working unit based on the corresponding upgrade method stored in the component to be upgraded. If the upgrade logic of the component to be upgraded is the same, the same upgrade method can be used for upgrading. After upgrading the components, the upgrade results of each component are obtained.
[0079] This step will be described in detail below.
[0080] S14, updating the upgrade result based on the modification information of each component, determining the upgraded target working unit and determining the version of the component in the upgraded target working unit as the target version.
[0081] As mentioned above, the electronic device also stores the modification information of each component in the target working unit before the upgrade. After the upgrade results of each component in the target working unit are determined, the upgrade results are updated using the modification information to ensure that the corresponding modification information is retained in the updated component, thereby realizing customized modification. Customized modification refers to the customized modification made to the component by the user when the component is instantiated in the working unit. For example, the component butterfly valve has an attribute which is the water inlet pipe diameter. After the user instantiates a butterfly valve in the working unit, the value of the water inlet pipe diameter can be modified according to the design requirements. This operation belongs to the user-defined modification. During the component upgrade process, it is necessary to consider retaining the user's customized modifications. For example, a certain upgrade replaces the attribute water inlet pipe diameter with the nominal diameter, and the two have the same meaning. After the upgrade, it is necessary to ensure that the value of the new attribute nominal diameter is equal to the value of the water inlet pipe diameter previously customized by the user.
[0082] After the corresponding component in the target work unit is upgraded, the version of the target work unit is updated to the target version and recorded in the component upgrade manager of the target work unit.
[0083] This step will be described in detail below.
[0084] The component upgrade method of a collaborative project provided by an embodiment of the present invention triggers automatic upgrade of a target work unit when editing the target work unit of the collaborative project, records modification information of the target work unit before the upgrade, and uses the modification information to update the upgrade result after the upgrade, so that the upgraded component can retain the modification information before the upgrade, thereby realizing adaptive upgrade. There is no human intervention in the whole process, and each work unit is automatically upgraded without affecting each other, thereby improving the flexibility of component upgrades in collaborative projects.
[0085] In this embodiment, a method for upgrading a component of a collaborative project is provided, which can be used in the above-mentioned terminals, such as computers, tablet computers, etc. Figure 4 is a flowchart of a component upgrade method for a collaborative project according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0086] S21, in response to a selection operation on a target work unit of a collaborative project, obtaining a current version and a target version corresponding to a component in the target work unit.
[0087] For details, please see Figure 2 S11 of the illustrated embodiment will not be described in detail here.
[0088] S22, when the current version is lower than the target version, obtain the to-be-upgraded component information corresponding to the target version and the modification information of each component in the target work unit.
[0089] The information of the component to be upgraded includes the component to be upgraded and the upgrade method of the component to be upgraded.
[0090] In some optional implementations, the above S22 may include: when the current version is lower than the target version, and there are versions to be upgraded between the current version and the target version, obtaining the target version and the upgraded component information corresponding to each version to be upgraded, so as to upgrade the target work unit version by version.
[0091] Because the methods between versions are different, that is, the corresponding upgrade methods are different. For example, if there is a component, 0.19-0.20 needs to use upgrade method A, and 0.20-0.21 needs to use upgrade method B. In the state of 0.19, you must use upgrade methods A and B in sequence to upgrade correctly. Therefore, if there are other versions to be upgraded between the two versions, you need to upgrade them version by version.
[0092] For direct cross-version upgrades, such as 0.19-0.21, 0.19-0.22, etc., direct cross-version upgrades will increase the number of upgrade methods exponentially and are not very useful, because each cross-version upgrader is equivalent to the superposition of one or several single-version upgrade methods. By upgrading the target component version by version, the reliability of the component upgrade is guaranteed.
[0093] S23: Upgrade the corresponding component in the target working unit based on the information of the component to be upgraded.
[0094] Specifically, the above S23 includes:
[0095] S231, comparing the identifier of the component to be upgraded with the identifiers of each component in the target working unit to determine the target component to be upgraded in the target working unit.
[0096] In the component information to be upgraded, a unique identifier corresponding to the public library is set for each component to be upgraded, and the identifier is used as the identity of the component to be upgraded. Correspondingly, each component in the target working unit also has a corresponding identifier. Before upgrading the component in the target working unit, the electronic device first determines the target component to be upgraded in the target working unit by comparing the identifiers. Among them, the identifier can be the name of the component, or the component ID, etc., which is not limited here.
[0097] S232: Determine an upgrade method for the target component based on the upgrade method in the component-to-be-upgraded information and the target component.
[0098] As mentioned above, the component information to be upgraded includes the component to be upgraded and its upgrade method, that is, the component information to be upgraded is used to represent the mapping relationship between the component to be upgraded and the upgrade method. After determining the target component, the electronic device uses the identifier of the target component to query the configuration file to determine the upgrade method of the target component.
[0099] Furthermore, the upgrade method in the component information to be upgraded includes an identifier of the upgrade method. For the component information to be upgraded, it represents the corresponding relationship between the identifier of the component to be upgraded and the identifier of the upgrade method. Based on this, in some optional implementations, the above S232 may include:
[0100] (1) Based on the identifier of the target component, the upgrade method in the component information to be upgraded is queried to determine the target identifier of the upgrade method corresponding to the target component.
[0101] (2) Using the target identifier of the upgrade method to query the upgrade mapping relationship, determine the target upgrader creation function corresponding to the target identifier, wherein the upgrade mapping relationship is used to represent the correspondence between the identifier of the upgrade method and the upgrader creation function.
[0102] (3) Create an upgrader object based on the target upgrader creation function and determine the upgrade method for each target component.
[0103] The target identifier of the upgrade method corresponding to the target component can be determined by querying the component information to be upgraded using the identifier of the target component, and then the upgrade mapping relationship can be queried using the target identifier to obtain the target upgrader creation function. The upgrade mapping relationship can be recorded in a Map table.
[0104] Specifically, the configuration file records the correspondence between components and upgrade methods. However, during program execution, what is needed is not the identifier of the upgrade method, but the upgrader object instantiated by the upgrade method class. Therefore, during component upgrades, it is necessary to construct the upgrader object based on the identifier of the upgrade method. Specifically, a creation function is defined for each upgrade method and stored in a Map table, where the key value and value are the identifier of the upgrade method and the upgrader creation function, respectively. During component upgrades, the identifier of the upgrade method to be used in this upgrade is obtained by reading the configuration file, and the corresponding upgrader creation function is obtained from the above Map table based on the identifier of the upgrade method, and the upgrader object is created accordingly, thereby determining the upgrade method for each target component.
[0105] In a specific application example, the component upgrader corresponds to each version of each component. For example, in version 0.19-0.20, components A, B, and C need to be upgraded, so upgraders Upgrader19A, Upgrader19B, and Upgrader19C will be defined; in version 0.20-0.21, components A and D need to be upgraded, so upgraders Upgrader20A and Upgrader20D will be defined. The configuration file will record the components that need to be upgraded in each version and their corresponding upgrader names in units of versions. In other words, each component has an independent upgrader in each version that needs to be upgraded. Of course, if the upgrade method is the same, the upgrader can also be reused, as long as the name of the required upgrade method is correctly filled in the configuration file.
[0106] The upgrade mapping relationship stores the correspondence between the upgrade method identifier and the upgrader creation function. If the upgrade method is the same, the same upgrader object can be used to upgrade different components, avoiding the creation of the same upgrader object and improving component upgrade efficiency.
[0107] S233, upgrading the target component based on the upgrade method of the target component.
[0108] The electronic device upgrades the target components using the created upgrader objects to obtain upgrade results of each target component.
[0109] In some optional implementations, the above S233 may include: when the corresponding component in the target work unit fails to be upgraded, the state of the component that failed to be upgraded is restored to the state before the upgrade. That is, for the component that failed to be upgraded in the work unit, the upgrade of the component will be skipped and rolled back to the state before the upgrade. Failure information can be collected later and displayed to the user after the upgrade process is completed, and the user can choose the next processing solution, such as giving up the upgrade or manually upgrading.
[0110] It should be noted that the handling of component upgrade failure in the public library is the same as that of components in the work unit, that is, the upgrade of the component is skipped and the state before the upgrade is retained. Therefore, the same optimization can be performed on the upgrade solutions of the public library and the work unit in the future.
[0111] When the upgrade fails, the state of the component that failed to upgrade is restored to the original state, and the upgrade is skipped, so that the upgrade method can be improved later to ensure the reliability of the component upgrade.
[0112] In a specific application example, a butterfly valve is used as an example to illustrate the component upgrade effect. Figure 5a as well as Figure 5bAs shown in the figure, the modification of the butterfly valve in a certain upgrade is to delete the attribute water inlet diameter and add the attribute nominal diameter, and the attribute value of the newly added attribute is the same as the deleted attribute. After the user instantiates the old component in the old work unit, he customizes its attribute water inlet diameter to 222mm; Figure 6a as well as Figure 6b As shown in the figure, after the upgrade is completed, the shape and driving behavior of the component are correct, and the attribute values of the old attributes are migrated to the corresponding new attribute nominal diameter.
[0113] S24, updating the upgrade result based on the modification information of each component, determining the upgraded target working unit and determining the version of the component in the upgraded target working unit as the target version.
[0114] Specifically, the above S24 includes:
[0115] S241, updating the upgrade result of the corresponding component based on the modification information of the component, determining the target upgrade result of the corresponding target component, and determining the upgraded target work unit.
[0116] As described above, after the corresponding component is upgraded by the upgrader, the upgrade result of the component is obtained. On this basis, the upgrade result of the component is updated by using the modification information of the component to determine the target upgrade result of the target component. The electronic device performs the post-upgrade update processing on each target component to determine the upgraded target working unit.
[0117] S242, updating the version of the component in the upgraded target work unit to the target version.
[0118] After the target work unit is upgraded, the version of the component in the target work unit is updated from the current version to the target version.
[0119] The component upgrade method of the collaborative project provided by the embodiment of the present invention determines the target component to be upgraded in the target work unit by using the identifier of the component to be upgraded in the configuration file, and then upgrades it by using the corresponding upgrade method, thereby improving the reliability of the upgrade.
[0120] As a specific application example of component upgrade in a work unit, a refined component upgrade mechanism consisting of a configuration file, a component upgrader, and a component upgrade manager is designed to flexibly support the upgrade of different components and versions in the work unit. The configuration file is grouped by version and records the component information that needs to be upgraded for each version, including component name, component ID, component upgrade manager name, etc.
[0121] Before each component update is released, a component upgrader is defined for each component to be updated, which contains customized component upgrade logic to meet special requirements such as unconventional modifications and user data migration. If the upgrade logic of different components is the same, they can share the same component upgrader. The correspondence between components and component upgrade methods is recorded in the configuration file, and the component upgrader can be constructed later using the correspondence.
[0122] A component upgrade manager is defined for each work unit, which records the current version of the component in this work unit. Every time the user opens an old work unit, the upgrade manager first obtains the version list that needs to be upgraded based on the current component version and the upgrade version information configured in the configuration file. For example, the upgrade manager records that the current version is 0.19, and the configuration file configures the information of the components to be upgraded of three versions, 0.18-0.19, 0.19-0.20, and 0.20-0.21. It is concluded that the components of 0.19-0.20 and 0.20-0.21 need to be upgraded this time. Then, upgrade them version by version in order from low to high. In the upgrade of each version, first, according to the information of the components to be upgraded of the corresponding version recorded in the configuration file, the components to be upgraded are screened from the instantiated components in the current work unit. Secondly, the upgrader is constructed according to the upgrader name recorded in the configuration file. Finally, the upgrade logic in the upgrader is run to complete the upgrade of the corresponding component instance in the current work unit. After all components are upgraded, the latest version upgraded is recorded in the upgrade manager.
[0123] In the collaborative work mode, refined upgrades are achieved component by component and version by version to support necessary component modification requirements due to changes in business requirements, component bugs, etc. This allows users to upgrade independently without any noticeable changes and improves the availability and ease of use of the software.
[0124] In this embodiment, a component upgrade device for a collaborative project is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0125] This embodiment provides a component upgrade device for a collaborative project, such as Figure 7 As shown, including:
[0126] A first acquisition module 31 is used to respond to a selection operation on a target work unit of the collaborative project to acquire a current version and a target version corresponding to a component in the target work unit;
[0127] A second acquisition module 32 is used to acquire, when the current version is lower than the target version, the component information to be upgraded corresponding to the target version and the modification information of each component in the target working unit, wherein the component information to be upgraded includes the component to be upgraded and the upgrade method of the component to be upgraded;
[0128] An upgrading module 33, configured to upgrade a corresponding component in the target working unit based on the component information to be upgraded;
[0129] The updating module 34 is used to update the upgrading result based on the modification information of each component, determine the upgraded target working unit and determine the version of the component in the upgraded target working unit as the target version.
[0130] The component upgrade device of the collaborative project in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0131] The further functional description of each of the above modules is the same as that of the above corresponding embodiments and will not be repeated here.
[0132] The embodiment of the present invention also provides an electronic device having the above Figure 7 A component upgrade device of a collaborative project is shown.
[0133] See also Figure 8 , Figure 8 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, such as Figure 8 As shown, the electronic device may include: at least one processor 41, such as a CPU (Central Processing Unit), at least one communication interface 43, a memory 44, and at least one communication bus 42. The communication bus 42 is used to realize the connection and communication between these components. The communication interface 43 may include a display screen (Display) and a keyboard (Keyboard), and the optional communication interface 43 may also include a standard wired interface and a wireless interface. The memory 44 may be a high-speed RAM memory (Random Access Memory) or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 44 may optionally be at least one storage device located away from the aforementioned processor 41. The processor 41 may be combined with Figure 7 In the described device, the memory 44 stores an application program, and the processor 41 calls the program code stored in the memory 44 to execute any of the above method steps.
[0134] The communication bus 42 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The communication bus 42 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0135] Among them, the memory 44 may include a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviated: RAM); the memory may also include a non-volatile memory (English: non-volatile memory), such as a flash memory (English: flash memory), a hard disk drive (English: hard disk drive, abbreviated: HDD) or a solid-state drive (English: solid-state drive, abbreviated: SSD); the memory 44 may also include a combination of the above types of memory.
[0136] The processor 41 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and a NP.
[0137] The processor 41 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0138] Optionally, the memory 44 is also used to store program instructions. The processor 41 can call the program instructions to implement the component upgrade method of the collaborative project as shown in any embodiment of the present application.
[0139] The embodiment of the present invention further provides a non-transitory computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions can execute the component upgrade method of the collaborative project in any of the above method embodiments. The storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memory.
[0140] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A component upgrade method for a collaborative project, characterized in that: include: In response to a selection operation on a target work unit of the collaborative project, obtaining a current version and a target version corresponding to a component in the target work unit; When the current version is lower than the target version, obtaining the component information to be upgraded corresponding to the target version and the modification information of each component in the target work unit, wherein the component information to be upgraded includes the component to be upgraded and the upgrade method of the component to be upgraded, wherein the upgrade method corresponds to the upgrader creation function in a one-to-one manner, and the upgrader creation function is used to create an upgrader object, and the upgrader object is used to upgrade the component; Upgrading the corresponding component in the target working unit based on the component information to be upgraded; The upgrade result is updated based on the modification information of each component, an upgraded target working unit is determined, and the version of the component in the upgraded target working unit is determined as the target version.
2. The method according to claim 1, characterized in that The step of upgrading the corresponding component in the target working unit based on the component information to be upgraded includes: Comparing the identification of the component to be upgraded with the identification of each component in the target working unit to determine the target component to be upgraded in the target working unit; Determine an upgrade method for the target component based on the upgrade method in the to-be-upgraded component information and the target component; The target component is upgraded based on the upgrade mode of the target component.
3. The method according to claim 2, characterized in that The upgrade method includes an identifier of the upgrade method, and the step of determining the upgrade method of the target component based on the upgrade method in the component information to be upgraded and the target component includes: Based on the identifier of the target component, query the upgrade method in the component information to be upgraded to determine the target identifier of the upgrade method corresponding to the target component; Using the target identifier of the upgrade method to query the upgrade mapping relationship, determine the target upgrader creation function corresponding to the target identifier, the upgrade mapping relationship is used to represent the corresponding relationship between the identifier of the upgrade method and the upgrader creation function; An upgrader object is created based on the target upgrader creation function, and an upgrade mode of each target component is determined.
4. The method according to claim 1, characterized in that: When the current version is lower than the target version, obtaining the to-be-upgraded component information corresponding to the target version and the modification information of each component in the target working unit includes: When the current version is lower than the target version, and there are versions to be upgraded between the current version and the target version, the target version and the component information to be upgraded corresponding to each version to be upgraded are obtained to upgrade the target working unit version by version.
5. The method according to claim 1, characterized in that The updating of the upgrade result based on the modification information of each component, determining the upgraded target working unit and determining the version of the component in the upgraded target working unit as the target version, includes: Based on the modification information of the component, the upgrade result of the corresponding component is updated, and the target upgrade result corresponding to the component is determined to determine the target work unit after the upgrade; The version of the component in the upgraded target work unit is updated to the target version.
6. The method according to any one of claims 1 to 5, characterized in that The step of upgrading the corresponding component in the target working unit based on the component information to be upgraded includes: When the corresponding component in the target work unit fails to be upgraded, the state of the component that fails to be upgraded is restored to the state before the upgrade.
7. A component upgrade device for a collaborative project, characterized in that: include: A first acquisition module, configured to respond to a selection operation on a component in a target work unit of the collaborative project to acquire a current version and a target version corresponding to the target work unit; A second acquisition module is used to acquire, when the current version is lower than the target version, the component information to be upgraded corresponding to the target version and the modification information of each component in the target work unit, wherein the component information to be upgraded includes the component to be upgraded and the upgrade method of the component to be upgraded, wherein the upgrade method corresponds to an upgrader creation function in a one-to-one manner, and the upgrader creation function is used to create an upgrader object, and the upgrader object is used to upgrade the component; An upgrading module, used for upgrading the corresponding component in the target working unit based on the component information to be upgraded; The updating module is used to update the upgrading result based on the modification information of each component, determine the upgraded target working unit and determine the version of the component in the upgraded target working unit as the target version.
8. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the component upgrading method according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the component upgrading method according to any one of claims 1 to 6.
10. A component upgrade system for a collaborative project, characterized in that: include: The server is used to obtain the configuration file corresponding to the target version of the target software when the target software is released, and query the component project library of all collaborative projects based on the configuration file to update the component project library. The configuration file is used to record the component to be upgraded and the upgrade method of the component to be upgraded; At least one terminal is connected to the server, and the terminal is used to execute the component upgrade method of the collaborative project according to any one of claims 1-6.
Citation Information
Patent Citations
File upgrading method and device and electronic equipment
CN113419759A
Visual component configuration method and device, equipment and storage medium
CN114090083A