Resource library processing method and apparatus, electronic device, and storage medium
By dividing the file hierarchy in the application resource library and correcting the configuration information of complex components, the problem of low efficiency in resource library optimization configuration in the prior art is solved, and efficient and automated resource library reconstruction and abnormal component monitoring are realized.
Patent Information
- Application Number
- CN202210854615.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-15
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-07-15
AI Technical Summary
Current technologies for optimizing application modules are inefficient, requiring manual analysis of each component and file, which is costly.
By determining the dependencies between various files in the application resource library, dividing them into components at multiple levels, generating initial configuration information, and modifying the target components based on preset configuration information influencing factors to obtain modified configuration information, the files are finally reconfigured to form a reconstructed resource library.
It improves the automation level of resource repository processing, reduces manual intervention, increases processing efficiency, reduces the risk of conflicts, and promptly detects and handles abnormal components.
Smart Images

Figure CN115237462B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to a resource library processing method and device, electronic equipment, storage medium and program product. BACKGROUND
[0002] In recent years, with the development of Internet technology, more and more service items or functions are added in application programs, the scale of application program or application product modules is also increasing, and many components in the modules are becoming more and more complex, so many large components become more and more difficult to maintain. Therefore, it is often necessary to periodically disassemble various modules for optimization configuration processing.
[0003] At present, the optimization configuration work of the application program module often needs the technical personnel to analyze each component in the module and each file under the component one by one, and then optimizes the configuration according to the analysis result, which is low in efficiency. SUMMARY
[0004] The present disclosure provides a resource library processing method and device, electronic equipment, storage medium and program product to at least solve the technical problem of low efficiency of optimization configuration work of application program modules in the related art. The technical solutions of the present disclosure are as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a resource library processing method is provided, comprising:
[0006] determining the dependency relationship between each file in the application program resource library; the dependency relationship represents the calling relationship of the file in the use process;
[0007] dividing the files into a plurality of hierarchical components according to the dependency relationship between the files, and generating initial configuration information of the files; the initial configuration information is used to record the moving path of the files, and each hierarchical level corresponds to different file complexity;
[0008] correcting the initial configuration information of the files in the target component based on a preset configuration information influencing factor to obtain corrected configuration information; the target component represents a component of a hierarchical level whose complexity meets a preset condition;
[0009] reconfiguring each file in the application program resource library through the initial configuration information corresponding to the remaining components except the target component in the components and the corrected configuration information corresponding to the target component, to obtain a reconstructed resource library corresponding to the application program resource library.
[0010] In an exemplary embodiment, the dividing the files into a plurality of hierarchical components according to the dependency relationship between the files comprises:
[0011] determining a dependency number of the files according to the dependency relationship between the files;
[0012] dividing the files into a plurality of hierarchical components according to the dependency number.
[0013] In an example embodiment, the initial configuration information of the files in the target component is modified based on the preset configuration information influencing factor to obtain modified configuration information, including:
[0014] determining a to-be-modified file and a modification manner corresponding to the to-be-modified file from the files of the target component based on the configuration information influencing factor; the modification manner includes at least one of modification of a moving path, splitting of a file, and merging of a file;
[0015] modifying the initial configuration information of the to-be-modified file according to the modification manner to obtain the modified configuration information.
[0016] In an example embodiment, after the initial configuration information of the files in the target component is modified based on the preset configuration information influencing factor to obtain the modified configuration information, the method further includes:
[0017] obtaining an updated application resource library and comparing the updated application resource library with the application resource library;
[0018] in a case where a new file is obtained through the comparison, determining a dependency relationship corresponding to the new file, and modifying the modified configuration information corresponding to the target component and / or the initial configuration information corresponding to the remaining components again according to the dependency relationship corresponding to the new file to obtain new modified configuration information;
[0019] reconfiguring each file in the updated application resource library through the new modified configuration information to obtain a reconstruction resource library corresponding to the application resource library.
[0020] In an example embodiment, after the reconstruction resource library corresponding to the application resource library is obtained, the method further includes:
[0021] replacing reference information corresponding to each file in the application resource library with reference information corresponding to each file in the reconstruction resource library.
[0022] In an example embodiment, after the reconstruction resource library corresponding to the application resource library is obtained, the method further includes:
[0023] obtaining a dependency relationship corresponding to each component in the reconstruction resource library; each component includes a plurality of files.
[0024] based on the dependency relationship between the files and the dependency relationship corresponding to each component, obtaining a direct dependent component number, a recursive dependent component number of each component, and a file feature of a file under each component;
[0025] based on the direct dependent component number, the recursive dependent component number, and the file feature, determining a running state of each component.
[0026] In an exemplary embodiment, after determining the running state of each component based on the direct dependent component number, the recursive dependent component number, and the file feature, the method further comprises:
[0027] In the case where an abnormal component with an abnormal running state is determined, determining an abnormal factor causing the abnormal component to be abnormal from the direct dependent component number, the recursive dependent component number, and the file feature;
[0028] generating prompt information for the abnormal component and the abnormal factor according to the abnormal factor.
[0029] According to a second aspect of the embodiments of the present disclosure, a resource library processing apparatus is provided, comprising:
[0030] a determination unit configured to determine a dependency relationship between files in an application resource library; the dependency relationship represents a calling relationship of the files in a use process;
[0031] a division unit configured to divide the files into components at multiple levels according to the dependency relationship between the files, and generate initial configuration information of the files; the initial configuration information is used to record a moving path of the files, and each level corresponds to a different file complexity;
[0032] a correction unit configured to correct the initial configuration information of the files in a target component based on a preset configuration information influencing factor, to obtain corrected configuration information; the target component represents a component at a level with a complexity meeting a preset condition;
[0033] a configuration unit configured to reconfigure the files in the application resource library based on the initial configuration information corresponding to the components other than the target component in the application resource library and the corrected configuration information corresponding to the target component, to obtain a reconstructed resource library corresponding to the application resource library.
[0034] In an exemplary embodiment, the division unit is further configured to determine a dependency relationship number of the files according to the dependency relationship between the files, and divide the files into components at multiple levels according to the dependency relationship number.
[0035] In an exemplary embodiment, the correction unit is further configured to perform an action based on the configuration information influencing factors to determine a file to be corrected and a correction method corresponding to the file to be corrected from the files of the target component; the correction method includes at least one of modifying the movement path, splitting the file, and merging the file; and to correct the initial configuration information of the file to be corrected according to the correction method to obtain the corrected configuration information.
[0036] In an exemplary embodiment, the correction unit is further configured to perform the following: obtain an updated application resource library and compare the updated application resource library with the application resource library; if a new file is obtained from the comparison, determine the dependency relationship corresponding to the new file, and correct the corrected configuration information corresponding to the target component and / or the initial configuration information corresponding to the other components again according to the dependency relationship corresponding to the new file to obtain new corrected configuration information;
[0037] The configuration unit is further configured to reconfigure each file in the updated application resource library using the new corrected configuration information to obtain a reconstructed resource library corresponding to the application resource library.
[0038] In one exemplary embodiment, the apparatus further includes a replacement unit configured to perform the replacement of reference information corresponding to each file in the application resource library with the corresponding reference information in the reconstructed resource library.
[0039] In an exemplary embodiment, the apparatus further includes a state determination unit configured to perform the following: obtaining the dependency relationships corresponding to each component in the reconstructed resource library; each component includes multiple files; based on the dependency relationships between the files and the dependency relationships corresponding to each component, obtaining the number of directly dependent components, the number of recursively dependent components, and the file characteristics of the files under each component; and determining the running state of each component based on the number of directly dependent components, the number of recursively dependent components, and the file characteristics.
[0040] In one exemplary embodiment, the apparatus further includes an exception notification unit configured to, upon determining an exception component with an abnormal operating state, identify exception factors causing the exception component to be abnormal from the number of directly dependent components, the number of recursively dependent components, and the file characteristics; and generate notification information for the exception component and the exception factors based on the exception factors.
[0041] According to a third aspect of the present disclosure, an electronic device is provided, comprising:
[0042] processor;
[0043] a memory for storing the processor-executable instructions;
[0044] The processor is configured to execute the instructions to implement the method according to any one of the preceding embodiments.
[0045] According to a fourth aspect of the embodiments 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 an electronic device, the electronic device can execute the method according to any one of the preceding embodiments.
[0046] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, the computer program product includes instructions, when the instructions are executed by a processor of an electronic device, the electronic device can execute the method according to any one of the preceding embodiments.
[0047] The embodiments of the present disclosure provide at least the following beneficial effects:
[0048] By applying the dependency relationship between each file in the application resource library, each file is first divided into a plurality of hierarchical components, and initial configuration information of each file is generated, then based on the preset configuration information influencing factors, the initial configuration information of the file in the target component is corrected to obtain the corrected configuration information, finally, through the initial configuration information corresponding to the remaining components except the target component in each component, and the corrected configuration information corresponding to the target component, each file in the application resource library is reconfigured to obtain the restructured resource library corresponding to the application resource library. The method first divides each file based on the dependency relationship to obtain the initial configuration information, then only corrects the more complex files to obtain the corrected configuration information, without manual participation in each analysis process, thereby improving the processing efficiency of the resource library.
[0049] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0050] The accompanying drawings, which are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification serve to explain the principles of the present disclosure, and do not constitute an improper limitation on the present disclosure.
[0051] Figure 1 is an application environment diagram of a resource library processing method according to an exemplary embodiment.
[0052] Figure 2 is a flowchart of a resource library processing method according to an exemplary embodiment.
[0053] Figure 3 is a complete flow diagram of a resource library processing method according to an example embodiment.
[0054] Figure 4 is a structural block diagram of a resource library processing apparatus according to an example embodiment.
[0055] Figure 5 is a block diagram of an electronic device according to an example embodiment. DETAILED DESCRIPTION
[0056] In order for those skilled 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 described clearly and completely below with reference to the drawings.
[0057] It should be noted that the implementations described in the following example embodiments do not represent all the implementations consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present disclosure as detailed in the appended claims. It should also 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, analyzed data, etc.) involved in the present disclosure are all information and data authorized by the user or authorized by all parties.
[0058] The resource library processing method provided by the embodiments of the present disclosure can be applied in an application environment as shown in Figure 1 . In the application environment, the terminal 102 communicates with the server 104 through a network, and an application program resource library is deployed in the server 104. In the application scenario of the present disclosure, the terminal 102 can obtain the dependency relationship between each file in the application program resource library from the server 104, divide each file into a plurality of hierarchical components according to the dependency relationship between each file, and generate initial configuration information of each file; based on a preset configuration information influencing factor, the initial configuration information of the file in the target component is corrected to obtain corrected configuration information; and based on the initial configuration information corresponding to each component except the target component and the corrected configuration information corresponding to the target component, each file in the application program resource library is reconfigured to obtain a reconstructed resource library corresponding to the application program resource library.
[0059] The terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle-mounted device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0060] Figure 2 is a flowchart of a resource library processing method according to an exemplary embodiment, as shown in Figure 2 the method is applied to the terminal 102 in Figure 1 for example, including the following steps:
[0061] In step S210, the dependency relationship between each file in the application resource library is determined, and the dependency relationship represents the calling relationship between the files in the use process.
[0062] Among them, the dependency relationship can be understood as the calling relationship between the files in the use process, for example, when the application program executes a certain function, it needs to use file a, and file a needs to call file b, then there is a dependency relationship between file a and file b.
[0063] It can be understood that the resource library of an application program stores files that implement different functions, and each function file can be stored in a resource library, therefore, an application program can include multiple resource libraries, each resource library can include multiple components, and each component includes multiple files, thereby implementing hierarchical division of application program files.
[0064] In the specific implementation, to configure the resource library, it is necessary to first determine which files are in the resource library and what the relationship between the files is, therefore, it is necessary to first determine the dependency graph of the files in the application resource library and the dependency graph of the components, and then determine the dependency relationship between each file by combining the dependency graph of the files and the dependency graph of the components.
[0065] In step S220, according to the dependency relationship between each file, each file is divided into multiple hierarchical components, and initial configuration information of each file is generated.
[0066] Among them, the initial configuration information is used to record the moving path of each file, and specifically includes the component name of the file currently located and the component name to be moved to.
[0067] Among them, each level corresponds to a different file complexity. For example, a first-level file indicates that the file has no external dependency relationship and the responsibility is relatively single; a second-level file indicates that the file has a simple dependency relationship, such as only one or two dependent files; and a third-level file indicates that the file has a relatively complex dependency relationship, such as depending on multiple other files or being dependent on multiple other files.
[0068] In a specific implementation, the complexity of a file can be represented by dependency relationship information, for example, the more the dependency relationships, the higher the complexity of the file; the fewer the dependency relationships, the simpler the file. Therefore, the number of dependency relationships of each file can be determined according to the dependency relationships between the files in the application resource library, and each file can be divided into a plurality of hierarchical components according to the number of dependency relationships.
[0069] In step S230, the initial configuration information of the files in the target component is modified based on the preset configuration information influencing factor to obtain modified configuration information; the target component represents a hierarchical component whose complexity meets the preset condition.
[0070] The configuration information influencing factor can be the actual application scenario of the file and the attribute information of the file (such as the type of the file).
[0071] In a specific implementation, since the storage location of the files in the resource library is affected not only by the dependency relationships of the files but also by factors such as the actual application scenario of the file and the attribute information of the file, after the initial configuration information of each file is determined based on the dependency relationships between the files, the initial configuration information needs to be modified according to the preset configuration information influencing factor to determine which component the file should actually be moved to.
[0072] More specifically, since files with no dependency relationship or simple dependency relationships are less affected by the configuration information influencing factor, to improve processing efficiency, a target component whose complexity meets the preset condition can be determined from the plurality of components, the initial configuration information of the target component is modified based on the preset configuration information influencing factor to obtain modified configuration information of the target component.
[0073] In step S240, each file in the application resource library is reconfigured based on the initial configuration information corresponding to the remaining components other than the target component in each component and the modified configuration information corresponding to the target component to obtain a reconstructed resource library corresponding to the application resource library.
[0074] In a specific implementation, after the modified configuration information of the target component is obtained, each file in the application resource library can be reconfigured based on the initial configuration information of the remaining components other than the target component in each component and the modified configuration information of the target component to obtain a reconstructed resource library corresponding to the application resource library.
[0075] More specifically, each file in the application resource library is reconfigured, including splitting, merging and moving each file in the application resource library according to the configuration information, and the specific order can be to split the files that need to be split first, then merge the files that need to be merged, and finally move the split or merged files and other files to the corresponding target component according to the configuration information, and generate a new component to describe the files, and add the configuration information of the new component.
[0076] In the above resource library processing method, based on the dependency relationship between each file in the application resource library, each file is first divided into multiple hierarchical components, and initial configuration information of each file is generated, then the initial configuration information of the files in the target component is modified based on the preset configuration information influencing factor, to obtain the modified configuration information, and finally, based on the initial configuration information corresponding to the remaining components except the target component in each component and the modified configuration information corresponding to the target component, each file in the application resource library is reconfigured to obtain the restructured resource library corresponding to the application resource library. This method first divides each file based on the dependency relationship to obtain initial configuration information, and then only modifies the more complex files to obtain modified configuration information, without human intervention in each analysis process, thereby improving the processing efficiency of the resource library.
[0077] In an exemplary embodiment, in step S220, each file is divided into multiple hierarchical components according to the dependency relationship between each file, which can be achieved by the following steps:
[0078] Step S220A, according to the dependency relationship between each file, the number of dependency relationships of each file is determined;
[0079] Step S220B, according to the number of dependency relationships, each file is divided into multiple hierarchical components.
[0080] The number of dependency relationships can include the number of directly dependent files and the number of recursively dependent files.
[0081] The number of directly dependent files represents the number of files that directly depend on each file. For example, if file a needs to call file b, a direct dependency is formed between file a and file b, and file b can be a direct dependent file of file a.
[0082] The number of recursively dependent files represents the number of files that indirectly depend on each file. For example, if file c needs to call file d, and file d needs to call file e, a direct dependency is formed between file e and file c, and file c can be an indirect dependent file of file e.
[0083] In a specific implementation, different levels correspond to different file complexity, and the number of file dependency relationships can reflect the complexity of the file. Therefore, the number of dependency relationships of each file can be determined according to the dependency relationships between the files, and each file can be divided into components of multiple levels according to the number of dependency relationships.
[0084] More specifically, a corresponding dependency relationship number interval can be set for each level of component in advance. After determining the number of dependency relationships of each file, a target dependency relationship number interval corresponding to each file is determined from the dependency relationship number intervals, and the component corresponding to the target dependency relationship number interval is used as the target component to which the file needs to be moved. Thus, each file is divided into components of multiple levels.
[0085] In this embodiment, the number of dependency relationships of each file is determined through the dependency relationships between the files, and each file is divided into components of multiple levels based on the number of dependency relationships, thereby achieving automatic primary division of each file in the application resource library without human intervention in analysis, thereby improving processing efficiency.
[0086] In an exemplary embodiment, in step S230, the initial configuration information of the files in the target component is corrected based on the preset configuration information influencing factors to obtain corrected configuration information. This can be achieved through the following steps:
[0087] In step S230A, based on the configuration information influencing factors, the files to be corrected and the correction methods corresponding to the files to be corrected are determined from the files in the target component. The correction methods include at least one of modification of the moving path, splitting of the files, and merging of the files.
[0088] In step S230B, the initial configuration information of the files to be corrected is corrected according to the correction method to obtain the corrected configuration information.
[0089] The number of files to be corrected can be one or more.
[0090] In a specific implementation, after the files divided from the application resource library into the target component are analyzed by the configuration information influencing factors, the configuration information of some files can not need to be corrected. Therefore, before the correction process, the files in the target component can be analyzed according to the configuration information influencing factors to determine the files to be corrected that need to be corrected, and based on the configuration information influencing factors, it is determined which correction methods, such as modification of the moving path, splitting of the files, and merging of the files, are to be used for the files to be corrected. The initial configuration information of the files to be corrected is corrected according to the correction method, and the initial configuration information of the other files in the target component is used as the corrected configuration information.
[0091] In the embodiment, the initial configuration information of the to-be-corrected file is corrected according to the correction mode to obtain the corrected configuration information, without processing other files of the target component, thereby improving the processing efficiency.
[0092] In an example embodiment, after the initial configuration information of the file in the target component is corrected based on the preset configuration information influencing factor to obtain the corrected configuration information in step S230, the method further includes:
[0093] In step S231, an updated application program resource library is obtained, and the updated application program resource library is compared with the application program resource library.
[0094] In step S232, in the case that a new file is obtained through the comparison, a dependency relationship corresponding to the new file is determined, and the initial configuration information of the remaining components and / or the corrected configuration information corresponding to the target component are re-corrected according to the dependency relationship corresponding to the new file to obtain new corrected configuration information.
[0095] In step S233, each file in the updated application program resource library is reconfigured through the new corrected configuration information to obtain a reconstructed resource library corresponding to the application program resource library.
[0096] In a specific implementation, during the process of determining the configuration information of the files in the application resource library, other developers can develop some new files. If the configuration information is not determined based on the updated application resource library, subsequent conflicts can be caused, leading to running failure of the application. Therefore, after the initial configuration information of the target component is corrected to obtain the corrected configuration information, it is further needed to check whether the content in the application resource library is updated. If the content is updated, the updated application resource library is obtained, and the updated application resource library is compared with the original application resource library. In the case that new files are obtained through the comparison, it is indicated that the corrected configuration information of the target component or the initial configuration information of the remaining components other than the target component needs to be corrected again. Therefore, the dependency relationship corresponding to the new files can be determined, that is, the dependency relationship between the new files and other files is determined. According to the dependency relationship, the files that need to be corrected are determined, and the configuration information of the files that need to be corrected is corrected again to obtain new corrected configuration information. The files that need to be corrected can belong to the target component or the remaining components other than the target component. Therefore, the configuration information of the files that need to be corrected can be the corrected configuration information or the initial configuration information. Further, after the new corrected configuration information is obtained, each file in the updated application resource library can be split, merged, or moved according to the new corrected configuration information to obtain the reconstruction resource library corresponding to the application resource library.
[0097] In the embodiment, the corrected configuration information of the target component or the initial configuration information of the remaining components other than the target component is corrected based on the dependency relationship of the new files in the updated application resource library. Each file in the updated application resource library is reconfigured according to the new corrected configuration information, so that the obtained configuration information is analyzed based on the latest application resource library, and conflicts in the subsequent running process are avoided.
[0098] In an example embodiment, after the reconstruction resource library corresponding to the application resource library is obtained, the reference information corresponding to each file in the application resource library is replaced with the reference information corresponding to each file in the reconstruction resource library.
[0099] In a specific implementation, after the reconstruction resource library corresponding to the application resource library is obtained, the original storage directory of each file cannot refer to the corresponding file. Therefore, it is further needed to update the reference information of each file, that is, the reference information corresponding to each file in the application resource library is replaced with the reference information corresponding to each file in the reconstruction resource library.
[0100] For example, if file a is originally in component A, and the reference to file a needs to bring component A, after file a is moved to component B, all places that reference file a need to change component A to component B.
[0101] In this embodiment, after the reconstruction resource library corresponding to the application resource library is obtained, the reference information corresponding to each file in the application resource library is replaced with the corresponding reference information in the reconstruction resource library, so that each file can be correctly referenced, and it is ensured that the application can normally run.
[0102] In an example embodiment, after the reconstruction resource library corresponding to the application resource library is obtained, the method further includes:
[0103] In step S250, the dependency relationship corresponding to each component in the reconstruction resource library is obtained; each component includes a plurality of files;
[0104] In step S260, based on the dependency relationship between each file and the dependency relationship corresponding to each component, the number of directly dependent components, the number of recursively dependent components of each component, and the file characteristics of the files under each component are obtained.
[0105] In step S270, based on the number of directly dependent components, the number of recursively dependent components, and the file characteristics, the running state of each component is determined.
[0106] The dependency relationship between the components can be the dependency between the components, or the dependency between the files in the components.
[0107] The number of directly dependent components represents the number of components that directly constitute a dependency relationship with each component. For example, when file a in component A is called, file a needs to call file b in component B, then component A and component B constitute a direct dependency, and component B can be a directly dependent component of component A.
[0108] The number of recursively dependent components represents the number of components that indirectly constitute a dependency relationship with each component. For example, when file a in component A is called, file a needs to call file b in component B, and file b needs to call file c in component C, then component A and component C constitute a recursive dependency, and component C can be a recursive dependent component of component A.
[0109] The file characteristics represent the file characteristics of each file under a component, which can specifically be the average number of file lines, which represents the average value of the number of file lines of each file under a component.
[0110] It can be understood that, as the functions of the application program gradually increase, the components of the application resource library will increase, and the engineering architecture problems will also increase, therefore, the running state of each component needs to be supervised to timely find abnormal components that appear abnormally.
[0111] In a specific implementation, the direct dependency component number, the recursive dependency component number of each component, and the file features of the files under each component can be obtained by obtaining the dependency relationship of each component in the reconstruction resource library, and the dependency relationship between each file and the dependency relationship of each component. The running state of each component is determined based on the direct dependency component number, the recursive dependency component number, and the file features.
[0112] More specifically, the first average value of the direct dependency component number of each component, the second average value of the recursive dependency component number of each component, and the third average value of the file features of each component can be calculated first. Then, for each component, the first difference value between the direct dependency number of the component and the first average value, the second difference value between the recursive dependency number of the component and the second average value, and the third difference value between the file features of the component and the third average value are calculated. The sum of squares of the first difference value, the second difference value, and the third difference value is further calculated to obtain the variance of the direct dependency component number, the recursive dependency component number, and the file features respectively as the state indicator value. The state indicator value is compared with the threshold value. If the state indicator value is greater than the threshold value, it is determined that the component is abnormal. If the state indicator value is less than the threshold value, it is determined that the component is normal.
[0113] In this embodiment, the direct dependency component number, the recursive dependency component number of each component, and the file features of the files under each component are obtained by the dependency relationship between each file and the dependency relationship of each component. The running state of each component is determined based on the direct dependency component number, the recursive dependency component number, and the file features. The quantitative evaluation of the running state of each component is realized. The accuracy of the determined abnormal component is ensured. The abnormal component that appears abnormally can be found out in time. The time of manual inspection is reduced.
[0114] In an exemplary embodiment, after the running state of each component is determined based on the direct dependency component number, the recursive dependency component number, and the file features in step S270, the following steps are further included.
[0115] Step S271, in the case where the abnormal component with an abnormal running state is determined, the abnormal factor causing the abnormality of the abnormal component is determined from the direct dependency component number, the recursive dependency component number, and the file features.
[0116] Step S272, according to the abnormal factor, the prompt information for the abnormal component and the abnormal factor is generated.
[0117] In a specific implementation, after determining the abnormal component in the running state, it can be determined which factor causes the abnormal component. Specifically, the abnormal factor causing the abnormal component can be determined according to the variances of the number of directly dependent components, the number of recursively dependent components, and the file characteristics. More specifically, the factor with the largest variance is determined from the number of directly dependent components, the number of recursively dependent components, and the file characteristics, and is used as the abnormal factor. It can be understood that the larger the variance, the greater the deviation from the average, and the more likely it is abnormal.
[0118] After determining the abnormal factor, a prompt information for the abnormal component and the abnormal factor can be generated and sent to the user terminal, so that the user terminal processes the abnormal component. More specifically, the processing method of the abnormal component can be:
[0119] For a component with a large number of directly dependent components, the number of functions assumed by the component can be determined based on each file dependency relationship and the function of each component, whether the component is too bloated, and whether part of the functions can be intelligently split out.
[0120] For a component with a large number of recursively dependent components, whether the component itself has a problem can be determined based on the direct dependency analysis, and whether the component itself recursively depends on too bloated other components to cause the recursive dependency of the component to be too bloated.
[0121] For a component with too many average file lines, whether the number of files is too large or the number of lines of a single file is too large can be determined based on the number of lines of each file. For a large single file, the file can also be split.
[0122] Further, after screening the abnormal components and files, the code coupling relationship table of each department and all other departments can be analyzed based on the department information to which the component belongs. For a very serious coupling situation, it can be indicated which places can attempt to decouple, and which file in which component depends on another file in another component to cause the coupling. Finally, based on the engineering component hierarchical relationship diagram, it can be analyzed that each component is currently at which level, and each level of the component is what, whether the level relationship needs to be modified, and which dependent level does not meet the requirements can be reported.
[0123] In the embodiment, by determining the abnormal factor causing the abnormal component, the prompt information for the abnormal component and the abnormal factor is generated and sent to the user terminal, so that the user of the user terminal not only knows which component is abnormal, but also knows the reason why the abnormal component is abnormal. Therefore, the terminal user can specifically process the abnormal problem, and the processing efficiency of the abnormal situation is greatly improved.
[0124] In another exemplary embodiment, in order to facilitate the understanding of the present disclosure by those skilled in the art, as shown in the complete flowchart of the resource library processing method, the method in the present embodiment comprises the following steps: Figure 3
[0125] Step S310, determining the application program resource library to be processed and the dependency relationship between each file in the application program resource library;
[0126] Step S320, determining the number of dependency relationships of each file according to the dependency relationship between each file;
[0127] Step S330, dividing each file into a plurality of hierarchical components according to the number of dependency relationships, and generating initial configuration information of each file; the initial configuration information is used to record the moving path of each file;
[0128] Step S340, determining the to-be-corrected file and the correction mode corresponding to the to-be-corrected file from the files of the target component based on the configuration information influencing factor; the correction mode comprises at least one of modification of the moving path, splitting of the file and merging of the file; the target component represents a hierarchical component whose complexity meets a preset condition;
[0129] Step S350, correcting the initial configuration information of the to-be-corrected file according to the correction mode to obtain corrected configuration information;
[0130] Step S360, obtaining an updated application program resource library, and comparing the updated application program resource library with the application program resource library;
[0131] Step S370, in the case that a new file is obtained through the comparison, determining the dependency relationship corresponding to the new file, and re-correcting the corrected configuration information corresponding to the target component and / or the initial configuration information corresponding to the remaining components according to the dependency relationship corresponding to the new file to obtain new corrected configuration information;
[0132] Step S380, reconfiguring each file in the updated application program resource library through the new corrected configuration information to obtain a reconstructed resource library corresponding to the application program resource library.
[0133] The resource library processing method provided in the present embodiment has the following beneficial effects:
[0134] 1. The time for actual code modification is reduced, and the conflicts caused by the splitting period are reduced.
[0135] 2. For mechanical modifications, automation has improved processing efficiency. For example, if file 'a' was originally in component A, referencing file 'a' required including component A. After moving to component B, all places referencing file 'a' now need to change component A to component B.
[0136] 3. Regularly monitor the project's operation, promptly identify architectural issues, reduce the time spent on manual inspections, directly pinpoint the specific location of problems, and provide targeted solutions for simple issues.
[0137] 4. Compared to dealing with the entire project, directly accessing complete reports makes it easier for developers to modify and resolve issues.
[0138] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0139] It is understood that the same / similar parts between the various embodiments of the methods described above in this specification can be referred to each other. Each embodiment focuses on the differences from other embodiments, and relevant parts can be referred to the description of other method embodiments.
[0140] Based on the same inventive concept, this disclosure also provides a resource library processing apparatus for implementing the resource library processing method described above.
[0141] Figure 4 This is a structural block diagram illustrating a resource database processing apparatus according to an exemplary embodiment. (Refer to...) Figure 4 The device includes: a determining unit 410, a dividing unit 420, a correcting unit 430, and a configuring unit 440, wherein,
[0142] The determination unit 410 is configured to determine the dependencies between various files in the application resource library; the dependencies represent the calling relationships between files during use.
[0143] The dividing unit 420 is configured to divide each file into components of multiple levels according to the dependency relationship between the files, and generate initial configuration information of each file; the initial configuration information is used to record a moving path of each file, and each level corresponds to a different file complexity;
[0144] The modifying unit 430 is configured to modify the initial configuration information of the files in the target component based on a preset configuration information influencing factor, to obtain modified configuration information; the target component represents a component of a level whose complexity meets a preset condition;
[0145] The configuration unit 440 is configured to reconfigure each file in the application resource library according to the initial configuration information corresponding to the remaining components except the target component in each component and the modified configuration information corresponding to the target component, to obtain a reconstructed resource library corresponding to the application resource library.
[0146] In an example embodiment, the dividing unit 420 is further configured to determine a dependency relationship number of each file according to the dependency relationship between the files, and divide each file into components of multiple levels according to the dependency relationship number.
[0147] In an example embodiment, the modifying unit 430 is further configured to determine a to-be-modified file and a modification mode corresponding to the to-be-modified file from the files in the target component based on the configuration information influencing factor; the modification mode includes at least one of modification of the moving path, splitting of the file, and merging of the file; and the initial configuration information of the to-be-modified file is modified according to the modification mode to obtain the modified configuration information.
[0148] In an example embodiment, the modifying unit 430 is further configured to obtain an updated application resource library, and compare the updated application resource library with the application resource library; in a case where a new file is obtained through the comparison, determine a dependency relationship corresponding to the new file, and re-modify the modified configuration information corresponding to the target component and / or the initial configuration information corresponding to the remaining components according to the dependency relationship corresponding to the new file, to obtain new modified configuration information.
[0149] The configuration unit 440 is further configured to reconfigure each file in the updated application resource library according to the new modified configuration information, to obtain the reconstructed resource library corresponding to the application resource library.
[0150] In an example embodiment, the apparatus further includes a replacing unit configured to replace reference information corresponding to each file in the application resource library with reference information corresponding to each file in the reconstructed resource library.
[0151] In an example embodiment, the apparatus further includes a state determining unit configured to perform obtaining dependency relationships corresponding to each component in the reconstruction resource library; each component includes a plurality of files; based on the dependency relationships between the files and the dependency relationships corresponding to each component, obtaining a number of directly dependent components, a number of recursively dependent components of each component, and file features of the files under each component; and determining a running state of each component based on the number of directly dependent components, the number of recursively dependent components, and the file features.
[0152] In an example embodiment, the apparatus further includes an exception prompting unit configured to perform, in a case where an exception component with an abnormal running state is determined, determining an exception factor causing the exception component to be abnormal from the number of directly dependent components, the number of recursively dependent components, and the file features; generating prompt information for the exception component and the exception factor according to the exception factor; and sending the prompt information to a user terminal to enable the user terminal to process the exception component.
[0153] As to the apparatus in the above embodiments, the specific manners in which the modules perform operations have been described in detail in the embodiments of the method, and thus will not be described in detail here.
[0154] Figure 5 FIG. 5 is a block diagram illustrating an electronic device 500 for implementing a resource library processing method according to an example embodiment. The electronic device 500 can be, for example, a mobile phone, a computer, a digital broadcasting terminal, a message transmitting / receiving device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like.
[0155] Referring to Figure 5 , the electronic device 500 can include one or more of the following components: a processing component 502, a memory 504, a power supply component 506, a multimedia component 508, an audio component 510, an input / output (I / O) interface 512, a sensor component 514, and a communication component 516.
[0156] The processing component 502 generally controls the overall operations of the electronic device 500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 502 can include one or more processors 520 to execute instructions to complete all or part of the steps of the methods described above. In addition, the processing component 502 can include one or more modules to facilitate the interaction between the processing component 502 and other components. For example, the processing component 502 can include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.
[0157] The memory 504 is configured to store various types of data to support the operations of the electronic device 500. Examples of these data include instructions for any application programs or methods operating on the electronic device 500, contact data, phonebook data, messages, pictures, videos, etc. The memory 504 can be implemented by any type of volatile or nonvolatile memory, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory, magnetic disc, optical disc, or graphene memory.
[0158] The power supply component 506 supplies power for various components of the electronic device 500. The power supply component 506 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 500.
[0159] The multimedia component 508 includes a screen providing an output interface between the electronic device 500 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swiping, and gestures on the touch panel. The touch sensors can not only sense a boundary of a touching or swiping action, but also detect duration and pressure related to the touching or swiping action. In some embodiments, the multimedia component 508 includes a front camera and / or a rear camera. The front and / or rear camera can receive external multimedia data when the electronic device 500 is in an operating mode, such as a shooting mode or a video mode. Each of the front and rear cameras can be a fixed optical lens system or have a focal length and optical zoom capability.
[0160] The audio component 510 is configured to output and / or input audio signals. For example, the audio component 510 includes a microphone (MIC) configured to receive external audio signals when the electronic device 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 504 or transmitted via the communication component 516. In some embodiments, the audio component 510 also includes a speaker for outputting audio signals.
[0161] The I / O interface 512 provides an interface between the processing component 502 and peripheral interface modules, which can be a keyboard, a click wheel, a button, etc. These buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0162] The sensor component 514 includes one or more sensors for providing status assessments for various aspects of the electronic device 500. For example, the sensor component 514 can detect an open / closed position of the electronic device 500, relative positioning of components, such as a display and a keypad of the electronic device 500, a change in position of the electronic device 500 or a component of the electronic device 500, presence or absence of user contact with the electronic device 500, orientation or acceleration / deceleration / g-force and temperature of the electronic device 500. The sensor component 514 can include an optical sensor for detecting ambient light, a proximity sensor configured to detect proximity of an object, a motion sensor, a temperature sensor, a magnetic sensor, an acceleration sensor, a gyroscope sensor, a pressure sensor, or the like.
[0163] The communication component 516 is configured to facilitate wired or wireless communication between the electronic device 500 and other devices. The electronic device 500 can access a wireless network based on a corresponding communication standard, such as WiFi, a cellular network (e.g., 2G, 3G, 4G, or 5G), or a combination thereof. In an example embodiment, the communication component 516 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an example embodiment, the communication component 516 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) techniques, infrared data association (IrDA) techniques, ultra-wideband (UWB) techniques, Bluetooth (BT) techniques, and other techniques.
[0164] In an example embodiment, the electronic device 500 can be implemented using one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements to perform the above-described methods.
[0165] In an example embodiment, a computer-readable storage medium, such as the memory 504 including instructions stored thereon, is also provided. The instructions may, for example, be executable by the processor 520 of the electronic device 500 to cause the processor 520 to perform the above-described methods. The computer-readable storage medium can be, for example, a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, among others.
[0166] In an exemplary embodiment, a computer program product is also provided, which comprises instructions executable by the processor 520 of the electronic device 500 to perform the above method.
[0167] It should be noted that the above apparatus, electronic device, computer readable storage medium, computer program product and the like according to the description of the method embodiments can also include other implementation manners, and the specific implementation manners can be referred to the description of the related method embodiments, which will not be repeated here.
[0168] Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the concepts disclosed herein. The disclosure is intended to cover any variations, uses or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice in the art to which the disclosure pertains. The specification and examples are to be regarded as illustrative only, and the true scope and spirit of the disclosure are indicated by the appended claims.
[0169] It should be understood that the present disclosure is not limited to the precise structures herein described and illustrated in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the claims that follow.
Claims
1. A resource database processing method, characterized in that, include: Determine the dependencies between files in the application repository; The dependency relationship represents the calling relationship of files during use; Based on the dependencies between the files, the files are divided into components at multiple levels, and initial configuration information for each file is generated. The initial configuration information is used to record the movement path of each file, with each level corresponding to a different file complexity. Based on preset configuration information influencing factors, the initial configuration information of the files in the target component is corrected to obtain the corrected configuration information; The target component represents a component whose complexity meets preset conditions at a certain level; Using the initial configuration information of the components other than the target component, and the corrected configuration information of the target component, the files in the application resource library are reconfigured to obtain the reconstructed resource library corresponding to the application resource library.
2. The method according to claim 1, characterized in that, The step of dividing the files into multiple levels of components based on the dependencies between them includes: Based on the dependencies between the files, determine the number of dependencies for each file; Based on the number of dependencies, the files are divided into components at multiple levels.
3. The method according to claim 1, characterized in that, The initial configuration information of the files in the target component is corrected based on preset configuration information influencing factors to obtain corrected configuration information, including: Based on the configuration information influencing factors, the file to be corrected and the corresponding correction method are determined from the files of the target component; the correction method includes at least one of the following: modification of the move path, file splitting, and file merging; According to the correction method, the initial configuration information of the file to be corrected is corrected to obtain the corrected configuration information.
4. The method according to claim 1, characterized in that, After correcting the initial configuration information of the files in the target component based on preset configuration information influencing factors, and obtaining the corrected configuration information, the following is also included: Obtain the updated application resource library and compare the updated application resource library with the existing application resource library; If a new file is obtained through comparison, the dependencies corresponding to the new file are determined. Based on the dependencies corresponding to the new file, the modified configuration information corresponding to the target component and / or the initial configuration information corresponding to the other components are modified again to obtain new modified configuration information. By reconfiguring each file in the updated application resource library using the new, corrected configuration information, a reconstructed resource library corresponding to the application resource library is obtained.
5. The method according to claim 4, characterized in that, After obtaining the reconstructed resource library corresponding to the application resource library, the process also includes: Replace the reference information corresponding to each file in the application resource library with the corresponding reference information in the reconstructed resource library.
6. The method according to any one of claims 1 to 5, characterized in that, After obtaining the reconstructed resource library corresponding to the application resource library, the process also includes: Obtain the dependency relationships of each component in the reconstructed resource library; each component includes multiple files; Based on the dependencies between files and the dependencies corresponding to each component, the number of direct dependent components, the number of recursively dependent components, and the file characteristics of files under each component are obtained. The running status of each component is determined based on the number of directly dependent components, the number of recursively dependent components, and the file characteristics.
7. The method according to claim 6, characterized in that, After determining the running status of each component based on the number of directly dependent components, the number of recursively dependent components, and the file characteristics, the process further includes: In the case of identifying an abnormal component with an abnormal running state, the abnormal factors that caused the abnormal component to be abnormal are determined from the number of directly dependent components, the number of recursively dependent components, and the file characteristics. Based on the abnormal factors, generate prompt information for the abnormal component and the abnormal factors.
8. A resource database processing device, characterized in that, include: The determination unit is configured to determine the dependencies between files in the application repository. The dependency relationship represents the calling relationship of files during use; The partitioning unit is configured to partition the files into components at multiple levels based on the dependencies between the files, and generate initial configuration information for each file. The initial configuration information is used to record the movement path of each file, with each level corresponding to a different file complexity. The correction unit is configured to correct the initial configuration information of the files in the target component based on preset configuration information influencing factors, and obtain the corrected configuration information. The target component represents a component whose complexity meets preset conditions at a certain level; The configuration unit is configured to execute the initial configuration information corresponding to the other components in each component (excluding the target component) and the corrected configuration information corresponding to the target component to reconfigure each file in the application resource library to obtain the reconstructed resource library corresponding to the application resource library.
9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the library processing method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the library processing method as described in any one of claims 1 to 7.
11. A computer program product, the computer program product comprising instructions, characterized in that, When the instruction is executed by the processor of the electronic device, the electronic device is able to perform the library processing method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Page loading method and device
CN108920203A
Resource configuration method and device, electronic equipment and storage medium
CN113010207A