WO2022199160A1 - Method for resolving component version conflict, device, and storage medium - Google Patents

Method for resolving component version conflict, device, and storage medium Download PDF

Info

Publication number
WO2022199160A1
WO2022199160A1 PCT/CN2021/140190 CN2021140190W WO2022199160A1 WO 2022199160 A1 WO2022199160 A1 WO 2022199160A1 CN 2021140190 W CN2021140190 W CN 2021140190W WO 2022199160 A1 WO2022199160 A1 WO 2022199160A1
Authority
WO
WIPO (PCT)
Prior art keywords
component
information
components
dependency
version
Prior art date
Application number
PCT/CN2021/140190
Other languages
French (fr)
Chinese (zh)
Inventor
周智
Original Assignee
京东科技控股股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 京东科技控股股份有限公司 filed Critical 京东科技控股股份有限公司
Publication of WO2022199160A1 publication Critical patent/WO2022199160A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The present application provides a method for resolving a component version conflict, a device, and a storage medium. The method comprises: after acquiring a component version setting request comprising application identifier information and first component version numbers set for information of first components of which component version numbers conflict, acquiring a plurality of first components corresponding to the information of the first components; acquiring a component dependency configuration file corresponding to the application identifier information; adjusting, to the first component version numbers, the component version numbers corresponding to the plurality of first components in the component dependency configuration file, so as to obtain an updated component dependency configuration file; and compiling, according to the updated component dependency configuration file, an application corresponding to the application identifier information.

Description

解决组件版本冲突的方法、设备和存储介质Method, device and storage medium for resolving component version conflicts
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求在2021年03月25日提交中国专利局、申请号为202110321895.9的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application No. 202110321895.9 filed with the China Patent Office on March 25, 2021, the entire contents of which are incorporated herein by reference.
技术领域technical field
本申请涉及计算机技术领域,尤其涉及解决组件版本冲突的方法、装置、电子设备和存储介质。The present application relates to the field of computer technology, and in particular, to a method, apparatus, electronic device and storage medium for resolving component version conflicts.
背景技术Background technique
目前,在基于组件化对应用程序进行开发的过程中,一个应用程序可能依赖多个组件,而一个组件可能存在多个版本。相关技术中,在对应用程序进行开发的过程中,为了可提高所开发的应用程序的运行的稳定性,需要对所开发应用程序中同一个组件是否有多个版本进行检查,并需要开发者人工对应用程序的程序代码进行调整,以将同一个组件的版本调整到一致,以解决版本冲突的问题。然而,上述方式在解决版本冲突的问题的过程中,用户的操作较多,解决冲突版本的成本较高,进而影响了开发应用程序的效率。At present, in the process of developing applications based on componentization, an application may depend on multiple components, and a component may exist in multiple versions. In the related art, in the process of developing an application, in order to improve the running stability of the developed application, it is necessary to check whether there are multiple versions of the same component in the developed application, and the developer needs to check whether the same component has multiple versions. Manually adjust the program code of the application to adjust the version of the same component to be consistent to solve the problem of version conflict. However, in the process of solving the problem of version conflict in the above method, the user has many operations, and the cost of solving the conflicting version is relatively high, thereby affecting the efficiency of developing the application program.
发明内容SUMMARY OF THE INVENTION
本申请提出一种解决组件版本冲突的方法、装置、电子设备和存储介质。The present application provides a method, apparatus, electronic device and storage medium for resolving component version conflicts.
本申请一方面实施例提出了一种解决组件版本冲突的方法,接收请求端的组件版本设置请求,其中,所述组件版本设置请求包括应用程序标识信息、为组件版本号存在冲突的第一组件信息所设置的第一组件版本号;获取与所述第一组件信息对应的多个第一组件;获取与所述应用程序标识信息对应的组件依赖配置文件;将所述组件依赖配置文件中所述多个第一组件对应的组件版本号均调整为所述第一组件版本号,以得到更新后的组件依赖配置文件;根据所述更新后的组件依赖配置文件,编译所述应用程序标识信息对应的应用程序。In one aspect of the present application, an embodiment of the present application proposes a method for resolving a component version conflict, receiving a component version setting request from a requesting end, wherein the component version setting request includes application identification information and information about a first component with conflicting component version numbers. The set version number of the first component; obtain a plurality of first components corresponding to the first component information; obtain a component dependency configuration file corresponding to the application identification information; The component version numbers corresponding to the plurality of first components are adjusted to the first component version number, so as to obtain the updated component dependency configuration file; according to the updated component dependency configuration file, compile the corresponding application identification information. s application.
在本申请的一个实施例中,所述接收请求端的组件版本设置请求之前,所述方法还包括:接收所述请求端的查询请求,其中,所述查询请求包括所述应用程序标识信息;从预设的数据库中,获取与所述应用程序标识信息对应的组件查询结果,其中,所述组件查询结果包括所述第一组件信息;将所述第一组件信息发送给所述请求端,以使得所述请求端上显示所述第一组件信息。In an embodiment of the present application, before the receiving the component version setting request of the requesting end, the method further includes: receiving a query request from the requesting end, wherein the query request includes the application identification information; In the designed database, obtain the component query result corresponding to the application program identification information, wherein the component query result includes the first component information; send the first component information to the requester, so that the The first component information is displayed on the requester.
在本申请的一个实施例中,所述从预设的数据库中,获取与所述应用程序标识信息对应的组件查询结果,包括:从所述预设的数据库中,获取所述应用程序标识信息 所标识的应用程序直接依赖的第二组件信息,其中,所述第二组件信息中包括多个第二组件各自对应的组件信息;针对每个第二组件,根据所述第二组件的组件信息,获取所述第二组件的第一组件依赖关系数据;根据所述第一组件依赖关系数据,确定组件版本号存在冲突的第三组件信息;根据各个所述组件的所述第三组件信息,生成所述第一组件信息。In an embodiment of the present application, the obtaining the component query result corresponding to the application identification information from a preset database includes: obtaining the application identification information from the preset database The second component information that the identified application program directly depends on, wherein the second component information includes component information corresponding to each of multiple second components; for each second component, according to the component information of the second component , obtain the first component dependency data of the second component; determine the third component information with conflicting component version numbers according to the first component dependency data; according to the third component information of each of the components, The first component information is generated.
在本申请的一个实施例中,所述根据所述第二组件的组件信息,获取所述第二组件的第一组件依赖关系数据,包括:获取所述第二组件所直接依赖的目标组件;获取所述目标组件所直接依赖的组件,直至对应组件所直接依赖的组件为空时结束;将所述第二组件以及所获取到的所有组件依次连接,以得到所述第二组件的第一组件依赖关系数据。In an embodiment of the present application, acquiring the first component dependency data of the second component according to the component information of the second component includes: acquiring a target component directly dependent on the second component; Obtain the component directly dependent on the target component, and end when the component directly dependent on the corresponding component is empty; connect the second component and all the obtained components in turn to obtain the first component of the second component. Component dependency data.
在本申请的一个实施例中,所述根据所述第一组件依赖关系数据,确定组件版本号存在冲突的第三组件信息,包括:对所述第一组件依赖关系数据中的各个组件,将组件标识相同的组件分为一组,以得到多组组件;判断每组组件中各个组件的组件版本号是否相同,并从所述多组组件中选出组件版本号不相同的目标组;根据所述目标组中组件版本号不同的组件,生成所述第三组件信息。In an embodiment of the present application, the determining, according to the first component dependency relationship data, third component information with conflicting component version numbers includes: for each component in the first component dependency relationship data, adding Components with the same component identification are grouped into one group to obtain multiple groups of components; determine whether the component version numbers of each component in each group of components are the same, and select target groups with different component version numbers from the multiple groups of components; For components in the target group with different component version numbers, the third component information is generated.
在本申请的一个实施例中,所述方法还包括:接收所述请求端的组件添加请求,其中,所述组件添加请求包括所述应用程序标识信息以及待添加组件信息;获取与所述应用程序标识信息对应的组件依赖关系数据;根据所述待添加组件信息,调整所述组件依赖关系数据;将调整后的组件依赖关系数据保存到所述组件依赖配置文件。In an embodiment of the present application, the method further includes: receiving a component addition request from the requester, wherein the component addition request includes the application identification information and the information of the component to be added; component dependency relationship data corresponding to the identification information; adjust the component dependency relationship data according to the to-be-added component information; save the adjusted component dependency relationship data to the component dependency configuration file.
在本申请的一个实施例中,所述组件添加请求还包括所述待添加组件信息所对应的组件版本号,所述方法还包括:查询所述组件依赖关系数据中是否存在所述待添加组件信息对应的目标组件;如果存在与所述待添加组件信息对应的目标组件,则确定所述目标组件的组件版本号与所述待添加组件信息所标识组件的组件版本号是否相同;如果不同,则根据所述目标组件和所述待添加组件信息所标识组件的组件信息,调整所述组件信息。In an embodiment of the present application, the component addition request further includes a component version number corresponding to the component information to be added, and the method further includes: querying the component dependency data for whether the component to be added exists The target component corresponding to the information; if there is a target component corresponding to the component information to be added, then determine whether the component version number of the target component is the same as the component version number of the component identified by the component information to be added; if different, Then, the component information is adjusted according to the target component and the component information of the component identified by the to-be-added component information.
本申请实施例的解决组件版本冲突的方法,在获取到包括应用程序标识信息、为组件版本号存在冲突的第一组件信息所设置的第一组件版本号的组件版本设置请求后,获取与第一组件信息对应的多个第一组件,并获取与应用程序标识信息对应的组件依赖配置文件,以及将组件依赖配置文件中多个第一组件对应的组件版本号均调整为第一组件版本号,以得到更新后的组件依赖配置文件,并根据更新后的组件依赖配置文件,编译应用程序标识信息对应的应用程序。由此,使得开发人员通过请求端发送一个组件版本设置请求,即可对组件版本号存在冲突的组件信息的组件版本号进行调整,从而无需开发人员手动调整应用程序的代码来解决组件版本号冲突的问题,减少了开发者的操作,减少了开发时间,提高了开发效率。In the method for resolving a component version conflict in the embodiment of the present application, after obtaining the component version setting request including the application identification information and the first component version number set for the first component information with the conflicting component version number, obtain the component version setting request with the first component version number. A plurality of first components corresponding to component information, obtain the component dependency configuration file corresponding to the application identification information, and adjust the component version numbers corresponding to the multiple first components in the component dependency configuration file to the first component version number , to obtain the updated component dependency configuration file, and compile the application corresponding to the application identification information according to the updated component dependency configuration file. Therefore, the developer can adjust the component version number of the component information with conflicting component version numbers by sending a component version setting request through the requester, so that the developer does not need to manually adjust the code of the application to resolve the component version number conflict. It reduces the developer's operation, reduces the development time, and improves the development efficiency.
本申请另一方面实施例提出了一种解决组件版本冲突的装置,所述装置包括:第 一接收模块,用于接收请求端的组件版本设置请求,其中,所述组件版本设置请求包括应用程序标识信息、为组件版本号存在冲突的第一组件信息所设置的第一组件版本号;第一获取模块,用于获取与所述第一组件信息对应的多个第一组件;第二获取模块,用于获取与所述应用程序标识信息对应的组件依赖配置文件;配置文件更新模块,用于将所述组件依赖配置文件中所述多个第一组件对应的组件版本号均调整为所述第一组件版本号,以得到更新后的组件依赖配置文件;编译模块,用于根据所述更新后的组件依赖配置文件,编译所述应用程序标识信息对应的应用程序。Another embodiment of the present application provides an apparatus for resolving component version conflicts. The apparatus includes: a first receiving module, configured to receive a component version setting request from a requester, wherein the component version setting request includes an application identifier information, the first component version number set for the first component information with conflicting component version numbers; a first acquisition module, used to acquire a plurality of first components corresponding to the first component information; a second acquisition module, for obtaining the component-dependent configuration file corresponding to the application identification information; the configuration file update module is used to adjust the component version numbers corresponding to the multiple first components in the component-dependent configuration file to the A component version number to obtain an updated component dependency configuration file; a compilation module for compiling an application program corresponding to the application program identification information according to the updated component dependency configuration file.
在本申请的一个实施例中,所述装置还包括:第二接收模块,用于接收所述请求端的查询请求,其中,所述查询请求包括所述应用程序标识信息;第三获取模块,用于从预设的数据库中,获取与所述应用程序标识信息对应的组件查询结果,其中,所述组件查询结果包括所述第一组件信息;发送模块,用于将所述第一组件信息发送给所述请求端,以使得所述请求端上显示所述第一组件信息。In an embodiment of the present application, the apparatus further includes: a second receiving module, configured to receive a query request from the requester, wherein the query request includes the application identification information; a third obtaining module, configured with obtaining a component query result corresponding to the application identification information from a preset database, wherein the component query result includes the first component information; a sending module is configured to send the first component information to the requesting end, so that the first component information is displayed on the requesting end.
在本申请的一个实施例中,所述第三获取模块,包括:第一获取单元,用于从所述预设的数据库中,获取所述应用程序标识信息所标识的应用程序直接依赖的第二组件信息,其中,所述第二组件信息中包括多个第二组件各自对应的组件信息;第二获取单元,用于针对每个第二组件,根据所述第二组件的组件信息,获取所述第二组件的第一组件依赖关系数据;确定单元,用于根据所述第一组件依赖关系数据,确定组件版本号存在冲突的第三组件信息;生成单元,用于根据各个所述第二组件的所述第三组件信息,生成所述第一组件信息。In an embodiment of the present application, the third obtaining module includes: a first obtaining unit, configured to obtain, from the preset database, a third obtaining unit directly dependent on the application identified by the application identification information. Two-component information, wherein the second component information includes component information corresponding to a plurality of second components; a second obtaining unit is configured to obtain, for each second component, according to the component information of the second component first component dependency data of the second component; a determining unit, configured to determine, according to the first component dependency data, third component information with conflicting component version numbers; a generating unit, configured to The third component information of the second component generates the first component information.
在本申请的一个实施例中,所述第二获取单元,具体用于:获取所述组件所直接依赖的目标组件;获取所述目标组件所直接依赖的组件,直至对应组件所直接依赖的组件为空时结束;将所述组件以及所获取到的所有组件依次连接,以得到所述组件的第一组件依赖关系数据。In an embodiment of the present application, the second obtaining unit is specifically configured to: obtain the target component directly dependent on the component; obtain the component directly dependent on the target component, until the component directly dependent on the corresponding component End when it is empty; connect the component and all the obtained components in sequence to obtain the first component dependency relationship data of the component.
在本申请的一个实施例中,所述确定单元,具体用于:对所述第一组件依赖关系数据中的各个组件,将组件标识相同的组件分为一组,以得到多组组件;判断每组组件中各个组件的组件版本号是否相同,并从所述多组组件中选出组件版本号不相同的目标组;根据所述目标组中组件版本号不同的组件,生成所述第四组件信息。In an embodiment of the present application, the determining unit is specifically configured to: for each component in the first component dependency relationship data, group components with the same component identification into one group to obtain multiple groups of components; determine Whether the component version numbers of each component in each group of components are the same, and select target groups with different component version numbers from the multiple groups of components; generate the fourth component according to the components with different component version numbers in the target group Component information.
在本申请的一个实施例中,所述装置还包括:第三接收模块,用于接收所述请求端的组件添加请求,其中,所述组件添加请求包括所述应用程序标识信息以及待添加组件信息;第四获取模块,用于获取与所述应用程序标识信息对应的组件依赖关系数据;第一调整模块,用于根据所述待添加组件信息,调整所述组件依赖关系数据;保存模块,用于将调整后的组件依赖关系数据保存到所述组件依赖配置文件。In an embodiment of the present application, the apparatus further includes: a third receiving module, configured to receive a component addition request from the requester, wherein the component addition request includes the application identification information and the component to be added information The fourth acquisition module is used to acquire the component dependency data corresponding to the identification information of the application; the first adjustment module is used to adjust the component dependency data according to the component information to be added; for saving the adjusted component dependency data to the component dependency configuration file.
在本申请的一个实施例中,所述组件添加请求还包括所述待添加组件信息所对应的组件版本号,所述装置还包括:查询模块,用于查询所述组件依赖关系数据中是否存在所述待添加组件信息对应的目标组件;确定模块,用于如果存在与所述待添加组 件信息对应的目标组件,则确定所述目标组件的组件版本号与所述待添加组件信息所标识组件的组件版本号是否相同;第二调整模块,用于如果不同,则根据所述目标组件和所述待添加组件信息所标识组件的组件信息,调整所述组件信息。In an embodiment of the present application, the component addition request further includes a component version number corresponding to the component information to be added, and the apparatus further includes: a query module configured to query whether the component dependency relationship data exists the target component corresponding to the component information to be added; a determining module, configured to determine the component version number of the target component and the component identified by the component information to be added if there is a target component corresponding to the component information to be added Whether the version numbers of the components are the same; the second adjustment module is configured to adjust the component information according to the target component and the component information of the component identified by the component information to be added if they are different.
本申请实施例的解决组件版本冲突的装置,在获取到包括应用程序标识信息、为组件版本号存在冲突的第一组件信息所设置的第一组件版本号的组件版本设置请求后,获取与第一组件信息对应的多个第一组件,并获取与应用程序标识信息对应的组件依赖配置文件,以及将组件依赖配置文件中多个第一组件对应的组件版本号均调整为第一组件版本号,以得到更新后的组件依赖配置文件,并根据更新后的组件依赖配置文件,编译应用程序标识信息对应的应用程序。由此,使得开发人员通过请求端发送一个组件版本设置请求,即可对组件版本号存在冲突的组件信息的组件版本号进行调整,从而无需开发人员手动调整应用程序的代码来解决组件版本号冲突的问题,减少了开发者的操作,减少了开发时间,提高了开发效率。The device for resolving component version conflicts according to the embodiment of the present application, after obtaining the component version setting request including the application identification information and the first component version number set for the first component information with the conflicting component version numbers, obtains the component version setting request with the first component version number. A plurality of first components corresponding to component information, obtain the component dependency configuration file corresponding to the application identification information, and adjust the component version numbers corresponding to the multiple first components in the component dependency configuration file to the first component version number , to obtain the updated component dependency configuration file, and compile the application corresponding to the application identification information according to the updated component dependency configuration file. Therefore, the developer can adjust the component version number of the component information with conflicting component version numbers by sending a component version setting request through the requester, so that the developer does not need to manually adjust the code of the application to resolve the component version number conflict. It reduces the developer's operation, reduces the development time, and improves the development efficiency.
本申请另一方面实施例提出了一种电子设备,包括:存储器,处理器;所述存储器中存储有计算机指令,当所述计算机指令被所述处理器执行时,实现本申请实施例的解决组件版本冲突的方法。Another embodiment of the present application proposes an electronic device, comprising: a memory and a processor; the memory stores computer instructions, and when the computer instructions are executed by the processor, the solutions of the embodiments of the present application are realized. Component version conflict method.
本申请另一方面实施例提出了一种存储有计算机指令的非瞬时计算机可读存储介质,所述计算机指令用于使所述计算机执行本申请实施例公开的解决组件版本冲突的方法。Another embodiment of the present application provides a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to cause the computer to execute the method for resolving component version conflicts disclosed in the embodiments of the present application.
本申请另一方面实施例提出了一种计算机程序产品,当所述计算机程序产品中的指令处理器执行时实现本申请实施例中的解决组件版本冲突的方法。Another embodiment of the present application provides a computer program product, which implements the method for resolving component version conflicts in the embodiments of the present application when an instruction processor in the computer program product is executed.
上述可选方式所具有的其他效果将在下文中结合具体实施例加以说明。Other effects of the above-mentioned optional manners will be described below with reference to specific embodiments.
附图说明Description of drawings
附图用于更好地理解本方案,不构成对本申请的限定。其中:The accompanying drawings are used for better understanding of the present solution, and do not constitute a limitation to the present application. in:
图1是根据本申请一个实施例的解决组件版本冲突的方法的流程示意图。FIG. 1 is a schematic flowchart of a method for resolving a component version conflict according to an embodiment of the present application.
图2是根据本申请另一个实施例的解决组件版本冲突的方法的流程示意图。FIG. 2 is a schematic flowchart of a method for resolving a component version conflict according to another embodiment of the present application.
图3是根据本申请另一个实施例的解决组件版本冲突的方法的流程示意图。FIG. 3 is a schematic flowchart of a method for resolving a component version conflict according to another embodiment of the present application.
图4是根据本申请另一个实施例的解决组件版本冲突的方法的流程示意图。FIG. 4 is a schematic flowchart of a method for resolving a component version conflict according to another embodiment of the present application.
图5是根据本申请另一个实施例的解决组件版本冲突的方法的流程示意图。FIG. 5 is a schematic flowchart of a method for resolving a component version conflict according to another embodiment of the present application.
图6是根据本申请另一个实施例的解决组件版本冲突的方法的流程示意图。FIG. 6 is a schematic flowchart of a method for resolving a component version conflict according to another embodiment of the present application.
图7是根据本申请一个实施例的解决组件版本冲突的装置的结构示意图。FIG. 7 is a schematic structural diagram of an apparatus for resolving component version conflicts according to an embodiment of the present application.
图8是根据本申请一个实施例的电子设备的框图。FIG. 8 is a block diagram of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同 或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本申请,而不能理解为对本申请的限制。The following describes in detail the embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary, and are intended to be used to explain the present application, but should not be construed as a limitation to the present application.
下面参考附图描述本申请实施例的解决组件版本冲突的方法、装置、电子设备和存储介质。The following describes the method, apparatus, electronic device, and storage medium for resolving component version conflicts according to the embodiments of the present application with reference to the accompanying drawings.
图1是根据本申请一个实施例的解决组件版本冲突的方法的流程示意图。其中,需要说明的是,本实施例提供的解决组件版本冲突的方法的执行主体为解决组件版本冲突的装置,该解决组件版本冲突的装置可以由软件和/或硬件的方式实现,该实施例中解决组件版本冲突的装置可以配置在应用管理服务端中,该应用管理服务端可以提供应用程序的开发环境以及开发工具,以提高应用程序的开发效率。该应用管理服务端可以配置在电子设备中,本实施例中的电子设备可以包括但不限于终端设备和服务器等设备,该实施例对电子设备不作具体限定。FIG. 1 is a schematic flowchart of a method for resolving a component version conflict according to an embodiment of the present application. It should be noted that the execution body of the method for resolving component version conflicts provided by this embodiment is a device for resolving component version conflicts, and the device for resolving component version conflicts may be implemented in software and/or hardware. This embodiment The device for resolving component version conflicts in the system can be configured in an application management server, and the application management server can provide an application development environment and development tools, so as to improve the development efficiency of the application. The application management server may be configured in an electronic device, and the electronic device in this embodiment may include, but is not limited to, a terminal device and a server and other devices, and the electronic device is not specifically limited in this embodiment.
如图1所示,该解决组件版本冲突的方法可以包括步骤101至步骤105。As shown in FIG. 1 , the method for resolving component version conflicts may include steps 101 to 105 .
步骤101,接收请求端的组件版本设置请求,其中,组件版本设置请求包括应用程序标识信息、为组件版本号存在冲突的第一组件信息所设置的第一组件版本号。Step 101: Receive a component version setting request from a requesting end, wherein the component version setting request includes application identification information and a first component version number set for the first component information with conflicting component version numbers.
在一些实施例中,上述请求端可以为任意类型的电子设备,例如,个人计算机,该实施例对请求端不作具体限定。In some embodiments, the above-mentioned requesting end may be any type of electronic device, for example, a personal computer, and the requesting end is not specifically limited in this embodiment.
其中,应用程序标识信息用于对应用程序进行唯一标识,不同应用程序所对应的应用程序标识信息是不同的。The application identification information is used to uniquely identify the application, and the application identification information corresponding to different applications is different.
在一些实施例中,可在请求端上显示对应应用程序的组件版本号存在冲突的第一组件信息。In some embodiments, the first component information with conflicting component version numbers of the corresponding application may be displayed on the requesting end.
在另一些实施例中,为了方便开发人员可视化查看应用程序中组件的依赖关系,可在请求端上以图形化的方式显示组件依赖关系,并在组件依赖关系中对组件版本号冲突的组件信息进行标记。In other embodiments, in order to facilitate developers to visually check the dependencies of components in the application, the component dependencies may be displayed on the requesting side in a graphical manner, and the component information of the conflicting component version numbers may be displayed in the component dependencies. mark.
对应地,在请求端可视化显示出组件版本号存在冲突的组件信息后,开发人员可在请求端通过编辑操作对组件信息的组件版本号进行设置。Correspondingly, after the requesting end visually displays the component information with conflicting component version numbers, the developer can set the component version number of the component information through an editing operation on the requesting end.
具体地,请求端上还可以显示组件信息所对应的多个候选组件版本号,开发人员可通过选择操作从多个候选组件版本号中选择出第一组件版本号。Specifically, multiple candidate component version numbers corresponding to the component information may also be displayed on the requesting end, and the developer may select the first component version number from the multiple candidate component version numbers through a selection operation.
其中,上述标记的方式是预先设置的,例如,可对组件版本号存在冲突的组件信息进行高亮、标黄、标红等方式显示,该实施例对请求端对组件进行标记的方式不作具体限定。The above marking method is preset, for example, the component information with conflicting component version numbers can be highlighted, marked in yellow, marked in red, etc., and the method of marking the component by the requester is not specified in this embodiment. limited.
步骤102,获取与第一组件信息对应的多个第一组件。Step 102: Acquire multiple first components corresponding to the first component information.
作为一种可能的实现方式,可根据预先保存的各个组件与组件信息之间的对应关系,获取该第一组件信息所对应的多个第一组件。As a possible implementation manner, a plurality of first components corresponding to the first component information may be acquired according to the pre-stored correspondence between each component and component information.
其中,组件信息可以包括但不限于组件标识信息和组件名称信息等。The component information may include, but is not limited to, component identification information, component name information, and the like.
步骤103,获取与应用程序标识信息对应的组件依赖配置文件。Step 103: Obtain a component dependency configuration file corresponding to the application identification information.
作为一种可能的实现方式,可根据预先保存的应用程序标识信息与组件依赖配置文件之间的对应关系,获取与该应用程序标识信息对应的组件依赖配置文件。As a possible implementation manner, the component dependency configuration file corresponding to the application identification information may be acquired according to the pre-saved correspondence between the application identification information and the component dependency configuration file.
步骤104,将组件依赖配置文件中多个第一组件对应的组件版本号均调整为第一组件版本号,以得到更新后的组件依赖配置文件。Step 104: Adjust the component version numbers corresponding to the multiple first components in the component dependency configuration file to the first component version numbers, so as to obtain an updated component dependency configuration file.
在一些实施例中,针对每个第一组件,可确定该第一组件的当前组件版本号与第一组件版本号是否相同,如果两者相同,则将该第一组件的当前组件版本号调整为第一组件版本号。In some embodiments, for each first component, it may be determined whether the current component version number of the first component is the same as the first component version number, and if the two are the same, adjust the current component version number of the first component is the version number of the first component.
可以理解的是,在第一组件的当前组件版本号与第一组件版本号相同,则保持第一组件的当前组件版本号不变,即,不对第一组件的当前组件版本号进行调整。It can be understood that, when the current component version number of the first component is the same as the first component version number, the current component version number of the first component is kept unchanged, that is, the current component version number of the first component is not adjusted.
其中,第一组件版本号可以是存在冲突的组件版本号中的一个,或者,是一个新的组件版本号。The first component version number may be one of conflicting component version numbers, or a new component version number.
例如,应用程序应用到组件1两次,在利用组件1的这两次过程,组件1对应的组件版本号分别为组件版本号A和组件版本号B。为了避免后续所开发的应用程序不稳定,可将这两次所应用到的组件1的组件版本号均设置为组件版本号A或者B。For example, the application is applied to the component 1 twice, and in the two processes of using the component 1, the component version numbers corresponding to the component 1 are the component version number A and the component version number B, respectively. In order to avoid instability of the subsequently developed application program, the component version number of the component 1 applied to both times can be set to the component version number A or B.
再例如,组件1对应的组件版本号包括组件版本号A、组件版本号B和组件版本号C。假设应用程序应用到组件1两次,在利用组件1的这两次过程,组件1对应的组件版本号分别为组件版本号A和组件版本号B。为了避免后续所开发的应用程序不稳定,可将这两次所应用到的组件1的组件版本号均设置为组件版本号C。For another example, the component version numbers corresponding to component 1 include component version number A, component version number B, and component version number C. Assuming that the application is applied to component 1 twice, in the two processes of using component 1, the component version numbers corresponding to component 1 are component version number A and component version number B, respectively. In order to avoid instability of the subsequently developed application program, the component version number of the component 1 applied to both times can be set to the component version number C.
步骤105,根据更新后的组件依赖配置文件,编译应用程序标识信息对应的应用程序。Step 105: Compile an application program corresponding to the application program identification information according to the updated component dependency configuration file.
在一些实施例中,在与应用程序标识信息所对应的应用程序是基于安卓系统开发工具所开发的,并在应用程序被触发时,可控制请求端中预先安装的Gradle插件,读取更新后的组件依赖配置文件,并根据更新后的组件依赖配置文件,对应用程序标识信息所对应的应用程序进行编译。由此,无需开发人员手动调整应用程序的代码来解决组件版本号冲突的问题,减少了开发者的操作,减少了开发时间,提高了开发效率。In some embodiments, when the application corresponding to the application identification information is developed based on the Android system development tool, and when the application is triggered, the Gradle plug-in pre-installed in the requester can be controlled, and after the update is read, the Gradle plugin can be controlled. The component dependency configuration file is updated, and the application corresponding to the application identification information is compiled according to the updated component dependency configuration file. Therefore, it is unnecessary for the developer to manually adjust the code of the application to solve the problem of the conflict of the component version numbers, which reduces the operation of the developer, reduces the development time, and improves the development efficiency.
在一些实施例中,可通过建立build、同步sync,或者被任务task等方式触发应用程序。In some embodiments, the application can be triggered by establishing a build, synchronizing sync, or being tasked by a task.
本申请实施例的解决组件版本冲突的方法,在获取到包括应用程序标识信息、为组件版本号存在冲突的第一组件信息所设置的第一组件版本号的组件版本设置请求后,获取与第一组件信息对应的多个第一组件,并获取与应用程序标识信息对应的组件依赖配置文件,以及将组件依赖配置文件中多个第一组件对应的组件版本号均调整为第一组件版本号,以得到更新后的组件依赖配置文件,并根据更新后的组件依赖配置文件,编译应用程序标识信息对应的应用程序。由此,使得开发人员通过请求端发送一个组件版本设置请求,即可对组件版本号存在冲突的组件信息的组件版本号进行调整,从而无需开发人员手动调整应用程序的代码来解决组件版本号冲突的问题,减 少了开发者的操作,减少了开发时间,提高了开发效率。In the method for resolving a component version conflict in the embodiment of the present application, after obtaining the component version setting request including the application identification information and the first component version number set for the first component information with the conflicting component version number, obtain the component version setting request with the first component version number. A plurality of first components corresponding to component information, obtain the component dependency configuration file corresponding to the application identification information, and adjust the component version numbers corresponding to the multiple first components in the component dependency configuration file to the first component version number , to obtain the updated component dependency configuration file, and compile the application corresponding to the application identification information according to the updated component dependency configuration file. Therefore, the developer can adjust the component version number of the component information with conflicting component version numbers by sending a component version setting request through the requester, so that the developer does not need to manually adjust the code of the application to resolve the component version number conflict. It reduces the developer's operation, reduces the development time, and improves the development efficiency.
在一些实施例中,开发人员获取对应应用程序的组件依赖关系数据的一般过程为,开发人员在请求端中通过代码的方式输入相应指令,对应地,根据相应指令从应用程序对应的项目管理仓库中获取所有依赖的组件,并基于所依赖的组件进行分析,并根据分析结果,确定组件的依赖关系以及组件版本冲突信息。然而,上述方式,由于一个应用程序通常所依赖的组件特别多,因此,得到组件的依赖关系以及组件版本冲突信息的效率比较低。为了可以快速获取对应应用程序的组件版本依赖关系数据,在一些实施例中,还可以接收请求端发送的组件关系查询请求,其中,组件关系查询请求中包括应用标识信息。对应地,可从预设的数据库中获取该应用程序标识信息对应的组件依赖关系数据,并将组件依赖关系数据发送给请求端。对应地,请求端可视化显示组件依赖关系数据。In some embodiments, the general process for the developer to obtain the component dependency data of the corresponding application is as follows: the developer enters the corresponding instruction in the requesting terminal by means of code, and correspondingly, according to the corresponding instruction, from the project management warehouse corresponding to the application Obtain all the dependent components in the , and analyze based on the dependent components, and determine the dependencies of the components and the conflict information of the component versions according to the analysis results. However, in the above method, since an application usually depends on a lot of components, the efficiency of obtaining the component dependency relationship and the component version conflict information is relatively low. In order to quickly obtain the component version dependency data of the corresponding application, in some embodiments, a component relationship query request sent by the requesting end may also be received, where the component relationship query request includes application identification information. Correspondingly, the component dependency relationship data corresponding to the identification information of the application may be obtained from a preset database, and the component dependency relationship data may be sent to the requester. Correspondingly, the requester visually displays component dependency data.
在本申请的一个实施例中,为了方便开发人员可快速获取存在组件版本号存在冲突的第一组件信息,在接收请求端的组件版本设置请求之前,如图2所示,可以包括步骤201至步骤203。In an embodiment of the present application, in order to facilitate developers to quickly obtain the first component information with conflicting component version numbers, before receiving the component version setting request from the requesting end, as shown in FIG. 2 , steps 201 to 201 may be included. 203.
步骤201,接收请求端的查询请求,其中,查询请求包括应用程序标识信息。Step 201: Receive a query request from a requester, where the query request includes application identification information.
步骤202,从预设的数据库中,获取与应用程序标识信息对应的组件查询结果,其中,组件查询结果包括第一组件信息。Step 202: Obtain a component query result corresponding to the application identification information from a preset database, wherein the component query result includes first component information.
在一些实施例中,上述预设的数据库中可保存各个应用程序标识信息与其对应的组件版本号存在冲突的组件信息。In some embodiments, the above-mentioned preset database may store component information in which each application identification information conflicts with its corresponding component version number.
在获取到查询请求后,可从查询请求中获取应用程序标识信息,然后,可从数据库中获取应用程序标识信息所对应的组件版本号存在冲突的第一组件信息。After the query request is obtained, the application identification information can be obtained from the query request, and then the first component information with conflicting component version numbers corresponding to the application identification information can be obtained from the database.
步骤203,将第一组件信息发送给请求端,以使得请求端上显示第一组件信息。Step 203: Send the first component information to the requester, so that the requester displays the first component information.
在另一些实施例中,上述从预设的数据库中,获取与应用程序标识信息对应的组件查询结果的一种可能实现方式,如图3所示,可以包括步骤301至步骤304。In other embodiments, a possible implementation manner of obtaining the component query result corresponding to the application identification information from the preset database, as shown in FIG. 3 , may include steps 301 to 304 .
步骤301,从预设的数据库中,获取应用程序标识信息所标识的应用程序直接依赖的第二组件信息,其中,第二组件信息中包括多个第二组件各自对应的组件信息。Step 301: Acquire from a preset database second component information that an application identified by the application identification information directly depends on, wherein the second component information includes component information corresponding to each of a plurality of second components.
步骤302,针对每个第二组件,根据第二组件的组件信息,获取第二组件的第一组件依赖关系数据。 Step 302 , for each second component, obtain first component dependency relationship data of the second component according to the component information of the second component.
在一些实施例中,针对每个第二组件,可根据该第二组件的组件信息查询预设的数据库中是否存在该组件信息对应的组件依赖关系数据,如果存在,则从预设的数据库中获取该组件对应的组件依赖关系数据。In some embodiments, for each second component, according to the component information of the second component, a preset database can be queried to see whether there is component dependency data corresponding to the component information, and if so, the preset database can be queried. Get the component dependency data corresponding to this component.
可以理解的是,通常一些组件之间存在固定的依赖关系,因此,在获取应用程序标识信息所对应的组件依赖关系数据的过程中,可从数据库中遍历出应用程序标识所对应的应用程序所直接依赖的一级组件,然后,获取一级组件中各个组件对应的组件依赖关系数据,并根据一级组件中各个组件对应的组件依赖关系数据,确定出该应用 程序标识所对应的组件依赖关系数据。由此,通过已分析过组件的组件依赖关系数据,快速确定出对应应用程序的组件依赖关系数据,从而可提高获取对应应用程序的组件依赖关系数据的效率。It can be understood that there are usually fixed dependencies between some components. Therefore, in the process of obtaining the component dependency data corresponding to the application identification information, the data of the application corresponding to the application identification can be traversed from the database. Directly dependent first-level components, then obtain the component dependency data corresponding to each component in the first-level component, and determine the component dependency corresponding to the application identifier according to the component dependency data corresponding to each component in the first-level component. data. Therefore, the component dependency data of the corresponding application can be quickly determined by analyzing the component dependency data of the components, thereby improving the efficiency of acquiring the component dependency data of the corresponding application.
在另一些实施例中,上述根据第二组件的组件信息,获取第二组件的第一组件依赖关系数据的另一种可能实现方式为:获取第二组件所直接依赖的目标组件;获取目标组件所直接依赖的组件,直至对应组件所直接依赖的组件为空时结束;将第二组件以及所获取到的所有组件依次连接,以得到第二组件的第一组件依赖关系数据。In other embodiments, another possible implementation manner of obtaining the first component dependency relationship data of the second component according to the component information of the second component is as follows: obtaining the target component directly dependent on the second component; obtaining the target component The directly dependent component ends when the component directly dependent on the corresponding component is empty; the second component and all the acquired components are connected in sequence to obtain the first component dependency relationship data of the second component.
其中,需要说明的是,在不同应用场景中,可通过不同的方式获取第二组件所直接依赖的目标组件,示例说明如下:Among them, it should be noted that in different application scenarios, the target component directly dependent on the second component can be obtained in different ways. Examples are as follows:
在一些实施例中,获取第二组件对应的对象模型文件;对对象模型文件进行解析,以得到解析结果,其中,解析结果包括第二组件所直接依赖的目标组件的组件标识;根据目标组件标识,获取目标组件。In some embodiments, an object model file corresponding to the second component is obtained; the object model file is parsed to obtain a parsing result, wherein the parsing result includes a component identifier of a target component directly dependent on the second component; according to the target component identifier , to get the target component.
具体地,在获取对象模型文件后,可根据对象模型文件中的组件坐标信息进行解析,以得到该第二组件所直接依赖的目标组件的组件标识。Specifically, after the object model file is acquired, analysis can be performed according to the component coordinate information in the object model file to obtain the component identifier of the target component directly dependent on the second component.
其中,组件坐标信息是由组件标识以及组件版本号等信息组成。例如,应程序是基于安卓系统Android的应用程序,对应在对该应用程序进行开发时,该应用程序所有的依赖数据(包括aar/jar包,pom文件等)都存储在Maven仓库。对应地,对象模型文件为pom.xml文件,该pom.xml文件中保存有Maven坐标,其中不同组件对应的Maven坐标是不同的,Maven坐标表现形式为groupId:atifactId:version。其中,groupId:定义当前Maven项目隶属项目、组织artifactId:定义实际项目中的一个模块,version:定义当前项目的当前版本。其中,需要说明的是,一个组件的直接依赖存储在pom.xml文件的依赖dependencies节点中。The component coordinate information is composed of component identification and component version number and other information. For example, the application is an application based on the Android system, and when the application is developed, all the dependent data of the application (including aar/jar packages, pom files, etc.) are stored in the Maven repository. Correspondingly, the object model file is a pom.xml file, and the pom.xml file stores Maven coordinates, wherein the Maven coordinates corresponding to different components are different, and the Maven coordinates are expressed in the form of groupId:atifactId:version. Among them, groupId: defines the project to which the current Maven project belongs, organization artifactId: defines a module in the actual project, version: defines the current version of the current project. Among them, it should be noted that the direct dependencies of a component are stored in the dependencies node of the pom.xml file.
举例而言,应用应用程序APP直接依赖组件libraryA-1.0->libraryB-1.0,那么依赖libraryA-1.0的pom存储形式如下:For example, the application APP directly depends on the component libraryA-1.0->libraryB-1.0, then the storage form of the pom that depends on libraryA-1.0 is as follows:
Figure PCTCN2021140190-appb-000001
Figure PCTCN2021140190-appb-000001
Figure PCTCN2021140190-appb-000002
Figure PCTCN2021140190-appb-000002
可以理解的是,在一些实施例中,如果需要分析组件libraryA的组件依赖关系数据,可根据指定的maven仓库访问地址加上/com/test/libraryB/1.0/libraryA-1.0.pom就可以获取libraryA所有的依赖,这样可以递归遍历任何一个项目中所有的依赖(包括直接依赖,直接依赖的下级依赖,以此类推),也能同时分析出依赖方式scope,并分析出依赖层级关系,存储在数据库中。It can be understood that, in some embodiments, if the component dependency data of component libraryA needs to be analyzed, libraryA can be obtained by adding /com/test/libraryB/1.0/libraryA-1.0.pom to the specified maven repository access address All dependencies, so that you can recursively traverse all dependencies in any project (including direct dependencies, subordinate dependencies of direct dependencies, and so on), and can also analyze the scope of the dependency mode, and analyze the dependency hierarchy relationship, which is stored in the database. middle.
在一些实施例中,在上述应用程序是基于安卓系统开发工具所开发的情况下,上述依赖方式可以包括implementation、接口api和编译compileOnly等方式。In some embodiments, in the case that the above application is developed based on an Android system development tool, the above dependency may include implementation, interface api, and compileOnly.
其中,implementation:该依赖方式所依赖的库不会传递,只会在当前module中生效。Among them, implementation: The library that this dependency method depends on will not be passed, and will only take effect in the current module.
api:该依赖方式会传递所依赖的库,当其他module依赖了该module时,可以使用该module下使用api依赖的库。api: This dependency method will pass the dependent library. When other modules depend on this module, you can use the api-dependent library under this module.
compileOnly:只在编译时有效,不会参与打包。compileOnly: Only valid at compile time and will not participate in packaging.
在另一些实施例中,可根据预先保存的各个组件之间的依赖关系,获取第二组件所直接依赖的目标组件。In other embodiments, the target component directly dependent on the second component may be acquired according to the pre-saved dependencies between the components.
步骤303,根据第一组件依赖关系数据,确定组件版本号存在冲突的第三组件信息。Step 303: Determine, according to the first component dependency relationship data, third component information with conflicting component version numbers.
在本申请的一个实施例中,为了可以准确确定出组件版本号存在冲突的第三组件信息,上述根据第一组件依赖关系数据,确定组件版本号存在冲突的第三组件信息的一种可能实现方式为:对第一组件依赖关系数据中的各个组件,将组件标识相同的组件分为一组,以得到多组组件;判断每组组件中各个组件的组件版本号是否相同,并从多组组件中选出组件版本号不相同的目标组;根据目标组中组件版本号不同的组件,生成第三组件信息。In an embodiment of the present application, in order to accurately determine the third component information with conflicting component version numbers, a possible implementation of the above-mentioned determining the third component information with conflicting component version numbers according to the first component dependency data The method is as follows: for each component in the first component dependency data, the components with the same component ID are grouped into one group to obtain multiple groups of components; it is judged whether the component version numbers of each component in each group of components are the same, and from the multiple groups of components. A target group with different component version numbers is selected from the components; the third component information is generated according to the components with different component version numbers in the target group.
步骤304,根据各个第二组件的第三组件信息,生成第一组件信息。Step 304: Generate first component information according to the third component information of each second component.
基于上述任意实施例的基础上,为了满足对应开发人员动态添加组件的需求,在一些实施例中,如图4所示,该方法还可以包括步骤401至步骤404。Based on any of the foregoing embodiments, in order to meet the requirements of the corresponding developers to dynamically add components, in some embodiments, as shown in FIG. 4 , the method may further include steps 401 to 404 .
步骤401,接收请求端的组件添加请求,其中,组件添加请求包括应用程序标识信息以及待添加组件信息。Step 401: Receive a component addition request from a requesting end, where the component addition request includes application identification information and information of a component to be added.
步骤402,获取与应用程序标识信息对应的组件依赖关系数据。Step 402: Obtain component dependency relationship data corresponding to the application identification information.
在一些实施例中,可从预设的数据库中,获取与应用程序标识信息对应的组件依赖关系数据。In some embodiments, the component dependency relationship data corresponding to the application identification information may be acquired from a preset database.
其中,上述预设的数据库中的组件依赖关系数据是通过与应用程序表示信息所对应的组件依赖配置文件进行预先分析而得到的。The component dependency relationship data in the above-mentioned preset database is obtained by pre-analyzing the component dependency configuration file corresponding to the application program representation information.
步骤403,根据待添加组件信息,调整组件依赖关系数据。Step 403: Adjust the component dependency relationship data according to the component information to be added.
步骤404,将调整后的组件依赖关系数据保存到组件依赖配置文件。Step 404: Save the adjusted component dependency relationship data to a component dependency configuration file.
在一些实施例中,应用服务端中可以包括用于对数据库进行管理的PaaS平台,以及可与该PaaS平台对应的代码服务器。对应地,在获取调整后的组件依赖关系数据后,可将PaaS平台中的数据库中保存调整后的组件依赖关系数据,并可将调整后的组件依赖关系数据,以预设方式发送给代码服务器,对应地,代码服务器获取调整后的组件依赖关系数据,并将组件依赖关系数据写入与应用程序标识信息对应的组件依赖配置文件中。In some embodiments, the application server may include a PaaS platform for managing the database, and a code server corresponding to the PaaS platform. Correspondingly, after obtaining the adjusted component dependency data, the adjusted component dependency data can be saved in the database in the PaaS platform, and the adjusted component dependency data can be sent to the code server in a preset manner. , correspondingly, the code server obtains the adjusted component dependency data, and writes the component dependency data into the component dependency configuration file corresponding to the application identification information.
作为一种示例性的实施方式,应用服务端和代码服务器之间可通过json格式,对组件依赖关系数据进行传输,从而使得代码服务器可获取json格式的组件依赖关系数据,并对json格式的组件依赖关系数据进行解析,以得到组件依赖关系数据,然后,将组件依赖关系数据写入与应用程序标识信息对应的组件依赖配置文件中。As an exemplary implementation, the component dependency data can be transmitted between the application server and the code server in json format, so that the code server can obtain the component dependency data in json format, and the component dependency data in json format can be transmitted. The dependency relationship data is parsed to obtain the component dependency relationship data, and then the component dependency relationship data is written into the component dependency configuration file corresponding to the application identification information.
对应地,在应用程序被触发后,可控制请求端中预先安装的Gradle插件,读取更新后的组件依赖配置文件,并根据更新后的组件依赖配置文件,对应用程序标识信息所对应的应用程序进行编译。由此,使得用户可通过可视化的方式添加组件,减少了用户通过代码添加组件的麻烦,方便了开发,提高了开发效率。Correspondingly, after the application is triggered, the Gradle plug-in pre-installed in the requester can be controlled, the updated component dependency configuration file can be read, and according to the updated component dependency configuration file, the application corresponding to the application identification information can be identified. program to compile. As a result, the user can add components in a visual manner, which reduces the trouble of adding components through code, facilitates development, and improves development efficiency.
在一些实施例中,可通过建立build、同步sync,或者执行某个任务task等方式触发应用程序。In some embodiments, the application can be triggered by establishing a build, synchronizing sync, or executing a certain task task.
在一些实施例中,上述组件添加请求还包括待添加组件的组件标识,在图4所示的实施例的基础上,如图5所示,该方法还可以包括步骤501至步骤503。In some embodiments, the above-mentioned component addition request further includes the component identifier of the component to be added. Based on the embodiment shown in FIG. 4 , as shown in FIG. 5 , the method may further include steps 501 to 503 .
步骤501,查询组件依赖关系数据中是否存在待添加组件信息对应的目标组件。Step 501: Query whether there is a target component corresponding to the component information to be added in the component dependency relationship data.
步骤502,如果存在与待添加组件信息对应的目标组件,则确定目标组件的组件版本号与待添加组件信息所标识组件的组件版本号是否相同。Step 502: If there is a target component corresponding to the component information to be added, determine whether the component version number of the target component is the same as the component version number of the component identified by the component information to be added.
步骤503,如果不同,则根据目标组件和待添加组件信息所标识组件的组件信息,调整组件信息。 Step 503, if different, adjust the component information according to the target component and the component information of the component identified by the component information to be added.
在本申请的实施例中,在请求端添加组件的过程中,从组件依赖关系中获取与待添加组件具有相同组件标识的目标组件,并比较目标组件与待添加组件的组件版本号是否一致,并在两者不一致的情况下,根据目标组件以及待添加组件的组件信息,调整组件版本号存在冲突的组件信息。In the embodiment of the present application, in the process of adding a component at the requesting end, a target component with the same component identifier as the component to be added is obtained from the component dependency relationship, and it is compared whether the component version numbers of the target component and the component to be added are consistent, And in the case of inconsistency between the two, according to the target component and the component information of the component to be added, adjust the component information with conflicting component version numbers.
为了使得本领域技术人员可以清楚了解本申请下面结合图6对添加组件的过程进行示例性描述。其中,本实施例中以应用管理端为paas平台服务端为例进行示意,其中,Paas平台,即(Platform-as-a-Service:平台即服务),把应用服务的运行和开发环境作为一种服务提供的平台。In order for those skilled in the art to clearly understand the present application, a process of adding components is exemplarily described below with reference to FIG. 6 . Among them, in this embodiment, the application management end is the paas platform server end as an example for illustration, wherein, the Paas platform, namely (Platform-as-a-Service: Platform-as-a-Service: Platform-as-a-Service), takes the operation and development environment of the application service as a A platform for providing services.
如图6所示,可以包括步骤601至步骤608。As shown in FIG. 6 , steps 601 to 608 may be included.
步骤601,预先在前端界面录入组件到Paas平台服务端。 Step 601, pre-enter the components on the front-end interface to the Paas platform server.
步骤602,构建不同组件版本将依赖分析数据存入数据库(Data Base)DB。 Step 602, build different component versions and store the dependency analysis data in the database (Data Base) DB.
步骤603,进入APP管理页面,选择APP。 Step 603, enter the APP management page, and select an APP.
步骤604,显示能被APP添加的依赖组件列表。 Step 604, displaying a list of dependent components that can be added by the APP.
步骤605,页面上选择添加的组件,以json串的形式发送给Pass平台服务端。Step 605: Select the added component on the page and send it to the Pass platform server in the form of a json string.
步骤606,Paas平台服务端将数据存存入DB,然后将一律组件列表发送给代码服务器。 Step 606, the Paas platform server stores the data in the DB, and then sends the list of uniform components to the code server.
步骤607,代码服务器上,将json串的依赖列表写入到APP的组件依赖配置文件。Step 607: On the code server, write the dependency list of the json string into the component dependency configuration file of the APP.
例如,json串的形式为:For example, a json string has the form:
{{"scope":"implementation","component_id":"com.test:libraryA","maven_coordinate":"co m.test:libraryA:1.0"},{"scope":"implementation","component_id":"com.test:libraryB","maven_coordinate":"com.test:libraryB:1.0"}}。{{"scope":"implementation","component_id":"com.test:libraryA","maven_coordinate":"co m.test:libraryA:1.0"},{"scope":"implementation","component_id" :"com.test:libraryB","maven_coordinate":"com.test:libraryB:1.0"}}.
步骤608,APP将依赖添加到APP中。 Step 608, the APP adds the dependency to the APP.
在一些实施例中,APP在执行build、sync或者执行某个任务task时触发自定义Gradle插件,通过方法Configuration.getDependencies().addAll(List)动态将依赖添加到APP中。In some embodiments, the APP triggers a custom Gradle plugin when executing build, sync, or executing a certain task, and dynamically adds dependencies to the APP through the method Configuration.getDependencies().addAll(List).
与上述几种实施例提供的解决组件版本冲突的方法相对应,本申请的一种实施例还提供一种解决组件版本冲突的装置,由于本申请实施例提供的解决组件版本冲突的装置与上述几种实施例提供的解决组件版本冲突的方法相对应,因此在解决组件版本冲突的方法的实施方式也适用于本实施例提供的解决组件版本冲突的装置,在本实施例中不再详细描述。Corresponding to the methods for resolving component version conflicts provided by the above-mentioned embodiments, an embodiment of the present application further provides an apparatus for resolving component version conflicts. The methods for resolving component version conflicts provided in several embodiments correspond to each other, so the implementation of the method for resolving component version conflicts is also applicable to the device for resolving component version conflicts provided in this embodiment, which will not be described in detail in this embodiment. .
图7是根据本申请一个实施例的解决组件版本冲突的装置的结构示意图。其中,需要说明的是,本实施例中的装置应用在应用管理服务端。FIG. 7 is a schematic structural diagram of an apparatus for resolving component version conflicts according to an embodiment of the present application. It should be noted that the device in this embodiment is applied to the application management server.
如图7所示,该解决组件版本冲突的装置700包括:As shown in FIG. 7 , the apparatus 700 for resolving component version conflicts includes:
第一接收模块701,用于接收请求端的组件版本设置请求,其中,组件版本设置请求包括应用程序标识信息、为组件版本号存在冲突的第一组件信息所设置的第一组件版本号;A first receiving module 701, configured to receive a component version setting request from a requesting end, wherein the component version setting request includes application identification information and a first component version number set for the first component information with conflicting component version numbers;
第一获取模块702,用于获取与第一组件信息对应的多个第一组件;a first obtaining module 702, configured to obtain a plurality of first components corresponding to the first component information;
第二获取模块703,用于获取与应用程序标识信息对应的组件依赖配置文件;A second obtaining module 703, configured to obtain a component-dependent configuration file corresponding to the application identification information;
配置文件更新模块704,用于将组件依赖配置文件中多个第一组件对应的组件版本号均调整为第一组件版本号,以得到更新后的组件依赖配置文件;The configuration file update module 704 is used to adjust the component version numbers corresponding to the multiple first components in the component dependency configuration file to the first component version numbers, so as to obtain the updated component dependency configuration file;
编译模块705,用于根据更新后的组件依赖配置文件,编译应用程序标识信息对应的应用程序。The compiling module 705 is configured to compile an application program corresponding to the application program identification information according to the updated component dependency configuration file.
在本申请的一个实施例中,该装置还可以包括:In an embodiment of the present application, the device may further include:
第二接收模块,用于接收请求端的查询请求,其中,查询请求包括应用程序标识信息;a second receiving module, configured to receive a query request from a requesting end, wherein the query request includes application identification information;
第三获取模块,用于从预设的数据库中,获取与应用程序标识信息对应的组件查 询结果,其中,组件查询结果包括第一组件信息;The third acquisition module is used to acquire the component query result corresponding to the application identification information from the preset database, wherein the component query result includes the first component information;
发送模块,用于将第一组件信息发送给请求端,以使得请求端上显示第一组件信息。The sending module is configured to send the first component information to the requester, so that the requester displays the first component information.
在本申请的一个实施例中,第三获取模块可以包括:In an embodiment of the present application, the third acquisition module may include:
第一获取单元,用于从预设的数据库中,获取应用程序标识信息所标识的应用程序直接依赖的第二组件信息,其中,第二组件信息中包括多个第二组件各自对应的组件信息;The first obtaining unit is configured to obtain, from a preset database, second component information that an application identified by the application identification information directly depends on, wherein the second component information includes component information corresponding to each of a plurality of second components ;
第二获取单元,用于针对每个第二组件,根据第二组件的组件信息,获取第二组件的第一组件依赖关系数据;a second obtaining unit, configured to obtain, for each second component, the first component dependency relationship data of the second component according to the component information of the second component;
确定单元,用于根据第一组件依赖关系数据,确定组件版本号存在冲突的第三组件信息;a determining unit, configured to determine third component information with conflicting component version numbers according to the first component dependency data;
生成单元,用于根据各个第二组件的第三组件信息,生成第一组件信息。The generating unit is configured to generate the first component information according to the third component information of each second component.
在本申请的一个实施例中,第二获取单元,具体用于:In an embodiment of the present application, the second acquisition unit is specifically used for:
获取组件所直接依赖的目标组件;Get the target component that the component directly depends on;
获取目标组件所直接依赖的组件,直至对应组件所直接依赖的组件为空时结束;Get the components directly dependent on the target component, until the component directly dependent on the corresponding component is empty;
将组件以及所获取到的所有组件依次连接,以得到组件的第一组件依赖关系数据。The components and all the acquired components are connected in sequence to obtain the first component dependency relationship data of the components.
在本申请的一个实施例中,确定单元,具体用于:In an embodiment of the present application, the determining unit is specifically used for:
对第一组件依赖关系数据中的各个组件,将组件标识相同的组件分为一组,以得到多组组件;For each component in the first component dependency data, the components with the same component identification are grouped into one group to obtain multiple groups of components;
判断每组组件中各个组件的组件版本号是否相同,并从多组组件中选出组件版本号不相同的目标组;Determine whether the component version numbers of each component in each group of components are the same, and select target groups with different component version numbers from multiple groups of components;
根据目标组中组件版本号不同的组件,生成第四组件信息。Fourth component information is generated according to components in the target group with different component version numbers.
在本申请的一个实施例中,装置还包括:In an embodiment of the present application, the device further includes:
第三接收模块,用于接收请求端的组件添加请求,其中,组件添加请求包括应用程序标识信息以及待添加组件信息;a third receiving module, configured to receive a component addition request from the requesting end, wherein the component addition request includes application identification information and information about the component to be added;
第四获取模块,用于获取与应用程序标识信息对应的组件依赖关系数据;a fourth acquisition module, configured to acquire component dependency data corresponding to the application identification information;
第一调整模块,用于根据待添加组件信息,调整组件依赖关系数据;a first adjustment module, configured to adjust the component dependency data according to the component information to be added;
保存模块,用于将调整后的组件依赖关系数据保存到组件依赖配置文件。The save module is used to save the adjusted component dependency data to the component dependency configuration file.
在本申请的一个实施例中,组件添加请求还包括待添加组件信息所对应的组件版本号,装置还包括:In an embodiment of the present application, the component addition request further includes a component version number corresponding to the component information to be added, and the device further includes:
查询模块,用于查询组件依赖关系数据中是否存在待添加组件信息对应的目标组件;A query module, used to query whether there is a target component corresponding to the component information to be added in the component dependency data;
确定模块,用于如果存在与待添加组件信息对应的目标组件,则确定目标组件的组件版本号与待添加组件信息所标识组件的组件版本号是否相同;a determining module, configured to determine whether the component version number of the target component is the same as the component version number of the component identified by the component information to be added if there is a target component corresponding to the component information to be added;
第二调整模块,用于如果不同,则根据目标组件和待添加组件信息所标识组件的组件 信息,调整组件信息。The second adjustment module is configured to adjust the component information according to the target component and the component information of the component identified by the component information to be added if they are different.
本申请实施例的解决组件版本冲突的装置,在获取到包括应用程序标识信息、为组件版本号存在冲突的第一组件信息所设置的第一组件版本号的组件版本设置请求后,获取与第一组件信息对应的多个第一组件,并获取与应用程序标识信息对应的组件依赖配置文件,以及将组件依赖配置文件中多个第一组件对应的组件版本号均调整为第一组件版本号,以得到更新后的组件依赖配置文件,并根据更新后的组件依赖配置文件,编译应用程序标识信息对应的应用程序。由此,使得开发人员通过请求端发送一个组件版本设置请求,即可对组件版本号存在冲突的组件信息的组件版本号进行调整,从而无需开发人员手动调整应用程序的代码来解决组件版本号冲突的问题,减少了开发者的操作,减少了开发时间,提高了开发效率。The device for resolving component version conflicts according to the embodiment of the present application, after obtaining the component version setting request including the application identification information and the first component version number set for the first component information with the conflicting component version numbers, obtains the component version setting request with the first component version number. A plurality of first components corresponding to component information, obtain the component dependency configuration file corresponding to the application identification information, and adjust the component version numbers corresponding to the multiple first components in the component dependency configuration file to the first component version number , to obtain the updated component dependency configuration file, and compile the application corresponding to the application identification information according to the updated component dependency configuration file. Therefore, the developer can adjust the component version number of the component information with conflicting component version numbers by sending a component version setting request through the requester, so that the developer does not need to manually adjust the code of the application to resolve the component version number conflict. It reduces the developer's operation, reduces the development time, and improves the development efficiency.
根据本申请的实施例,本申请还提供了一种电子设备和一种可读存储介质。According to the embodiments of the present application, the present application further provides an electronic device and a readable storage medium.
图8是根据本申请一个实施例的电子设备的框图。FIG. 8 is a block diagram of an electronic device according to an embodiment of the present application.
如图8所示,该电子设备该电子设备包括:As shown in Figure 8, the electronic device includes:
存储器801、处理器802及存储在存储器801上并可在处理器802上运行的计算机指令。 Memory 801 , processor 802 , and computer instructions stored on memory 801 and executable on processor 802 .
处理器802执行指令时实现上述实施例中提供的解决组件版本冲突的方法。When the processor 802 executes the instructions, the method for resolving a component version conflict provided in the foregoing embodiment is implemented.
进一步地,电子设备还包括:Further, the electronic device also includes:
通信接口803,用于存储器801和处理器802之间的通信。The communication interface 803 is used for communication between the memory 801 and the processor 802 .
存储器801,用于存放可在处理器802上运行的计算机指令。 Memory 801 is used to store computer instructions executable on processor 802 .
存储器801可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。The memory 801 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk memory.
处理器802,用于执行程序时实现上述实施例的解决组件版本冲突的方法。The processor 802 is configured to implement the method for resolving a component version conflict in the foregoing embodiment when executing the program.
如果存储器801、处理器802和通信接口803独立实现,则通信接口803、存储器801和处理器802可以通过总线相互连接并完成相互间的通信。总线可以是工业标准体系结构(Industry Standard Architecture,简称为ISA)总线、外部设备互连(Peripheral Component,简称为PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,简称为EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图9中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。If the memory 801, the processor 802 and the communication interface 803 are independently implemented, the communication interface 803, the memory 801 and the processor 802 can be connected to each other through a bus and complete communication with each other. The bus may be an Industry Standard Architecture (referred to as ISA) bus, a Peripheral Component (referred to as PCI) bus, or an Extended Industry Standard Architecture (referred to as EISA) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. For ease of presentation, only one thick line is used in FIG. 9, but it does not mean that there is only one bus or one type of bus.
可选的,在具体实现上,如果存储器801、处理器802及通信接口803,集成在一块芯片上实现,则存储器801、处理器802及通信接口803可以通过内部接口完成相互间的通信。Optionally, in terms of specific implementation, if the memory 801, the processor 802 and the communication interface 803 are integrated on one chip, the memory 801, the processor 802 and the communication interface 803 can communicate with each other through an internal interface.
处理器802可能是一个中央处理器(Central Processing Unit,简称为CPU),或者是特定集成电路(Application Specific Integrated Circuit,简称为ASIC),或者是被配置成实施本申请实施例的一个或多个集成电路。The processor 802 may be a central processing unit (Central Processing Unit, referred to as CPU), or a specific integrated circuit (Application Specific Integrated Circuit, referred to as ASIC), or is configured to implement one or more of the embodiments of the present application integrated circuit.
本申请还提出一种计算机程序产品,当计算机程序产品中的指令处理器执行时实现本 申请实施例的解决组件版本冲突的方法。The present application also provides a computer program product, which implements the method for resolving component version conflicts according to the embodiments of the present application when an instruction processor in the computer program product is executed.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, description with reference to the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples", etc., mean specific features described in connection with the embodiment or example , structure, material or feature is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine the different embodiments or examples described in this specification, as well as the features of the different embodiments or examples, without conflicting each other.
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本申请的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。In addition, the terms "first" and "second" are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implying the number of indicated technical features. Thus, a feature delimited with "first", "second" may expressly or implicitly include at least one of that feature. In the description of the present application, "plurality" means at least two, such as two, three, etc., unless expressly and specifically defined otherwise.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现定制逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本申请的实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。Any process or method description in the flowcharts or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing custom logical functions or steps of the process , and the scope of the embodiments of the present application includes alternative implementations in which the functions may be performed out of the order shown or discussed, including performing the functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be Those skilled in the art to which the embodiments of the present application pertain will be understood.
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得程序,然后将其存储在计算机存储器中。The logic and/or steps represented in flowcharts or otherwise described herein, for example, may be considered an ordered listing of executable instructions for implementing the logical functions, may be embodied in any computer-readable medium, For use with, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch instructions from and execute instructions from an instruction execution system, apparatus, or apparatus) or equipment. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport the program for use by or in connection with an instruction execution system, apparatus, or apparatus. More specific examples (non-exhaustive list) of computer readable media include the following: electrical connections with one or more wiring (electronic devices), portable computer disk cartridges (magnetic devices), random access memory (RAM), Read Only Memory (ROM), Erasable Editable Read Only Memory (EPROM or Flash Memory), Fiber Optic Devices, and Portable Compact Disc Read Only Memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program may be printed, as may be done, for example, by optically scanning the paper or other medium, followed by editing, interpretation, or other suitable means as necessary process to obtain the program electronically and then store it in computer memory.
应当理解,本申请的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。如,如果用硬件来实现和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场 可编程门阵列(FPGA)等。It should be understood that various parts of this application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented by any one of the following techniques known in the art, or a combination thereof: discrete with logic gates for implementing logic functions on data signals Logic circuits, application specific integrated circuits with suitable combinational logic gates, Programmable Gate Arrays (PGA), Field Programmable Gate Arrays (FPGA), etc.
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。Those of ordinary skill in the art can understand that all or part of the steps carried by the methods of the above embodiments can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium, and when the program is executed, Include one or a combination of the steps of a method embodiment.
此外,在本申请各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing module, or each unit may exist physically alone, or two or more units may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium.
上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本申请的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施例进行变化、修改、替换和变型。The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, and the like. Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limitations to the present application. Embodiments are subject to variations, modifications, substitutions and variations.

Claims (17)

  1. 一种解决组件版本冲突的方法,包括:A method for resolving component version conflicts, including:
    接收请求端的组件版本设置请求,其中,所述组件版本设置请求包括应用程序标识信息、为组件版本号存在冲突的第一组件信息所设置的第一组件版本号;Receive a component version setting request from the requesting end, wherein the component version setting request includes application identification information and a first component version number set for the first component information whose component version numbers are in conflict;
    获取与所述第一组件信息对应的多个第一组件;acquiring a plurality of first components corresponding to the first component information;
    获取与所述应用程序标识信息对应的组件依赖配置文件;obtaining a component-dependent configuration file corresponding to the application identification information;
    将所述组件依赖配置文件中所述多个第一组件对应的组件版本号均调整为所述第一组件版本号,以得到更新后的组件依赖配置文件;Adjusting the component version numbers corresponding to the multiple first components in the component dependency configuration file to the first component version numbers to obtain an updated component dependency configuration file;
    根据所述更新后的组件依赖配置文件,编译所述应用程序标识信息对应的应用程序。The application corresponding to the application identification information is compiled according to the updated component dependency configuration file.
  2. 如权利要求1所述的方法,其中所述接收请求端的组件版本设置请求之前,所述方法还包括:The method according to claim 1, wherein before the receiving the request for setting the component version of the requester, the method further comprises:
    接收所述请求端的查询请求,其中,所述查询请求包括所述应用程序标识信息;receiving a query request from the requester, wherein the query request includes the application identification information;
    从预设的数据库中,获取与所述应用程序标识信息对应的组件查询结果,其中,所述组件查询结果包括所述第一组件信息;Obtain, from a preset database, a component query result corresponding to the application identification information, wherein the component query result includes the first component information;
    将所述第一组件信息发送给所述请求端,以使得所述请求端上显示所述第一组件信息。Sending the first component information to the requester, so that the requester displays the first component information.
  3. 如权利要求2所述的方法,其中所述从预设的数据库中,获取与所述应用程序标识信息对应的组件查询结果,包括:The method according to claim 2, wherein the obtaining the component query result corresponding to the application identification information from a preset database comprises:
    从所述预设的数据库中,获取所述应用程序标识信息所标识的应用程序直接依赖的第二组件信息,其中,所述第二组件信息中包括多个第二组件各自对应的组件信息;Acquiring, from the preset database, second component information on which the application identified by the application identification information directly depends, wherein the second component information includes component information corresponding to each of a plurality of second components;
    针对每个第二组件,根据所述第二组件的组件信息,获取所述第二组件的第一组件依赖关系数据;For each second component, obtain the first component dependency relationship data of the second component according to the component information of the second component;
    根据所述第一组件依赖关系数据,确定组件版本号存在冲突的第三组件信息;According to the first component dependency relationship data, determine third component information with conflicting component version numbers;
    根据各个所述组件的所述第三组件信息,生成所述第一组件信息。The first component information is generated according to the third component information of each of the components.
  4. 如权利要求3所述的方法,其中所述根据所述第二组件的组件信息,获取所述第二组件的第一组件依赖关系数据,包括:The method according to claim 3, wherein the obtaining the first component dependency relationship data of the second component according to the component information of the second component comprises:
    获取所述第二组件所直接依赖的目标组件;Obtain the target component that the second component directly depends on;
    获取所述目标组件所直接依赖的组件,直至对应组件所直接依赖的组件为空时结束;Obtain the component directly dependent on the target component, and end when the component directly dependent on the corresponding component is empty;
    将所述第二组件以及所获取到的所有组件依次连接,以得到所述第二组件的第一组件依赖关系数据。Connect the second component and all the obtained components in sequence to obtain the first component dependency relationship data of the second component.
  5. 如权利要求3所述的方法,其中所述根据所述第一组件依赖关系数据,确定组件版本号存在冲突的第三组件信息,包括:The method according to claim 3, wherein the determining, according to the first component dependency relationship data, the third component information with conflicting component version numbers, comprising:
    对所述第一组件依赖关系数据中的各个组件,将组件标识相同的组件分为一组,以得到多组组件;For each component in the first component dependency data, the components with the same component identification are grouped into one group to obtain multiple groups of components;
    判断每组组件中各个组件的组件版本号是否相同,并从所述多组组件中选出组件版本号不相同的目标组;Determine whether the component version numbers of each component in each group of components are the same, and select target groups with different component version numbers from the multiple groups of components;
    根据所述目标组中组件版本号不同的组件,生成所述第三组件信息。The third component information is generated according to components in the target group with different component version numbers.
  6. 如权利要求1所述的方法,还包括:The method of claim 1, further comprising:
    接收所述请求端的组件添加请求,其中,所述组件添加请求包括所述应用程序标识信息以及待添加组件信息;receiving a component addition request from the requester, wherein the component addition request includes the application identification information and the component to be added information;
    获取与所述应用程序标识信息对应的组件依赖关系数据;obtaining component dependency data corresponding to the application identification information;
    根据所述待添加组件信息,调整所述组件依赖关系数据;adjusting the component dependency data according to the component information to be added;
    将调整后的组件依赖关系数据保存到所述组件依赖配置文件。Save the adjusted component dependency data to the component dependency configuration file.
  7. 如权利要求6所述的方法,其中所述组件添加请求还包括所述待添加组件信息所对应的组件版本号,所述方法还包括:The method of claim 6, wherein the component addition request further includes a component version number corresponding to the component information to be added, and the method further includes:
    查询所述组件依赖关系数据中是否存在所述待添加组件信息对应的目标组件;query whether the target component corresponding to the to-be-added component information exists in the component dependency relationship data;
    如果存在与所述待添加组件信息对应的目标组件,则确定所述目标组件的组件版本号与所述待添加组件信息所标识组件的组件版本号是否相同;If there is a target component corresponding to the component information to be added, determine whether the component version number of the target component is the same as the component version number of the component identified by the component information to be added;
    如果不同,则根据所述目标组件和所述待添加组件信息所标识组件的组件信息,调整所述组件信息。If different, the component information is adjusted according to the target component and the component information of the component identified by the to-be-added component information.
  8. 一种解决组件版本冲突的装置,包括:A means of resolving component version conflicts, including:
    第一接收模块,用于接收请求端的组件版本设置请求,其中,所述组件版本设置请求包括应用程序标识信息、为组件版本号存在冲突的第一组件信息所设置的第一组件版本号;a first receiving module, configured to receive a component version setting request from a requesting end, wherein the component version setting request includes application identification information and a first component version number set for the first component information with conflicting component version numbers;
    第一获取模块,用于获取与所述第一组件信息对应的多个第一组件;a first obtaining module, configured to obtain a plurality of first components corresponding to the first component information;
    第二获取模块,用于获取与所述应用程序标识信息对应的组件依赖配置文件;a second obtaining module, configured to obtain a component-dependent configuration file corresponding to the application identification information;
    配置文件更新模块,用于将所述组件依赖配置文件中所述多个第一组件对应的组件版本号均调整为所述第一组件版本号,以得到更新后的组件依赖配置文件;A configuration file update module, configured to adjust the component version numbers corresponding to the multiple first components in the component dependency configuration file to the first component version numbers, so as to obtain an updated component dependency configuration file;
    编译模块,用于根据所述更新后的组件依赖配置文件,编译所述应用程序标识信息对应的应用程序。A compiling module, configured to compile an application program corresponding to the application program identification information according to the updated component dependency configuration file.
  9. 如权利要求8所述的装置,还包括:The apparatus of claim 8, further comprising:
    第二接收模块,用于接收所述请求端的查询请求,其中,所述查询请求包括所述应用程序标识信息;a second receiving module, configured to receive a query request from the requester, wherein the query request includes the application identification information;
    第三获取模块,用于从预设的数据库中,获取与所述应用程序标识信息对应的组件查询结果,其中,所述组件查询结果包括所述第一组件信息;a third obtaining module, configured to obtain a component query result corresponding to the application identification information from a preset database, wherein the component query result includes the first component information;
    发送模块,用于将所述第一组件信息发送给所述请求端,以使得所述请求端上显示所述第一组件信息。A sending module, configured to send the first component information to the requester, so that the requester displays the first component information.
  10. 如权利要求9所述的装置,其中所述第三获取模块,包括:The apparatus of claim 9, wherein the third acquisition module comprises:
    第一获取单元,用于从所述预设的数据库中,获取所述应用程序标识信息所标识的应用程序直接依赖的第二组件信息,其中,所述第二组件信息中包括多个第二组件各自对应的组件信息;The first obtaining unit is configured to obtain, from the preset database, second component information that the application identified by the application identification information directly depends on, wherein the second component information includes a plurality of second components. Component information corresponding to each component;
    第二获取单元,用于针对每个第二组件,根据所述第二组件的组件信息,获取所述 第二组件的第一组件依赖关系数据;a second obtaining unit, configured to obtain, for each second component, the first component dependency data of the second component according to the component information of the second component;
    确定单元,用于根据所述第一组件依赖关系数据,确定组件版本号存在冲突的第三组件信息;a determining unit, configured to determine third component information with conflicting component version numbers according to the first component dependency data;
    生成单元,用于根据各个所述第二组件的所述第三组件信息,生成所述第一组件信息。A generating unit, configured to generate the first component information according to the third component information of each of the second components.
  11. 如权利要求10所述的装置,其中所述第二获取单元进一步用于:The apparatus of claim 10, wherein the second obtaining unit is further configured to:
    获取所述组件所直接依赖的目标组件;Obtain the target component that the component directly depends on;
    获取所述目标组件所直接依赖的组件,直至对应组件所直接依赖的组件为空时结束;Obtain the component directly dependent on the target component, and end when the component directly dependent on the corresponding component is empty;
    将所述组件以及所获取到的所有组件依次连接,以得到所述组件的第一组件依赖关系数据。Connect the components and all the obtained components in sequence to obtain the first component dependency relationship data of the components.
  12. 如权利要求10所述的装置,其中所述确定单元进一步用于:The apparatus of claim 10, wherein the determining unit is further configured to:
    对所述第一组件依赖关系数据中的各个组件,将组件标识相同的组件分为一组,以得到多组组件;For each component in the first component dependency data, the components with the same component identification are grouped into one group to obtain multiple groups of components;
    判断每组组件中各个组件的组件版本号是否相同,并从所述多组组件中选出组件版本号不相同的目标组;Determine whether the component version numbers of each component in each group of components are the same, and select target groups with different component version numbers from the multiple groups of components;
    根据所述目标组中组件版本号不同的组件,生成所述第四组件信息。The fourth component information is generated according to components in the target group with different component version numbers.
  13. 如权利要求8所述的装置,还包括:The apparatus of claim 8, further comprising:
    第三接收模块,用于接收所述请求端的组件添加请求,其中,所述组件添加请求包括所述应用程序标识信息以及待添加组件信息;A third receiving module, configured to receive a component addition request from the requester, wherein the component addition request includes the application identification information and the component information to be added;
    第四获取模块,用于获取与所述应用程序标识信息对应的组件依赖关系数据;a fourth acquisition module, configured to acquire component dependency data corresponding to the application identification information;
    第一调整模块,用于根据所述待添加组件信息,调整所述组件依赖关系数据;a first adjustment module, configured to adjust the component dependency relationship data according to the to-be-added component information;
    保存模块,用于将调整后的组件依赖关系数据保存到所述组件依赖配置文件。The saving module is used for saving the adjusted component dependency relationship data to the component dependency configuration file.
  14. 如权利要求13所述的装置,其中所述组件添加请求还包括所述待添加组件信息所对应的组件版本号,所述装置还包括:The apparatus according to claim 13, wherein the component addition request further includes a component version number corresponding to the component information to be added, and the apparatus further includes:
    查询模块,用于查询所述组件依赖关系数据中是否存在所述待添加组件信息对应的目标组件;a query module, configured to query whether there is a target component corresponding to the to-be-added component information in the component dependency relationship data;
    确定模块,用于如果存在与所述待添加组件信息对应的目标组件,则确定所述目标组件的组件版本号与所述待添加组件信息所标识组件的组件版本号是否相同;a determining module, configured to determine whether the component version number of the target component is the same as the component version number of the component identified by the component information to be added if there is a target component corresponding to the component information to be added;
    第二调整模块,用于如果不同,则根据所述目标组件和所述待添加组件信息所标识组件的组件信息,调整所述组件信息。A second adjustment module, configured to adjust the component information according to the target component and the component information of the component identified by the to-be-added component information if they are different.
  15. 一种电子设备,包括:An electronic device comprising:
    存储器,memory,
    处理器;processor;
    其中所述存储器中存储有计算机指令,当所述计算机指令被所述处理器执行时,实现如权利要求1-7中任一项所述的解决组件版本冲突的方法。The memory stores computer instructions, and when the computer instructions are executed by the processor, implements the method for resolving a component version conflict according to any one of claims 1-7.
  16. 一种存储有计算机指令的非瞬时计算机可读存储介质,其中所述计算机指令用 于使所述计算机执行权利要求1-7中任一项所述的解决组件版本冲突的方法。A non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the method for resolving component version conflicts of any of claims 1-7.
  17. 一种计算机程序产品,其中当所述计算机程序产品中的指令处理器执行时实现如权利要求1-7中任一项所述的解决组件版本冲突的方法。A computer program product wherein, when executed by an instruction processor in the computer program product, the method for resolving a component version conflict as claimed in any one of claims 1-7 is implemented.
PCT/CN2021/140190 2021-03-25 2021-12-21 Method for resolving component version conflict, device, and storage medium WO2022199160A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110321895.9A CN115202714A (en) 2021-03-25 2021-03-25 Method, device and storage medium for resolving component version conflict
CN202110321895.9 2021-03-25

Publications (1)

Publication Number Publication Date
WO2022199160A1 true WO2022199160A1 (en) 2022-09-29

Family

ID=83396295

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/140190 WO2022199160A1 (en) 2021-03-25 2021-12-21 Method for resolving component version conflict, device, and storage medium

Country Status (2)

Country Link
CN (1) CN115202714A (en)
WO (1) WO2022199160A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7032033B1 (en) * 2001-11-30 2006-04-18 Microsoft Corporation Handling collisions during synchronization of data between client and server computers
CN106293763A (en) * 2016-08-19 2017-01-04 广州唯品会信息科技有限公司 The management method of application component version and device
CN110737460A (en) * 2019-09-04 2020-01-31 厦门网宿有限公司 platform project management method and device
CN111967017A (en) * 2020-07-28 2020-11-20 深圳开源互联网安全技术有限公司 Method and device for generating dependency relationship, terminal equipment and storage medium
CN112214408A (en) * 2020-10-12 2021-01-12 北京字节跳动网络技术有限公司 Dependency conflict detection method and device, electronic equipment and computer readable medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7032033B1 (en) * 2001-11-30 2006-04-18 Microsoft Corporation Handling collisions during synchronization of data between client and server computers
CN106293763A (en) * 2016-08-19 2017-01-04 广州唯品会信息科技有限公司 The management method of application component version and device
CN110737460A (en) * 2019-09-04 2020-01-31 厦门网宿有限公司 platform project management method and device
CN111967017A (en) * 2020-07-28 2020-11-20 深圳开源互联网安全技术有限公司 Method and device for generating dependency relationship, terminal equipment and storage medium
CN112214408A (en) * 2020-10-12 2021-01-12 北京字节跳动网络技术有限公司 Dependency conflict detection method and device, electronic equipment and computer readable medium

Also Published As

Publication number Publication date
CN115202714A (en) 2022-10-18

Similar Documents

Publication Publication Date Title
US7614042B1 (en) System and method for selecting applicable tests in an automation testing system
US20230244465A1 (en) Systems and methods for automated retrofitting of customized code objects
JP5475979B2 (en) Method and apparatus for providing project development environment and project development system (method and apparatus for providing project development environment and project development system)
US8434062B2 (en) Enhancing source code debugging and readability using visual symbols
US20110307860A1 (en) Simulation-based interface testing automation system and method for robot software components
CN111428462A (en) Communication protocol template construction method and terminal equipment
US11675575B2 (en) Checking source code validity at time of code update
JPH11316696A (en) Relocatable measuring tag for testing and debugging of computer program
US9043757B2 (en) Identifying differences between source codes of different versions of a software when each source code is organized using incorporated files
CN108170465B (en) Version information management method, electronic equipment and readable storage medium
US8600925B2 (en) Object-relational mapped database initialization
US9304893B1 (en) Integrated software development and test case management system
US20210103514A1 (en) Reusable test cases for identifiable patterns
CN107203535B (en) Information query method and device
US8676627B2 (en) Vertical process merging by reconstruction of equivalent models and hierarchical process merging
US10275234B2 (en) Selective bypass of code flows in software program
US20220283885A1 (en) Application programming interface compatibility
US20160124795A1 (en) Evaluation method and apparatus
US9395977B2 (en) Locating program code units after software refactoring
US20120151441A1 (en) Efficient generation of executable file from program files when some of the program files expressly incorporate other program files
US20200097260A1 (en) Software application developer tools platform
WO2022199160A1 (en) Method for resolving component version conflict, device, and storage medium
CN111858959A (en) Method and device for generating component relation map, computer equipment and storage medium
CN111240987A (en) Migration program detection method and device, electronic equipment and computer readable storage medium
JP5377522B2 (en) Efficiently correlate nominally incompatible types

Legal Events

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

Ref document number: 21932767

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE