Method and apparatus for optimizing front-end repository

By receiving project configuration information, generating the target graphical interface, and extracting tool instances to store in the resource library, the problem of non-reusability of front-end development tools is solved, thus improving development efficiency and quality.

CN115794191BActive Publication Date: 2026-11-20SHENZHEN COMTOP INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211500002.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-28
Publication Date
2026-11-20
Estimated Expiration
2042-11-28

AI Technical Summary

Technical Problem

In the development of hybrid and HTML5 applications, front-end developers are unable to effectively reuse components, resulting in low development efficiency and an inability to meet the needs of different projects.

Method used

By receiving the project configuration information input by the user, the target front-end tool is determined from the pre-set resource library, the target graphical interface is generated, and the target tool instance is extracted based on the business function and stored in the resource library, thereby realizing the updating and accumulation of front-end development tools.

Benefits of technology

It increases the reusability of front-end development tools and improves the efficiency and quality of software development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115794191B_ABST
    Figure CN115794191B_ABST
Patent Text Reader

Abstract

The application discloses an optimization method and device for a front-end resource library, and the method comprises the following steps: receiving engineering configuration information input by a user, wherein the engineering configuration information at least comprises service parameters; determining all target front-end tools corresponding to the engineering configuration information from a preset resource library, and generating a target graphical interface corresponding to the engineering configuration information according to all the target front-end tools and the service parameters; extracting a target tool instance from a service logic corresponding to the target graphical interface based on a service function corresponding to the target graphical interface, and storing the target tool instance into the preset resource library to update the preset resource library. It can be seen that the application can be beneficial to realize the update or accumulation of front-end development tools, thereby being beneficial to improve the reuse rate of the front-end development tools, and further being beneficial to improve the efficiency and quality of subsequent software development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of front-end development technology, and in particular to a method and apparatus for optimizing a front-end resource library. Background Technology

[0002] In real life, with the rapid development of internet information and the iterative updates of user information interaction technology, modular development plays an important role in the development of hybrid applications and HTML5 applications.

[0003] During project development, there is a need to reuse some front-end components. Currently, different front-end developers can only find existing components from previous projects to achieve component reuse. The variety of components is limited, failing to meet the needs of different projects and requirements. This necessitates developers to rewrite and update software code, leading to low development efficiency. Clearly, existing technologies have certain shortcomings and urgently need to be addressed. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method and apparatus for optimizing a front-end resource library, which can facilitate the updating or accumulation of front-end development tools, thereby improving the reusability of front-end development tools and thus improving the efficiency and quality of subsequent software development.

[0005] To address the aforementioned technical problems, the first aspect of this invention discloses a method for optimizing a front-end resource library, the method comprising:

[0006] Receive engineering configuration information input by the user, wherein the engineering configuration information includes at least business parameters;

[0007] All target front-end tools corresponding to the project configuration information are identified from the pre-set resource library, and a target graphical interface corresponding to the project configuration information is generated based on all the target front-end tools and the business parameters.

[0008] Based on the business function corresponding to the target graphical interface, the target tool instance is extracted from the business logic corresponding to the target graphical interface, and the target tool instance is stored in the preset resource library to update the preset resource library.

[0009] As an optional implementation, in the first aspect of the present invention, the project configuration information further includes business requirement information, and the step of determining all target front-end tools corresponding to the project configuration information from a pre-set resource library includes:

[0010] Based on the business requirements information, determine all the basic functions of the graphical interface to be generated, and obtain the tool-function index table corresponding to the pre-built resource library;

[0011] For each basic function of the graphical interface to be generated, the tool-function index table is queried for that basic function to obtain all first front-end tools corresponding to that basic function, and the second front-end tool corresponding to that basic function is determined from all the first front-end tools corresponding to that basic function.

[0012] All the second front-end tools corresponding to all the basic functions are identified as all the target front-end tools corresponding to the project configuration information.

[0013] As an optional implementation, in the first aspect of the present invention, for each basic function of the graphical interface to be generated, determining the second front-end tool corresponding to the basic function from all the first front-end tools corresponding to the basic function includes:

[0014] Determine whether the number of all the first front-end tools corresponding to the basic function is greater than a preset number threshold;

[0015] If it is determined that the number of all the first front-end tools corresponding to the basic function is greater than the preset number threshold, then each first front-end tool is loaded into the graphical interface to be generated for effect display, and the visualization effect corresponding to each first front-end tool is obtained.

[0016] In response to a triggering operation on the graphical interface to be generated based on the visualization effect corresponding to each of the first front-end tools, the second front-end tool corresponding to the basic function is determined.

[0017] As an optional implementation, in the first aspect of the present invention, after determining all the second front-end tools corresponding to all the basic functions as all target front-end tools corresponding to the project configuration information, for each of the target front-end tools corresponding to the project configuration information, the method further includes:

[0018] Obtain the attribute file corresponding to the target front-end tool, and obtain the pre-stored location information of the target front-end tool from the attribute file corresponding to the target front-end tool. The location information of the target front-end tool includes at least the save path of the target front-end tool and the line number of the target front-end tool in the target data packet. The target data packet is used to store the target front-end tool.

[0019] The target front-end tool is located in the target data package based on its save path and its line number within the target toolkit.

[0020] As an optional implementation, in the first aspect of the present invention, the step of generating the target graphical interface corresponding to the project configuration information based on all the target front-end tools and the business parameters includes:

[0021] Obtain the target tool information corresponding to each of the target front-end tools, and generate a basic graphical interface corresponding to the project configuration information based on all the target tool information corresponding to all the target front-end tools and the business parameters;

[0022] Determine whether an adjustment operation on the basic graphical interface is detected. If the user's adjustment operation on the basic graphical interface is detected, the adjusted basic graphical interface is determined as the target graphical interface. If no adjustment operation on the basic graphical interface is detected, the basic graphical interface is directly determined as the target graphical interface.

[0023] As an optional implementation, in the first aspect of the present invention, the adjustment operation has a corresponding operation type, the operation type including an increase operation;

[0024] After determining the adjusted basic graphical interface as the target graphical interface, the step of extracting the target tool instance from the business logic corresponding to the target graphical interface based on the business function corresponding to the target graphical interface includes:

[0025] Determine the operation type corresponding to the adjustment operation;

[0026] If the operation type corresponding to the adjustment operation is the addition operation, then all business functions corresponding to the target graphical interface are compared with all basic functions of the graphical interface to be generated to determine the first target function, wherein the first target function is the function that is different from all basic functions of the graphical interface to be generated among all business functions corresponding to the target graphical interface.

[0027] Extract the target tool instance corresponding to the first target function from the business logic corresponding to the target graphical interface.

[0028] As an optional implementation, in the first aspect of the present invention, the operation type further includes a modification operation;

[0029] After determining the operation type corresponding to the adjustment operation, the method further includes:

[0030] If the operation type corresponding to the adjustment operation is the modification operation, then the layout tools and graphic tools corresponding to the basic graphical interface are compared with the layout tools and graphic tools corresponding to the target graphical interface to determine the target tool, wherein the target tool is the tool obtained by modifying the layout tools or graphic tools in the basic graphical interface in the target graphical interface;

[0031] Determine the second target function corresponding to the target tool in the target graphical interface, and extract the target tool instance corresponding to the second target function from the business logic corresponding to the target graphical interface.

[0032] A second aspect of the present invention discloses an optimization apparatus for a front-end resource library, the apparatus comprising:

[0033] A receiving module is used to receive engineering configuration information input by the user, wherein the engineering configuration information includes at least business parameters;

[0034] The determination module is used to determine all target front-end tools corresponding to the project configuration information from the preset resource library;

[0035] The generation module is used to generate a target graphical interface corresponding to the project configuration information based on all the target front-end tools and the business parameters;

[0036] The extraction module is used to extract target tool instances from the business logic corresponding to the target graphical interface based on the business functions corresponding to the target graphical interface.

[0037] A storage module is used to store the target tool instance to the preset resource library to update the preset resource library.

[0038] As an optional implementation, in the second aspect of the present invention, the project configuration information further includes business requirement information, and the method by which the determining module determines all target front-end tools corresponding to the project configuration information from the preset resource library is specifically as follows:

[0039] Based on the business requirements information, determine all the basic functions of the graphical interface to be generated, and obtain the tool-function index table corresponding to the pre-built resource library;

[0040] For each basic function of the graphical interface to be generated, the tool-function index table is queried for that basic function to obtain all first front-end tools corresponding to that basic function, and the second front-end tool corresponding to that basic function is determined from all the first front-end tools corresponding to that basic function.

[0041] All the second front-end tools corresponding to all the basic functions are identified as all the target front-end tools corresponding to the project configuration information.

[0042] As an optional implementation, in the second aspect of the present invention, for each basic function of the graphical interface to be generated, the determining module determines the second front-end tool corresponding to the basic function from all the first front-end tools corresponding to the basic function in the following specific manner:

[0043] Determine whether the number of all the first front-end tools corresponding to the basic function is greater than a preset number threshold;

[0044] If it is determined that the number of all the first front-end tools corresponding to the basic function is greater than the preset number threshold, then each first front-end tool is loaded into the graphical interface to be generated for effect display, and the visualization effect corresponding to each first front-end tool is obtained.

[0045] In response to a triggering operation on the graphical interface to be generated based on the visualization effect corresponding to each of the first front-end tools, the second front-end tool corresponding to the basic function is determined.

[0046] As an optional implementation, in a second aspect of the invention, the apparatus further includes:

[0047] The acquisition module is configured to, after the determining module determines all the second front-end tools corresponding to all the basic functions as all target front-end tools corresponding to the project configuration information, acquire the attribute file corresponding to each target front-end tool corresponding to the project configuration information, and acquire the pre-stored location information of the target front-end tool from the attribute file corresponding to the target front-end tool, wherein the location information of the target front-end tool includes at least the save path of the target front-end tool and the line number of the target front-end tool in the target data packet, and the target data packet is used to store the target front-end tool;

[0048] The positioning module is used to locate the target front-end tool in the target data package based on the save path of the target front-end tool and the line number of the target front-end tool in the target tool package.

[0049] As an optional implementation, in the second aspect of the present invention, the generation module generates the target graphical interface corresponding to the project configuration information based on all the target front-end tools and the business parameters in the following specific manner:

[0050] Obtain the target tool information corresponding to each of the target front-end tools, and generate a basic graphical interface corresponding to the project configuration information based on all the target tool information corresponding to all the target front-end tools and the business parameters;

[0051] Determine whether an adjustment operation on the basic graphical interface is detected. If the user's adjustment operation on the basic graphical interface is detected, the adjusted basic graphical interface is determined as the target graphical interface. If no adjustment operation on the basic graphical interface is detected, the basic graphical interface is directly determined as the target graphical interface.

[0052] As an optional implementation, in a second aspect of the present invention, the adjustment operation has a corresponding operation type, the operation type including an increase operation;

[0053] The extraction module extracts the target tool instance from the business logic corresponding to the target graphical interface based on the business function corresponding to the target graphical interface in the following specific way:

[0054] After the generation module determines the adjusted basic graphical interface as the target graphical interface, it determines the operation type corresponding to the adjustment operation.

[0055] If the operation type corresponding to the adjustment operation is the addition operation, then all business functions corresponding to the target graphical interface are compared with all basic functions of the graphical interface to be generated to determine the first target function, wherein the first target function is the function that is different from all basic functions of the graphical interface to be generated among all business functions corresponding to the target graphical interface.

[0056] Extract the target tool instance corresponding to the first target function from the business logic corresponding to the target graphical interface.

[0057] As an optional implementation, in a second aspect of the invention, the operation type further includes a modification operation; the apparatus further includes:

[0058] The comparison module is used to compare the layout tools and graphic tools corresponding to the basic graphical interface with the layout tools and graphic tools corresponding to the target graphical interface after the extraction module determines the operation type corresponding to the adjustment operation. If the operation type corresponding to the adjustment operation is the modification operation, the comparison module is used to determine the target tool. The target tool is the tool obtained by modifying the layout tools or graphic tools in the basic graphical interface in the target graphical interface.

[0059] The determining module is further configured to determine the second target function corresponding to the target tool in the target graphical interface;

[0060] The extraction module is further configured to extract the target tool instance corresponding to the second target function from the business logic corresponding to the target graphical interface.

[0061] A third aspect of the present invention discloses another optimization apparatus for a front-end resource library, the apparatus comprising:

[0062] Memory containing executable program code;

[0063] A processor coupled to the memory;

[0064] The processor calls the executable program code stored in the memory to execute the front-end resource library optimization method disclosed in the first aspect of the present invention.

[0065] The fourth aspect of the present invention discloses a computer-storable medium storing computer instructions, which, when invoked, are used to execute the optimization method for the front-end resource library disclosed in the first aspect of the present invention.

[0066] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0067] In this embodiment of the invention, user-inputted project configuration information is received, which includes at least business parameters. All target front-end tools corresponding to the project configuration information are determined from a pre-set resource library, and a target graphical interface corresponding to the project configuration information is generated based on all target front-end tools and business parameters. Target tool instances are extracted from the business logic corresponding to the target graphical interface based on its business functions, and these instances are stored in the pre-set resource library to update the library. Therefore, implementing this invention facilitates the updating or accumulation of front-end development tools, thereby improving the reusability of front-end development tools and ultimately enhancing the efficiency and quality of subsequent software development. Attached Figure Description

[0068] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0069] Figure 1 This is a flowchart illustrating an optimization method for a front-end resource library disclosed in an embodiment of the present invention;

[0070] Figure 2 This is a flowchart illustrating another optimization method for a front-end resource library disclosed in an embodiment of the present invention;

[0071] Figure 3 This is a schematic diagram of the structure of a front-end resource library optimization device disclosed in an embodiment of the present invention;

[0072] Figure 4This is a schematic diagram of another front-end resource library optimization device disclosed in an embodiment of the present invention;

[0073] Figure 5 This is a schematic diagram of the structure of another front-end resource library optimization device disclosed in an embodiment of the present invention. Detailed Implementation

[0074] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0075] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or end that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or ends.

[0076] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0077] This invention discloses a method and apparatus for optimizing a front-end resource library, which facilitates the updating or accumulation of front-end development tools, thereby increasing the reusability of these tools and ultimately improving the efficiency and quality of subsequent software development. Detailed descriptions follow.

[0078] Example 1

[0079] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for optimizing a front-end resource library according to an embodiment of the present invention. Figure 1The described optimization method for the front-end resource library can be applied to a front-end resource library optimization device, or to a terminal device or server that needs front-end resource library optimization. The terminal device may include a computer, mobile phone, tablet computer, PDA (Personal Digital Assistant), MID (Mobile Internet Device), etc., and this embodiment of the invention is not limited thereto. Figure 1 As shown, the optimization method for this front-end resource library may include the following operations:

[0080] 101. Receive project configuration information input by the user.

[0081] In this embodiment of the invention, the project configuration information includes at least business parameters. These business parameters represent specific information or data about the target project that the developers are to develop. Optionally, the business parameters may include at least one of the following: rendering parameters in the graphical interface of the current scene, fields required to be configured for the business needs of the current scene (e.g., fields required to be configured for the business needs of a user login scene). Specifically, the fields required to be configured for the business needs of a user login scene may include at least one of the following: username, password, verification code, verification question, etc. The rendering parameters in the graphical interface of the current scene may include at least one of the following: color parameters, resolution parameters, image size parameters, etc.

[0082] In this embodiment of the invention, the project configuration information is input by the developer on the terminal side, and the computer device acquires and analyzes the content of the project configuration information. Optionally, the project configuration information may also include a series of project configurations such as basic project information, project type, applicable platform, certificate configuration, component information, and template information. Optionally, the basic project information may include project name, code, and a detailed description of the project; the project type may include hybrid application, H5, etc.; the applicable platform may include iOS, Android, etc.; and the certificate configuration may include Android signing certificate, iOS packaging certificate, etc.

[0083] 102. Identify all target front-end tools corresponding to the project configuration information from the pre-built resource library.

[0084] In this embodiment of the invention, a pre-built resource library is used to store front-end tools. Optionally, the front-end tools may include components, behavior templates, composite components, page layouts, project templates, etc.; the target front-end tool is the front-end tool in the pre-built resource library that corresponds to the project configuration information. Optionally, the pre-built resource library may include the following storage methods: (1) file data stored on the server disk (such as project template files); (2) unstructured data stored in MongoDB (such as storing components, behavior templates, composite components, page layouts, etc.).

[0085] In this embodiment of the invention, optionally, a component or composite component refers to an entity that encapsulates the code of the view and the part that interacts with user behavior in a webpage. Business logic can be easily processed through components or composite components. Optionally, a component or composite component can be various functional code segments in a project, and the component or composite component can be stored in a directory. In this embodiment of the invention, optionally, a component or composite component also has its corresponding component information, which may include at least one of tags, attributes, event information, etc. For example, taking a button component as an example, the events of this button component may include touch responses when the mouse moves in, touch responses when the mouse is removed, and touch responses when the mouse is clicked, etc., the type is button, and the attributes include button size, color, text, etc.

[0086] In this embodiment of the invention, optionally, the component or composite component may include one of the following: a basic component, a form component, a pop-up component, a scrolling component, etc. The basic component includes a graphic component and a layout component; the graphic component may include at least one of the following: a font component, a border component, a button component, a table component, etc. The form component includes multiple form controls; the form controls may include at least one of the following: a radio button control, a checkbox control, an input box control, a counter control, a selector control, an upload control, etc. The pop-up component may include at least one of the following: a pop-up box, a dialog box, a confirmation box, etc. The scrolling component is used to provide a series of scrolling lists with native Android / iOS scrolling experiences, and may include at least one of the following: an infinite scrolling list, a looping scrolling list, etc. Through a pre-built resource library composed of rich component types, it is beneficial to use pre-packaged components from the registered component library to modularly build mobile applications, thereby improving the development efficiency of mobile applications.

[0087] In this embodiment of the invention, optionally, an engineering template refers to the standardization and fixation of the technical framework, component library, style library, JS tool library, build tools, etc., of a certain type of project for the purpose of fixed development. Furthermore, each project corresponds to at least one engineering template; therefore, developers can select the appropriate engineering template based on the characteristics of the target project. For example, if the target project is an H5 project, then an H5 engineering template should be selected.

[0088] In this embodiment of the invention, optionally, the components or composite components in the pre-built resource library are reusable components. Reusable components are those that developers can directly visualize and manipulate within a software construction tool. The software construction tool can be a web page builder, a visual application builder, a GUI (Graphical User Interface) design builder, or a server application builder. The construction tool can also be a document editor containing a composite document of software component models.

[0089] In this embodiment of the invention, after receiving the project configuration information input by the developer, the code of the front-end components that conform to the project configuration information is obtained from the server and then abstracted and extracted. Optionally, the server includes a storage device, which can be used to store the component files corresponding to each front-end component, or the component files corresponding to each front-end component can also be stored in a code repository; and the component files corresponding to the front-end components contain the front-end component code. Optionally, the code repository can be a Git repository or an SVN repository associated with a server. Git is a distributed version control system, and Git repositories can be divided into local repositories and remote repositories. A local repository can be a code repository stored on a computer device; a remote repository can be a repository storing code on a public server, such as a repository on a server like GitHub (a software source code hosting service) or GitLab (an open-source repository management system project). SVN is a centralized version control system. An SVN repository is like a central repository stored on a public server, which remembers every change to files, including the program source code. Program developers first obtain the latest version of the project from the repository on the server and copy it to their local machine (client). Then, each developer can work independently on their own client and can commit new code to the server at any time.

[0090] 103. Generate the target graphical interface corresponding to the project configuration information based on all target front-end tools and business parameters.

[0091] In this embodiment of the invention, as an optional implementation, generating a target graphical interface corresponding to the project configuration information based on all target front-end tools and business parameters includes:

[0092] Based on business parameters, the target components and target templates corresponding to the project configuration information are determined among all target front-end tools;

[0093] Add the target component to the target template to obtain the updated template, and generate the target graphical interface based on the updated template.

[0094] As can be seen, implementing this optional implementation method can generate a target front-end interface by combining the target component and the target template, which can help improve the development efficiency of the front-end interface and enhance the user experience.

[0095] 104. Extract the target tool instance from the business logic corresponding to the target graphical interface based on the business functions corresponding to the target graphical interface.

[0096] In this embodiment of the invention, optionally, the target tool instance is an object instantiated from a component, and the target tool instance has corresponding instance information and corresponding code files. Further, the instance information may include at least one of attributes, methods, and events. Optionally, the business logic can be represented as a program integrating corresponding business function code. In this way, by generating a target graphical interface corresponding to the business parameters based on the mobile component library and the collected business parameters of the current scenario, and extracting the target component instance, the interfaces of each sub-module can be quickly built using the components corresponding to the business parameters, saving development resources and improving the development efficiency and reducing the development cycle of mobile applications.

[0097] 105. Store the target tool instance in the default resource library to update the default resource library.

[0098] In this embodiment of the invention, updating the pre-set resource library includes two methods: (1) modifying the original components, composite components and page layout; (2) extracting composite components and page layout without relying on the original components, composite components and layout.

[0099] It is evident that implementation Figure 1 The described optimization method for the front-end resource library can extract target implementation examples from the corresponding business logic of the business functions corresponding to the target graphical interface to update the pre-built resource library storing front-end tools. This can facilitate the updating or accumulation of front-end development tools, thereby improving the reusability of front-end development tools and ultimately enhancing the efficiency and quality of subsequent software development.

[0100] Example 2

[0101] Please see Figure 2 , Figure 2 This is a flowchart illustrating a method for optimizing a front-end resource library according to an embodiment of the present invention. Wherein, Figure 2The described optimization method for the front-end resource library can be applied to a front-end resource library optimization device, or to a terminal device or server that needs front-end resource library optimization. The terminal device may include a computer, mobile phone, tablet computer, PDA (Personal Digital Assistant), MID (Mobile Internet Device), etc., and this embodiment of the invention is not limited thereto. Figure 2 As shown, the optimization method for this front-end resource library may include the following operations:

[0102] 201. Receive project configuration information input by the user.

[0103] 202. Determine all the basic functions of the graphical interface to be generated based on the business requirements information.

[0104] In this embodiment of the invention, the business requirement information is used to represent the functions that the graphical interface to be generated should have.

[0105] 203. Obtain the tool-function index table corresponding to the preset resource library.

[0106] In this embodiment of the invention, the tool-function index table is used to represent a lookup table of components, templates, and their corresponding functions. Optionally, each component and template has its corresponding function. For example, a graphic component is used to generate graphics and layouts for mobile interaction, while a button component is used to trigger specific actions.

[0107] 204. For each basic function of the graphical interface to be generated, query the tool-function index table for that basic function to obtain all the first front-end tools corresponding to that basic function.

[0108] 205. For each basic function of the graphical interface to be generated, determine the second front-end tool corresponding to the basic function from all the first front-end tools corresponding to the basic function.

[0109] 206. Determine all secondary front-end tools corresponding to all basic functions as all target front-end tools corresponding to the project configuration information.

[0110] 207. Generate the target graphical interface corresponding to the project configuration information based on all target front-end tools and business parameters.

[0111] 208. Extract the target tool instance from the business logic corresponding to the target graphical interface based on the business functions corresponding to the target graphical interface.

[0112] 209. Store the target tool instance in the default repository to update the default repository.

[0113] In this embodiment of the invention, it should be noted that for other related descriptions of steps 201 and 207-209, please refer to the detailed description of steps 101-105 in Embodiment 1. These descriptions will not be repeated in this embodiment of the invention.

[0114] It is evident that implementation Figure 2 The described optimization method for the front-end resource library can determine the second front-end tool corresponding to each basic function of the graphical interface to be generated by using the tool-function index table corresponding to the pre-set resource library, and identify all second front-end tools as all target front-end tools. This can help improve the efficiency and accuracy of identifying target front-end tools, thereby improving the efficiency and quality of subsequent software development.

[0115] In an optional embodiment, for each basic function of the graphical interface to be generated, a second front-end tool corresponding to that basic function is determined from all first front-end tools corresponding to that basic function, including:

[0116] Determine whether the number of all first-level front-end tools corresponding to this basic function is greater than a preset number threshold;

[0117] If it is determined that the number of all first front-end tools corresponding to the basic function is greater than the preset number threshold, then each first front-end tool will be loaded into the graphical interface to be generated for effect display, and the visualization effect corresponding to each first front-end tool will be obtained.

[0118] In response to the triggering operation of the graphical interface to be generated based on the visualization effect corresponding to each first front-end tool, the second front-end tool corresponding to the basic function is determined.

[0119] In this optional embodiment, the preset quantity threshold can be 1. When the number of all first front-end tools corresponding to the basic function is greater than 1, the component data package corresponding to each first front-end tool is obtained, and the component data package corresponding to each first front-end tool is run to obtain the visualization effect corresponding to each first front-end tool. The visualization effect is used to represent the running effect of each first front-end component, which enables developers to determine the second front-end tool based on the running effect of different front-end tools, thereby improving the efficiency and quality of determining the second front-end tool, so that the finally determined target front-end tool can be more matched and more applicable to the current scenario, thereby improving the efficiency and quality of subsequent software development.

[0120] As can be seen, implementing this optional embodiment can determine a more suitable second front-end tool through effect demonstration when the number of first front-end tools exceeds a preset number threshold, thereby helping to further improve the efficiency and accuracy of determining the target front-end tool.

[0121] In another optional embodiment, after determining all second front-end tools corresponding to all basic functions as all target front-end tools corresponding to the project configuration information, for each target front-end tool corresponding to the project configuration information, the method further includes:

[0122] Obtain the property file corresponding to the target front-end tool, and obtain the pre-stored location information of the target front-end tool from the property file corresponding to the target front-end tool. The location information of the target front-end tool includes at least the save path of the target front-end tool and the line number of the target front-end tool in the target data packet. The target data packet is used to store the target front-end tool.

[0123] Based on the save path of the target front-end tool and the line number of the target front-end tool in the target toolkit, locate the target front-end tool in the target data package.

[0124] In this optional embodiment, due to the reusability of front-end tools, multiple page elements may use the same front-end tool. Therefore, when searching for the name of the front-end tool in the tool-function index table, the table may display multiple locations where the front-end tool exists, requiring manual searching to accurately locate the front-end component, thus leading to low debugging and development efficiency for the front-end tool. Optionally, each front-end tool has corresponding tool information, which includes at least one of corresponding tags, attributes, and event information. Optionally, the attributes corresponding to the tool information at least include an attribute file, where the attribute file may also include other information, such as the color, size, and shape attributes of the page element corresponding to the front-end tool.

[0125] In this optional embodiment, the target data packet stores a file containing the target front-end tool, and the target front-end tool needs to be located within this target data packet. Optionally, the save path of the target front-end tool is the location of the target data packet storing the target front-end component. Optionally, the save path of the target front-end tool can also represent the nesting relationship between the target data packet and other data packets or files. Optionally, the save path of the target front-end tool contains the name of the target data packet. Optionally, the line number of the target front-end tool in the target file is the line number where the target front-end tool appears in the target data packet.

[0126] As can be seen, implementing this optional embodiment can determine the specific location of the target front-end tool in the target data packet by using the location information of the target front-end tool pre-stored in the attribute file corresponding to the target front-end tool, which can help to quickly locate the target front-end tool and improve the development efficiency of the front-end tool.

[0127] In another optional embodiment, a target graphical interface corresponding to the project configuration information is generated based on all target front-end tools and business parameters, including:

[0128] Obtain the target tool information corresponding to each target front-end tool, and generate the basic graphical interface corresponding to the project configuration information based on the target tool information and business parameters of all target front-end tools;

[0129] Determine whether an adjustment operation targeting the basic graphical interface is detected. If the user's adjustment operation targeting the basic graphical interface is detected, the adjusted basic graphical interface is determined as the target graphical interface. If no adjustment operation targeting the basic graphical interface is detected, the basic graphical interface is directly determined as the target graphical interface.

[0130] In this optional embodiment, the adjustment operation for the basic graphical interface is visual. Optionally, the page applying various target front-end tools can be modified through visual engineering operations such as drag and drop.

[0131] In this optional embodiment, adjustments to the basic graphical interface are achieved by developers / users triggering operations on target interface elements of the application development interface. In response to these triggering operations, adjustments to the basic graphical interface are made. Optionally, the interface elements include at least one or more of text elements, list elements, hyperlink elements, image elements, multimedia elements, table elements, and embedded frames. Optionally, the interface elements are visible interface elements, and the corresponding front-end tool is a visual front-end tool. The target interface element is one of the interface elements on the application development interface.

[0132] As can be seen, implementing this optional embodiment can pre-generate a basic graphical interface and detect whether there are any adjustment operations for the basic graphical interface to determine the final target graphical interface. By checking and adjusting the basic graphical interface before determining the target graphical interface, the target graphical interface can better meet the needs of the current scenario, thereby improving the matching and adaptability of the target graphical interface with the current scenario, and thus improving the efficiency and quality of front-end development.

[0133] In yet another optional embodiment, the adjustment operation has a corresponding operation type, which includes an add operation;

[0134] After determining the adjusted basic graphical interface as the target graphical interface, the target tool instance is extracted from the business logic corresponding to the target graphical interface based on the business functions corresponding to the target graphical interface, including:

[0135] Determine the operation type corresponding to the adjustment operation;

[0136] If the operation type corresponding to the adjustment operation is an add operation, then all business functions corresponding to the target graphical interface are compared with all basic functions of the graphical interface to be generated to determine the first target function. The first target function is the function that is different from all basic functions of the graphical interface to be generated among all business functions corresponding to the target graphical interface.

[0137] Extract the target tool instance corresponding to the first target function from the business logic corresponding to the target graphical interface.

[0138] As can be seen, implementing this optional embodiment enables the user to determine the target graphical interface by adding operations, and then compare the business functions of the target graphical interface with the functions of the graphical interface to be generated to identify the first target function that has differences. The target tool instance corresponding to the first target function is then extracted, thereby enabling the extraction of composite components and page layouts without relying on the original components, composite components and layouts. This allows for the accumulation of front-end development tools, thereby improving the reusability of front-end development tools and enhancing the efficiency and quality of subsequent development.

[0139] In yet another optional embodiment, the operation type further includes a modification operation;

[0140] After determining the operation type corresponding to the adjustment operation, the method also includes:

[0141] If the operation type corresponding to the adjustment operation is a modification operation, then the layout tools and graphic tools corresponding to the basic graphical interface are compared with the layout tools and graphic tools corresponding to the target graphical interface to determine the target tool. The target tool is the tool obtained by modifying the layout tools or graphic tools in the basic graphical interface in the target graphical interface.

[0142] Identify the second target function corresponding to the target tool in the target graphical interface, and extract the target tool instance corresponding to the second target function from the business logic corresponding to the target graphical interface.

[0143] As can be seen, implementing this optional embodiment can identify the modified target tool by comparing the graphics and layout of the target graphical interface with those of the basic graphical interface after the user determines the target graphical interface through modification operations. It can also extract the target tool instance corresponding to the second target function of the target tool, thereby enabling the modification of the original components, composite components and page layout, and thus updating the front-end development tool. This improves the reusability of the front-end development tool and enhances the efficiency and quality of subsequent development.

[0144] Example 3

[0145] Please see Figure 3 , Figure 3This is a schematic diagram of the structure of a front-end resource library optimization device disclosed in an embodiment of the present invention. Figure 3 As shown, the optimization device for the front-end resource library may include:

[0146] The receiving module 301 is used to receive engineering configuration information input by the user, which includes at least business parameters.

[0147] The determination module 302 is used to determine all target front-end tools corresponding to the project configuration information from the preset resource library;

[0148] The generation module 303 is used to generate the target graphical interface corresponding to the project configuration information based on all target front-end tools and business parameters.

[0149] Extraction module 304 is used to extract target tool instances from the business logic corresponding to the target graphical interface based on the business functions corresponding to the target graphical interface.

[0150] Storage module 305 is used to store target tool instances to a pre-built resource library to update the pre-built resource library.

[0151] visible, Figure 3 The described front-end resource library optimization device can extract target implementation examples from the corresponding business logic based on the business functions corresponding to the target graphical interface to update the pre-built resource library storing front-end tools. This facilitates the updating or accumulation of front-end development tools, thereby improving the reusability of front-end development tools and ultimately enhancing the efficiency and quality of subsequent software development.

[0152] In an optional embodiment, the project configuration information also includes business requirement information. The specific method by which the determining module 302 determines all target front-end tools corresponding to the project configuration information from the pre-set resource library is as follows:

[0153] Based on business requirements, determine all the basic functions of the graphical interface to be generated, and obtain the tool-function index table corresponding to the pre-built resource library;

[0154] For each basic function of the graphical interface to be generated, the tool-function index table is queried for that basic function to obtain all the first front-end tools corresponding to that basic function, and the second front-end tool corresponding to that basic function is determined from all the first front-end tools corresponding to that basic function.

[0155] All secondary front-end tools corresponding to all basic functions are identified as target front-end tools corresponding to the project configuration information.

[0156] visible, Figure 2The described optimization device for the front-end resource library can determine the second front-end tool corresponding to each basic function of the graphical interface to be generated through the tool-function index table corresponding to the pre-set resource library, and determine all the second front-end tools as all target front-end tools. This can help improve the efficiency and accuracy of determining the target front-end tools, thereby improving the efficiency and quality of subsequent software development.

[0157] In another optional embodiment, for each basic function of the graphical interface to be generated, the determining module 302 determines the second front-end tool corresponding to the basic function from all the first front-end tools corresponding to the basic function in the following specific way:

[0158] Determine whether the number of all first-level front-end tools corresponding to this basic function is greater than a preset number threshold;

[0159] If it is determined that the number of all first front-end tools corresponding to the basic function is greater than the preset number threshold, then each first front-end tool will be loaded into the graphical interface to be generated for effect display, and the visualization effect corresponding to each first front-end tool will be obtained.

[0160] In response to the triggering operation of the graphical interface to be generated based on the visualization effect corresponding to each first front-end tool, the second front-end tool corresponding to the basic function is determined.

[0161] As can be seen, this optional embodiment can determine a more suitable second front-end tool through effect display when the number of first front-end tools exceeds a preset number threshold, thereby helping to further improve the efficiency and accuracy of determining the target front-end tool.

[0162] Please see Figure 4 , Figure 4 This is a schematic diagram of another front-end resource library optimization device disclosed in an embodiment of the present invention. Figure 4 As shown, in yet another optional embodiment, the optimization apparatus for the front-end resource library further includes:

[0163] The acquisition module 306 is used to, after the determination module 302 determines all the second front-end tools corresponding to all basic functions as all target front-end tools corresponding to the project configuration information, acquire the attribute file corresponding to the target front-end tool for each target front-end tool corresponding to the project configuration information, and acquire the pre-stored location information of the target front-end tool from the attribute file corresponding to the target front-end tool. The location information of the target front-end tool includes at least the save path of the target front-end tool and the line number of the target front-end tool in the target data packet. The target data packet is used to store the target front-end tool.

[0164] The positioning module 307 is used to locate the target front-end tool in the target data package based on the save path of the target front-end tool and the line number of the target front-end tool in the target tool package.

[0165] As can be seen, this optional embodiment can determine the specific location of the target front-end tool in the target data packet by using the location information of the target front-end tool pre-stored in the attribute file corresponding to the target front-end tool, which can help to quickly locate the target front-end tool and improve the development efficiency of the front-end tool.

[0166] In another optional embodiment, the generation module 303 generates the target graphical interface corresponding to the project configuration information based on all target front-end tools and business parameters in the following specific way:

[0167] Obtain the target tool information corresponding to each target front-end tool, and generate the basic graphical interface corresponding to the project configuration information based on the target tool information and business parameters of all target front-end tools;

[0168] Determine whether an adjustment operation targeting the basic graphical interface is detected. If the user's adjustment operation targeting the basic graphical interface is detected, the adjusted basic graphical interface is determined as the target graphical interface. If no adjustment operation targeting the basic graphical interface is detected, the basic graphical interface is directly determined as the target graphical interface.

[0169] As can be seen, this optional embodiment can pre-generate a basic graphical interface and detect whether there are any adjustment operations for the basic graphical interface to determine the final target graphical interface. By checking and adjusting the basic graphical interface before determining the target graphical interface, the target graphical interface can better meet the needs of the current scenario, thereby improving the matching and adaptability of the target graphical interface with the current scenario, and thus improving the efficiency and quality of front-end development.

[0170] In yet another optional embodiment, the adjustment operation has a corresponding operation type, which includes an add operation;

[0171] The extraction module 304 extracts the target tool instance from the business logic corresponding to the target graphical interface based on the business function of the target graphical interface in the following specific way:

[0172] After the generation module 303 determines the adjusted basic graphical interface as the target graphical interface, it determines the operation type corresponding to the adjustment operation.

[0173] If the operation type corresponding to the adjustment operation is an add operation, then all business functions corresponding to the target graphical interface are compared with all basic functions of the graphical interface to be generated to determine the first target function. The first target function is the function that is different from all basic functions of the graphical interface to be generated among all business functions corresponding to the target graphical interface.

[0174] Extract the target tool instance corresponding to the first target function from the business logic corresponding to the target graphical interface.

[0175] As can be seen, this optional embodiment can, after the user determines the target graphical interface by adding operations, compare the business functions of the target graphical interface with the functions of the graphical interface to be generated, determine the first target function that has differences, and extract the target tool instance corresponding to the first target function. This enables the extraction of composite components and page layouts without relying on the original components, composite components and layouts, thereby accumulating front-end development tools, improving the reusability of front-end development tools, and improving the efficiency and quality of subsequent development.

[0176] like Figure 4 As shown, in yet another optional embodiment, the optimization apparatus for the front-end resource library further includes:

[0177] The operation type also includes modification operations; the device also includes:

[0178] The comparison module 308 is used to compare the layout tools and graphic tools corresponding to the basic graphical interface with the layout tools and graphic tools corresponding to the target graphical interface after the extraction module 304 determines the operation type corresponding to the adjustment operation. If the operation type corresponding to the adjustment operation is a modification operation, the comparison module 308 is used to determine the target tool. The target tool is the tool obtained by modifying the layout tools or graphic tools in the basic graphical interface in the target graphical interface.

[0179] The determination module 302 is also used to determine the second target function corresponding to the target tool in the target graphical interface;

[0180] The extraction module 304 is also used to extract the target tool instance corresponding to the second target function from the business logic corresponding to the target graphical interface.

[0181] As can be seen, this optional embodiment can determine the modified target tool by comparing the graphics and layout of the target graphical interface with those of the basic graphical interface after the user determines the target graphical interface through modification operations. It can also extract the target tool instance corresponding to the second target function of the target tool, thereby enabling the modification of the original components, composite components and page layout, and thus updating the front-end development tool. This improves the reusability of the front-end development tool and enhances the efficiency and quality of subsequent development.

[0182] Example 4

[0183] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of another front-end resource library optimization device disclosed in an embodiment of the present invention. For example... Figure 5 As shown, the optimization device for the front-end resource library may include:

[0184] Memory 501 storing executable program code;

[0185] Processor 502 coupled to memory 501;

[0186] The processor 502 calls the executable program code stored in the memory 501 to execute the steps in the front-end resource library optimization method described in Embodiment 1 or Embodiment 2 of the present invention.

[0187] Example 5

[0188] This invention discloses a computer storage medium storing computer instructions. When these computer instructions are invoked, they are used to execute the steps in the optimization method for the front-end resource library described in Embodiment 1 or Embodiment 2 of this invention.

[0189] Example 6

[0190] This invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform the steps in the optimization method of the front-end resource library described in Embodiment 1 or Embodiment 2.

[0191] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0192] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0193] Finally, it should be noted that the optimization method and apparatus for a front-end resource library disclosed in the embodiments of the present invention are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for optimizing a front-end resource library, characterized in that, The method includes: Receive engineering configuration information input by the user, wherein the engineering configuration information includes at least business parameters; Identify all target front-end tools corresponding to the project configuration information from the pre-set resource library; Obtain the target tool information corresponding to each of the target front-end tools, and generate a basic graphical interface corresponding to the project configuration information based on all the target tool information corresponding to all the target front-end tools and the business parameters; Determine whether an adjustment operation for the basic graphical interface is detected. If the user's adjustment operation for the basic graphical interface is detected, the adjusted basic graphical interface is determined as the target graphical interface. If no adjustment operation for the basic graphical interface is detected, the basic graphical interface is directly determined as the target graphical interface. The adjustment operation has a corresponding operation type, which includes an add operation or a modify operation. Determine the operation type corresponding to the adjustment operation; If the operation type corresponding to the adjustment operation is the addition operation, then all business functions corresponding to the target graphical interface are compared with all basic functions of the graphical interface to be generated to determine the first target function, wherein the first target function is the function that is different from all basic functions of the graphical interface to be generated among all business functions corresponding to the target graphical interface; and the target tool instance corresponding to the first target function is extracted from the business logic corresponding to the target graphical interface. If the operation type corresponding to the adjustment operation is the modification operation, then the layout tools and graphic tools corresponding to the basic graphical interface are compared with the layout tools and graphic tools corresponding to the target graphical interface to determine the target tool, wherein the target tool is the tool obtained by modifying the layout tools or graphic tools in the basic graphical interface in the target graphical interface; the second target function corresponding to the target tool in the target graphical interface is determined, and the target tool instance corresponding to the second target function is extracted from the business logic corresponding to the target graphical interface; The target tool instance is stored in the preset resource library to update the preset resource library.

2. The optimization method for the front-end resource library according to claim 1, characterized in that, The project configuration information also includes business requirement information. The step of determining all target front-end tools corresponding to the project configuration information from the pre-built resource library includes: Based on the business requirements information, determine all the basic functions of the graphical interface to be generated, and obtain the tool-function index table corresponding to the pre-built resource library; For each basic function of the graphical interface to be generated, the tool-function index table is queried for that basic function to obtain all first front-end tools corresponding to that basic function, and the second front-end tool corresponding to that basic function is determined from all the first front-end tools corresponding to that basic function. All the second front-end tools corresponding to all the basic functions are identified as all the target front-end tools corresponding to the project configuration information.

3. The optimization method for the front-end resource library according to claim 2, characterized in that, For each basic function of the graphical interface to be generated, determining the second front-end tool corresponding to that basic function from all the first front-end tools corresponding to that basic function includes: Determine whether the number of all the first front-end tools corresponding to the basic function is greater than a preset number threshold; If it is determined that the number of all the first front-end tools corresponding to the basic function is greater than the preset number threshold, then each first front-end tool is loaded into the graphical interface to be generated for effect display, and the visualization effect corresponding to each first front-end tool is obtained. In response to a triggering operation on the graphical interface to be generated based on the visualization effect corresponding to each of the first front-end tools, the second front-end tool corresponding to the basic function is determined.

4. The optimization method for the front-end resource library according to claim 2 or 3, characterized in that, After determining all the second front-end tools corresponding to all the basic functions as all target front-end tools corresponding to the project configuration information, for each target front-end tool corresponding to the project configuration information, the method further includes: Obtain the attribute file corresponding to the target front-end tool, and obtain the pre-stored location information of the target front-end tool from the attribute file corresponding to the target front-end tool. The location information of the target front-end tool includes at least the save path of the target front-end tool and the line number of the target front-end tool in the target data packet. The target data packet is used to store the target front-end tool. The target front-end tool is located in the target data packet based on its save path and the number of its rows in the target data packet.

5. An optimization device for a front-end resource library, characterized in that, The apparatus is used to perform the optimization method for the front-end resource library as described in any one of claims 1-4, and the apparatus comprises: A receiving module is used to receive engineering configuration information input by the user, wherein the engineering configuration information includes at least business parameters; The determination module is used to determine all target front-end tools corresponding to the project configuration information from the preset resource library; The generation module is used to generate a target graphical interface corresponding to the project configuration information based on all the target front-end tools and the business parameters; The extraction module is used to extract target tool instances from the business logic corresponding to the target graphical interface based on the business functions corresponding to the target graphical interface. A storage module is used to store the target tool instance to the preset resource library to update the preset resource library.

6. An optimization device for a front-end resource library, characterized in that, The device includes: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the optimization method of the front-end resource library as described in any one of claims 1-4.

7. A computer storage medium, characterized in that, The computer storage medium stores computer instructions, which, when invoked, are used to execute the optimization method for the front-end resource library as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Universal component calling method and device, computer equipment and storage medium

    CN109582303A

  • Front-end project resource updating method and device, electronic equipment and storage medium

    CN113312032A