Methods, systems, devices, electronic equipment, and media for modifying component versions
By obtaining and updating component dependency information through independent commands, the complexity of component version change operations in CocoaPods is solved, achieving independence of component version control and simplifying operations, thereby improving system efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-18
- Publication Date
- 2026-03-06
AI Technical Summary
In iOS development, when using CocoaPods for component management, changing component versions is complex and error-prone, especially when it requires manually modifying the Podfile description file within the project.
The system retrieves component modification dependency information via independent commands, determines the type of dependency and updates the dependency list, generates new dependency results, automatically compares and updates component versions, and avoids modifying the description files within the user's project.
It achieves independent component version control and simplifies operations, improves system efficiency, reduces the probability of errors, and ensures the accuracy and ease of component version updates.
Smart Images

Figure CN115840585B_ABST
Abstract
Description
Technical Field
[0001] This disclosure belongs to the field of computer technology, and in particular relates to a method, apparatus, electronic device and medium for modifying component versions. Background Technology
[0002] Currently, iOS development utilizes several dependency libraries, such as ASIHttpRequest, AFNetworking, and JSONKit. Using these third-party libraries greatly simplifies project development; however, integrating these libraries requires manual configuration. For example, integrating the ASIHttpRequest library requires manually adding system frameworks like CFNetwork and MobileCoreServices in addition to the source code. Furthermore, if these libraries are updated, the project must be manually updated, making the process very cumbersome. Currently, CocoaPods is widely used for component management in iOS development. CocoaPods downloads necessary components to the local machine based on the analyzed component list for use in the main project. Due to the complexity of business logic, iOS development not only requires developing its own repository but also upgrading / downgrading certain component versions.
[0003] In existing technologies, CocoaPods natively supports component version changes, but it requires modifying the Podfile description file and the Podfile.lock result description file within the project, making the code merging process still complex and prone to errors. Summary of the Invention
[0004] To at least address the aforementioned technical problems, this disclosure provides a method, system, apparatus, electronic device, and readable storage medium for modifying component versions.
[0005] According to the first aspect of this disclosure, a method for modifying a component version is provided, including:
[0006] Obtain the initial dependency result of the component as the first dependency result;
[0007] Retrieve the modification dependency information of the components set by the user;
[0008] Determine the type of the modified dependency information, modify the component information of the corresponding dependency list according to the type, obtain the updated dependency list, and generate a second dependency result based on the updated dependency list;
[0009] The second dependency result is compared with the first dependency result, and the component description file is updated according to the comparison result to obtain the modified component version.
[0010] Furthermore, the step of determining the type of the modified dependency information, modifying the component information of the corresponding dependency list according to the type, obtaining the updated dependency list, and generating a second dependency result based on the updated dependency list includes:
[0011] When the type of the modified dependency information is a component external dependency, the external dependency list is modified according to the obtained component external dependency, and the component information corresponding to the component external dependency is added; and / or
[0012] When the type of the modified dependency information is component version information, the version dependency list is modified according to the obtained component version information, and the component information corresponding to the component version information is modified.
[0013] Based on the external dependency list and the version dependency list, a second dependency result is generated.
[0014] Furthermore, the generation of a second dependency result based on the external dependency list and the version dependency list includes...
[0015] Inject external dependencies based on the aforementioned external dependency list, perform dependency analysis, and obtain the dependency analysis results;
[0016] A second dependency result is generated based on the dependency analysis results and the version dependency list.
[0017] Furthermore, the step of comparing the second dependency result with the first dependency result, updating the component's description file based on the comparison result, and obtaining the modified component version includes:
[0018] The second dependency result is compared with the first dependency result to obtain the change part of the difference between the second dependency result and the first dependency result that is not caused by the modification of dependency information. The change part caused by the modification of dependency information is used to replace the corresponding part in the first dependency result to obtain the modified first dependency result. The change part caused by the modification of dependency information is the part of the change of the second dependency result relative to the first dependency result, excluding the changes caused by the update component and associated component corresponding to the modification of dependency information.
[0019] Based on the modified first dependency result and the updated dependency list, obtain the modified component version.
[0020] Furthermore, obtaining the modification dependency information of the user-set components includes:
[0021] Obtain the component information set by the user component, and use the component version and / or component source information in the component information as the component version information, and use the remote address and / or branch and / or tag in the component information as the component external dependency.
[0022] Furthermore, obtaining the modification dependency information of the user-set components includes:
[0023] Acquire and store component version information and / or external dependencies of the component set by the user, collected in the form of independent commands.
[0024] Furthermore, when the modified dependency information is an external dependency of a component, the external dependency list is modified according to the obtained external dependencies of the component, and component information is added, including:
[0025] If the modified dependency information is at least one of remote address, branch, or tag, it is determined to be an external dependency of the component. The external dependency of the component is injected, analyzed, and the component information is modified to the specified version based on the analysis results.
[0026] Furthermore, when the modified dependency information is component version information, the version dependency list is modified according to the obtained component version information, and the corresponding component information is modified, including:
[0027] If the dependency information is modified to include at least one of component version or component source information, it is determined to be component version information. Based on the obtained component version information, the version dependency list is modified, and the corresponding component information is modified.
[0028] Furthermore, the method also includes: upon detecting a code review request, reading and uploading the modified component description file and the updated dependency list.
[0029] According to a second aspect of this disclosure, a system for modifying component versions is provided, comprising:
[0030] The user terminal and the code review module connected to the user terminal, and the repository update module connected to the code review module;
[0031] On the user side, it is used to collect and save the modification dependency information of components in the form of independent commands.
[0032] The code review module is used to read and upload the stored modification dependency information when a code review request is detected.
[0033] The repository update module is used to obtain and inject the modified dependency information when an installation dependency request is detected. It then performs dependency analysis on the modified dependency information, modifies the component to the specified version based on the analysis results, generates a new dependency result, compares the new dependency result with the original dependency result, obtains the changes caused by non-updated components, and replaces the corresponding part in the original dependency result with the changes caused by non-updated components in the new dependency result, thus completing the repository update operation.
[0034] According to a third aspect of this disclosure, an apparatus for modifying a component version is provided, comprising:
[0035] The first acquisition module is used to acquire the initial dependency results of the component as the first dependency result;
[0036] The second acquisition module is used to acquire the modification dependency information of the components set by the user;
[0037] The generation module is used to determine the type of the modified dependency information, modify the component information of the corresponding dependency list according to the type, obtain the updated dependency list, and generate a second dependency result based on the updated dependency list;
[0038] The update module is used to compare the second dependency result with the first dependency result, update the component's description file according to the comparison result, and obtain the modified component version.
[0039] Furthermore, the device also includes:
[0040] The code merging module is used to read and upload stored modification dependency information when a code review request is detected.
[0041] According to a fourth aspect of this disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor.
[0042] When the processor executes the program, it implements the steps of the method described in any of the first aspects of this disclosure.
[0043] According to a fifth aspect of this disclosure, a computer-readable storage medium is provided, the computer-readable storage medium storing a program that, when executed, can implement the method described in any one of the first aspects of this disclosure.
[0044] The beneficial effects of this disclosure are as follows: By using independent commands to set and modify dependency information, users can independently control component versioning, thus achieving independent component control. This ensures that system operation is unaffected by user-defined component settings, allowing both to occur simultaneously and effectively improving system efficiency. Furthermore, this disclosure modifies the Cocoapods external dependency list based on at least one of the obtained external dependencies (remote address, branch, or tag), adding component information and maintaining the external dependency list. It also updates the repository based on the new dependency results. The system does not require modification of the component version description file within the user's project, making the operation simple, error-free, and enabling fast, independent, and controllable component-related information. Attached Figure Description
[0045] The above and / or additional aspects and advantages of this disclosure will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein,
[0046] Figure 1 A flowchart illustrating a method for modifying a component version provided in this disclosure embodiment;
[0047] Figure 2 A schematic diagram of a system architecture for a component version modification provided in an embodiment of this disclosure;
[0048] Figure 3 A system flowchart for modifying a component version is provided in an embodiment of this disclosure;
[0049] Figure 4 A schematic diagram of a device structure for modifying a component version provided in an embodiment of this disclosure;
[0050] Figure 5 This is a schematic diagram of an electronic device structure provided in an embodiment of the present disclosure. Detailed Implementation
[0051] The embodiments of this disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote 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 only used to explain this disclosure, and should not be construed as limiting this disclosure.
[0052] To more clearly illustrate this disclosure, the preferred embodiments and accompanying drawings will be used for further description. Similar components in the drawings are indicated by the same reference numerals. Those skilled in the art should understand that the specific description below is illustrative rather than restrictive and should not be construed as limiting the scope of protection of this disclosure.
[0053] In a first aspect of this disclosure, a method for modifying a component version is provided, such as Figure 1 As shown, it includes:
[0054] Step 101: Obtain the initial dependency result of the component as the first dependency result.
[0055] This disclosure obtains the initial dependency results of the component settings. These initial dependency results include a dependency list, which includes component version information, i.e., dependency information, including the component version and component source information. External dependencies of the component include: remote addresses, branches, tags, etc. The remote address is the Git address. A branch corresponds to a series of operation commands; it's a line connecting many points, used when modifying code. The operation command is `commit`. A tag is used to mark something; it's a snapshot of the Git repository, a pointer to a specific operation command. Generally, tags are used for viewing without modifying the code.
[0056] Furthermore, the `mbox depend component_name --version 2.0` command can be used to update the component version to 2.0;
[0057] Use the command `mbox depend component_name --git remote_address --branch_BRANCH_name --commit_COMMIT_name --tag_TAG_name` to set external dependencies for the component.
[0058] Furthermore, the system obtains component information set by the user using independent commands. This component information includes component version, component source information, remote address, branch, and tag. The obtained component version and / or component source information are used as dependency information, and the obtained remote address and / or branch and / or tag are used as external dependencies. The system saves the component dependency information and / or external dependencies, where the component dependency information is the component version information.
[0059] Step 102: Obtain the modification dependency information of the components set by the user.
[0060] Modify dependency information, including component version information and / or external dependencies of the component; obtain the component version information and / or external dependencies of the component set by the user; and save the component version information and / or external dependencies of the component.
[0061] In this disclosure, we obtain the dependency information for modifying component settings by the user using independent commands.
[0062] In another embodiment of this disclosure, the configuration file can be directly modified to achieve the same effect as modifying it using a separate command tool.
[0063] Furthermore, the system obtains component information set by the user using independent commands. This component information includes component version, component source information, remote address, branch, and tag. The obtained component version and / or component source information are used as dependency information, and the obtained remote address and / or branch and / or tag are used as external dependencies. The system saves the component dependency information and / or external dependencies, where the component dependency information is the component version information.
[0064] By setting dependency information and / or external dependencies of components using independent commands, users can independently control component versioning, thereby enabling independent control of components. This ensures that system operation is not affected by user-set component-related information, and both can be performed synchronously, effectively improving system efficiency.
[0065] Step 103: Determine the type of the modified dependency information, modify the component information of the corresponding dependency list according to the type, obtain the updated dependency list, and generate a second dependency result based on the updated dependency list;
[0066] In this disclosure, when it is detected that a user-set component is an external dependency, the external dependency list is modified according to the obtained external dependencies, the corresponding component information is added, and step 104 is executed.
[0067] This disclosure further determines the type of the modified dependency information and modifies the component information of the corresponding dependency list according to the type. When it is detected that the user has modified the component to at least one of remote address, branch, and tag, it is determined that the user has set an external dependency of the component. At this time, it is necessary to update the external dependency list according to the obtained external dependency of the component, generate a second dependency result based on the updated dependency list, and add the corresponding component information.
[0068] By modifying the Cocoapods external dependency list based on at least one of the obtained component external dependencies (remote address, branch, tag), component information is added, thus completing the maintenance of the external dependency list. Adding component information specifically involves adding external component information. Since external components are stored at remote addresses (e.g., a specified Git address), these remote code files need to be downloaded first before their files and other information can be analyzed. For example, the component's dependencies and version number are stored in the component's repository. Therefore, they need to be downloaded first. Before downloading, an external component list needs to be generated for subsequent download preparation. This public system does not require modification of the component version description file within the user's project, is simple to operate, less prone to errors, and enables fast, independent, and controllable component-related information.
[0069] Step 104: Compare the second dependency result with the first dependency result, update the component description file according to the comparison result, and obtain the modified component version.
[0070] In this disclosure, the dependency information is modified to component version information. That is, when the user sets the component version information, i.e. the component dependency information, it is detected that the version dependency list is modified according to the obtained component version information, the component information is modified, and step 104 is executed.
[0071] Specifically, the second dependency result is compared with the first dependency result to obtain the change portion of the difference between the second dependency result and the first dependency result that is not caused by the modification of dependency information. The change portion caused by the modification of dependency information is used to replace the corresponding part in the first dependency result to obtain the modified first dependency result. The change portion caused by the modification of dependency information is the part of the change of the second dependency result relative to the first dependency result, excluding the changes caused by the update component and associated component corresponding to the modification of dependency information.
[0072] Component dependency information is also known as component version information, which includes: component version and component source information.
[0073] If it is detected that the user has modified at least one of the component version or component source information, it is determined that the user has set component dependency information, that is, the user has set component version information. Based on the obtained component dependency information, the version dependency list is modified and the corresponding component information is modified.
[0074] Furthermore, CocoaPods is used to obtain the external dependencies of the components, and the obtained external dependencies are injected. The external dependencies of the components are analyzed, and the original version information is modified based on the obtained component dependency information.
[0075] In this disclosure, after generating a new dependency result, the original dependency result is compared with the new dependency result to obtain the changes brought about by non-updating components. The changes brought about by non-updating components in the new dependency result are used to replace the corresponding parts in the original dependency result to complete the repository update operation.
[0076] Furthermore, the logic for generating Podfile.lock in CocoaPods is rewritten. Podfile.lock is used to store the component versions of the installed pods dependency libraries. The newly generated Podfile.lock is compared with the original Podfile.lock to exclude changes caused by local component upgrades, and other changes are updated to the original Podfile.lock.
[0077] In another embodiment of this disclosure, a system for quickly switching component versions is provided, such as Figure 2As shown, it includes:
[0078] The client 201 and the code review module 202 connected to it, and the repository update module 203 connected to the code review module.
[0079] Client 201 is used to collect and save the modification dependency information of components in the form of independent commands.
[0080] Specifically, client 201 uses independent commands to collect and save component version information and / or external dependencies of components;
[0081] In this disclosure, such as Figure 3 As shown, client-side 201 uses independent commands to set component version information and / or external dependencies. Component version information, also known as component dependency information, includes: component version and component source information. External dependencies include: remote address, branch, tags, etc. A branch corresponds to a series of operation commands; it's a line connecting many points and is used when modifying code. A tag is used to mark something; it's a snapshot of the Git repository and a pointer to a specific operation command. Generally, tags are used for viewing without modifying the code.
[0082] The user-end 201 disclosed herein sets component version information and / or external dependencies of components by using independent commands, enabling users to independently control component versions and achieve independent control of components. This ensures that the system operation is not affected by user settings of component-related information, and the two can be carried out synchronously, effectively improving the system's work efficiency.
[0083] The code review module 202 is used to read and upload the stored modification dependency information when a code review request is detected; further, the code review module 202 is specifically used to read and upload the stored component version information and / or external component dependencies when a user initiates a code review request.
[0084] In this disclosure, the code review module 202, upon detecting a user-initiated code review request (i.e., upon receiving a MergeRequest), reads the component information set by the user, namely the stored component version information and / or external dependencies of the component, and uploads the component information.
[0085] The repository update module 203 is used to obtain the external dependencies of the component when a Cocoapods installation dependency request is detected, inject the external dependencies of the component, perform dependency analysis on the external dependencies of the component, modify the component to a specified version according to the analysis results, generate a new dependency result, compare the new dependency result with the original dependency result, obtain the changes brought about by non-updated components, and replace the corresponding part in the original dependency result with the changes brought about by non-updated components in the new dependency result, thus completing the repository update operation.
[0086] Furthermore, the repository update module 203 is used to rewrite the logic for generating Podfile.lock in CocoaPods. It compares the newly generated Podfile.lock with the original Podfile.lock, excludes changes caused by local component upgrades, and updates other changes to the original Podfile.lock.
[0087] In a third aspect of this disclosure, an apparatus for modifying component versions is provided, such as Figure 4 As shown, it includes:
[0088] The first acquisition module 401 is used to acquire the initial dependency result of the component as the first dependency result.
[0089] In this disclosure, the first acquisition module 401 is used to acquire the initial dependency results of the component settings. This initial dependency result includes a dependency list, which includes component version information. The component version information, also known as dependency information, includes the component version and component source information. External dependencies of the component include remote addresses, branches, tags, etc. The remote address is the Git address. A branch corresponds to a series of operation commands; it's a line connecting many points and is used when modifying code. The operation command is `commit`. A tag is used to mark something; it's a snapshot of the Git repository and a pointer to a specific operation command. Generally, tags are used for viewing without modifying the code.
[0090] The second module 402 is used to obtain the modification dependency information of user-set components.
[0091] In this disclosure, the information acquisition module 401 is specifically used to acquire the component version information and / or the component's external dependencies as modification dependency information set by the user, and save the modification dependency information.
[0092] In the embodiments of this disclosure, the configuration file can be directly modified to achieve the same effect as modifying it using a separate command tool.
[0093] Furthermore, the second acquisition module is specifically used to acquire component information set by the user using independent commands. This component information includes component version, component source information, remote address, branch, and tag. The acquired component version and / or component source information is used as the component version information, and the acquired remote address and / or branch and / or tag is used as the component's external dependencies. The component version information and / or component external dependencies are then saved.
[0094] By using independent commands to set component version information and / or external dependencies, users can independently control component versions, thereby enabling the system to operate without being affected by user-defined component information. Both can be performed synchronously, effectively improving system efficiency.
[0095] The generation module 403 is used to determine the type of the modified dependency information, modify the component information of the corresponding dependency list according to the type, obtain the updated dependency list, and generate a second dependency result based on the updated dependency list.
[0096] When the generation module detects that the user has set external dependencies for the component, it modifies the external dependency list according to the obtained external dependencies, adds the corresponding component information, and triggers the update module 404.
[0097] In this disclosure, the generation module is specifically used to determine the type of the modified dependency information and modify the component information of the corresponding dependency list according to the type. When it is detected that the user has modified the component to at least one of remote address, branch, and tag, it is determined that the user has set an external dependency of the component. At this time, it is necessary to update the external dependency list according to the obtained external dependency of the component, generate a second dependency result based on the updated dependency list, and add the corresponding component information.
[0098] By modifying the Cocoapods external dependency list based on at least one of the obtained external dependencies—remote addresses, branches, and tags—component information is added, thus completing the maintenance of the external dependency list. Specifically, external component information is added. Since external components are stored at remote addresses, such as a specified Git address, the remote code needs to be downloaded first before analyzing the files and other information within them. For example, the component's dependencies and version number are stored in the component's repository. Therefore, they need to be downloaded first. Before downloading, an external component list needs to be generated for subsequent download preparation. This public system does not require modification of the component version description files within the user's project, is simple to operate, less prone to errors, and enables fast, independent, and controllable component-related information.
[0099] The update module 404 is used to compare the second dependency result with the first dependency result, update the component description file according to the comparison result, and obtain the modified component version.
[0100] The update module is specifically used to: compare the second dependency result with the first dependency result, obtain the change portion of the difference between the second dependency result and the first dependency result that is not caused by the modification of dependency information, replace the corresponding part in the first dependency result with the change portion of the non-modification dependency information, and obtain the modified first dependency result. The change portion of the non-modification dependency information is the part of the change of the second dependency result relative to the first dependency result, excluding the changes caused by the update component and associated component corresponding to the modification dependency information.
[0101] The update module is further configured to: upon detecting user-set component dependency information, modify the version dependency list based on the obtained component dependency information, modify the component information, and trigger an update operation. In this disclosure, component dependency information is also component version information, including: component version and component source information.
[0102] When the update module detects that a user has modified at least one of the component version or component source information, it determines that the user has set the component version information, modifies the version dependency list based on the obtained component version information, and modifies the corresponding component information.
[0103] In this disclosure, the update module uses CocoaPods to obtain external dependencies, injects the obtained external dependencies, analyzes the dependency information, modifies the original version information according to the obtained dependency information, generates a new dependency result, compares the original dependency result with the new dependency result, obtains the changes brought about by non-updating components, and replaces the corresponding part in the original dependency result with the changes brought about by non-updating components in the new dependency result, thus completing the repository update operation.
[0104] Furthermore, the update module rewrites the logic for generating Podfile.lock in CocoaPods. Podfile.lock is used to store the component versions of the installed pods dependency libraries. The newly generated Podfile.lock is compared with the original Podfile.lock to exclude changes caused by local component upgrades, and other changes are updated to the original Podfile.lock.
[0105] Furthermore, the device also includes a code merging module, used to read and upload stored modification dependency information upon detecting a code review request. Code merging merges the dependency information branches from the code review request into the target dependency information, and reads the modification dependency information from the stored dependency list. Users can also choose whether to delete dependency information branches after merging. Users can also input a string or regular expression; only matching dependency information branches will be deleted.
[0106] In summary, the user interface disclosed herein sets dependency information and / or external dependencies using independent commands, enabling users to independently control component versions and thus achieve independent component control. This ensures that system operation is unaffected by user-defined component information settings, allowing both to be performed synchronously and effectively improving system efficiency.
[0107] In a fourth aspect of this disclosure, an electronic device is provided, as described below. Figure 5 The diagram illustrates a structural schematic of an electronic device suitable for implementing embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0108] like Figure 5 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 506 into a random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0109] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 506 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0110] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 509, or installed from storage device 506, or installed from ROM 502. When the computer program is executed by processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.
[0111] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0112] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0113] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0114] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: receive a voice signal from a first device; parse the voice signal to obtain a second device identifier and a second device control command; send the second device control command to the second device according to the second device identifier; receive the execution result of the second device control command from the second device; and send the execution result of the second device control command to the first device.
[0115] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0116] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0117] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.
[0118] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0119] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0120] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this disclosure means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.
[0121] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0122] It should be understood that the above detailed description of the technical solutions of this disclosure by means of preferred embodiments is illustrative and not restrictive. Those skilled in the art can modify the technical solutions described in the various embodiments or make equivalent substitutions for some of the technical features based on reading this disclosure; however, such modifications 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 various embodiments of this disclosure.
Claims
1. A method of component version modification, characterized by, The method comprises the following steps: obtaining an initial dependency result of a component as a first dependency result; obtaining modification dependency information of the component set by a user; judging the type of the modification dependency information, modifying component information of a corresponding dependency list according to the type, obtaining an updated dependency list, and generating a second dependency result based on the updated dependency list; comparing the second dependency result with the first dependency result, updating a description file of the component according to a comparison result, and obtaining a modified component version; wherein the comparison of the second dependency result with the first dependency result, the updating of the description file of the component according to the comparison result, and the obtaining of the modified component version comprise: comparing the second dependency result with the first dependency result, obtaining a change part caused by non-modification dependency information in a difference between the second dependency result and the first dependency result, modifying the first dependency result based on the change part, and obtaining a modified first dependency result, wherein the change part caused by the non-modification dependency information is a part of the change of the second dependency result relative to the first dependency result, except for a change caused by updated components and associated components corresponding to the modification dependency information; obtaining the modified component version based on the modified first dependency result and the updated dependency list; the obtaining of the modification dependency information of the component set by the user comprises: obtaining and storing component version information and / or external dependency of the component set by the user in an independent command mode.
2. The method of claim 1, wherein, the judgment of the type of the modification dependency information, the modification of the component information of the corresponding dependency list according to the type, the obtaining of the updated dependency list, and the generation of the second dependency result based on the updated dependency list comprise: when the type of the modification dependency information is external dependency of the component, modifying an external dependency list according to the obtained external dependency of the component, and adding component information corresponding to the external dependency of the component; and / or, when the type of the modification dependency information is component version information, modifying a version dependency list according to the obtained component version information, and modifying component information corresponding to the component version information; generating the second dependency result based on the external dependency list and the version dependency list.
3. The method of claim 2, wherein, the generation of the second dependency result based on the external dependency list and the version dependency list comprises: injecting external dependency based on the external dependency list, and performing dependency analysis to obtain a dependency analysis result; generating the second dependency result based on the dependency analysis result and the version dependency list.
4. The method of claim 1, wherein, the obtaining of the modification dependency information of the component set by the user comprises: obtaining component information set by the user, taking component version and / or component source information in the component information as component version information, and taking a remote address and / or a branch and / or a tag in the component information as external dependency of the component.
5. The method of claim 1, wherein, when the modification dependency information is external dependency of the component, modifying an external dependency list according to the obtained external dependency of the component, and adding component information comprise: In the case that the modified dependency information is at least one of a remote address, a branch, and a tag, it is determined that the component is externally dependent, the component external dependency is injected, the component external dependency is analyzed, and the component information is modified to a specified version according to the analysis result.
6. The method of claim 5, wherein, In the case that the modified dependency information is at least one of a remote address, a branch, and a tag, it is determined that the component is externally dependent, the component external dependency is injected, the component external dependency is analyzed, and the component information is modified to a specified version according to the analysis result. In the case that the modified dependency information is at least one of a remote address, a branch, and a tag, it is determined that the component is externally dependent, the component external dependency is injected, the component external dependency is analyzed, and the component information is modified to a specified version according to the analysis result.
7. The method of claim 1, wherein, The method further includes: in the case that the code review request is detected, reading and uploading the description file of the modified component and the updated dependency list.
8. An apparatus for component version modification, the apparatus comprising: In the case that the modified dependency information is at least one of a remote address, a branch, and a tag, it is determined that the component is externally dependent, the component external dependency is injected, the component external dependency is analyzed, and the component information is modified to a specified version according to the analysis result. The first obtaining module is configured to obtain an initial dependency result of the component as a first dependency result. The second obtaining module is configured to obtain modified dependency information of the component set by a user. The generating module is configured to determine a type of the modified dependency information, modify component information of a corresponding dependency list according to the type, obtain an updated dependency list, and generate a second dependency result based on the updated dependency list. The updating module is configured to compare the second dependency result with the first dependency result, update a description file of the component according to a comparison result, and obtain a modified component version. The updating module is configured to compare the second dependency result with the first dependency result, obtain a change part caused by non-modified dependency information in a difference between the second dependency result and the first dependency result, modify the first dependency result based on the change part, obtain a modified first dependency result, and obtain a modified component version based on the modified first dependency result and the updated dependency list. The second obtaining module is configured to obtain and store component version information and / or component external dependency set by the user to the component in an independent command manner.
9. The apparatus of claim 8, wherein, The code merging module is configured to read and upload the stored modified dependency information in the case that the code review request is detected. 10.An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein The processor implements the steps of the method of any one of claims 1-7 when executing the program. The computer readable storage medium stores a program, and the program can implement the method of any one of claims 1-7 when executed.
11. A computer readable storage medium characterized by,
Citation Information
Patent Citations
Dependent component information extraction method and device and computer readable storage medium
CN112711438A
Project dependency relationship change detection method and device
CN112860312A