Method and apparatus for upgrading functional components, electronic device, and storage medium
Patent Information
- Application Number
- CN202310806841.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-03
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-07-03
AI Technical Summary
然而,虽然不同功能组件对应不同的代码库,但由于不同功能组件对应的代码库中的代码文件可能相互交叉,导致无法直接对各个功能组件进行独立升级
Smart Images

Figure CN116820554B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of software testing, and more specifically, to a method for upgrading a functional component, a device for upgrading a functional component, an electronic device, and a computer storage medium. Background Technology
[0002] In application development, in addition to developing the main functions of the application, it is also necessary to integrate some additional functions. For example, taking a game application as an example, in addition to implementing the game function, it is also necessary to integrate some additional functional components to implement additional functions, such as login, payment, and sharing components. However, although different functional components correspond to different code libraries, the code files in the code libraries of different functional components may overlap, making it impossible to directly upgrade each functional component independently. Summary of the Invention
[0003] This disclosure provides at least one method, apparatus, electronic device, and computer-readable storage medium for upgrading functional components, enabling independent upgrading of functional components.
[0004] This disclosure provides a method for upgrading a functional component, including:
[0005] Obtain the upgrade file for the target functional component; the upgrade file includes at least one sub-upgrade file;
[0006] For each sub-upgrade file, determine whether there is a shared code file corresponding to the sub-upgrade file in the shared code library of the code repository; the code repository includes a shared code library and sub-code libraries corresponding to multiple functional components respectively; the shared code library is used to store shared code files, and the shared code file refers to a code file referenced by two or more functional components.
[0007] If the shared code library does not include a shared code file corresponding to each sub-upgrade file, for each sub-upgrade file, determine whether the sub-code library corresponding to the other functional components among the plurality of functional components (excluding the target functional component) includes a code file corresponding to the sub-upgrade file;
[0008] If none of the sub-code libraries corresponding to the other functional components contain code files corresponding to each sub-upgrade file, the target functional component is upgraded based on the upgrade file.
[0009] In this embodiment of the disclosure, since the code library includes a shared code library and multiple sub-code libraries corresponding to each functional component, when upgrading a target functional component, if the upgrade file of the target functional component does not affect the shared code files in the shared code library and the upgrade file does not affect other functional components, the target functional component can be upgraded independently, thereby improving the efficiency of functional component upgrades.
[0010] In one possible implementation, the method further includes:
[0011] For each sub-upgrade file, if the sub-code library corresponding to the other functional components includes a code file corresponding to the sub-upgrade file, determine whether the target other functional components including the code file corresponding to the sub-upgrade file are compatible with the sub-upgrade file;
[0012] If each target functional component is compatible with the corresponding sub-upgrade file, the target functional component is upgraded based on the upgrade file.
[0013] In this embodiment of the disclosure, by determining whether the target other functional components, including the code file corresponding to the sub-upgrade file, are compatible with the corresponding sub-upgrade file, it can be ensured that the target other functional components are not affected. Thus, when each target other functional component is compatible with the corresponding sub-upgrade file, the target functional components can be independently upgraded based on the upgrade file, thereby improving the efficiency of the target functional component upgrade.
[0014] In one possible implementation, the codebase is determined in the following way:
[0015] Obtain a software development kit (SDK) set; the SSD set includes multiple code file packages corresponding to various functional components, each code file package includes at least one code file, wherein at least two code file packages contain the same code file;
[0016] The code files existing in different code file packages are identified as the common code files, and the common code library is generated based on the common code files;
[0017] Based on the code files individually referenced by each functional component, a sub-code library corresponding to each functional component is generated;
[0018] The code library is generated based on the shared code library and the sub-code libraries corresponding to each functional component.
[0019] In this embodiment of the disclosure, code files existing in different code file packages are used to generate a common code library, and a sub-code library corresponding to each functional component is generated based on the code files referenced separately by each functional component. In this way, when upgrading functional components in the future, corresponding upgrade detection can be performed based on the common code library and each sub-code library to ensure the normal upgrade of functional components.
[0020] In one possible implementation, the method further includes:
[0021] For each shared code file in the shared code library, if the shared code file is changed, determine whether the functional components that reference the shared code file can implement the corresponding functions;
[0022] If a functional component that references the shared code file can perform the corresponding function, the shared code file is moved from the shared code library into the sub-code library corresponding to the functional component that references the shared code file.
[0023] In this embodiment of the disclosure, when the shared code file is changed and the functional component referencing the shared code file can perform the corresponding function, it is explained that the functional component referencing the shared code file can be compatible with the shared code file at the same time. In this way, the shared code file can be moved into the corresponding sub-code library, thereby reducing the cross-dependency between the sub-code libraries corresponding to the functional components that share the shared code file.
[0024] In one possible implementation, the method further includes:
[0025] For each sub-upgrade file, if a corresponding common code file exists in the common code repository, the software development kit set is updated based on the sub-upgrade file;
[0026] The codebase is updated based on the updated software development kit set to obtain the updated codebase.
[0027] In this embodiment of the disclosure, if a shared code file corresponding to the sub-upgrade file exists in the shared code library, it means that the sub-upgrade file cannot be directly used for functional component upgrades, which will cause errors in other functional components that reference the sub-upgrade file. Therefore, the software development kit collection can be updated based on the sub-upgrade file, thereby ensuring the normal update of the target functional components based on the updated code library.
[0028] In one possible implementation, the method further includes:
[0029] For each target other functional component, if the target other functional component is incompatible with the corresponding sub-upgrade file, the software development kit set is updated based on the sub-upgrade file corresponding to the target other functional component;
[0030] The codebase is updated based on the updated software development kit set.
[0031] In this embodiment of the disclosure, if other target functional components are not compatible with the corresponding sub-upgrade file, it means that other target functional components cannot be independently updated based on the sub-upgrade file. Therefore, the software development kit collection can be updated based on the sub-upgrade file, thereby ensuring the normal update of the target functional components based on the updated code library.
[0032] In one possible implementation, the method further includes:
[0033] For each target other functional component, if the target other functional component is compatible with the corresponding sub-upgrade file, in response to the upgrade operation for the target other functional component, the target other functional component is upgraded based on the sub-upgrade file corresponding to the target other functional component.
[0034] In this embodiment of the disclosure, if the target other functional components are compatible with the corresponding sub-upgrade files, it means that the target other functional components can be upgraded independently based on the corresponding sub-upgrade files, thereby improving the upgrade efficiency of the target other functional components.
[0035] This disclosure provides an upgrade device for a functional component, including:
[0036] The file acquisition module is used to acquire upgrade files for the target functional component; the upgrade file includes at least one sub-upgrade file;
[0037] The first determining module is used to determine, for each sub-upgrade file, whether there is a shared code file corresponding to the sub-upgrade file in the shared code library of the code repository; the code library includes a shared code library and sub-code libraries corresponding to multiple functional components respectively; the shared code library is used to store shared code files, and the shared code file refers to a code file referenced by two or more functional components.
[0038] The second determining module is used to determine, for each sub-upgrade file, whether the sub-code library corresponding to the other functional components among the plurality of functional components (excluding the target functional component) includes a code file corresponding to the sub-upgrade file, in the case where the shared code library does not include a shared code file corresponding to each sub-upgrade file.
[0039] The component upgrade module is used to upgrade the target functional component based on the upgrade file when the code files corresponding to each sub-upgrade file are not included in the sub-code libraries corresponding to the other functional components.
[0040] In one possible implementation, the second determining module is specifically used for:
[0041] For each sub-upgrade file, if the sub-code library corresponding to the other functional components includes a code file corresponding to the sub-upgrade file, determine whether the target other functional components including the code file corresponding to the sub-upgrade file are compatible with the sub-upgrade file;
[0042] If each target functional component is compatible with the corresponding sub-upgrade file, the target functional component is upgraded based on the upgrade file.
[0043] In one possible implementation, the apparatus further includes a codebase generation module, the codebase generation module being used for:
[0044] Obtain a software development kit (SDK) set; the SSD set includes multiple code file packages corresponding to various functional components, each code file package includes at least one code file, wherein at least two code file packages contain the same code file;
[0045] The code files existing in different code file packages are identified as the common code files, and the common code library is generated based on the common code files;
[0046] Based on the code files individually referenced by each functional component, a sub-code library corresponding to each functional component is generated;
[0047] The code library is generated based on the shared code library and the sub-code libraries corresponding to each functional component.
[0048] In one possible implementation, the codebase generation module is further configured to:
[0049] For each shared code file in the shared code library, if the shared code file is changed, determine whether the functional components that reference the shared code file can implement the corresponding functions;
[0050] If a functional component that references the shared code file can perform the corresponding function, the shared code file is moved from the shared code library into the sub-code library corresponding to the functional component that references the shared code file.
[0051] In one possible implementation, the first determining module is further configured to:
[0052] For each sub-upgrade file, if a corresponding common code file exists in the common code repository, the software development kit set is updated based on the sub-upgrade file;
[0053] The codebase is updated based on the updated software development kit set to obtain the updated codebase.
[0054] In one possible implementation, the second determining module is further configured to:
[0055] For each target other functional component, if the target other functional component is incompatible with the corresponding sub-upgrade file, the software development kit set is updated based on the sub-upgrade file corresponding to the target other functional component;
[0056] The codebase is updated based on the updated software development kit set.
[0057] In one possible implementation, the component upgrade module is further configured to:
[0058] For each target other functional component, if the target other functional component is compatible with the corresponding sub-upgrade file, in response to the upgrade operation for the target other functional component, the target other functional component is upgraded based on the sub-upgrade file corresponding to the target other functional component.
[0059] This disclosure also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the functional component upgrade method described in any of the above possible embodiments are performed.
[0060] This disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the method for upgrading the functional components described in any of the possible embodiments above.
[0061] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0062] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.
[0063] Figure 1 A flowchart illustrating a method for upgrading functional components provided in some embodiments of this disclosure is shown;
[0064] Figure 2 A flowchart illustrating a method for generating a code library provided in some embodiments of this disclosure is shown;
[0065] Figure 3 A schematic diagram is shown of a collection of software tool development kits provided in some embodiments of this disclosure;
[0066] Figure 4 A schematic diagram of the code library provided in some embodiments of this disclosure is shown;
[0067] Figure 5 A schematic diagram of the code library provided by other embodiments of this disclosure is shown;
[0068] Figure 6 A flowchart illustrating a method for generating a code library provided in other embodiments of this disclosure is shown;
[0069] Figure 7 A schematic diagram of the structure of an upgrade device for functional components provided in some embodiments of this disclosure is shown;
[0070] Figure 8 A schematic diagram of the structure of an upgrade device for functional components provided in other embodiments of this disclosure is shown;
[0071] Figure 9 A schematic diagram of an electronic device provided in some embodiments of the present disclosure is shown. Detailed Implementation
[0072] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.
[0073] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0074] In this document, the term "and / or" merely describes a relationship, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0075] Research has revealed that in the application development process, in addition to developing the main functions of the application, it is also necessary to integrate some additional functions. For example, taking game applications as an example, in addition to implementing the game functions, it is also necessary to integrate some additional functional components to implement additional functions, such as login components, payment components, and sharing components. However, although different functional components correspond to different code libraries, the code files in the code libraries corresponding to different functional components may overlap, making it impossible to directly upgrade each functional component independently.
[0076] Based on the above research, this disclosure provides a method for upgrading a functional component. First, an upgrade file for the target functional component is obtained. Second, for each sub-upgrade file, it is determined whether a shared code file corresponding to the sub-upgrade file exists in a shared code library within the code repository. The code repository includes a shared code library and multiple sub-code libraries corresponding to each functional component. The shared code library stores shared code files, which are code files referenced by two or more functional components. Then, if the shared code file corresponding to each sub-upgrade file is not found in the shared code library, for each sub-upgrade file, it is determined whether the sub-code libraries corresponding to other functional components (excluding the target functional component) contain a code file corresponding to the sub-upgrade file. Finally, if the sub-code libraries corresponding to other functional components do not contain a code file corresponding to each sub-upgrade file, the target functional component is upgraded based on the upgrade file.
[0077] In this embodiment of the disclosure, since the code library includes a shared code library and multiple sub-code libraries corresponding to each functional component, when upgrading a target functional component, if the upgrade file of the target functional component does not affect the shared code files in the shared code library and the upgrade file does not affect other functional components, the target functional component can be upgraded independently, thereby improving the efficiency of functional component upgrades.
[0078] To facilitate understanding of this embodiment, the executing entity of the functional component upgrade method provided in this disclosure will first be described in detail. The executing entity of the functional component upgrade method provided in this disclosure is an electronic device. In this embodiment, the electronic device is a server, which can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, big data, and artificial intelligence platforms. In other embodiments, the electronic device can also be a terminal device. This terminal device can be a mobile device, user terminal, handheld device, computing device, or wearable device, etc. Furthermore, the functional component upgrade method can also be implemented by a processor calling computer-readable instructions stored in memory.
[0079] The method for upgrading functional components provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings. See also Figure 1 The diagram shows a flowchart of a method for upgrading a functional component according to an embodiment of this disclosure. The method includes steps S101 to S107, wherein:
[0080] S101, Obtain the upgrade file for the target functional component; the upgrade file includes at least one sub-upgrade file.
[0081] Here, a component can refer to a simple encapsulation of data and methods. The target functional component refers to a component used to implement a target function, such as a login function component, a payment function component, or a sharing function component. Each functional component can be reused by different target applications, thereby enabling the target application to have the corresponding function. In this embodiment, the target application can refer to a game application.
[0082] The upgrade file refers to the code file required to upgrade the target functional component, and the sub-upgrade file can refer to a sub-code file. It is understood that since the target functional component can implement its corresponding function based on one or more code files, the upgrade file may include at least one sub-upgrade file.
[0083] S102, for each sub-upgrade file, determine whether there is a shared code file corresponding to the sub-upgrade file in the shared code library in the code repository; the code library includes a shared code library and sub-code libraries corresponding to multiple functional components respectively, the shared code library is used to store shared code files, and the shared code file refers to a code file referenced by two or more functional components.
[0084] It is important to emphasize that since a shared code file is a code file referenced by two or more functional components, if one of the functional components that references the shared code file modifies the shared code file, it will affect the functionality of the other functional components.
[0085] To clearly explain the meaning of the above steps, we will first provide a detailed explanation of the process of determining the code repository and the contents of the code repository.
[0086] Please see Figure 2 This is a flowchart illustrating a code library generation method provided in some embodiments of this disclosure. For example... Figure 2 As shown, the codebase generation method may include the following steps S201 to S204:
[0087] S201, Obtain a software development kit set; the software development kit set includes multiple code file packages corresponding to each functional component, each code file package includes at least one code file, wherein at least two code file packages contain the same code file.
[0088] For example, please see Figure 3 This is a schematic diagram illustrating a collection of software development toolkits provided in some embodiments of this disclosure. For example... Figure 3As shown, the software development kit collection includes code file packages corresponding to the sharing function component, the login function component, and the payment function component. Specifically, the code file package corresponding to the sharing function component includes code files 6, 7, and 3; the code file package corresponding to the login function component includes code files 1, 2, and 3; and the code file package corresponding to the payment function component includes code files 4, 5, and 2. Furthermore, the code file packages corresponding to the sharing function component and the login function component share the same code file 3, and the code file packages corresponding to the login function component and the payment function component share the same code file 2.
[0089] S202, the code files existing in different code file packages are identified as the common code files, and the common code library is generated based on the common code files.
[0090] It is understandable that if a code file exists in different code file packages, it means that the code file is a shared code file. Therefore, the code file can be identified as a shared code file.
[0091] For example, please see Figure 4 The above is a schematic diagram of a code library provided in some embodiments of this disclosure. As can be seen from the above embodiments, the code files existing in different code file packages can refer to code file 2 and code file 3. In this way, a shared code library can be generated based on code file 2 and code file 3.
[0092] S203, based on the code files individually referenced by each functional component, generate a sub-code library corresponding to each functional component.
[0093] It should be understood that the code files referenced by each functional component are independent of other functional components. For ease of management, a sub-code library corresponding to each functional component can be generated based on the individually referenced code files.
[0094] Please see again Figure 4 For the sharing function component, its separately referenced code files include code file 6 and code file 7, so a sub-code library A corresponding to the sharing function component can be generated based on code file 6 and code file 7; for the login function component, its separately referenced code file includes code file 1, so a sub-code library B corresponding to the login function component can be generated based on code file 1; for the payment function component, its separately referenced code files include code file 4 and code file 5, so a sub-code library C corresponding to the payment function component can be generated based on code file 4 and code file 5.
[0095] S204, Based on the shared code library and the sub-code libraries corresponding to each functional component, generate the code library.
[0096] It should be understood that once the common codebase and the sub-codebases corresponding to each functional component are determined, the codebase can be generated based on the common codebase and the sub-codebases corresponding to each functional component.
[0097] In some implementations, after generating the code library, the method further includes: for each shared code file in the shared code library, if the shared code file is changed, determining whether the functional component referencing the shared code file can perform the corresponding function; if the functional component referencing the shared code file can perform the corresponding function, moving the shared code file from the shared code library into the sub-code library corresponding to the functional component referencing the shared code file.
[0098] For example, please see Figure 5 This is a schematic diagram illustrating the code library provided in other embodiments of this disclosure. Please also refer to... Figure 4 and Figure 5 , Figure 4 The shared code files include shared code file 2 and shared code file 3. For shared code file 2, it can be determined whether shared code file 2 is compatible with the functional components that reference it. If incompatible, a shared code library is generated based on shared code file 2. If compatible, the shared code file can be added to the sub-code library corresponding to the login functional component and the sub-code library corresponding to the payment component; that is, shared code file 2 is added to sub-code library B and sub-code library C (e.g., ...). Figure 5 (As shown). Similarly, the shared code file 3 can also be processed according to the above process, which will not be elaborated here.
[0099] In this embodiment, for each shared code file, it is checked whether the components referencing the shared code file are compatible with it. If they are compatible, they can be divided into corresponding sub-code libraries. This reduces the coupling between the sub-code libraries corresponding to each functional component, thereby improving the efficiency of subsequent independent upgrades of functional components.
[0100] Here, when testing compatibility, a corresponding testing script file can be written in advance, and compatibility testing can be performed based on the script file.
[0101] Here, in step S102, it is determined whether the sub-upgrade file will affect the functionality of other functional components by determining whether there is a shared code file corresponding to the sub-upgrade file in the shared code library of the code library. That is, since the sub-upgrade file is corresponding to the target functional component, the above-mentioned judgment process of step S102 is required.
[0102] The following explanation uses the login function component as an example. The upgrade files corresponding to the login function component include sub-upgrade file 11 and sub-upgrade file 12. Please refer to [link / reference] again. Figure 3 , Figure 3 The shared codebase shown includes shared code file 3. For sub-upgrade file 11, it is determined whether there is a shared code file corresponding to sub-upgrade file 11 in the shared codebase of the codebase. If there is, the upgrade of the login function component is stopped. Similarly, for sub-upgrade file 12, if there is a shared code file corresponding to sub-upgrade file 12 in the shared codebase, the upgrade of the login function component is stopped.
[0103] S103, if the shared code library does not include a shared code file corresponding to each sub-upgrade file, for each sub-upgrade file, determine whether the sub-code library corresponding to the other functional components among the plurality of functional components (excluding the target functional component) includes a code file corresponding to the sub-upgrade file.
[0104] If the shared code repository does not include the shared code file corresponding to each sub-upgrade file in this step, it means that the upgrade file does not affect the functionality of other functional components, and subsequent steps can be performed. For an example, please refer to [link / reference]. Figure 5 Since the shared code library includes shared code file 3, meaning the shared code library does not include the shared code file corresponding to each sub-upgrade file (sub-upgrade file 11 and sub-upgrade file 12), the subsequent steps will proceed.
[0105] Furthermore, for each sub-upgrade file, it is determined whether the sub-code libraries of the other functional components besides the target functional component include the code file corresponding to the sub-upgrade file. Based on the above example, for sub-upgrade files 11 and 12 corresponding to the login functional component, it is determined whether the sub-code libraries of the sharing functional component and the payment functional component contain the corresponding code files.
[0106] S104, if none of the sub-code libraries corresponding to each sub-upgrade file are included, the target functional component is upgraded based on the upgrade file.
[0107] It should be understood that if the sub-code libraries corresponding to other functional components do not include code files corresponding to each sub-upgrade file, it means that the upgrade file is unrelated to other functional components, and the target functional component can be upgraded directly based on the upgrade file.
[0108] Please see Figure 6 This is a flowchart illustrating a method for upgrading functional components provided in other embodiments of this disclosure. For example... Figure 6 As shown, the method includes the following steps S601 to S607:
[0109] S601, Obtain the upgrade file for the target functional component; the upgrade file includes at least one sub-upgrade file.
[0110] The content of step S601 is similar to that of step S101 in the above embodiment. For a detailed description, please refer to the description of step S101, which will not be repeated here.
[0111] S602, for each sub-upgrade file, determine whether there is a shared code file corresponding to the sub-upgrade file in the shared code library of the code repository; if yes, proceed to step S603, if no, proceed to step S604.
[0112] The content of step S602 is similar to that of step S102 in the above embodiment. For a detailed description, please refer to the description of step S102. It will not be repeated here.
[0113] S603, based on the sub-upgrade file corresponding to the shared code file, the software development kit set is updated, and based on the updated software development kit set, the code library is updated to obtain the updated code library.
[0114] For example, if at least one sub-upgrade file contains a first sub-upgrade file 31, and the first sub-upgrade file 31 is an upgrade version of the shared code file 3, then the update of the target functional component is stopped, and the software development kit set is updated based on the first sub-upgrade file 31 to obtain the updated software development kit set 1. Here, after determining the updated software development kit 1, the various functional components involved are compatible with the corresponding code files, so the code library can be updated based on the software development kit set 1 to obtain the updated code library.
[0115] Alternatively, the next update can be made based on the newly determined codebase, which will not be elaborated here.
[0116] S604, for each sub-upgrade file, determine whether the sub-code library corresponding to the other functional components among the plurality of functional components besides the target functional component includes a code file corresponding to the sub-upgrade file; if yes, proceed to step S605; if no, proceed to step S606.
[0117] The content of step S604 is similar to that of step S103 in the above embodiment. For a detailed description, please refer to the description of step S103. It will not be repeated here.
[0118] S605, determine whether the target other functional components, including the code file corresponding to the sub-upgrade file, are compatible with the corresponding sub-upgrade file; if yes, proceed to step S606; if no, proceed to step S607.
[0119] Whether the target other functional components are compatible with the corresponding sub-upgrade file refers to whether the target other functional components can achieve the corresponding functions by referencing their corresponding sub-upgrade files.
[0120] S606, upgrade the target functional component based on the upgrade file.
[0121] It should be understood that if each target's other functional components are compatible with the corresponding sub-upgrade files, it means that each sub-upgrade file has no impact on each target's other functional components and can still achieve the corresponding functions. Therefore, the target functional components can be upgraded based on the upgrade files.
[0122] Optionally, for each target other functional component, if the target other functional component is compatible with the corresponding sub-upgrade file, in response to the upgrade operation for the target other functional component, the target other functional component is upgraded based on the sub-upgrade file corresponding to the target other functional component.
[0123] It is understood that since each target other functional component is compatible with its corresponding sub-upgrade file, this means that the sub-upgrade file will not affect the corresponding target other functional component. Therefore, the target other functional component can be upgraded based on its corresponding sub-upgrade file. It should be noted that if other code files in the sub-code library of the target other functional component also need to be upgraded, then the upgrade files and corresponding sub-upgrade files for those other code files can be obtained to update the target other functional component.
[0124] S607, based on the sub-upgrade files corresponding to other functional components of the target, update the software development kit set, and based on the updated software development kit set, update the code library.
[0125] It is understood that if it is determined that other target functional components, including code files corresponding to the sub-upgrade file, are incompatible with the corresponding sub-upgrade file, it means that the sub-upgrade file will affect the other target functional components. Therefore, the target functional components cannot be upgraded based on the upgrade file. If an upgrade is required, the software development kit (SDK) set is updated based on the sub-upgrade file that is incompatible with the other target functional components, and the code library is updated based on the updated SSD set. In this way, the target functional components can be updated normally.
[0126] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0127] Based on the same inventive concept, this disclosure also provides an upgrade device for a functional component corresponding to the upgrade method for the functional component. Since the principle of the device in this disclosure for solving the problem is similar to the upgrade method for the functional component described above in this disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0128] Reference Figure 7 The diagram shown is a schematic representation of a functional component upgrade device 700 provided in an embodiment of this disclosure. The device includes:
[0129] The file acquisition module 701 is used to acquire upgrade files for the target functional component; the upgrade file includes at least one sub-upgrade file;
[0130] The first determining module 702 is used to determine, for each sub-upgrade file, whether there is a common code file corresponding to the sub-upgrade file in the common code library of the code repository; the code library includes a common code library and sub-code libraries corresponding to multiple functional components respectively; the common code library is used to store common code files; the common code file refers to a code file referenced by two or more functional components.
[0131] The second determining module 703 is used to determine, for each sub-upgrade file, whether the sub-code library corresponding to the other functional components among the plurality of functional components (excluding the target functional component) includes a code file corresponding to the sub-upgrade file when the shared code library does not include a shared code file corresponding to each sub-upgrade file.
[0132] The component upgrade module 704 is used to upgrade the target functional component based on the upgrade file when the code file corresponding to each sub-upgrade file is not included in the sub-code library corresponding to the other functional components.
[0133] In one possible implementation, the second determining module 703 is specifically used for:
[0134] For each sub-upgrade file, if the sub-code library corresponding to the other functional components includes a code file corresponding to the sub-upgrade file, determine whether the target other functional components including the code file corresponding to the sub-upgrade file are compatible with the sub-upgrade file;
[0135] If each target functional component is compatible with the corresponding sub-upgrade file, the target functional component is upgraded based on the upgrade file.
[0136] Reference Figure 8 The diagram shown is a structural schematic of an upgrade device 700 for functional components provided in other embodiments of this disclosure. The device further includes a code library generation module 705, which is used for:
[0137] Obtain a software development kit (SDK) set; the SSD set includes multiple code file packages corresponding to various functional components, each code file package includes at least one code file, wherein at least two code file packages contain the same code file;
[0138] The code files existing in different code file packages are identified as the common code files, and the common code library is generated based on the common code files;
[0139] Based on the code files individually referenced by each functional component, a sub-code library corresponding to each functional component is generated;
[0140] The code library is generated based on the shared code library and the sub-code libraries corresponding to each functional component.
[0141] In one possible implementation, the code library generation module 705 is further configured to:
[0142] For each shared code file in the shared code library, if the shared code file is changed, determine whether the functional components that reference the shared code file can implement the corresponding functions;
[0143] If a functional component that references the shared code file can perform the corresponding function, the shared code file is moved from the shared code library into the functional component that references the shared code file.
[0144] In one possible implementation, the first determining module 702 is further configured to:
[0145] For each sub-upgrade file, if a corresponding common code file exists in the common code repository, the software development kit set is updated based on the sub-upgrade file;
[0146] The codebase is updated based on the updated software development kit set to obtain the updated codebase.
[0147] In one possible implementation, the second determining module 703 is further configured to:
[0148] For each target other functional component, if the target other functional component is incompatible with the corresponding sub-upgrade file, the software development kit set is updated based on the sub-upgrade file corresponding to the target other functional component;
[0149] The codebase is updated based on the updated software development kit set.
[0150] In one possible implementation, the component 704 upgrade module is further configured to:
[0151] For each target other functional component, if the target other functional component is compatible with the corresponding sub-upgrade file, in response to the upgrade operation for the target other functional component, the target other functional component is upgraded based on the sub-upgrade file corresponding to the target other functional component.
[0152] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0153] Based on the same technical concept, this disclosure also provides an electronic device. (See also...) Figure 8 The diagram shown is a structural schematic of an electronic device 800 provided in an embodiment of this disclosure, including a processor 801, a memory 802, and a bus 803. The memory 802 is used to store execution instructions and includes a main memory 8021 and an external memory 8022. The main memory 8021, also called internal memory, is used to temporarily store computational data in the processor 801, as well as data exchanged with external memory 8022 such as a hard disk. The processor 801 exchanges data with the external memory 8022 through the main memory 8021.
[0154] In this embodiment, the memory 802 is specifically used to store application code that executes the solution of this application, and its execution is controlled by the processor 801. That is, when the electronic device 800 is running, the processor 801 communicates with the memory 802 through the bus 803, so that the processor 801 executes the application code stored in the memory 802, and then executes the method described in any of the foregoing embodiments.
[0155] The memory 802 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0156] Processor 801 may be an integrated circuit chip with signal processing capabilities. The aforementioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application-Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor.
[0157] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 800. In other embodiments of this application, the electronic device 800 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0158] This disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of upgrading the functional components in the above method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.
[0159] This disclosure also provides a computer program product carrying program code. The program code includes instructions that can be used to execute the upgrade steps of the functional components in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.
[0160] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0161] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.
[0162] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0163] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0164] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.
[0165] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.
Claims
1. A method for upgrading a functional component, characterized in that, include: Obtain the upgrade files for the target functional component; The upgrade file includes at least one sub-upgrade file; For each sub-upgrade file, determine whether a common code file corresponding to the sub-upgrade file exists in the common code library of the code repository; The code library includes a shared code library and multiple sub-code libraries corresponding to each functional component. The shared code library is used to store shared code files, which are code files referenced by two or more functional components. If the shared code library does not include a shared code file corresponding to each sub-upgrade file, for each sub-upgrade file, determine whether the sub-code library corresponding to the other functional components among the plurality of functional components (excluding the target functional component) includes a code file corresponding to the sub-upgrade file; If none of the sub-code libraries corresponding to the other functional components contain code files corresponding to each sub-upgrade file, the target functional component is upgraded based on the upgrade file.
2. The method according to claim 1, characterized in that, The method further includes: For each sub-upgrade file, if the sub-code library corresponding to the other functional components includes a code file corresponding to the sub-upgrade file, determine whether the target other functional components including the code file corresponding to the sub-upgrade file are compatible with the sub-upgrade file; If each target functional component is compatible with the corresponding sub-upgrade file, the target functional component is upgraded based on the upgrade file.
3. The method according to claim 1 or 2, characterized in that, The codebase is identified in the following ways: Obtain a software development kit (SDK) set; the SSD set includes multiple code file packages corresponding to various functional components, each code file package includes at least one code file, wherein at least two code file packages contain the same code file; The code files existing in different code file packages are identified as the common code files, and the common code library is generated based on the common code files; Based on the code files referenced separately by each functional component, a sub-code library corresponding to each functional component is generated; The code library is generated based on the shared code library and the sub-code libraries corresponding to each functional component.
4. The method according to claim 3, characterized in that, The method further includes: For each shared code file in the shared code library, if the shared code file is changed, determine whether the functional components that reference the shared code file can implement the corresponding functions; If a functional component that references the shared code file can perform the corresponding function, the shared code file is moved from the shared code library into the functional component that references the shared code file.
5. The method according to claim 3, characterized in that, The method further includes: For each sub-upgrade file, if a corresponding common code file exists in the common code repository, the software development kit set is updated based on the sub-upgrade file; The codebase is updated based on the updated software development kit set to obtain the updated codebase.
6. The method according to claim 3, characterized in that, The method further includes: For each target other functional component, if the target other functional component is incompatible with the corresponding sub-upgrade file, the software development kit set is updated based on the sub-upgrade file corresponding to the target other functional component; The codebase is updated based on the updated software development kit set.
7. The method according to claim 2, characterized in that, The method further includes: For each target other functional component, if the target other functional component is compatible with the corresponding sub-upgrade file, in response to the upgrade operation for the target other functional component, the target other functional component is upgraded based on the sub-upgrade file corresponding to the target other functional component.
8. An upgrade device for a functional component, characterized in that, include: The file acquisition module is used to acquire upgrade files for the target functional components; The upgrade file includes at least one sub-upgrade file; The first determining module is used to determine, for each sub-upgrade file, whether there is a shared code file corresponding to the sub-upgrade file in the shared code library of the code repository; The code library includes a shared code library and multiple sub-code libraries corresponding to each functional component. The shared code library is used to store shared code files, which are code files referenced by two or more functional components. The second determining module is used to determine, for each sub-upgrade file, whether the sub-code library corresponding to the other functional components among the plurality of functional components (excluding the target functional component) includes a code file corresponding to the sub-upgrade file, in the case where the shared code library does not include a shared code file corresponding to each sub-upgrade file. The component upgrade module is used to upgrade the target functional component based on the upgrade file when the code files corresponding to each sub-upgrade file are not included in the sub-code libraries corresponding to the other functional components.
9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable requests executable by the processor, and the processor communicates with the memory via the bus when the electronic device is running, and the steps of the method for upgrading a functional component as described in any one of claims 1 to 7 are performed when the machine-readable request is executed by the processor.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the method for upgrading a functional component as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Software installation package processing method and device, electronic equipment and storage medium
CN113377382A
Front-end public component publishing method and device, equipment and medium
CN115357272A