Business logic processing method, device and electronic device

By identifying functional units in the user interface and generating corresponding business logic and code, the problem of repetitive labor in user interface development is solved and development efficiency is improved.

CN113282287BActive Publication Date: 2025-03-18ALIBABA GROUP HOLDING LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010105377.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-20
Publication Date
2025-03-18
Estimated Expiration
2040-02-20

AI Technical Summary

Technical Problem

During the user interface development process, there is a lot of repetitive labor, resulting in low development efficiency.

Method used

By obtaining user interface design data, identifying functional units, and obtaining and generating corresponding business logic and business codes based on functional units, avoiding manual repeated processing.

Benefits of technology

It improves the output efficiency of business code, reduces manual repetitive labor, and realizes intelligent user interface code generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113282287B_ABST
    Figure CN113282287B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method, device and electronic device for processing business logic, the method comprising: obtaining user interface design data, identifying functional units in the user interface according to the user interface design data; obtaining corresponding business logic according to the functional units; and generating corresponding business code according to the business logic. The technical solution of the embodiment of the present invention first identifies abstract business logic through user interface design data, and then further generates business code. Through such a processing process, manual repeated processing is avoided and the efficiency of code output is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to a method, device and electronic equipment for processing business logic, and belongs to the field of computer technology. Background Art

[0002] In the business processing based on the Internet, there are a lot of user interface (UI) development needs. In the process of UI development in the prior art, UI designers usually complete the interface visual draft, and then give it to code developers to write executable code corresponding to the interface.

[0003] In the above-mentioned user interfaces, there are actually many similar user interfaces or similar functional units in the interfaces. Based on the current code development method, there is a large amount of repetitive work, resulting in low efficiency in user interface development. Summary of the invention

[0004] The embodiments of the present invention provide a method, device and electronic device for processing business logic to improve the output efficiency of business codes.

[0005] In order to achieve the above object, an embodiment of the present invention provides a method for processing business logic, including:

[0006] Acquire user interface design data, and identify functional units in the user interface according to the user interface design data;

[0007] According to the functional unit, obtaining corresponding business logic;

[0008] According to the business logic, a corresponding business code is generated.

[0009] The embodiment of the present invention further provides a service logic processing device, including:

[0010] A functional unit identification module, used to obtain user interface design data and identify functional units in the user interface according to the user interface design data;

[0011] A business logic acquisition module, used to acquire corresponding business logic according to the functional unit;

[0012] The business code generation module is used to generate corresponding business codes according to the business logic.

[0013] The embodiment of the present invention also provides a method for processing business logic, including:

[0014] Visual mockup of loading screen design;

[0015] Performing business logic identification on the visual draft and extracting business logic, wherein the business logic includes one or more of view transformation logic, data binding logic, event binding logic, function call logic and dependency management logic;

[0016] Generate business code according to the business logic.

[0017] An embodiment of the present invention further provides an electronic device, including:

[0018] Memory, used to store programs;

[0019] The processor is used to run the program stored in the memory to execute the aforementioned business logic processing method.

[0020] The technical solution of the embodiment of the present invention first identifies the abstract business logic through the user interface design data, and then further generates the business code. Through such a processing process, repeated manual processing is avoided and the code output efficiency is improved.

[0021] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A schematic diagram of an application scenario of the business logic processing of an embodiment of the present invention;

[0023] Figure 2 A flowchart of a business logic processing method according to an embodiment of the present invention;

[0024] Figure 3 This is one of the structural schematic diagrams of the service logic processing device according to an embodiment of the present invention;

[0025] Figure 4 This is a second structural diagram of the service logic processing device according to an embodiment of the present invention;

[0026] Figure 5 FIG. 4 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0027] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0028] The embodiment of the present invention provides an intelligent user interface-based business code generation method, which can be applied to a data service platform that provides user interface configuration services, or a data service platform that provides web page configuration and access services. Web page configuration users can configure web pages on the data service platform, and provide page access services to web page access users through the data service platform. These data service platforms can be, for example, large websites that provide e-commerce services, provide store page design and configuration services to merchants, and provide store page access services to commodity purchasing users. For another example, the data service platform can be a platform that provides office business services, providing office interactive user interface configuration services for various companies, and providing office business support to company employees.

[0029] In the above-mentioned business code generation process, the corresponding business logic is first extracted by analyzing and identifying the user interface design data, and then the executable business code is generated based on the business logic. The user interface design data mentioned here may include the visual design draft of the user interface, for example, a PSD (Photoshop software format) file designed by an interface designer, or a document generated by other dedicated interface development software, etc. In addition, it may also include some configuration information for the user interface, which may describe the function of a certain interface unit or the relationship with certain data, for example, the function of a certain button or the text format of a certain text input box, and the merchant ID associated with a certain interface unit.

[0030] In the process of business logic identification, the main identification goal is to identify the functional units in the user interface. After the functional unit is identified, the pre-configured business logic corresponding to the functional unit can be called according to the functional unit. The business logic mentioned here is an abstract logic, an abstract description of some business processing procedures. For example, taking the follow-up store as an example, its business logic is that when the follow button is clicked, an association with the specified store is established, and the dynamic information of the specified store is received. In this business logic, there is no need to specify the specific store ID, but the store ID can be used as a variable and further input in the subsequent coding process.

[0031] For some more complex user interfaces, the user interface can be classified first and divided into multiple user interface modules. Then, the corresponding user interface design data is obtained for each user interface module, and the functional units are identified for each user interface module.

[0032] After identifying the business logic, code can be further generated based on the business logic. The process of generating code can specifically include two stages. In the first stage, the business logic is converted into code protocol data. The code protocol data is an abstract code expression that meets the code completeness conditions and can be coded according to different languages. The second stage is to generate business code for executing user interface business processing based on the code protocol data combined with the programming language used by the user interface. The business code generated at the end is the code that meets the online requirements.

[0033] In the above-mentioned identification process of the functional unit, the machine learning model can be used to process the user interface design data to determine the corresponding functional unit. Then, the configured business logic is called according to the identified functional unit. The machine learning model needs to be trained in advance for functional unit identification. The training data can come from the above-mentioned data service platform.

[0034] Specifically, the data service platform extracts and classifies the functional units that may be involved in the user interface in advance. This part of the work can be done manually or automatically through a program. Since the existing user interface is complete from the interface design document to the corresponding business code, the functional units in the user interface can be accurately determined by analyzing these data. Through the analysis of the functional units involved in the user interface, the classification of multiple functional units is set, and classification labels are assigned. The classification here refers to identifying the functional units with the same functions in each user interface as the same category and assigning the same classification label. For example, there is a "Follow" button in multiple user interfaces. The specific form of each button and the object of attention may be different, but when performing functional classification, because the basic logical function of attention is the same, it will be classified into the same category and assigned the same classification label.

[0035] After forming and extracting classification labels of multiple functional units, the corresponding business logic is pre-configured for each type of functional unit, and the business logic and the classification labels of the functional units are stored correspondingly. For example, in the user interface of the e-commerce field, the functional units involved include: store attention, adding to shopping cart, one-click purchase, payment, etc. Pre-configuring the corresponding processing logic for these functional units shows that for any user's user interface, the specific functional units may have different forms, but the processing logic therein is common. For example, the logic of adding to the shopping cart will not differ greatly in business processing logic due to different commodities. In addition, in the interface form corresponding to the functional unit, the same functional unit will have certain common characteristics. For example, on the interface corresponding to the "Follow" functional unit, there is generally a button, and there will be attention text or icons reflecting the attention function, etc. These features constitute the feature basis for identifying the attention functional unit.

[0036] The above business logic can be abstracted from the existing business code. Business logic is relatively abstract data, which mainly describes the business functions and specific operations performed by the functional unit, but does not need to include specific business data, which can be introduced in subsequent coding. Still taking the "Follow" functional unit as an example, the follow logic can be to start receiving update information from the "specified store ID" and display it in the "specified display area" of the page. In this business logic, the "specified store ID" and "specified display area" can be replaced by variables and wait for input in the subsequent coding process.

[0037] In addition, the above-mentioned business logic and classification definition of functional units can be set separately according to different business fields. For example, a series of classification definitions of functional units and corresponding business logic can be configured for the user interface in the e-commerce field, while another series of classification definitions of functional units and corresponding business logic can be configured for the user interface in the social network field. When providing users with automatic code generation services, different configuration data can be used according to the user's field or the user's choice of field.

[0038] After configuring the functional unit classification and the corresponding business logic, the user interface design data of the existing user interface and the corresponding functional unit classification can be used as training data to train the machine learning model, so that the machine learning model has the ability to identify the functional unit classification contained in the user interface.

[0039] Then, when the trained machine learning model is put into online application, the machine learning model will first extract features of the user interface design data, and then determine the functional unit classification corresponding to the user interface based on the extracted features. In other words, the machine learning model does not directly generate business logic, but outputs the classification results of the functional units, and then calls the corresponding business logic based on the classification results.

[0040] In an embodiment of the present invention, the machine learning model may mainly include a model for classification based on image features and a model for classification based on text features. Classification based on image features may adopt a model for feature analysis based on image pixels, such as an image analysis model based on a neural network. In addition, a model focusing on image structure for feature analysis may also be adopted, that is, a model related to material feature analysis of the interface may be adopted, such as a model constructed using an XGboost (an algorithm in the field of machine learning, developed on the basis of a gradient boosting decision tree) algorithm. For example, a common "add to cart" image structure is that the button includes a shopping cart icon and is wrapped by a circular border, and the button is at the top of the user interface. On the other hand, a model for classification based on text features may adopt NLP (Natural language processing) technology to perform semantic analysis on the text information contained in the user interface design data, thereby determining the corresponding functional unit classification, such as if the text on the button is "Follow", then through semantic analysis it can be known that the functional unit corresponding to the part is the "Follow" classification.

[0041] In addition, in addition to using machine learning to identify business logic, it is also possible to use a custom function to identify, that is, to make a judgment by setting specific identification rules. Specifically, in the process of user interface design, the part corresponding to a certain functional unit in the user interface is composed of many design element modules, which are interrelated to form a module node tree, each module node is a design element module, and has certain style attributes. For example, taking the user interface corresponding to the "Follow" functional unit as an example, the user interface of this part may include module nodes such as buttons, surrounding graphics, and text. The relationship between the module nodes is that the button is embedded in the circular border as the surrounding graphics, and the text "Follow" is on the top layer of the button. The button, circular border and text all have their own style attributes. Identification is performed by pre-setting rules, for example, the relationship between the button and the circular border is an embedded relationship, the relationship between the text and the button is a stacked relationship, the length of the character is 2, etc., and the corresponding functional unit is determined based on these rules. The method of judging based on preset identification rules is suitable for functional units with clear interface design styles and less changes in the design of similar user interfaces.

[0042] After identifying the functional unit and calling the corresponding business logic, the business code needs to be generated based on the business logic, that is, the business logic expression is executed. In this process, it is possible to interact with the user as needed to obtain further business data. Of course, the aforementioned user interface design data contains the configuration information of the user interface to be used in the generation process of the business code. This configuration information can be some business data of user information, such as user ID, or some business data related to business processing, such as price calculation rules, etc.

[0043] The process of converting business logic into code mainly involves generating the following codes based on the business logic:

[0044] 1) The business code corresponding to the component view transformation relationship corresponding to the functional unit. In the user interface, the functional unit will involve one or more components. In the process of business processing, the components may correspond to multiple different views. As the business is executed, it will trigger switching between multiple views. The transformation relationship between these views has been recorded in the business logic. For example, taking the functional unit of attention as an example, the component of the attention button will switch from the "unfollowed" view to the "followed" view after being clicked. For another example, the add to cart button will trigger the change of the quantity display view on the shopping cart component, etc.

[0045] 2) Business code corresponding to the business data processing involved in the functional unit. The user interface is logically composed of multiple functional units, each of which involves some business data and is associated with it. For example, the function unit of the focus button needs to be associated with a specific focus object when it comes to a specific user interface. The relevant information of the focus object is the business data. Taking the store focus as an example, the business data is the store ID. These business data can be declared in the configuration information in the user interface design data.

[0046] 3) Business codes corresponding to the trigger event processing involved in the functional unit. Some business processing of the user interface is triggered by events, which can be events triggered by user operations, such as mouse clicks, touch screen clicks, sliding, etc. Which events a functional unit involves can be directly determined by the data service platform. For example, buttons can generally correspond to mouse clicks and touch screen clicks. In addition, it can also be configured by the user himself. The user can declare it in the configuration information in the user interface design data.

[0047] 4) Business code that calls the code dependencies involved in the functional unit. In the user interface, many business processing codes do not need to be embedded in the current user interface code, but can call business codes deployed elsewhere. In the code corresponding to the current user interface, only the program code for executing the code call needs to be added. The relevant information of the code dependency can also be declared in the configuration information in the user interface design data.

[0048] The business code generated by the above process can be the protocol code data that meets the code completeness conditions, and then, it can be used to generate executable business code that can be put online according to different languages. From another perspective, the protocol code data can have a certain degree of reusability, and the business logic of the same user interface can be deployed to different types of application environments as needed.

[0049] The above is an exemplary description of the processing process of the business logic provided by the embodiment of the present invention. The above technical solution can be applied to Figure 1 In the data service platform shown, Figure 1 In the example of the application scenario, the merchant user is used as an example. The data service platform provides merchant users with a product sales page (user interface) generation service. The merchant user needs to provide the user interface design data to the data service platform. The platform is equipped with a machine learning model to process the user interface design data and generate the classification results of the functional units. Then, the business logic is retrieved from the database storing the business logic according to the classification results, and the business code is further generated through the business code generation engine, and the business code is combined with the user interface to form a product sales page that can be put online. After that, the data service platform can also provide operation services for the product sales page, and the visiting user as a consumer can visit the merchant sales page through the data service platform and conduct product transactions.

[0050] Through the technical solution of the embodiment of the present invention, it is possible to provide users with automated business code generation services. After the user provides the user interface design data, the abstract business logic is first extracted, and then the business code is further generated. In such a processing process, some common logics of functional units in the user interface in the same field are fully utilized, thereby avoiding manual repeated processing and improving the efficiency of code output. In addition, the user interface design data can also be intelligently identified in combination with a machine learning model, so as to more effectively determine the corresponding business logic and realize the intelligent generation of business code.

[0051] The technical solution of the present invention is further illustrated by some specific embodiments below.

[0052] Embodiment 1

[0053] like Figure 2As shown, it is a flow chart of a method for processing business logic according to an embodiment of the present invention. The method can be applied on the above-mentioned data service platform, and includes:

[0054] S101: Obtain user interface design data, and identify functional units in the user interface based on the user interface design data. The user interface design data may include, for example, design files such as interface visual design drafts that contain image data and / or text data, and the functional units included in the user interface are determined by identifying and analyzing the image structure features and / or semantic features in these data. The user interface design data may be the design data of the entire user interface or the design data of some modules thereof. For user interfaces that are more complex or involve more functional units, the user interface may be first classified to generate multiple user interface modules, and then the user interface design data corresponding to each user interface module may be obtained respectively, and subsequent processing may be performed.

[0055] After obtaining the above-mentioned user interface design data, a machine learning model can be used to perform feature recognition for the image data and text data therein, and determine the corresponding functional units. Among them, an image recognition classification model can be used for image data, and a semantic analysis classification model can be used for text data. The recognition results of these two models can be used separately or in combination to finally determine the functional units. The machine learning model actually outputs the classification results of the functional units based on the input features. The classification results mentioned here are pre-defined, and each classification result corresponds to a functional unit. The specific classification definition of the functional unit can be flexibly set according to the characteristics and needs of the corresponding business field.

[0056] After configuring the functional unit classification and the corresponding business logic, you can train the machine learning model. The training process may include:

[0057] Obtain user interface design data of multiple existing user interfaces and functional units included in the existing user interfaces. These functional units can be flexibly divided according to different fields or different needs. Then, extract image data and / or text data in the user interface design data, and set classification labels corresponding to each functional unit. After defining the division of each functional unit, assign a classification label to each functional unit, and the classification label uniquely identifies this type of functional unit. Finally, establish a correspondence between the image data and / or text data and the classification label of the functional unit as training data for the image recognition classification model and / or the semantic analysis classification model, and use these training data to train machine learning models such as the image recognition classification model and the semantic analysis classification model.

[0058] The training process can be completed by the data service platform, which can use its massive user interface design data and business code to extract training data and train the machine learning model. During the training process, training can also be based on different business fields or different types of customers. For example, for the user interface in the e-commerce field, the existing user interface design data in the e-commerce field can be used for training, and for the user interface in the social network field, the user interface design data of social software or social networking sites can be used for training.

[0059] In addition, it is also possible to identify by using a custom function, that is, to make a judgment by setting specific identification rules. Specifically, the module node tree composed of the design elements in the user interface design data can be analyzed, and the functional units in the user interface can be determined based on the association relationship between the module nodes and the style attributes of the module nodes. The module node tree mentioned here refers to the part corresponding to a functional unit in the user interface during the interface design process, which is composed of many design element modules. These design element modules are interrelated to form a module node tree, and each module node is a design element module and has certain style attributes. The method of judging based on preset identification rules is suitable for functional units with clear interface design styles and fewer changes in the design of similar user interfaces.

[0060] S102: Obtain the corresponding business logic according to the functional unit. After the functional unit is identified, the corresponding business logic can be obtained according to the functional unit. As mentioned above, the classification definition of the functional unit and the corresponding business logic can be configured in advance. After the functional unit is identified, the business logic can be directly called. Business logic is an abstract logic, an abstract description of some business processing procedures, and is applicable to all user interfaces with the same type of functional units.

[0061] S103: Generate corresponding business code according to business logic. In some cases, generating business code based on business logic may require specific business data or involve some specific triggering events. For example, the functional unit "Follow" needs to obtain the object of attention when executing specific business. In the field of e-commerce, the object of attention may be a store or a product, then "store ID" or "product ID" is the business data corresponding to the business logic of "Follow". For another example, for the execution of some business logic, event triggering is required, and the specific event still needs to be specified by the user. These business data or triggering events can come from interaction with the user, that is, in the process of generating business code, the user can provide relevant information through an interactive dialog box. In addition, the user can provide this information in advance in the user interface design data. In this case, the user interface design data can include configuration information for business data and / or triggering events in addition to visual design files such as image data and text data. Then, in the process of generating business code, the business code is generated based on the business logic and configuration information.

[0062] The process of generating business code can include the following two stages: first, the code protocol data corresponding to the business execution is generated according to the business logic. The code protocol data is an abstract code expression that meets the code completeness conditions and can be coded according to different languages. Then, according to the business code and the programming language used by the user interface, the business code for executing the user interface business processing is generated.

[0063] The technical solution of the embodiment of the present invention provides user interface design data for the user, first extracts abstract business logic, and then further generates business code. In such a processing process, some common logics of functional units in the user interface in the same field are fully utilized, thereby avoiding manual repetitive processing and improving code output efficiency.

[0064] Embodiment 2

[0065] like Figure 3 As shown, it is one of the structural schematic diagrams of the service logic processing device of the embodiment of the present invention. The device can be set on the above-mentioned data service platform, and the device includes:

[0066] The functional unit identification module 11 is used to obtain user interface design data and identify the functional units in the user interface according to the user interface design data. The user interface design data may include, for example, design files containing image data and / or text data such as interface visual design drafts, and the functional units included in the user interface are determined by identifying and analyzing the image structure features and / or semantic features in these data. After obtaining the above-mentioned user interface design data, a machine learning model can be used to perform feature recognition for the image data and text data therein, and determine the corresponding functional units, wherein an image recognition classification model can be used for image data, and a semantic analysis classification model can be used for text data. The recognition results of these two models can be used separately or in combination to finally determine the functional units. The machine learning model actually outputs the classification results of the functional units based on the input features. The classification results mentioned here are pre-defined, and each classification result corresponds to a functional unit. The classification definition specifically for the functional unit can be flexibly set according to the characteristics and needs of the corresponding business field.

[0067] In addition, it is also possible to identify by using a custom function, that is, to make a judgment by setting specific identification rules. Specifically, the module node tree composed of the design elements in the user interface design data can be analyzed, and the functional units in the user interface can be determined based on the association relationship between the module nodes and the style attributes of the module nodes. The module node tree mentioned here refers to the part corresponding to a functional unit in the user interface during the interface design process, which is composed of many design element modules. These design element modules are interrelated to form a module node tree, and each module node is a design element module and has certain style attributes. The method of judging based on preset identification rules is suitable for functional units with clear interface design styles and fewer changes in the design of similar user interfaces.

[0068] The business logic acquisition module 12 is used to obtain the corresponding business logic according to the functional unit. The classification definition of the functional unit and the corresponding business logic can be configured in advance. When the functional unit is identified, the business logic can be directly called. Business logic is an abstract logic, an abstract description of some business processing processes, and is applicable to all user interfaces with the same type of functional unit.

[0069] The business code generation module 13 is used to generate corresponding business codes according to business logic. In some cases, generating business codes based on business logic may require specific business data or involve some specific triggering events. These business data or triggering events can come from interacting with users, that is, in the process of generating business codes, users can provide relevant information through interactive dialog boxes. In addition, users can provide this information in advance in the user interface design data. In this case, the user interface design data may include configuration information for business data and / or triggering events in addition to visual design files such as image data and text data. Then, in the process of generating business codes, business codes are generated based on business logic and configuration information.

[0070] The process of generating business code can include the following two stages: first, the code protocol data corresponding to the business execution is generated according to the business logic. The code protocol data is an abstract code expression that meets the code completeness conditions and can be coded according to different languages. Then, according to the business code and the programming language used by the user interface, the business code for executing the user interface business processing is generated.

[0071] The specific description of the above-mentioned processing process, the detailed description of the technical principle and the detailed analysis of the technical effect have been described in detail in the previous embodiments and will not be repeated here.

[0072] Embodiment 3

[0073] The embodiment of the present invention also provides a method for processing business logic, which can be applied to an auxiliary development tool for a front-end interface. The auxiliary development tool can be a development software installed on a mobile device, a desktop computer, or a server, or a software development system deployed on a cloud data service platform. The method is mainly used to liberate or reduce the work content of code developers of the front-end interface, directly connect with the interface design link, and realize the automation of code generation. The method may include:

[0074] S201: Load the visual draft of the interface design. The visual draft designed by the interface designer can exist in the form of a separate file, such as a PS (PHOTOSHOP, an image design software) format file, which can be imported into the above-mentioned auxiliary development software, or uploaded to the cloud-based software development system for further processing. In addition, the visual draft can also be designed through the same software development system, which will be more convenient in terms of data loading and analysis of the visual draft. In addition, the visual draft can also include some explanatory information on the interface functions, such as manual rules configured by the designer, which stipulates the jump relationship between some interfaces, etc. Based on this information, the business logic can be more accurately identified in subsequent processing. In addition, the visual draft can also come from third-party designers or design agencies, so that the design of the user interface can be separated from the code generation of the user interface to a certain extent, which can better liberate the interface designer.

[0075] S202: Identify the business logic of the visual draft and extract the business logic, wherein the business logic includes one or more of view transformation logic, data binding logic, event binding logic, function call logic, and dependency management logic. Among them, identifying the business logic of the visual draft may include: identifying one or more of interface material features, text semantic features, and custom function features of the visual draft.

[0076] S203: Generate business code according to the business logic.

[0077] The following is an example of a device for executing the above business logic processing. The device can be embedded in the aforementioned software development tool or cloud-based software development system. Figure 4 As shown, it is the second structural schematic diagram of the business logic processing device of an embodiment of the present invention, and the device can execute the above-mentioned business logic processing method.

[0078] Among them, the visual draft input source can provide the visual draft designed by the interface designer and the corresponding manual rules, and input them into the logic identifier in the business logic processing device for logic identification. Among them, the logic identification is mainly analyzed and identified from the following aspects: interface material feature identification, this part of the processing is mainly to analyze the features of the image structure and identify the business function logic in the interface; text semantic recognition, recognize the semantics of the text part in the visual draft, so as to extract the business function logic; custom function recognition, this part of the content can be extracted from the manual rules.

[0079] The identified business logic will generate logical intent data, which is provided to the logic expressor as intermediate data. The main function of the logic expressor is to analyze the logical intent data in the following aspects: view transformation logic, the visual draft generally contains multiple views, and the logical change relationship between views is also an important part of the interface logic; data binding logic, some interface functional units will correspond to business data, and the corresponding business data needs to be bound to the interface functional units during the coding stage; event binding logic, some business processing of the user interface is triggered by events, which can be triggered by user operations. The processing of this part is to bind the functional units in the interface with the involved events; function call logic, this part can further improve the custom function and determine the specific input and output business data, etc.; dependency management logic, this part involves calling business code deployed elsewhere, and the called business code does not belong to the business code corresponding to the current user interface. Therefore, it is only necessary to generate the corresponding code dependency relationship here to realize the subsequent call to the external business code.

[0080] After being processed by the logic expressor, the module code corresponding to the front-end user interface can be generated. The module code can be a protocol code that meets the code completeness condition, and the protocol code can be based on different module applications, that is, based on different module protocols to generate business code that can be finally put online.

[0081] The above-mentioned software development tools can be configured differently for different industries or user interface types. The above-mentioned logic identifiers and logic expressers can be implemented in the form of machine learning models. Different training data can be used for different industries or user interface types, so that machine learning models that conform to various industries or user interface types can be generated, and ultimately the recognition of business logic and the generation of business codes can be more accurately achieved. Based on such technology, the above-mentioned software development tools can be sold as auxiliary development tool products, and can be configured differently according to the needs of different users, thereby realizing product customization of development tools.

[0082] Through the technical solution of the embodiment of the present invention, business logic can be automatically extracted and business code can be generated according to the visual draft provided by the designer, which can effectively assist the work of code developers of the front-end user interface and even replace the code developers of the front-end interface, thereby realizing intelligent business code generation.

[0083] Embodiment 4

[0084] The above embodiments describe the method flow and device structure for processing business logic. The functions of the above methods and devices can be implemented with the help of an electronic device, such as Figure 5As shown, it is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention, which specifically includes: a memory 110 and a processor 120.

[0085] The memory 110 is used to store programs.

[0086] In addition to the above-mentioned programs, the memory 110 may also be configured to store various other data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phone book data, messages, pictures, videos, etc.

[0087] The memory 110 may be implemented by any type of volatile or nonvolatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0088] The processor 120 is coupled to the memory 110 and is used to execute the program in the memory 110 to perform the operation steps of the service logic processing method described in the above embodiments.

[0089] In addition, the processor 120 may also include the various modules described in the above embodiments to perform processing for business logic, and the memory 110 may be used, for example, to store data required for these modules to perform operations and / or output data.

[0090] The specific description of the above-mentioned processing process, the detailed description of the technical principle and the detailed analysis of the technical effect have been described in detail in the previous embodiments and will not be repeated here.

[0091] Furthermore, as shown in the figure, the electronic device may also include other components such as a communication component 130, a power component 140, an audio component 150, and a display 160. The figure only schematically shows some components, which does not mean that the electronic device only includes the components shown in the figure.

[0092] The communication component 130 is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component 130 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 130 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0093] The power supply component 140 provides power to various components of the electronic device. The power supply component 140 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device.

[0094] The audio component 150 is configured to output and / or input audio signals. For example, the audio component 150 includes a microphone (MIC), and when the electronic device is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 110 or sent via the communication component 130. In some embodiments, the audio component 150 also includes a speaker for outputting audio signals.

[0095] The display 160 includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

[0096] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.

[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for processing business logic, comprising: Acquire user interface design data, and identify functional units in the user interface according to the user interface design data; The user interface design data includes image data and text data, including configuration information for business data and / or trigger events; According to the functional unit, the corresponding business logic is obtained; the business logic is applicable to the user interface having the same type of functional unit; According to the business logic, a corresponding business code is generated; and generating the business code based on the business logic requires the business data or the trigger event.

2. The method according to claim 1, wherein: According to the user interface design data, identifying the functional units in the user interface includes: Performing image structural feature recognition on the image in the user interface design data, and determining the functional units in the user interface according to the image structural features; and / or, Performing semantic feature recognition on the text in the user interface design data, and determining the functional units in the user interface according to the semantic features; and / or, The module node tree composed of the design elements in the user interface design data is analyzed. The design element modules are mutually associated to form the module node tree. Each module node is a design element module. The functional units in the user interface are determined based on the association relationship between the module nodes and the style attributes of the module nodes.

3. The method according to claim 1, wherein: Also includes: Analyze multiple existing user interfaces and extract multiple functional units; For each functional unit, configure the corresponding business logic.

4. The method according to claim 1, wherein: According to the business logic, generating corresponding business codes includes: According to the business logic, obtaining the component view transformation relationship corresponding to the functional unit, and generating business code corresponding to the component view transformation; and / or, According to the business logic, obtaining the association relationship between the functional unit and the business data, and binding the business data with the functional unit to generate a business code corresponding to the business data processing; and / or, According to the business logic, the association relationship between the functional unit and the trigger event is obtained, and the trigger event is bound to the functional unit to generate a business code corresponding to the trigger event processing; and / or, According to the business logic, obtaining a processing function corresponding to the functional unit, and generating a business code corresponding to the processing function; and / or, According to the business logic, the code dependency corresponding to the functional unit is obtained, and the business code for calling the code dependency is generated.

5. The method according to claim 1, wherein: The user interface design data includes configuration information for business data and / or trigger events, and generating corresponding business codes according to the business logic includes: generating corresponding business codes according to the business logic and the configuration information.

6. The method according to claim 1, wherein: The generating corresponding business code according to the business logic includes: Generate code protocol data corresponding to business execution according to the business logic; A service code for executing the user interface service processing is generated according to the service code protocol data and the programming language used by the user interface.

7. The method according to claim 1, wherein: Determining the corresponding functional unit according to the user interface design data includes: Using an image recognition classification model, processing the image in the user interface design data to determine the functional unit; and / or, The text in the user interface design data is processed using a semantic analysis classification model to determine the functional unit.

8. The method according to claim 7, further comprising: Acquire user interface design data of a plurality of existing user interfaces and functional units included in the existing user interfaces; Extracting image data and / or text data from the user interface design data, and setting classification labels corresponding to each of the functional units; A correspondence between the image data and / or text data and the classification labels of the functional units is established as training data for the image recognition classification model and / or semantic analysis classification model to perform model training.

9. The method according to claim 1, wherein: Obtaining user interface design data includes: Perform classification processing on the user interface to generate multiple user interface modules; The user interface design data corresponding to each user interface module is obtained respectively.

10. A business logic processing device, comprising: A functional unit identification module, used to obtain user interface design data and identify functional units in the user interface according to the user interface design data; The user interface design data includes image data and text data, including configuration information for business data and / or trigger events; A business logic acquisition module, used to acquire corresponding business logic according to the functional unit; the business logic is applicable to user interfaces having the same type of functional units; The business code generation module is used to generate corresponding business codes according to the business logic; the business data or the trigger event is required to generate the business code based on the business logic.

11. The device according to claim 10, wherein: According to the user interface design data, identifying the functional units in the user interface includes: Performing image structural feature recognition on the image in the user interface design data, and determining the functional units in the user interface according to the image structural features; and / or, Performing semantic feature recognition on the text in the user interface design data, and determining the functional units in the user interface according to the semantic features; and / or, The module node tree composed of the design elements in the user interface design data is analyzed. The design element modules are mutually associated to form the module node tree. Each module node is a design element module. The functional units in the user interface are determined based on the association relationship between the module nodes and the style attributes of the module nodes.

12. The device according to claim 10, wherein: The generating corresponding business code according to the business logic includes: Generate code protocol data corresponding to business execution according to the business logic; A service code for executing the user interface service processing is generated according to the service code protocol data and the programming language used by the user interface.

13. A method for processing business logic, comprising: Visual mockup of loading screen design; The visual mockup includes information on the interface’s functionality; Performing business logic identification on the visual draft and extracting the business logic, wherein the business logic includes one or more of view transformation logic, data binding logic, event binding logic, function call logic and dependency management logic; the business logic is applicable to user interfaces having functional units of the same type; Generate business code based on the business logic; generating business code based on the business logic requires business data or triggering events.

14. The method according to claim 13, wherein: Performing business logic recognition on the visual draft includes: Perform one or more of interface material feature recognition, text semantic recognition, and custom function recognition on the visual draft.

15. An electronic device, comprising: Memory, used to store programs; A processor, configured to run the program stored in the memory to execute the business logic processing method described in any one of claims 1 to 9.

16. An electronic device comprising: Memory, used to store programs; A processor, used to run the program stored in the memory to execute the business logic processing method described in claim 13 or 14.

Citation Information

Patent Citations

  • Application program testing method and equipment

    CN110262965A

  • Code generation method and device

    CN110297632A