Component processing method, device, electronic device and storage medium
By obtaining the associated file search path and associated file of the pending component and performing combination processing, the problem of component packaging exception is solved, and the flexibility and accuracy of component packaging is improved.
Patent Information
- Application Number
- CN202111664858.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2041-12-31
AI Technical Summary
In the prior art, component packaging problems occur because component operation needs to rely on the operation of the entire engineering project.
By receiving the component processing request of the pending component, obtaining the associated file search path corresponding to the pending component, obtaining the associated file based on the path, and combining the to-process component and the associated file to generate the target component package.
It avoids component packaging exceptions caused by individually packaging components that are being processed without considering file reference relationships, and improves component packaging flexibility and accuracy.
Smart Images

Figure CN114528007B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a component processing method, device, electronic device and storage medium. Background Art
[0002] As the project becomes larger and larger, and each business module is modularized, each business module can be managed in a local library, assembled into an application or generated software framework in a pluggable way, and provided to external users. In the related art, since the operation of each component depends on the operation of the entire project, when the components need to be assembled, the related components cannot run independently, which may cause component packaging abnormalities. Summary of the invention
[0003] The present disclosure provides a component processing method, device, electronic device and storage medium to at least solve the problem of component packaging abnormality in the related art. The technical solution of the present disclosure is as follows:
[0004] According to a first aspect of an embodiment of the present disclosure, a component processing method is provided, including:
[0005] receiving a component processing request for a component to be processed;
[0006] Acquire an associated file search path corresponding to the component to be processed; the associated file search path is obtained based on file reference information of the component to be processed;
[0007] Based on the associated file search path, acquiring associated files associated with the component to be processed;
[0008] The component to be processed and the associated files are combined and processed to obtain a target component package corresponding to the component to be processed.
[0009] In an exemplary embodiment, the file reference information includes a file identifier of the associated file;
[0010] The method further comprises:
[0011] Determining the associated component to which the associated file belongs based on the file identifier of the associated file;
[0012] The associated file search path is determined based on the component identification of the associated component; at least one component file of the associated component is stored under the associated file search path.
[0013] In an exemplary embodiment, the associated files include directly referenced files and indirectly referenced files; the directly referenced files are files directly referenced by the component to be processed, and the indirectly referenced files are files referenced by the directly referenced files;
[0014] The method further comprises:
[0015] Determine a first file path corresponding to the directly referenced file and a second file path corresponding to the indirectly referenced file;
[0016] The associated file search path is determined based on the first file path and the second file path.
[0017] In an exemplary embodiment, the file reference information includes a file identifier of the associated file;
[0018] The acquiring the associated file associated with the component to be processed based on the associated file search path includes:
[0019] Concatenate the associated file search path and the file identifier of the associated file to obtain a first target search path;
[0020] The associated file is acquired based on the first target search path.
[0021] In an exemplary embodiment, the method further comprises:
[0022] If the associated file is not obtained based on the associated file search path, obtaining updated file reference information;
[0023] Based on the updated file reference information, obtaining an updated associated file search path;
[0024] Based on the updated associated file search path, the associated file is acquired.
[0025] In an exemplary embodiment, an associated file acquisition link is stored under the associated file search path, and the associated file acquisition link points to a preset file library;
[0026] The acquiring the associated file associated with the component to be processed based on the associated file search path includes:
[0027] Based on the associated file acquisition link, the associated file is acquired from the preset file library.
[0028] According to a second aspect of an embodiment of the present disclosure, there is provided a component processing device, including:
[0029] A component processing request receiving unit, configured to receive a component processing request for a component to be processed;
[0030] An associated file search path acquisition unit is configured to execute acquisition of an associated file search path corresponding to the component to be processed; the associated file search path is obtained based on file reference information of the component to be processed;
[0031] An associated file acquisition unit, configured to acquire associated files associated with the component to be processed based on the associated file search path;
[0032] The component processing unit is configured to perform combined processing on the component to be processed and the associated file to obtain a target component package corresponding to the component to be processed.
[0033] In an exemplary embodiment, the file reference information includes a file identifier of the associated file;
[0034] The device also includes:
[0035] an associated component determining unit, configured to determine an associated component to which the associated file belongs based on the file identification of the associated file;
[0036] The associated file search path determining unit is configured to determine the associated file search path based on the component identification of the associated component; at least one component file of the associated component is stored in the associated file search path.
[0037] In an exemplary embodiment, the associated files include directly referenced files and indirectly referenced files; the directly referenced files are files directly referenced by the component to be processed, and the indirectly referenced files are files referenced by the directly referenced files;
[0038] The device also includes:
[0039] A first determining unit is configured to determine a first file path corresponding to the directly referenced file and a second file path corresponding to the indirectly referenced file;
[0040] The second determining unit is configured to determine the associated file search path based on the first file path and the second file path.
[0041] In an exemplary embodiment, the file reference information includes a file identifier of the associated file;
[0042] The associated file acquisition unit includes:
[0043] An information splicing unit is configured to perform splicing on the associated file search path and the file identifier of the associated file to obtain a first target search path;
[0044] A first acquiring unit is configured to acquire the associated file based on the first target search path.
[0045] In an exemplary embodiment, the apparatus further comprises:
[0046] A second acquiring unit is configured to acquire updated file reference information when the associated file is not acquired based on the associated file search path;
[0047] A path updating unit, configured to obtain an updated associated file search path based on the updated file reference information;
[0048] The third acquisition unit is configured to execute the associated file search path based on the updated associated file search path to acquire the associated file.
[0049] In an exemplary embodiment, an associated file acquisition link is stored under the associated file search path, and the associated file acquisition link points to a preset file library;
[0050] The associated file acquisition unit includes:
[0051] The fourth acquisition unit is configured to execute acquisition link based on the associated file and acquire the associated file from the preset file library.
[0052] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the component processing method as described above.
[0053] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of a server, the server is enabled to execute the component processing method as described above.
[0054] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, which includes a computer program, wherein the computer program is stored in a readable storage medium, and at least one processor of a computer device reads and executes the computer program from the readable storage medium, so that the device performs the above-mentioned component processing method.
[0055] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0056] When receiving a component processing request, the present invention obtains an associated file search path corresponding to the component to be processed. The associated file search path is obtained based on the file reference information of the component to be processed. Therefore, it can be known that the associated file search path corresponds to the file reference information, and a corresponding associated file search path is generated for each file referenced by the component to be processed. Further, the associated files associated with the component to be processed can be obtained based on the associated file search path, and the component to be processed and the associated files are combined and processed to obtain a target component package. The present invention determines the associated files associated with the component to be processed, and packages the component to be processed and the associated files together, thereby avoiding the problem of component packaging anomalies caused by packaging the component to be processed alone without considering the file reference relationship, thereby improving the flexibility and accuracy of component packaging.
[0057] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0059] Figure 1 It is a schematic diagram of an implementation environment according to an exemplary embodiment.
[0060] Figure 2 The present invention is a flow chart of a component processing method according to an exemplary embodiment.
[0061] Figure 3 The present invention is a flow chart of a method for determining an associated file search path according to an exemplary embodiment.
[0062] Figure 4 The figure is a flow chart of another method for determining an associated file search path according to an exemplary embodiment.
[0063] Figure 5 The present invention is a flow chart of another component processing method according to an exemplary embodiment.
[0064] Figure 6 The present invention is a flow chart showing a method for updating and acquiring associated files based on file reference information according to an exemplary embodiment.
[0065] Figure 7 is an example interface diagram shown according to an exemplary embodiment.
[0066] Figure 8 The figure is a block diagram of a component processing device according to an exemplary embodiment.
[0067] Fig. 9 The figure is a schematic diagram showing the structure of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0068] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0069] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0070] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0071] See also Figure 1 , which shows a schematic diagram of an implementation environment provided by an embodiment of the present disclosure, the implementation environment may include: at least one component request end 110 and a component management end 120, and the component request end 110 and the component management end 120 can communicate data through a network.
[0072] Specifically, the component request end 110 can send a component processing request to the component management end 120 according to demand. The component management end 120 selects corresponding components from the preset component library according to the component processing request for packaging to generate a corresponding target component package, and sends the target component package to the component request end 110.
[0073] The component request end 110 can communicate with the component management end 120 based on the browser / server mode (B / S) or the client / server mode (C / S). The component request end 110 may include: physical devices such as smart phones, tablet computers, laptops, digital assistants, smart wearable devices, vehicle terminals, servers, etc., and may also include software running in physical devices, such as applications, etc. The operating system running on the component request end 110 in the embodiment of the present disclosure may include but is not limited to Android system, IOS system, Linux, Windows, etc.
[0074] The component management end 120 and the component request end 110 can establish a communication connection via wired or wireless communication. The component management end 120 can include an independently operated server, or a distributed server, or a server cluster composed of multiple servers, wherein the server can be a cloud server.
[0075] In order to solve the problem in the related art that the operation of a component depends on the operation of the entire engineering project, which leads to abnormal component packaging, the embodiment of the present disclosure provides a component processing method, the execution subject of which can be Figure 1 Component management side in ; see Figure 2 , the method may specifically include:
[0076] S210. Receive a component processing request for a component to be processed.
[0077] Specifically, a component processing request may be a request to assemble multiple components to form a target application, or a request to run one or more specific components, etc., so that a component processing request may involve one or more components to be processed; the component processing request may include a component identifier of the component to be processed, thereby facilitating determination of the component to be processed from a preset component library based on the component processing request.
[0078] In one example, the components included in the preset component library may correspond to an overall engineering project, that is, the operation of the engineering project needs to be based on the various components in the preset component library; in addition, by combining different components in the preset component library, different business needs can be met, and then related components can be combined and packaged according to the component processing request sent by the component request end.
[0079] S220. Obtain an associated file search path corresponding to the component to be processed; the associated file search path is obtained based on file reference information of the component to be processed.
[0080] Each component to be processed corresponds to an associated file search path, which is used to obtain the files referenced by the component to be processed; specifically, the associated file search path can be obtained in advance based on the file reference information of the component to be processed. The associated file search path can be stored locally in the component management end, or in a preset database. When the associated file search path is needed, it can be obtained based on the component identification of the component to be processed.
[0081] In an optional embodiment, when the associated file search path is stored in a preset database, before receiving a component processing request, the associated file search path can be read from the preset database to the local memory of the component management end in advance, so that the associated file search path can be directly obtained from the local memory, thereby improving the efficiency of obtaining the associated file search path; when the component packaging is completed, the associated file search path can be deleted from the local memory, thereby avoiding the occupation of local memory resources and improving the utilization of memory resources.
[0082] Furthermore, the file reference information may include one or more file reference items, and the file reference items correspond to the associated file search paths, that is, for a reference file existing in the file reference information, an associated file search path corresponding to the reference file will be generated; for a file not existing in the file reference information, an associated file search path corresponding to the file will not be generated; thereby ensuring that a file not included in the file reference information will not generate an associated file search path corresponding to it, and only a file included in the file reference information will generate an associated file search path corresponding to it. The files referenced by the component to be processed can be obtained through the associated file search path, thereby realizing reference isolation between components and matching the use of the components with the reference relationship.
[0083] In a specific embodiment, the file reference information may be a reference relationship description file, that is, each component corresponds to a reference relationship description file, and the reference relationship description file may include the file identifier of the file referenced by the component, etc. Therefore, when determining the associated file search path based on the file reference information, the file identifier in the reference relationship description information may be firstly subjected to text recognition to obtain the file identifier of the associated file; and then the corresponding associated file search path may be determined based on the file identifier of the associated file. In the present disclosure, a text recognizer may be used to recognize the file identifier, and a model capable of realizing text recognition in the related art may be applied in the present disclosure.
[0084] Furthermore, the file identifier in the reference relationship description file is represented in the target format, so that when the file identifier of the reference relationship description file is identified, the text in the target format can be directly identified, and then the file identifier in the target format can be obtained, thereby improving the recognition efficiency of the file identifier.
[0085] S230. Based on the associated file search path, obtain associated files associated with the component to be processed.
[0086] The associated files are files that the component to be processed depends on when it runs and are independent of the component to be processed. The associated files of the component to be processed may be files in one or more associated components.
[0087] S240. Combine and process the component to be processed and the associated files to obtain a target component package corresponding to the component to be processed.
[0088] Specifically, the combined processing of the components to be processed and the associated files can be component packaging of the components to be processed and the associated files, and the components to be processed and the associated files can be copied from the preset component library, that is, the component packaging does not affect the component content contained in the preset component library; then, a corresponding target component package is generated based on the preset component packaging command, and the target component package is an independent application or independent software framework that can realize the preset functions.
[0089] In an optional embodiment, since different terminal devices may have different operating systems, different packaging commands can be used to package the components to be processed and the associated files for different operating systems, so that the target components generated by the packaging can be applicable to different operating systems, thereby improving the adaptability and flexibility of component packaging.
[0090] The present disclosure determines the associated files associated with the component to be processed and packages the component to be processed and the associated files together, thereby avoiding the problem of component packaging anomalies caused by packaging the component to be processed separately without considering the file reference relationship, and improving the flexibility and accuracy of component packaging.
[0091] In an optional embodiment, the file reference information includes the file identifier of the associated file; accordingly, refer to Figure 3 , which shows a method for determining an associated file search path, which may include:
[0092] S310. Determine the associated component to which the associated file belongs based on the file identifier of the associated file.
[0093] Each component may generally include multiple files, and these multiple files work together to realize the component function of the corresponding component. In an optional embodiment, the file identifier of each file in each component is a unique identifier, so that a file search table can be generated based on the correspondence between the component identifier of each component and the file identifiers of the files included in the component. When the file identifier of the associated file is determined, the component identifier of the component corresponding to the file identifier of the associated file can be found in the file search table based on the file identifier, and then the associated component to which the associated file belongs can be determined.
[0094] In another optional embodiment, the file identifier of an associated file may include first identification information and second identification information. The first identification information may represent information of an associated component to which the associated file belongs, and the second identification information may be file name information of the associated file. Thus, the associated component to which the associated file belongs may be determined based on the first identification information in the file identifier of the associated file, thereby improving the convenience of determining the associated component.
[0095] S320. Determine the associated file search path based on the component identifier of the associated component; at least one component file of the associated component is stored under the associated file search path.
[0096] In one example, a search path corresponding to each component in a preset component library may be created in advance, that is, each component corresponds to a search path, and the file information contained in the component may be stored under the search path. Accordingly, the search path corresponding to each component may contain the component identification of the component, so that based on the component identification of the associated component, a match may be made in the search paths corresponding to multiple components to obtain a search path corresponding to the associated component. The search path corresponding to the associated component is the associated file search path, and the component files contained in the associated component are stored under the associated file search path.
[0097] Thus, the associated component to which the associated file belongs can be determined through the file identifier of the associated file included in the file reference information. The associated file is stored in the search path corresponding to the associated component to which it belongs. Determining the associated file search path based on the component identifier of the associated component can improve the efficiency of determining the search path.
[0098] In a specific embodiment, the associated files include directly referenced files and indirectly referenced files; the directly referenced files are files directly referenced by the component to be processed, and the indirectly referenced files are files referenced by the directly referenced files; accordingly, please refer to Figure 4 , which shows another method for determining an associated file search path, which may include:
[0099] S410. Determine a first file path corresponding to the directly referenced file and a second file path corresponding to the indirectly referenced file.
[0100] S420. Determine the associated file search path based on the first file path and the second file path.
[0101] In a specific embodiment, assuming that component A contains a statement referencing file b but does not contain a statement referencing file c, and file b contains a statement referencing file c, then file b can be determined to be a directly referenced file of component A, and file c can be determined to be an indirectly referenced file of component A. Furthermore, if file b and file c also reference other files, then the other files can also be determined to be indirectly referenced files of component A.
[0102] In an example, the first file path may be a storage path of a direct reference file, and the second file path may be a storage path of an indirect reference file. The first file path and the second file path may be directly determined as associated file search paths.
[0103] In another example, the first file path may be a search path corresponding to a component to which the file directly references, and the second file path may be a search path corresponding to a component to which the file indirectly references, so that the first file path and the second file path may be determined as associated file search paths.
[0104] The associated files determined in the present disclosure include direct reference files and indirect reference files of the components to be processed, thereby taking comprehensive consideration of the reference relationships between components, avoiding omissions of reference relationships, and further improving the comprehensiveness and accuracy of component packaging.
[0105] In another optional embodiment, the file reference information includes the file identifier of the associated file; accordingly, refer to Figure 5 , which shows another component processing method, which may include:
[0106] S510. Receive a component processing request for a component to be processed.
[0107] S520. Obtain an associated file search path corresponding to the component to be processed; the associated file search path is obtained based on file reference information of the component to be processed.
[0108] S530. Concatenate the associated file search path and the file identifier of the associated file to obtain a first target search path.
[0109] S540. Acquire the associated file based on the first target search path.
[0110] S550. Combine and process the component to be processed and the associated files to obtain a target component package corresponding to the component to be processed.
[0111] The implementation details of steps S510 - S520 are the same as those of the above-mentioned S210 - S220 and will not be repeated here.
[0112] In one example, the associated file search path can be regarded as a part of the path information, which can be used to indicate the search path direction for the associated files. Based on the associated file search path, the path of the associated component to which the associated file belongs can be determined. On this basis, the first target search path can be obtained by further adding the file identifier, and then the corresponding associated file can be obtained.
[0113] Therefore, the associated file search path is concatenated with the file identifier of the associated file to obtain the first target search path, and the corresponding associated file is obtained based on the first target search path, which can improve the accuracy and efficiency of obtaining the associated file, and further improve the accuracy and efficiency of component packaging.
[0114] In another optional embodiment, after obtaining the associated file search path corresponding to the component to be processed, the file identifier of the associated file can be matched with each file identifier under the associated file search path to obtain a file corresponding to a file identifier that matches the file identifier of the associated file. This file is the associated file.
[0115] In one specific embodiment, see Figure 6 , which shows a method for updating and acquiring associated files based on file reference information, the method may include:
[0116] S610. If the associated file is not obtained based on the associated file search path, obtain updated file reference information.
[0117] According to the above content of this embodiment, it can be known that the associated file search path is generated based on the file reference information, that is, if there is a file reference relationship, a corresponding associated file search path will be generated; if the associated file is not obtained based on the associated file search path, it means that there may not be an associated file search path for obtaining the corresponding associated file. Further, the reason may be that the corresponding file reference relationship is not updated; therefore, it is necessary to update the file reference information based on the current file reference relationship to obtain the updated file reference information.
[0118] S620. Based on the updated file reference information, obtain an updated associated file search path.
[0119] S630. Based on the updated associated file search path, obtain the associated file.
[0120] The implementation details of obtaining the updated associated file search path based on the updated file reference relationship in steps S620-S630, and acquiring the associated file based on the updated associated file search path can be found in the above content of this embodiment, which will not be repeated here.
[0121] Furthermore, the file reference information is updated based on the changes in the reference relationship between components, and then an associated file search path can be generated based on the updated file reference information, thereby matching the associated file search path with the file reference relationship. In the scenario where the reference relationship of the component to be processed to other associated files changes, the associated file search path can be adaptively updated, thereby improving the convenience and efficiency of obtaining associated files.
[0122] In another optional embodiment, an associated file acquisition link is stored under the associated file search path, and the associated file acquisition link points to a preset file library; thereby, based on the associated file search path, the associated file associated with the component to be processed is acquired, and specifically, based on the associated file acquisition link, the associated file is acquired from the preset file library.
[0123] In one example, the preset file library stores the file information contained in each component, so that when obtaining associated files based on the associated file search paths corresponding to each component, the corresponding file acquisition links can be stored under the corresponding associated file search paths instead of the associated files themselves; on the one hand, it can avoid the resource consumption of reading the associated files from the preset file library into the associated file search paths; on the other hand, it can avoid the repeated storage of associated files, and only one copy needs to be stored, thereby avoiding the waste of storage space and improving resource utilization.
[0124] The following is a specific example to illustrate the implementation process of the present disclosure. When adding header file references, there are three ways (reference the aaa file under the xxx library):
[0125] 1. File reference statement + "aaa"
[0126] 2. File reference statement + <aaa>
[0127] 3. File reference statement + <xxx aaa>
[0128] After the component library installation operation is executed on the project, an H folder will be generated, which includes M and N folders. M and N folders can include the header files of each component library; a search path list is generated for each component library, of which two paths are included in the search path list of all component libraries, one pointing to H / N, and the other pointing to H / M. On this basis, the path of the H / N / xxx library can also be added according to the current library dependency. xxx represents the name of the dependent library. There are several H / N / xxx paths for the number of dependent libraries.
[0129] In the process of executing the component library installation operation on the project in the present disclosure, a new directory H / D is added on the basis of the original H / N and H / M directories; then in the D directory, a corresponding folder is created with the library name of each component library as the folder name, and then inside each folder, another N folder is created, and inside the N folder, a soft link is made to the H / N / xxx library. Figure 7 Shows the creation of folders. Figure 7 The last B in the H / D / B / N / B path is a soft link to the N / B folder, that is, the addresses H / D / B / N / B and H / N / B are the same.
[0130] If component A references component B, and component A adds a dependency on component B, the search path of component A is modified to:
[0131] H / N
[0132] H / D / B / N
[0133] H / D / B / N / B
[0134] Accordingly, the actual path to find the bbb file is:
[0135] H / N / B / bbb or H / D / B / N / B / bbb.
[0136] Assume that component A needs to reference the bbb file of component B, through the file reference statement + , you can use the search path H / D / B / N to match a path like H / D / B / N / B / bbb; you can also use the file reference statement + "bbb" or the file reference statement + <bbb>, use the search path H / D / B / N / B to match the path H / D / B / N / B / bbb; therefore, after modifying the search path, the added dependent components still run normally.
[0137] When component A needs to reference the ccc file of component C, but component A does not add the dependency of component C, the real path to find the ccc file is:
[0138] H / N / C / ccc or H / D / C / N / C / ccc.
[0139] At this time, the path where ccc is located cannot be matched, and component A cannot reference the content of component C without adding dependencies.
[0140] When the dependency on component C is added, the search path for component A will increase by two items:
[0141] H / D / C / N
[0142] H / D / C / N / C
[0143] At this time, you can reference ccc in a similar way to reference bbb.
[0144] The present disclosure modifies the content and folder path of the header file soft link and the corresponding library search path list to achieve that each library can reference the content of the corresponding library by adding the corresponding dependency, so that each library can be compiled independently with complete dependency relationships; the header file references between components are isolated, and through forced isolation, it can be ensured that the use of header files between components matches the dependencies, ensuring that the code will not be cracked.
[0145] Figure 8 is a block diagram of a component processing device according to an exemplary embodiment. Figure 8 , the device comprises:
[0146] The component processing request receiving unit 810 is configured to receive a component processing request for a component to be processed;
[0147] The associated file search path acquisition unit 820 is configured to execute acquisition of an associated file search path corresponding to the component to be processed; the associated file search path is obtained based on the file reference information of the component to be processed;
[0148] The associated file acquisition unit 830 is configured to acquire associated files associated with the component to be processed based on the associated file search path;
[0149] The component processing unit 840 is configured to perform combined processing on the component to be processed and the associated files to obtain a target component package corresponding to the component to be processed.
[0150] In an exemplary embodiment, the file reference information includes a file identifier of the associated file;
[0151] The device also includes:
[0152] an associated component determining unit, configured to determine an associated component to which the associated file belongs based on the file identification of the associated file;
[0153] The associated file search path determining unit is configured to determine the associated file search path based on the component identification of the associated component; at least one component file of the associated component is stored in the associated file search path.
[0154] In an exemplary embodiment, the associated files include directly referenced files and indirectly referenced files; the directly referenced files are files directly referenced by the component to be processed, and the indirectly referenced files are files referenced by the directly referenced files;
[0155] The device also includes:
[0156] A first determining unit is configured to determine a first file path corresponding to the directly referenced file and a second file path corresponding to the indirectly referenced file;
[0157] The second determining unit is configured to determine the associated file search path based on the first file path and the second file path.
[0158] In an exemplary embodiment, the file reference information includes a file identifier of the associated file;
[0159] The associated file acquisition unit 830 includes:
[0160] An information splicing unit is configured to perform splicing on the associated file search path and the file identifier of the associated file to obtain a first target search path;
[0161] A first acquiring unit is configured to acquire the associated file based on the first target search path.
[0162] In an exemplary embodiment, the apparatus further comprises:
[0163] A second acquiring unit is configured to acquire updated file reference information when the associated file is not acquired based on the associated file search path;
[0164] A path updating unit, configured to obtain an updated associated file search path based on the updated file reference information;
[0165] The third acquisition unit is configured to execute the associated file search path based on the updated associated file search path to acquire the associated file.
[0166] In an exemplary embodiment, an associated file acquisition link is stored under the associated file search path, and the associated file acquisition link points to a preset file library;
[0167] The associated file acquisition unit 830 includes:
[0168] The fourth acquisition unit is configured to execute acquisition link based on the associated file and acquire the associated file from the preset file library.
[0169] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0170] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided. Optionally, the computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a tape, a floppy disk, an optical data storage device, etc.; when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any of the methods described above.
[0171] In an exemplary embodiment, a computer program product is also provided, which includes a computer program stored in a readable storage medium, and at least one processor of a computer device reads and executes the computer program from the readable storage medium, so that the device performs any of the above methods.
[0172] Fig. 9 is a block diagram of an electronic device for component processing according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as shown in FIG. Fig. 9 As shown. The electronic device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a component processing method is implemented.
[0173] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0174] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0175] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.< / bbb> < / xxx> < / aaa>
Claims
1. A component processing method, characterized in that: include: Receiving a component processing request for a component to be processed; the component processing request is a request to assemble multiple components to form a target application, or the component processing request is a request to run one or more components; Acquire an associated file search path corresponding to the component to be processed; the associated file search path is obtained based on file reference information of the component to be processed; Based on the associated file search path, the associated files associated with the component to be processed are obtained; each component corresponds to a search path, the search path corresponding to the associated component is the associated file search path, and the corresponding file acquisition link is stored under the associated file search path, and the file acquisition link points to a preset file library; The method for establishing a component library file directory includes: after executing a component library installation operation, generating an H / N directory, an H / M directory, and an H / D directory, wherein the M and N folders include header files of each component library, creating a corresponding folder under the D directory with the library name of each component library as the folder name, and then creating an N folder inside each created folder, and soft-linking the N folder to the H / N / xxx library, wherein the xxx library is a preset component library; wherein each component library corresponds to a search path H / D directory; The components to be processed and the associated files are combined to obtain a target component package corresponding to the components to be processed; the combined processing of the components to be processed and the associated files includes copying the components to be processed and the associated files from a preset component library, and generating the target component package based on a preset component packaging command, wherein the target component package is an independent application or an independent software framework that can realize preset functions.
2. The method according to claim 1, characterized in that The file reference information includes the file identifier of the associated file; The method further comprises: Determining the associated component to which the associated file belongs based on the file identifier of the associated file; The associated file search path is determined based on the component identification of the associated component; at least one component file of the associated component is stored under the associated file search path.
3. The method according to claim 1 or 2, characterized in that: The associated files include directly referenced files and indirectly referenced files; the directly referenced files are files directly referenced by the component to be processed, and the indirectly referenced files are files referenced by the directly referenced files; The method further comprises: Determine a first file path corresponding to the directly referenced file and a second file path corresponding to the indirectly referenced file; The associated file search path is determined based on the first file path and the second file path.
4. The method according to claim 1, characterized in that: The file reference information includes the file identifier of the associated file; The acquiring the associated file associated with the component to be processed based on the associated file search path includes: Concatenate the associated file search path and the file identifier of the associated file to obtain a first target search path; The associated file is acquired based on the first target search path.
5. The method according to claim 1, characterized in that The method further comprises: If the associated file is not obtained based on the associated file search path, obtaining updated file reference information; Based on the updated file reference information, obtaining an updated associated file search path; Based on the updated associated file search path, the associated file is acquired.
6. The method according to claim 1, characterized in that An associated file acquisition link is stored under the associated file search path, and the associated file acquisition link points to a preset file library; The acquiring the associated file associated with the component to be processed based on the associated file search path includes: Based on the associated file acquisition link, the associated file is acquired from the preset file library.
7. A component processing device, characterized in that: include: A component processing request receiving unit, configured to receive a component processing request for a component to be processed; The component processing request is a request to assemble multiple components to form a target application, or the component processing request is a request to run one or more components; An associated file search path acquisition unit is configured to execute acquisition of an associated file search path corresponding to the component to be processed; the associated file search path is obtained based on file reference information of the component to be processed; An associated file acquisition unit is configured to acquire associated files associated with the component to be processed based on the associated file search path; each component corresponds to a search path, and the search path corresponding to the associated component is the associated file search path, and a corresponding file acquisition link is stored under the associated file search path, and the file acquisition link points to a preset file library; The method for establishing a component library file directory includes: after executing a component library installation operation, generating an H / N directory, an H / M directory, and an H / D directory, wherein the M and N folders include header files of each component library, creating a corresponding folder under the D directory with the library name of each component library as the folder name, and then creating an N folder inside each created folder, and soft-linking the N folder to the H / N / xxx library, wherein the xxx library is a preset component library; wherein each component library corresponds to a search path H / D directory; The component processing unit is configured to perform combined processing on the components to be processed and the associated files to obtain a target component package corresponding to the components to be processed; the combined processing on the components to be processed and the associated files includes copying the components to be processed and the associated files from a preset component library, and generating the target component package based on a preset component packaging command, wherein the target component package is an independent application or an independent software framework that can realize preset functions.
8. The device according to claim 7, characterized in that The file reference information includes the file identifier of the associated file; The device also includes: an associated component determining unit, configured to determine an associated component to which the associated file belongs based on the file identification of the associated file; The associated file search path determining unit is configured to determine the associated file search path based on the component identification of the associated component; at least one component file of the associated component is stored in the associated file search path.
9. The device according to claim 7 or 8, characterized in that The associated files include directly referenced files and indirectly referenced files; the directly referenced files are files directly referenced by the component to be processed, and the indirectly referenced files are files referenced by the directly referenced files; The device also includes: A first determining unit is configured to determine a first file path corresponding to the directly referenced file and a second file path corresponding to the indirectly referenced file; The second determining unit is configured to determine the associated file search path based on the first file path and the second file path.
10. The device according to claim 7, characterized in that The file reference information includes the file identifier of the associated file; The associated file acquisition unit includes: An information splicing unit is configured to perform splicing on the associated file search path and the file identifier of the associated file to obtain a first target search path; A first acquiring unit is configured to acquire the associated file based on the first target search path.
11. The device according to claim 7, characterized in that The device also includes: A second acquiring unit is configured to acquire updated file reference information when the associated file is not acquired based on the associated file search path; A path updating unit, configured to obtain an updated associated file search path based on the updated file reference information; The third acquisition unit is configured to execute the associated file search path based on the updated associated file search path to acquire the associated file.
12. The device according to claim 7, characterized in that An associated file acquisition link is stored under the associated file search path, and the associated file acquisition link points to a preset file library; The associated file acquisition unit includes: The fourth acquisition unit is configured to execute acquisition link based on the associated file and acquire the associated file from the preset file library.
13. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the component processing method according to any one of claims 1 to 6.
14. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the component processing method as claimed in any one of claims 1 to 6.
15. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the component processing method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
File compiling method and device
CN108153529A
Method, device and apparatus for finding dependency relationship between components and storage medium
CN109189729A
Component compiling method, device and equipment and computer readable storage medium
CN112965720A