Component identification method, device and electronic device

By monitoring and combining the element operation records and source code of the low-code development platform, functional components are automatically identified and encapsulated, which solves the problems of long user page design cycle and high cost and realizes efficient and automated component design.

CN114706609BActive Publication Date: 2025-10-03QINGDAO HAIER TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210220898.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-08
Publication Date
2025-10-03
Estimated Expiration
2042-03-08

AI Technical Summary

Technical Problem

In low-code development platforms, the design cycle of user page components is long and costly, and reliance on manual design leads to inefficiency.

Method used

By monitoring the element operation records and source code of the functional operation interface, functional components are automatically identified and combined, and encapsulated into callable functional modules to reduce manual intervention.

Benefits of technology

It achieves rapid and automated component identification, improves design efficiency, reduces costs, and reduces the need for manual design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114706609B_ABST
    Figure CN114706609B_ABST
Patent Text Reader

Abstract

The present application discloses a component identification method, device and electronic device, which relate to the field of computer technology. The method comprises: obtaining element operation records by monitoring the operation of each element of the functional operation interface; combining each element based on the element operation records and the source code of the functional operation interface to obtain multiple functional components; determining the source code set corresponding to each functional component, and encapsulating each source code set into a callable functional module. Based on the element operation records of the functional operation interface and the source code of the functional operation interface, the present application can automatically and quickly obtain the corresponding multiple functional components, and encapsulate the source code set corresponding to each functional component to obtain a callable functional module, thereby avoiding the problem in traditional methods that rely on developers to manually identify components, resulting in a long component design cycle and high costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a component identification method, device, and electronic device. Background Art

[0002] Low-code development platforms are platforms that enable the rapid creation of applications with minimal or no coding. Through a visual approach to application development, developers of varying experience levels can create web and mobile applications using graphical user interfaces, drag-and-drop components, and model-driven logic.

[0003] Currently, when developing components using low-code development platforms, developers often manually analyze, identify, and design user pages, then code and package them to create the corresponding page components. However, this approach relies entirely on manual design, and each new page requires manual redesign and development, resulting in a long and costly process. Summary of the Invention

[0004] The present application provides a component identification method, device and electronic device to solve the defects of the prior art in that the user page component design cycle is long and the cost is high.

[0005] This application provides a component identification method, including:

[0006] By monitoring the operation of each element in the functional operation interface, the element operation record is obtained;

[0007] Based on the element operation records and the source code of the functional operation interface, the elements are combined to obtain multiple functional components;

[0008] Determine the source code set corresponding to each functional component, and encapsulate each source code set into a callable functional module.

[0009] According to a component identification method provided by the present application, the elements are combined based on the element operation records and the source code of the functional operation interface to obtain multiple functional components, including:

[0010] Combining each operation action in the element operation record with the element corresponding to each operation action to obtain an initial functional component;

[0011] Based on the source code, the business logic between the initial functional components is determined, and based on the business logic, the initial functional components are combined to obtain multiple functional components.

[0012] According to a component identification method provided by the present application, the initial functional components are combined based on the business logic to obtain multiple functional components, including:

[0013] Determining, based on the code specifications of the source code and the business logic, initial functional components corresponding to the same business logic;

[0014] The initial functional components corresponding to the same business logic are combined to obtain corresponding functional components.

[0015] According to a component identification method provided by the present application, determining the initial functional components corresponding to the same business logic based on the code specification of the source code and the business logic includes:

[0016] Based on the code specification, determining a minimum code block in the source code that can be run independently;

[0017] The initial functional component corresponding to the minimum code block corresponding to the same business logic is used as the initial functional component corresponding to the same business logic.

[0018] According to a component identification method provided by the present application, the combining of each operation action in the element operation record with the element corresponding to each operation action further includes:

[0019] Image recognition is performed on the element operation record to obtain each operation action and the element corresponding to each operation action.

[0020] According to a component identification method provided by the present application, the elements are combined based on the element operation records and the source code of the functional operation interface to obtain multiple functional components, including:

[0021] Inputting the element operation record and the source code into a functional component identification model to obtain the multiple functional components output by the functional component identification model; the functional component identification model is used to combine the elements based on the element operation record and the source code of the functional operation interface to obtain multiple functional components;

[0022] The functional component identification model is obtained based on sample element operation records, sample source code and sample functional component training.

[0023] According to a component identification method provided by the present application, the method further comprises: obtaining multiple functional components; and then:

[0024] Obtaining a correction functional component corresponding to the functional component;

[0025] The functional component identification model is updated based on the element operation record, the source code, and the corrected functional component.

[0026] According to a component identification method provided by the present application, the method of packaging each source code set into a callable function module further includes:

[0027] Based on the functions of each functional component in the functional module, each functional component is classified, and / or the key element name of each functional component is renamed.

[0028] The present application also provides a component identification device, comprising:

[0029] An acquisition unit, configured to monitor the operation of each element on the functional operation interface and acquire element operation records;

[0030] an identification unit, configured to combine the elements based on the element operation records and the source code of the functional operation interface to obtain a plurality of functional components;

[0031] The encapsulation unit is used to determine the source code set corresponding to each functional component and encapsulate each source code set into a callable functional module.

[0032] The present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-described component identification methods when executing the program.

[0033] The present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of any of the above-mentioned component identification methods are implemented.

[0034] The present application also provides a computer program product, comprising a computer program, which implements the steps of any of the above-mentioned component identification methods when executed by a processor.

[0035] The component identification method, device and electronic device provided in the present application can automatically and quickly obtain corresponding multiple functional components based on the element operation records of the functional operation interface and the source code of the functional operation interface, and encapsulate the source code set corresponding to each functional component to obtain a callable functional module, avoiding the problem of traditional methods that require developers to manually identify components, resulting in long component design cycles and high costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0038] Figure 1 This is a flowchart of a component identification method according to an embodiment of the present application;

[0039] Figure 2 This is a flowchart of another component identification method according to an embodiment of the present application;

[0040] Figure 3 1 is a flow chart of another component identification method according to an embodiment of the present application;

[0041] Figure 4 This is a schematic structural diagram of a component identification device according to an embodiment of the present application;

[0042] Figure 5 It is a structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0043] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0044] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0045] Currently, when developing components using low-code development platforms, developers often manually analyze, identify, and design user pages, then perform integration and packaging to create the corresponding page components. However, this approach relies entirely on manual design, and each new page requires manual redesign and development, resulting in a long and costly process.

[0046] To this end, the present application provides a component identification method. Figure 1 This is a flow chart of a component identification method provided by an embodiment of the present application. Figure 1 As shown, the method includes the following steps:

[0047] Step 110: Obtain element operation records by monitoring the operations of each element of the functional operation interface.

[0048] Here, the functional operation interface is the page that requires component identification, and the element operation record refers to the information recorded when operating the functional operation interface. It can be a recorded video of the operation of the functional operation interface, which is used to represent the image information of each element in the functional operation interface and the functional information of each element. It can include the page image information of the functional operation interface (such as buttons, pictures, dynamic panels, dividing lines, etc.) and the page operation information of the functional operation interface (such as click, drag, slide, etc.). For example, when the search button is clicked on the functional operation interface, the search button can be determined as the page image information, and the click event can be determined as the page operation event.

[0049] Step 120: Based on the element operation records and the source code of the functional operation interface, combine the elements to obtain multiple functional components.

[0050] Here, the source code of a functional interface refers to the original code information of the functional interface, which is used to indicate the business logic information within the functional interface and whether there are independently executable code blocks. For example, if a search is performed after clicking the search button on the functional interface, the source code indicates that the code block of the search interface can run independently, and combined with the business logic information, it is determined that "the search interface will be called only after clicking the search button," that is, "the search interface will be called only after the click event."

[0051] Based on the element operation interface, it is possible to determine whether each operation action can be combined with the element corresponding to each operation action from the image level of the functional operation interface. For example, when clicking the search button in the functional operation interface, it can be determined that the search button is the page image information and the click event is the page operation information. At this time, the two elements "search button" and "click event" can be combined to obtain the component corresponding to clicking the search button. Since the "search button" and "click event" correspond to corresponding historical codes, the corresponding component information can be directly obtained from the historical code without the need for developers to redesign the "click search button" component. This greatly improves the efficiency of component design and the utilization rate of historical codes. It also does not need to rely on professional developers for design, saving design costs.

[0052] Based on the source code of the functional operation interface, it is possible to determine whether the various elements can be combined from the code logic level of the functional operation interface. For example, a search is performed after clicking the search button on the functional operation interface. According to the source code, the code block portion of the search interface can run independently, and combined with the business logic information, it is determined that "the search interface will be called after clicking the search button", that is, "the search interface will be called after the click event". Therefore, the two elements of "the code block that calls the search interface" and "the click event" can be combined to obtain the component corresponding to the search after clicking the search button. Since the "code block that calls the search interface" and the "click event" correspond to corresponding historical codes, the corresponding component information can be obtained directly from the historical code without the need for developers to redesign the component for "search after clicking the search button", which greatly improves the component design efficiency and the utilization rate of historical codes. It also does not need to rely on professional developers for design, saving design costs.

[0053] By combining the element operation record and the combination results of the elements in the source code, such as fusing the element operation record and the combination results of the elements in the source code, a functional component that can be encapsulated can be ultimately obtained. For example, when searching after clicking the search button on the functional operation interface, the element combination result obtained based on the element operation record is a combination of the two elements "search button" and "click event", and the element combination result obtained based on the source code is a combination of the two elements "code block that calls the search interface" and "click event", so that the two combination results can be merged, that is, when searching after clicking the search button on the functional operation interface, the "search button", "click event" and "code block that calls the search interface" can be combined to obtain the corresponding functional component.

[0054] Step 130: Determine the source code set corresponding to each functional component, and encapsulate each source code set into a callable functional module.

[0055] Specifically, after determining each functional component, the source code set corresponding to the corresponding functional component can be obtained from the historical code library, and then each source code set can be encapsulated as a callable functional module. That is, the functional operation interface can use these functional modules to implement the corresponding component functions, without the need for developers to manually recode the functional operation interface, resulting in a long design cycle and high costs.

[0056] It can be seen that the component identification method provided in the embodiment of the present application can automatically and quickly obtain corresponding multiple functional components based on the element operation records of the functional operation interface and the source code of the functional operation interface, and encapsulate the source code set corresponding to each functional component to obtain a callable functional module, avoiding the problem of relying on developers to manually identify components in traditional methods, resulting in long component design cycles and high costs.

[0057] Based on the above embodiment, based on the element operation records and the source code of the function operation interface, the elements are combined to obtain multiple functional components, including:

[0058] Combine each operation action in the element operation record with the element corresponding to each operation action to obtain an initial functional component;

[0059] Based on the source code, the business logic between the initial functional components is determined, and the initial functional components are combined based on the business logic to obtain multiple functional components.

[0060] Specifically, the element operation record usually contains the page image information of each element in the page to be identified and the page operation information of each element, so that each operation action and the element corresponding to each operation action can be identified from the element operation record. For example, by identifying the element operation record of "clicking the search button", it can be identified that the corresponding operation action is "click" and the element corresponding to the operation action is "search button". Therefore, the two can be combined into an initial functional component, that is, the initial functional component corresponds to "clicking the search button".

[0061] After obtaining the initial functional components, there may be business logic between each initial functional component. For example, there may be a sequential execution relationship between some initial functional components, and they can be combined. In addition, the source code usually contains information such as the coding language rules, code development specifications, code business logic, etc. in the page to be identified. Therefore, the business logic between each initial functional component can be obtained from the source code. To this end, the embodiment of the present application combines the initial functional components with the same business logic based on the business logic between each initial functional component contained in the source code, and then obtains the final functional component. For example, after clicking the search button in the function operation interface, a search is performed. The two elements "search button" and "click event" are combined in the initial functional component. According to the source code, "the interface call function is executed after the click event", that is, after the "click event", the initial functional component "calling the search interface" needs to be executed. Therefore, the two initial functional components "search button" + "click event" and "calling the search interface" can be combined to obtain the corresponding functional component.

[0062] Based on any of the above embodiments, the initial functional components are combined based on business logic to obtain multiple functional components, including:

[0063] Based on the source code specifications and business logic, determine the initial functional components corresponding to the same business logic;

[0064] The initial functional components corresponding to the same business logic are combined to obtain corresponding functional components.

[0065] Specifically, the source code usually contains information such as coding language rules, code specifications, business logic, etc. of the functional operation interface. Based on the code specifications and business logic in the source code, the initial functional component with the same business logic can be determined from multiple initial functional components.

[0066] For example, in the function operation interface, a search is performed after clicking the search button. According to the source code, the corresponding business logic for the search service is to call the search interface after clicking the search button. That is, "calling the search interface" and "search button" + "click event" belong to the same business logic, and the three can be combined into a functional component.

[0067] The business logic may include judgment logic, data flow, framework used, interface call status, etc. It should be noted that when determining the business logic of the source code, the business logic in the source code can be determined based on a pre-built knowledge base. The knowledge base may store the business logic corresponding to different source codes and establish a mapping relationship between the source code and the corresponding business logic, so that the business logic corresponding to each source code can be quickly queried in the knowledge base.

[0068] Based on any of the above embodiments, determining the initial functional components corresponding to the same business logic based on the code specifications and business logic of the source code includes:

[0069] Based on the code specifications, determine the smallest code block that can run independently in the source code;

[0070] The initial functional component corresponding to the minimum code block corresponding to the same business logic is used as the initial functional component corresponding to the same business logic.

[0071] Specifically, the source code contains information such as the grammatical rules of the coding language and the code specifications for the development code. Based on the code specifications in the functional operation interface, the minimum code block in the source code that can run independently can be determined. That is, an initial functional component can correspond to one minimum code block or multiple minimum code blocks.

[0072] Because the same business logic may correspond to multiple initial functional components, meaning these initial functional components can be further combined, multiple initial functional components with the same business logic can be combined to obtain functional components of the functional operation interface. Furthermore, each initial functional component is composed of one or more minimal code blocks. In other words, once the minimal code blocks corresponding to the same business logic are determined, the initial functional components corresponding to these minimal code blocks can be obtained.

[0073] Based on any of the above embodiments, each operation action in the element operation record is combined with the element corresponding to each operation action, and the process also includes:

[0074] Perform image recognition on the element operation records to obtain each operation action and the element corresponding to each operation action.

[0075] Specifically, the element operation record can be a recorded video of the functional operation interface, and then the recorded video can be subjected to image recognition to obtain the action information contained in the recorded video and the image element category corresponding to each action, that is, to obtain each operation action and the element corresponding to each operation action.

[0076] It is understood that the element operation record can be input into a pre-trained recognition model, which performs image recognition on the element operation record to obtain each operation action and the element corresponding to each operation action. The recognition model can be trained based on sample element operation records and each operation action and the element corresponding to each operation action in the sample element operation records.

[0077] Based on any of the above embodiments, based on the element operation records and the source code of the function operation interface, the elements are combined to obtain multiple functional components, including:

[0078] Inputting element operation records and source code into a functional component identification model to obtain multiple functional components output by the functional component identification model; the functional component identification model is used to combine each element based on the element operation records and the source code of the functional operation interface to obtain multiple functional components;

[0079] Among them, the functional component recognition model is trained based on sample element operation records, sample source code and sample functional components.

[0080] Specifically, before inputting element operation records and source code into the functional component recognition model, a pre-trained functional component recognition model can be obtained. This can be achieved by performing the following steps: First, a large number of sample element operation records and sample source code are collected, and their corresponding sample functional components are identified through manual annotation. Then, an initial model is trained based on the sample element operation records, sample source code, and sample functional components to obtain the functional component recognition model.

[0081] In addition, as an optional embodiment, element operation records and source code can also be input into a functional component identification model. Based on the element operation records and the source code of the functional operation interface, the functional component identification model combines the elements to obtain multiple functional components, determines the source code set corresponding to each functional component, and encapsulates each source code set into a callable functional module. The functional component identification model here is trained based on sample element operation records, sample source code, and sample functional modules.

[0082] Based on any of the above embodiments, multiple functional components are obtained, and then further comprising:

[0083] Obtain the correction functional component corresponding to the functional component;

[0084] Based on the element operation records, source code and corrected functional components, the functional component identification model is updated.

[0085] Specifically, since the functional component identification model is obtained by deep learning of sample element operation records, sample source code and sample functional components, the results output by the functional component identification model (i.e., multiple functional components) can be regarded as prediction results, that is, the results may contain errors.

[0086] Therefore, in order to further improve the accuracy of the functional component identification model, after obtaining multiple functional components output by the functional component identification model, experts can perform corrections to obtain their corresponding corrected functional components, and use the corrected functional components as training labels and the element operation records and source code as training samples to update the functional component identification model, so that the updated functional component identification model can perform component identification more accurately.

[0087] Based on any of the above embodiments, each source code set is encapsulated as a callable function module, and then further includes:

[0088] Based on the functions of each functional component in the functional module, each functional component is classified and / or the key element name of each functional component is renamed.

[0089] Specifically, the multiple functional components corresponding to the functional module are obtained by combining the various elements in the functional operation interface, and there may be components that reuse historical codes in these functional components, that is, the classification and / or naming of these functional components all follow the classification and naming of historical code components, and there may be problems that the classification and / or naming do not conform to the current application scenario. Therefore, each functional component can be classified according to the function of each functional component in the functional module, and / or the key element name of each functional component can be renamed, so that developers can intuitively obtain the information of each functional component in the functional operation interface. It is understandable that a brief introduction to the corresponding content (such as a function introduction) can also be marked in each functional component, so that the information of each functional component can be intuitively obtained.

[0090] Based on any of the above embodiments, the key element name includes at least one of a package name, a class name, and a parameter name.

[0091] Specifically, the key element name can include at least one of the following: package name, class name, and parameter name. The package name uniquely identifies the application, meaning it is unique and represents one application. Two applications cannot have the same package name. The package name can contain uppercase and lowercase letters, numbers, and underscores, and can be separated by periods. The class name represents the name of the data type, which can include primitive and reference data types. The parameter name represents the name of the parameter.

[0092] Based on any of the above embodiments, the present application also provides a component identification method, such as Figure 2 As shown, the method includes:

[0093] First, a plug-in is locally integrated into the source code of the functional operation interface, and a recorded video (i.e., element operation record) and source code of the functional operation interface are obtained. Next, the functional component recognition model performs image analysis on the recorded video and code analysis on the source code to obtain the component recognition results of the page to be identified.

[0094] Then, the developer confirms the available functional components of the component recognition results of the page to be recognized, obtains the correction results, and updates the component recognition model based on the correction results, recorded video and source code.

[0095] At the same time, according to the functions of each functional component in the correction results, the package name, class name, and parameter name of the key elements in each component are classified and renamed, and the classified and renamed components are displayed.

[0096] Among them, such as Figure 3 As shown, when the functional component recognition model performs component recognition, an image analysis engine is used for image analysis, and a code analysis engine is used for code analysis. The component recognition results are then displayed and stored. The code analysis engines include a Web native analysis engine, an Angular analysis engine, a React analysis engine, and a Vue analysis engine.

[0097] The component identification device provided in the present application is described below. The component identification device described below and the component identification method described above can be referenced to each other.

[0098] Based on any of the above embodiments, the present application also provides a component identification device, such as Figure 4 As shown, the device includes:

[0099] The acquisition unit 410 is used to monitor the operation of each element of the functional operation interface and acquire the element operation record;

[0100] an identification unit 420 for combining the elements based on the element operation records and the source code of the functional operation interface to obtain a plurality of functional components;

[0101] The encapsulation unit 430 is configured to determine a source code set corresponding to each functional component and encapsulate each source code set into a callable functional module.

[0102] The component identification device provided in the embodiment of the present application can automatically and quickly obtain corresponding multiple functional components based on the element operation records of the functional operation interface and the source code of the functional operation interface, and encapsulate the source code set corresponding to each functional component to obtain a callable functional module, avoiding the problem of relying on developers to manually identify components in traditional methods, resulting in long component design cycles and high costs.

[0103] Based on any of the above embodiments, the identification unit 420 includes:

[0104] an initial combination unit, configured to combine each operation action in the element operation record with the element corresponding to each operation action to obtain an initial functional component;

[0105] The logic combination unit is used to determine the business logic between the initial functional components based on the source code, and combine the initial functional components based on the business logic to obtain multiple functional components.

[0106] Based on any of the above embodiments, the logic combination unit includes:

[0107] A logic determination unit, configured to determine, based on a code specification of the source code and the business logic, an initial functional component corresponding to the same business logic;

[0108] The logic combination sub-unit is used to combine the initial functional components corresponding to the same business logic to obtain corresponding functional components.

[0109] Based on any of the above embodiments, the logic determination unit includes:

[0110] A code block determining unit, configured to determine a minimum code block that can be run independently in the source code based on the code specification;

[0111] The code block combination unit is used to use the initial functional component corresponding to the minimum code block corresponding to the same business logic as the initial functional component corresponding to the same business logic.

[0112] Based on any of the above embodiments, the device further includes:

[0113] The image recognition unit is used to perform image recognition on the element operation record before combining each operation action in the element operation record with the element corresponding to each operation action, so as to obtain each operation action and the element corresponding to each operation action.

[0114] Based on any of the above embodiments, the identification unit 420 is configured to:

[0115] Inputting the element operation record and the source code into a functional component identification model to obtain the multiple functional components output by the functional component identification model; the functional component identification model is used to combine the elements based on the element operation record and the source code of the functional operation interface to obtain multiple functional components;

[0116] The functional component identification model is obtained based on sample element operation records, sample source code and sample functional component training.

[0117] Based on any of the above embodiments, the device further includes:

[0118] A correction component acquisition unit, configured to acquire, after obtaining a plurality of functional components, a correction functional component corresponding to the functional components;

[0119] A model updating unit is used to update the functional component identification model based on the element operation record, the source code and the correction functional component.

[0120] Based on any of the above embodiments, the device further includes:

[0121] The renaming unit is used to classify each functional component based on the function of each functional component in the functional module after encapsulating each source code set into a callable functional module, and / or rename the key element name of each functional component.

[0122] Figure 5 is a structural diagram of an electronic device provided in an embodiment of the present application, such as Figure 5 As shown, the electronic device may include: a processor 510, a memory 520, a communications interface 530, and a communications bus 540, wherein the processor 510, the memory 520, and the communications interface 530 communicate with each other via the communications bus 540. The processor 510 may call the logic instructions in the memory 520 to execute a component identification method, which includes: monitoring the operation of each element of the functional operation interface to obtain element operation records; combining each element based on the element operation records and the source code of the functional operation interface to obtain multiple functional components; determining the source code set corresponding to each functional component, and encapsulating each source code set into a callable functional module.

[0123] In addition, the logic instructions in the above-mentioned memory 520 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0124] On the other hand, the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the component identification method provided by the above methods, and the method includes: monitoring the operation of each element of the functional operation interface to obtain element operation records; based on the element operation records and the source code of the functional operation interface, combining each element to obtain multiple functional components; determining the source code set corresponding to each functional component, and encapsulating each source code set into a callable functional module.

[0125] On the other hand, the present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the component identification methods provided above, the methods comprising: obtaining element operation records by monitoring the operations of each element of the functional operation interface; combining each element based on the element operation records and the source code of the functional operation interface to obtain multiple functional components; determining the source code set corresponding to each functional component, and encapsulating each source code set into a callable functional module.

[0126] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0127] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0128] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A component identification method, characterized in that: include: By monitoring the operation of each element in the functional operation interface, the element operation record is obtained; Based on the element operation records and the source code of the functional operation interface, the elements are combined to obtain multiple functional components; Determine a source code set corresponding to each functional component, and encapsulate each source code set into a callable functional module; Based on the element operation record and the source code of the functional operation interface, the elements are combined to obtain multiple functional components, including: Combining each operation action in the element operation record with the element corresponding to each operation action to obtain an initial functional component; Determining the business logic between the initial functional components based on the source code, and combining the initial functional components based on the business logic to obtain multiple functional components; The initial functional components are combined based on the business logic to obtain multiple functional components, including: Determining, based on the code specifications of the source code and the business logic, initial functional components corresponding to the same business logic; The initial functional components corresponding to the same business logic are combined to obtain corresponding functional components.

2. The component identification method according to claim 1, characterized in that: The determining of the initial functional components corresponding to the same business logic based on the code specification of the source code and the business logic includes: Based on the code specification, determining a minimum code block in the source code that can be run independently; The initial functional component corresponding to the minimum code block corresponding to the same business logic is used as the initial functional component corresponding to the same business logic.

3. The component identification method according to claim 1, characterized in that: The combining of each operation action in the element operation record with the element corresponding to each operation action may also include: Image recognition is performed on the element operation record to obtain each operation action and the element corresponding to each operation action.

4. The component identification method according to any one of claims 1 to 3, characterized in that: Based on the element operation record and the source code of the functional operation interface, the elements are combined to obtain multiple functional components, including: Inputting the element operation record and the source code into a functional component identification model to obtain the multiple functional components output by the functional component identification model; the functional component identification model is used to combine the elements based on the element operation record and the source code of the functional operation interface to obtain multiple functional components; The functional component identification model is obtained based on sample element operation records, sample source code and sample functional component training.

5. The component identification method according to claim 4, characterized in that: The method further comprises obtaining a plurality of functional components and then: Obtaining a correction functional component corresponding to the functional component; The functional component identification model is updated based on the element operation record, the source code, and the corrected functional component.

6. The component identification method according to any one of claims 1 to 3, characterized in that: The step of packaging each source code set into a callable function module further includes: Based on the functions of each functional component in the functional module, each functional component is classified, and / or the key element name of each functional component is renamed.

7. A component identification device, characterized in that: include: An acquisition unit, configured to monitor the operation of each element on the functional operation interface and acquire element operation records; an identification unit, configured to combine the elements based on the element operation records and the source code of the functional operation interface to obtain a plurality of functional components; An encapsulation unit, configured to determine a source code set corresponding to each functional component and encapsulate each source code set into a callable functional module; Based on the element operation record and the source code of the functional operation interface, the elements are combined to obtain multiple functional components, including: Combining each operation action in the element operation record with the element corresponding to each operation action to obtain an initial functional component; Determining the business logic between the initial functional components based on the source code, and combining the initial functional components based on the business logic to obtain multiple functional components; The initial functional components are combined based on the business logic to obtain multiple functional components, including: Determining, based on the code specifications of the source code and the business logic, initial functional components corresponding to the same business logic; The initial functional components corresponding to the same business logic are combined to obtain corresponding functional components.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the component identification method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Json based complex web page component self-defining method and device

    CN105786505A

  • User interface automatic testing method and device and computer readable storage medium

    CN110297758A