Form generation method, device, computer equipment and storage medium
By receiving component identification and business requirement information in the creation request, obtaining and generating target form component modules and layout solutions, the problem of low form creation efficiency in front-end development is solved, and automated form component layout and generation is realized, which improves development efficiency .
Patent Information
- Application Number
- CN202111278200.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-30
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-10-30
AI Technical Summary
During the front-end development process, it takes a lot of time to develop form components according to different application business scenarios, resulting in low form creation efficiency.
By receiving component identification and business requirement information in the creation request, obtaining attribute configuration information of the target form component module and subcomponents, generating target form components, and predicting component layout schemes based on component behavior information, automatically laying out form components, reducing manual coding by developers and layout operations.
Improves the efficiency of form creation, reduces the workload of developers, and ensures the reasonable layout of form components in the form.
Smart Images

Figure CN114004206B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a form generation method, apparatus, computer equipment and storage medium. Background Art
[0002] At present, with the development of Internet technology, form components have always been the core in the process of front-end development. In actual application, different forms are developed for different application business scenarios. In the prior art, developers are usually required to customize and write software codes according to the different requirements for forms in different application business scenarios, so as to develop different form components and create forms based on the developed form components. When there are many application business scenarios, developers need to spend more time to generate form components, and further generate forms based on form components, resulting in low efficiency in creating forms. Summary of the invention
[0003] The embodiments of the present application provide a form generation method, apparatus, computer device and storage medium, which can improve the efficiency of form creation.
[0004] A first aspect of an embodiment of the present application provides a form generation method, the method comprising:
[0005] Receive a creation request for a target form, the creation request carrying a component identifier and business requirement information; the component identifier is used to indicate a target form component required to construct the target form;
[0006] According to the component identifier, a target form component module for creating the target form component is obtained from the form component module set, wherein the target form component module includes a plurality of target form subcomponents;
[0007] Acquire the first attribute configuration information of each target form subcomponent, and generate the target form component according to the first attribute configuration information of each target form subcomponent;
[0008] Acquire the second attribute configuration information and component behavior information of the target form component according to the business demand information, and predict the component layout scheme of the target form according to the second attribute configuration information and the component behavior information to obtain the target component layout scheme of the target form;
[0009] The target form component is used to generate the target form according to the target component layout scheme, and the target form component is displayed in the target form.
[0010] A second aspect of an embodiment of the present application provides a form generating device, including:
[0011] A receiving unit, configured to receive a creation request for a target form, wherein the creation request carries a component identifier and business requirement information; the component identifier is used to indicate a target form component required to construct the target form;
[0012] The processing unit is used to obtain a target form component module for creating the target form component from the form component module set according to the component identifier, wherein the target form component module includes a plurality of target form subcomponents;
[0013] The processing unit is further used to obtain the first attribute configuration information of each target form subcomponent, and generate the target form component according to the first attribute configuration information of each target form subcomponent;
[0014] The processing unit is further used to obtain the second attribute configuration information and component behavior information of the target form component according to the business demand information, and predict the component layout scheme of the target form according to the second attribute configuration information and the component behavior information to obtain the target component layout scheme of the target form;
[0015] The processing unit is further configured to generate the target form from the target form component according to the target component layout scheme, and the target form component is displayed in the target form.
[0016] A third aspect of an embodiment of the present application provides a computer device, including a processor and a memory, wherein the processor and the memory are interconnected, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the form generation method described above.
[0017] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, in which program instructions are stored. When the program instructions are executed, they are used to implement the form generation method described above.
[0018] A fifth aspect of an embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. When the computer instructions are executed by a processor of a computer device, the above-mentioned form generation method is executed.
[0019] In an embodiment of the present application, a creation request for a target form is received, the creation request carries a component identifier and business requirement information; a target form component module for creating a target form component is obtained from a form component module set according to the component identifier, the target form component module includes a plurality of target form subcomponents; the first attribute configuration information of each target form subcomponent is obtained, and a target form component is generated according to the first attribute configuration information of each target form subcomponent; the second attribute configuration information and component behavior information of the target form component are obtained according to the business requirement information, and a component layout scheme of the target form is predicted according to the second attribute configuration information and the component behavior information, and a target component layout scheme of the target form is obtained; the target form component is generated according to the target component layout scheme, and the target form component is displayed in the target form. Each form component corresponds to a form component module, and when the target form component is needed, the corresponding form module is directly obtained, and the target form subcomponents and corresponding attribute configuration information constituting the target form component can be obtained, without the need for developers to find the target form subcomponents for generating the target form component and configure the corresponding attribute configuration information for the target form subcomponent, thereby improving the efficiency of form creation. At the same time, by determining the component layout of the target form according to the attribute configuration information and component behavior information of the target form components, a reasonable layout of the target form components in the target form can be obtained without the need for developers to layout the components, further improving the efficiency of form creation. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 It is a schematic diagram of the architecture of a form generation system provided in an embodiment of the present application;
[0022] Figure 2 It is a flowchart of a form generation method provided in an embodiment of the present application;
[0023] Figure 3 It is a structural schematic diagram of a form generating device provided in an embodiment of the present application;
[0024] Figure 4 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0026] The embodiment of the present application can acquire and process the attribute configuration information of the form component based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0027] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0028] The embodiment of the present application provides a form generation scheme, which can be applied to data collection form generation, user registration and login forms, etc. For example, the data collection form is a questionnaire form in a questionnaire survey, a patient (or doctor) information collection form in a medical platform, etc. The form generation scheme can be executed by a computer device, which can be a terminal device or a server; the general principle of the form generation scheme is as follows: when a user or an enterprise wants to create a form, a creation request for a target form can be sent to the computer device, and then the computer device can receive the creation request for the target form, which can carry the component identification and business requirement information of the required component. The computer device can obtain the corresponding target form component module from the form component module set according to the component identification, and the target form component module can be used to generate the required target form component. The computer device can obtain the attribute configuration information of the target form subcomponent included in the target form component module. For example, the target form component required is an information login component, which may include an account login box subcomponent and a password login box subcomponent; then the computer device can generate the target form component required according to the attribute configuration information of the target form subcomponent (such as the attribute configuration information can be the length and width of the target form subcomponent, etc.), and then obtain the second attribute configuration information and component behavior information of the target form component, and predict the component layout scheme of the target form according to the second attribute configuration information and component behavior information to obtain the target component layout scheme of the target form; then the target form component generates the target form according to the target component layout scheme, wherein the component behavior information refers to whether the component needs input or drop-down selection, etc. For example, the component is a radio button component, and the component behavior information of the component is selection.
[0029] The above-mentioned form generation scheme has the following beneficial effects: the target form component module for creating the target form component can be directly selected through the form component module set. When a complex form component needs to be generated, the developer does not need to write too much code to implement the complex form component. The target form component can be generated by directly calling the first attribute configuration information of the target form subcomponent included in the target form module, and then the form is generated according to the target form component, thereby improving the efficiency of form creation; in addition, the component layout scheme of the target form component in the target form can be intelligently obtained, and then the target component is used to generate the target form according to the component layout scheme, thereby better ensuring the reasonable layout of the entire target form.
[0030] Based on the above provided form generation solution, the present application embodiment also provides a form generation system, see Figure 1, the form generation system may include at least one terminal device 101 and at least one server 102, the terminal device 101 may provide a form creation interface, through which the user may submit business demand information, and the terminal device 101 may generate a form creation request based on the submitted business demand information. The server 102 may create the required form based on the form creation request and the business demand information. Among them, the terminal device 101 and the server 102 may be directly or indirectly connected via wired or wireless communication, and this application is not limited here. The above-mentioned terminal device may be a smart device such as a mobile phone, a tablet computer, a laptop computer, a PDA, a mobile internet device (MID), a wearable device, etc. The above-mentioned server 102 includes multiple servers (also referred to as nodes), which may be independent physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0031] Based on the above form generation scheme, see Figure 2 , Figure 2 A flowchart of a form generation method provided in an embodiment of the present application. The form generation method can be executed by a computer device, which can be a terminal device 101 and a server 102 in a form generation system. The form generation method described in this embodiment can include the following steps S201-S205:
[0032] S201. Receive a creation request for a target form, the creation request carries a component identifier and business requirement information; the component identifier is used to indicate the target form component required to construct the target form. The target form can be a form for questionnaire survey, a form for user information registration, etc. For example, the user information registration form can be a personnel information registration form for a certain enterprise; the component identifier can be a string of components such as a series of numbers or letters, or the component identifier can be a hash value. The target form component can be an information input box, an information login box, a data selection box, etc.; the business requirement information can include the component display mode (such as always displaying, displaying according to a preset time period), the size of the component, the component rendering color, etc., or the business requirement information can be a component requirement for the target business, for example, if the target business is information collection, the business requirement information can be an information collection component, the size of the information collection component, etc.
[0033] In a specific implementation, when a user or an enterprise wants to create a form, a creation request of a target form page can be submitted through a form creation interface, and then a computer device can receive the creation request of the target form. In one embodiment, the creation request carries the identity information of the target user, and the computer device can obtain the reference identity information of the target user from other platforms, and compare the identity information carried in the creation request with the reference identity information. If the identity information carried in the creation request is consistent with the reference identity information, step S201 is executed. If the identity information carried in the creation request is inconsistent with the reference identity information, indicating that the target user does not have the authority to create the target form, a prompt message is output, and the prompt message is used to indicate that the target form cannot be created. Among them, the other platform can be a platform specifically used to store identity information, or the other platform can also be a platform for identity authentication.
[0034] S202. According to the component identifier, a target form component module for creating a target form component is obtained from the form component module set, and the target form component module includes multiple target form sub-components. Among them, the form component module set includes one or more form component modules, and each form component module can be used to generate a corresponding form component. Each form component module corresponds to a reference component identifier. The basic form sub-component can be a user name input box, a password input box, a login button, a database selection box, a Schema selection box, a data table selection box, etc., which is not limited in the embodiment of the present application.
[0035] In a specific implementation, the computer device can match the component identifier with the reference component identifier corresponding to each form component module in the form component module set, and determine the form component module corresponding to the matching component identifier that matches the component identifier as the target form component module for creating the target form component.
[0036] In one embodiment, the specific implementation method of the computer device determining the form component module corresponding to the matching component identifier that matches the component identifier as the target form component module for creating the target form component can also be: receiving the form component requirement information of the target user, and judging whether the form component corresponding to the form component module corresponding to the matching component identifier that matches the component identifier satisfies the form component indicated by the component requirement information, if the form component corresponding to the form component module corresponding to the matching component identifier that matches the component identifier does not satisfy the form component indicated by the component requirement information, then obtaining the required basic form subcomponent from the basic component library, and constructing the target form component module based on the obtained basic form subcomponent and the form component module corresponding to the matching component identifier that matches the component identifier. It can be understood that: in the form component module set, the form component module can only realize part of the component requirements in the form component requirement information, and it is necessary to obtain the required basic subcomponents from the basic component library to realize the remaining component requirements in the form component requirement information. For example, the form component corresponding to the form component module corresponding to the matching component identifier that matches the component identifier can satisfy the information input component in the form component requirement information, but does not implement the information submission component in the form component requirement information. At this time, it is necessary to obtain the basic subcomponent "information submission" button from the basic component library, and then build the target form component "information login" component based on the information input component and the basic subcomponent "information submission" button. If the form component corresponding to the form component module corresponding to the matching component identifier that matches the component identifier satisfies the form component indicated by the component requirement information, the obtained basic form subcomponent and the form component module corresponding to the matching component identifier that matches the component identifier are determined as the target form component module.
[0037] In one embodiment, the computer device can extract the association relationship between the basic form subcomponent and the basic form subcomponent from a large number of historical forms in advance, and then build a form component module for generating a form component based on the association relationship between the basic form subcomponent and the basic form subcomponent, and add the form component module of the form component to the form component module. Among them, the association relationship between the basic form subcomponent and the basic form subcomponent can be determined according to the form component composed of the basic form subcomponent and the basic form subcomponent. For example, the form component is an information login box, and the information login box includes the basic form subcomponent "account input box" and the basic form subcomponent "password input box". It can be known that the account input box and the password input box have an association relationship, that is, the password input box is generally required when the account input box is required. Alternatively, the association relationship between the basic form subcomponent and the basic form subcomponent can be determined based on the business that needs to be implemented in the historical form. For example, the business that needs to be implemented in a certain historical form is a user information form, and the user information form includes the basic form subcomponent "email input box" and the basic form subcomponent "phone input box". It can be known that the basic form subcomponent "email input box" and the basic form subcomponent "phone input box" have an association relationship. It should be noted that the association relationship involved here can refer to a strong association relationship (for example, if an account input box appears, a password input box must appear), or a weak association relationship (that is, if a phone input box appears, an email input box can appear, but of course, an email input box may not appear). This weak association relationship is to obtain the integrity of the form component module. That is, the form component generated according to the form component module has more complete functions.
[0038] In another embodiment, before executing step S202, when the computer device receives a module creation request for a target form component module, one or more target form subcomponents used to construct the target form component module can be determined from the basic component library, and the target form module is used to create the target form component; and one or more target form subcomponents are associated to obtain a target form component module; a component identifier is added to the target form component module, and the target form component module after the component identifier is added is stored in a form component module collection. Among them, the basic component library may include one or more form subcomponents, and the form subcomponents may be form subcomponents provided by a UI (User Interface) framework and custom form subcomponents. Custom form subcomponents may be a large number of custom form subcomponents obtained by updating the key value corresponding to the form subcomponent in the historical form using the onChange function.
[0039] Among them, the specific implementation method of associating one or more target form subcomponents to obtain the target form component module can be: obtaining the interaction logic between each target form subcomponent and the attribute information of each target form subcomponent; the attribute information can include the length, width, display mode, etc. of the target form subcomponent; configuring the first attribute configuration information for each target form subcomponent according to the interaction logic between each target form subcomponent and the attribute information of each target form subcomponent, and generating the target form component module based on each target form subcomponent and the corresponding first attribute configuration information. The interaction logic refers to which form subcomponent corresponding component function is executed first between the target form subcomponent and the target form subcomponent. For example, the target form component module is a user login component module, the target form subcomponent "account input box" first executes the account input function, and then after the account is entered in the account input box, the target subform component "password input box" is displayed. This process is the interaction logic between the target form subcomponent "account input box" and the "password input box". The display mode included in the attribute information can be how large the target form subcomponent is displayed, whether the target form subcomponent is displayed within a preset period, displayed at irregular intervals, displayed at a preset position, etc. Among them, the first attribute configuration information may include attribute information configuration items and interactive logic configuration items, and the attribute information configuration items may also be divided into display mode configuration items, length configuration items, etc.; the computer device may configure the attribute information configuration items and interactive logic configuration items in each target form subcomponent according to the interactive logic between each target form subcomponent and the attribute information of each target form subcomponent, and obtain the first attribute configuration information of each target form subcomponent. Then, the first attribute configuration information of each target form subcomponent and each target form subcomponent are encapsulated as a target form component module. Subsequently, the target form component module can be directly obtained without the need for developers to obtain the corresponding target form subcomponent and configure the first attribute configuration information for the target form subcomponent, thereby improving the efficiency of form component generation.
[0040] S203: Acquire the first attribute configuration information of each target form sub-component, and generate a target form component according to the first attribute configuration information of each target form sub-component.
[0041] In one embodiment, the target form component module includes multiple target form sub-components and first configuration attribute information of each target form sub-component. The computer device can obtain the first attribute configuration information of each target form sub-component from the target form component module, and then call the first attribute configuration information of each target form sub-component to generate the target form component.
[0042] In another embodiment, the target form component module only includes multiple target form subcomponents. In this case, the computer device can obtain the first configuration attribute information of each target form subcomponent from the preset storage space according to the interaction logic between the target form subcomponent and the target form subcomponent and the attribute configuration information of each target form subcomponent, wherein the preset storage space can be a local storage space of the computer device, a blockchain, etc. It can be understood that: the preset storage space stores multiple configuration attribute information of each target form subcomponent, and the computer device can determine the first configuration information of each target form subcomponent from the multiple configuration attribute information of each target form subcomponent according to the interaction logic between the target form subcomponent and the target form subcomponent of the current business needs and the attribute information of each target form subcomponent, and then call the first configuration attribute information of each target form subcomponent to generate the target form component. It can be understood that: each of the multiple target form subcomponents in the target form component module has multiple configuration attribute information to realize a form component that meets different business needs.
[0043] In one embodiment, after the target form component is generated according to the first attribute configuration information of each target form subcomponent, when a modification operation request for the target form component is received from the target user, the identity information of the target user is obtained; and the target user is verified for authority according to the identity information. If the authority verification of the target user is passed, the target form component module of the target form component is obtained; the operation indicated by the modification operation request is performed on the target form component module, and the modified target form component module is added to the form component module collection. Among them, the identity information may include an ID number, a unique identity identifier, an account number and a password, etc. The computer device may verify the authority of the target user according to the identity information, that is, verify whether the target user has the authority to modify the form component. If the authority verification of the target user is passed, it means that the target user has the authority to modify the target form component, and the target form component module of the target form component is obtained, and then the operation indicated by the modification operation request is performed on the target form component module, wherein the operation indicated by the modification operation may be a modification operation, a replacement operation, an addition operation, etc. The operation indicated by the modification operation request here can act on one or more target form subcomponents in the target form component module (for example, replacing one target form subcomponent in the target form component module with another target form subcomponent); or, the target form module includes the first attribute configuration information of each target form subcomponent, and the operation indicated by the modification operation request here can act on the corresponding first attribute configuration information in the target form component module. The target form module can be used to solve subsequent iterations of subsequent business demand changes, and by combining and disassembling, updating the target form subcomponents in the target form module can cover the business needs that need to be modified.
[0044] S204. Obtain the second attribute configuration information and component behavior information of the target form component according to the business requirement information, and predict the component layout scheme of the target form according to the second attribute configuration information and the component behavior information to obtain the target component layout scheme of the target form. The business requirement information may refer to the target form component being used for information input, user login, etc. The second attribute configuration information may include attribute configuration items such as size, position, display mode, etc. of the target form component, and the component behavior information may include input behavior, selection behavior, etc. For example, if the target form component is an information selection box, the component behavior information of the target form component may include selection behavior. The number of target form components may be one or more.
[0045] In a specific implementation, the computer device can obtain the second attribute configuration information (such as the display position of the target form component) and component information (i.e., selection behavior) of the target form component according to the business demand information (such as the user selecting information). Then, the computer device calls the component layout model to predict the component layout scheme of the target form according to the second attribute configuration information and the component behavior information, and obtains the target component layout scheme of the target form. For example, the number of target form components is 2, namely, target form component 1 and target form component 2; then, the data interaction logic between target form component 1 and target form component 2 is: target form component 2 can obtain data only after target form component 1 obtains data; the second attribute configuration information of target form component 1 is horizontal display in the target form, and the component behavior information includes input behavior, and the second attribute configuration information of target form component 2 is vertical display, and the component behavior information includes selection behavior (selection behavior means that selection data can be provided, and the user can directly select the corresponding data); then, the computer device predicts the component layout scheme according to the above data interaction logic, the second attribute configuration information and component behavior information of target form component 1, and the second attribute configuration information and component behavior information of target form component 2, and obtains the component layout scheme. The component layout scheme may be: displaying the target form component 2 vertically on the left side of the target form; and displaying the target form component 1 horizontally in the middle of the target form.
[0046] In one embodiment, when there are multiple target form components, the computer device predicts the component layout scheme of the target form according to the second attribute configuration information and the component behavior information, and obtains the target component layout scheme of the target form. The specific implementation method is as follows: obtain the data interaction logic between every two target form components; pre-process the data interaction logic between every two target form components to obtain the first vector of the data interaction logic between every two target form components; pre-process the second attribute configuration information and the component behavior information of each target form component to obtain the second vector of each target form component; according to the first vector of the data interaction logic between every two target form components and the second vector of each target form component, call the preset component layout model to predict the component layout scheme of the target form to obtain the target component layout scheme of the target form. In the specific implementation, the computer device can use one-hot encoding to encode the data interaction logic between every two form components and the second attribute configuration information and the component behavior information of each target form component, and obtain the first vector of the data interaction logic between every two form components and the second vector of each target form component. That is to say: the data interaction logic, second attribute configuration information and component behavior information can be converted into word vectors using one-hot encoding. For example, when the data interaction logic is logic 1, logic 1 is encoded as 10, and when the data interaction logic is logic 2, logic 2 is encoded as 01. Similarly, the second attribute configuration information and component behavior information of each form component can be encoded. For example, there are three target form components, namely target form component 1, target form component 2 and target form component 3. The data interaction logic between target form component 1 and target form component 2 is: logic 1; the data interaction logic between target form component 1 and target form component 3 is logic 2; the second attribute configuration information of target form component 1 is: area 12, displayed in the middle of the target form, and the component behavior information may include: input behavior; the second attribute configuration information of target form component 2 is: area 11, displayed in the middle of the target form, and the component behavior information may include: selection behavior; the second attribute configuration information of target form component 3 is: area 5, Displayed on the left side of the target form, the component behavior information may include: selection behavior; the computer device may use one-hot encoding to encode logic 1 and logic 2 respectively, and the first vector of logic 1 is 10, and the first vector of logic 2 is 01; the second attribute configuration information includes area and display position, there are 3 areas, area 12 can be encoded as 100, area 11 can be encoded as 010, area 5 can be encoded as 001, and so on; then the computer device uses one-hot encoding to encode the second attribute configuration information and component behavior information of the target form component 1, and the second vector of the target form component 1 is 1001010.The computer device uses one-hot encoding to encode the second attribute configuration information and component behavior information of the target form component 2, and the second vector of the target form component 2 is 0101001; the computer device uses one-hot encoding to encode the second attribute configuration information and component behavior information of the target form component 3, and the second vector of the target form component 3 is 0010101. The component layout scheme of the target form is predicted by calling the preset component layout model according to the first vector and the second vector, and the processing process is relatively simple.
[0047] In one embodiment, before adopting a preset component layout model, a computer device can obtain a training sample set, the training sample set includes multiple training sample pairs, each training sample pair includes multiple sample components, sample data interaction logic between each sample component, sample attribute configuration information and sample component behavior information of each sample component, and component layout scheme label; call the initial neural network model to perform component layout prediction scheme on each training sample pair to obtain component layout scheme prediction for each training sample pair; calculate the model loss of the initial neural network model according to the component layout scheme label and component layout prediction scheme of each training sample pair to obtain the model loss value; use the gradient descent algorithm to adjust the model parameters in the initial neural network model according to the model loss value to obtain the preset component layout model. In a specific implementation, the training sample pairs included in the training sample set can be a historical form, that is, the multiple sample groups included in each training sample pair, the sample data interaction logic between every two sample components, the sample attribute configuration information and sample component behavior information of each sample component can all be extracted from the historical form. Among them, the computer device calls the initial neural network model to perform component layout prediction on each training sample pair, and the specific implementation method for obtaining the component layout prediction of each training sample pair can be: preprocessing each training sample pair including the sample data interaction logic between every two sample components, the sample attribute configuration information of each sample component and the sample component behavior information to obtain the first sample vector of the sample data interaction logic between every two sample components and the second sample vector of each sample component, and then using the initial neural network model to predict the component layout for each training sample pair based on the first sample vector of the sample data interaction logic between every two sample components and the second sample vector of each sample component to obtain the component layout prediction for each training sample pair.
[0048] In one embodiment, the component layout scheme of the target form is predicted according to the second attribute configuration information and the component behavior information, and the specific implementation method of obtaining the target component layout scheme of the target form can be: the component layout scheme of the target form is predicted according to the second attribute configuration information and the component behavior information, and the candidate component layout scheme of the target form is obtained; and the target form generated according to the candidate component layout scheme is displayed in the preview interface, and when the first operation for the candidate component layout scheme is detected, the candidate component layout scheme is determined as the target component layout scheme, and step S205 is executed; when the second operation for the candidate component layout scheme is detected, it means that the candidate component layout scheme is unreasonable or the candidate component layout scheme is not what the user wants, and the component layout scheme sent by the user is obtained at this time, and the component layout scheme is determined as the target component layout scheme. Among them, the first operation can be understood as a confirmation operation, and the second operation can be understood as a cancellation operation. The confirmation operation and the cancellation operation can be input operations of specified gestures (such as inputting an OK gesture as a confirmation operation, and inputting an M gesture as a cancellation gesture), voice input operations, etc., which are not limited in the embodiments of the present application.
[0049] S205: Generate a target form based on the target form component according to the target component layout solution, and display the target form component in the target form.
[0050] In one embodiment, after the target form component generates a target form according to the target component layout scheme, the target form is used to implement the target business. For example, the target form is used for the user information collection business, so it can be verified whether the target form implements the target business when the target form is used to process the user information collection business. In the specific implementation, the computer device can obtain the business information input by the target form component in the target form; and determine whether the business information belongs to the target business. If the business information belongs to the target business (that is, the business information is user information and belongs to the user information collection business), it means that the target form can be used to implement the business information collection of the target business, etc., then the computer device can use the private key of the target business to digitally sign the target form; and send the target form with the digital signature to the blockchain node. If the business information does not belong to the target business, the target form component module of each target form component in one or more target form components included in the target form is regression tested. By performing regression testing on the target form component module, the place where problems are found can be greatly saved, and regression testing can also be avoided to affect multiple target form components.
[0051] In an embodiment of the present application, a creation request for a target form is received, the creation request carries a component identifier and business requirement information; a target form component module for creating a target form component is obtained from a form component module set according to the component identifier, the target form component module includes a plurality of target form subcomponents; the first attribute configuration information of each target form subcomponent is obtained, and a target form component is generated according to the first attribute configuration information of each target form subcomponent; the second attribute configuration information and component behavior information of the target form component are obtained according to the business requirement information, and a component layout scheme of the target form is predicted according to the second attribute configuration information and the component behavior information, and a target component layout scheme of the target form is obtained; the target form component is generated according to the target component layout scheme, and the target form component is displayed in the target form. Each form component corresponds to a form component module, and when the target form component is needed, the corresponding form module is directly obtained, and the target form subcomponents and corresponding attribute configuration information constituting the target form component can be obtained, without the need for developers to find the target form subcomponents for generating the target form component and configure the corresponding attribute configuration information for the target form subcomponent, thereby improving the efficiency of form creation. At the same time, by determining the component layout of the target form according to the attribute configuration information and component behavior information of the target form components, a reasonable layout of the target form components in the target form can be obtained without the need for developers to layout the components, further improving the efficiency of form creation.
[0052] Based on the description of the above-mentioned form generation method embodiment, the present application embodiment also discloses a form generation device, which can be a computer program (including program code) running on the above-mentioned computer device. The form generation device can execute Figure 2 See the method shown in Figure 3 , the form generating device can run the following units:
[0053] The receiving unit 301 is used to receive a creation request for a target form, wherein the creation request carries a component identifier and business requirement information; the component identifier is used to indicate a target form component required to construct the target form;
[0054] The processing unit 302 is used to obtain a target form component module for creating the target form component from the form component module set according to the component identifier, wherein the target form component module includes a plurality of target form subcomponents;
[0055] The processing unit 302 is further configured to obtain the first attribute configuration information of each target form subcomponent, and generate the target form component according to the first attribute configuration information of each target form subcomponent;
[0056] The processing unit 302 is further configured to obtain the second attribute configuration information and component behavior information of the target form component according to the business requirement information, and predict the component layout scheme of the target form according to the second attribute configuration information and the component behavior information to obtain the target component layout scheme of the target form;
[0057] The processing unit 302 is further configured to generate the target form from the target form component according to the target component layout scheme, and the target form component is displayed in the target form.
[0058] In one embodiment, the number of the target form components is multiple, and when the processing unit 302 predicts the component layout scheme of the target form according to the second attribute configuration information and the component behavior information to obtain the target component layout scheme of the target form, it can be specifically used to:
[0059] Get the data interaction logic between every two target form components;
[0060] Preprocessing the data interaction logic between each two target form components to obtain a first vector of the data interaction logic between each two target form components;
[0061] Preprocessing the second attribute configuration information and component behavior information of each target form component to obtain a second vector of each target form component;
[0062] According to the first vector of the data interaction logic between every two target form components and the second vector of each target form component, a preset component layout model is called to predict a component layout scheme for the target form to obtain a target component layout scheme for the target form.
[0063] In one embodiment, the method for obtaining the preset component layout model includes:
[0064] The processing unit 302 obtains a training sample set, wherein the training sample set includes multiple training sample pairs, each training sample pair includes multiple sample components, sample data interaction logic between every two sample components, sample attribute configuration information and sample component behavior information of each sample component, and component layout scheme labels; calls the initial neural network model to predict the component layout scheme of each training sample pair to obtain the component layout prediction scheme of each training sample pair; calculates the model loss of the initial neural network model according to the component layout scheme label and the component layout prediction scheme of each training sample pair to obtain a model loss value; and uses a gradient descent algorithm to adjust the model parameters in the initial neural network model according to the model loss value to obtain a preset component layout model.
[0065] In one embodiment, after generating the target form component according to the first attribute configuration information of each target form subcomponent, the processing unit 302 is further configured to:
[0066] When receiving a modification operation request from a target user for the target form component, obtaining identity information of the target user;
[0067] Performing authority verification on the target user according to the identity information, and if the authority verification on the target user passes, obtaining the target form component module of the target form component;
[0068] The operation indicated by the modification operation request is performed on the target form component module, and the modified target form component module is added to the form component module collection.
[0069] In one embodiment, the target form is used to execute the target business. After generating the target form by using the target form components according to the target component layout scheme, the processing unit 302 is further used to:
[0070] Acquire the business information input by the target form component in the target form;
[0071] Determine whether the business information belongs to the target business, and if the business information belongs to the target business, digitally sign the target form using the private key of the target business;
[0072] The target form with the digital signature is sent to a blockchain node.
[0073] In one embodiment, before acquiring the target form component module for creating the target form component from the form component module set according to the component identifier, the processing unit 302 is further configured to:
[0074] When receiving a module creation request for a target form component module, determining one or more target form subcomponents for constructing the target form component module from a basic component library, the target form module being used to create the target form component;
[0075] Associating the one or more target form subcomponents to obtain the target form component module;
[0076] A component identifier is added to the target form component module, and the target form component module after the component identifier is added is stored in a form component module collection.
[0077] In one embodiment, the processing unit 302 associates the one or more target form subcomponents to obtain a target form component module, which can be specifically used to:
[0078] Obtain the interaction logic between every two target form sub-components and the attribute information of each target form sub-component;
[0079] First attribute configuration information is configured for each target form subcomponent according to the interaction logic between each target form subcomponent and the attribute information of each target form subcomponent, and a target form component module is generated based on each target form subcomponent and the corresponding first attribute configuration information.
[0080] It is understandable that the functional modules of the form generation device of this embodiment can be based on the above method embodiment. Figure 2 The specific implementation process of the method in the embodiment can refer to the above method embodiment Figure 2 The relevant description will not be repeated here.
[0081] For further information, see Figure 4 , Figure 4 Schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 2 The computer device in the corresponding embodiment may be Figure 4 Computer equipment as shown. Figure 4 As shown, the computer device may include: a processor 401, an input device 402, an output device 403 and a memory 404. The processor 401, the input device 402, the output device 403 and the memory 404 are connected via a bus 405. The memory 404 is used to store a computer program, the computer program includes program instructions, and the processor 401 is used to execute the program instructions stored in the memory 404.
[0082] In the embodiment of the present application, the processor 401 performs the following operations by running the executable program code in the memory 404:
[0083] Receive a creation request for a target form, the creation request carrying a component identifier and business requirement information; the component identifier is used to indicate a target form component required to construct the target form;
[0084] According to the component identifier, a target form component module for creating the target form component is obtained from the form component module set, wherein the target form component module includes a plurality of target form subcomponents;
[0085] Acquire the first attribute configuration information of each target form subcomponent, and generate the target form component according to the first attribute configuration information of each target form subcomponent;
[0086] Acquire the second attribute configuration information and component behavior information of the target form component according to the business demand information, and predict the component layout scheme of the target form according to the second attribute configuration information and the component behavior information to obtain the target component layout scheme of the target form;
[0087] The target form component is used to generate the target form according to the target component layout scheme, and the target form component is displayed in the target form.
[0088] In one embodiment, the number of the target form components is multiple, and when the processor 401 predicts the component layout scheme of the target form according to the second attribute configuration information and the component behavior information to obtain the target component layout scheme of the target form, it can be specifically used to:
[0089] Get the data interaction logic between every two target form components;
[0090] Preprocessing the data interaction logic between each two target form components to obtain a first vector of the data interaction logic between each two target form components;
[0091] Preprocessing the second attribute configuration information and component behavior information of each target form component to obtain a second vector of each target form component;
[0092] According to the first vector of the data interaction logic between every two target form components and the second vector of each target form component, a preset component layout model is called to predict a component layout scheme for the target form to obtain a target component layout scheme for the target form.
[0093] In one embodiment, the method for obtaining the preset component layout model includes:
[0094] The processor 401 is used to obtain a training sample set, which includes multiple training sample pairs, each training sample pair includes multiple sample components, sample data interaction logic between every two sample components, sample attribute configuration information and sample component behavior information of each sample component, and component layout scheme labels; call the initial neural network model to predict the component layout scheme of each training sample pair to obtain the component layout prediction scheme of each training sample pair; calculate the model loss of the initial neural network model according to the component layout scheme label and the component layout prediction scheme of each training sample pair to obtain a model loss value; use the gradient descent algorithm to adjust the model parameters in the initial neural network model according to the model loss value to obtain a preset component layout model.
[0095] In one embodiment, after generating the target form component according to the first attribute configuration information of each target form subcomponent, the processor 401 is further configured to:
[0096] When receiving a modification operation request from a target user for the target form component, obtaining identity information of the target user;
[0097] Performing authority verification on the target user according to the identity information, and if the authority verification on the target user passes, obtaining the target form component module of the target form component;
[0098] The operation indicated by the modification operation request is performed on the target form component module, and the modified target form component module is added to the form component module collection.
[0099] In one embodiment, after generating the target form from the target form component according to the target component layout scheme, the processor 401 is further configured to:
[0100] Acquire the business information input by the target form component in the target form;
[0101] Determine whether the business information belongs to the target business, and if the business information belongs to the target business, digitally sign the target form using the private key of the target business;
[0102] The target form with the digital signature is sent to a blockchain node.
[0103] In one embodiment, before obtaining the target form component module for creating the target form component from the form component module set according to the component identifier, the processor 401 is further configured to:
[0104] When receiving a module creation request for a target form component module, determining one or more target form subcomponents for constructing the target form component module from a basic component library, the target form module being used to create the target form component;
[0105] Associating the one or more target form subcomponents to obtain the target form component module;
[0106] A component identifier is added to the target form component module, and the target form component module after the component identifier is added is stored in a form component module collection.
[0107] In one embodiment, when the processor 401 associates the one or more target form subcomponents to obtain the target form component module, it can be specifically used to:
[0108] Obtain the interaction logic between every two target form sub-components and the attribute information of each target form sub-component;
[0109] First attribute configuration information is configured for each target form subcomponent according to the interaction logic between each target form subcomponent and the attribute information of each target form subcomponent, and a target form component module is generated based on each target form subcomponent and the corresponding first attribute configuration information.
[0110] It should be understood that in the embodiment of the present application, the processor 401 may be a central processing unit (CPU), and the processor 401 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0111] The memory 404 may include a read-only memory and a random access memory, and provides instructions and data to the processor 401. A portion of the memory 404 may also include a nonvolatile random access memory.
[0112] The input device 402 may include a keyboard, etc., and inputs a request for creating a target form to the processor 401; the output device 403 may include a display, etc.
[0113] In a specific implementation, the processor 401, input device 402, output device 403 and memory 404 described in the embodiments of the present application can execute the implementation methods described in all the above embodiments, and can also execute the implementation methods described in the above apparatus, which will not be repeated here.
[0114] In an embodiment of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the steps performed in all the above embodiments can be executed.
[0115] An embodiment of the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. When the computer instructions are executed by a processor of a computer device, the methods in all the above embodiments are executed.
[0116] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. It should be emphasized that in order to further ensure the privacy and security of the above-mentioned data, the target form component module set involved can also be stored in a node of a blockchain. Among them, the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods, each of which contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.
[0117] What is disclosed above is only a preferred embodiment of the present application, and it certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present application are still within the scope of the invention.
Claims
1. A form generation method, characterized in that: include: Receive a creation request for a target form, wherein the creation request carries a component identifier and business requirement information; The component identifier is used to indicate the target form component required to construct the target form; According to the component identifier, a target form component module for creating the target form component is obtained from the form component module set, wherein the target form component module includes a plurality of target form subcomponents; Acquire the first attribute configuration information of each target form subcomponent, and generate the target form component according to the first attribute configuration information of each target form subcomponent; Acquire the second attribute configuration information and component behavior information of the target form component according to the business demand information, and predict the component layout scheme of the target form according to the second attribute configuration information and the component behavior information to obtain the target component layout scheme of the target form; Generate the target form by using the target form component according to the target component layout scheme, wherein the target form component is displayed in the target form; There are multiple components in the target form, and predicting a component layout scheme for the target form according to the second attribute configuration information and the component behavior information to obtain a target component layout scheme for the target form includes: Get the data interaction logic between every two target form components; Preprocessing the data interaction logic between each two target form components to obtain a first vector of the data interaction logic between each two target form components; Preprocessing the second attribute configuration information and component behavior information of each target form component to obtain a second vector of each target form component; According to the first vector of the data interaction logic between each two target form components and the second vector of each target form component, calling a preset component layout model to predict a component layout scheme for the target form, and obtaining a target component layout scheme for the target form; Before acquiring the target form component module for creating the target form component from the form component module set according to the component identifier, the method further includes: When receiving a module creation request for a target form component module, determining one or more target form subcomponents for constructing the target form component module from a basic component library, the target form component module being used to create a target form component; Get the interaction logic between every two target form sub-components and the attribute information of each target form sub-component; Configuring first attribute configuration information for each target form subcomponent according to the interaction logic between each target form subcomponent and the attribute information of each target form subcomponent, and generating a target form component module based on each target form subcomponent and the corresponding first attribute configuration information; A component identifier is added to the target form component module, and the target form component module after the component identifier is added is stored in a form component module collection.
2. The method according to claim 1, characterized in that: The method for obtaining the preset component layout model includes: Acquire a training sample set, wherein the training sample set includes a plurality of training sample pairs, each training sample pair includes a plurality of sample components, sample data interaction logic between every two sample components, sample attribute configuration information and sample component behavior information of each sample component, and a component layout scheme label; Calling the initial neural network model to predict the component layout scheme for each training sample pair, and obtaining the component layout prediction scheme for each training sample pair; Calculate the model loss of the initial neural network model according to the component layout scheme label and the component layout prediction scheme of each training sample pair to obtain a model loss value; A gradient descent algorithm is used to adjust the model parameters in the initial neural network model according to the model loss value to obtain a preset component layout model.
3. The method according to claim 1, characterized in that After generating the target form component according to the first attribute configuration information of each target form subcomponent, the method further includes: When receiving a modification operation request from a target user for the target form component, obtaining identity information of the target user; Performing authority verification on the target user according to the identity information, and if the authority verification on the target user passes, obtaining the target form component module of the target form component; The operation indicated by the modification operation request is performed on the target form component module, and the modified target form component module is added to the form component module collection.
4. The method according to claim 1, characterized in that: The target form is used to execute the target business. After the target form components are generated according to the target component layout scheme, the method further includes: Acquire the business information input by the target form component in the target form; Determine whether the business information belongs to the target business, and if the business information belongs to the target business, digitally sign the target form using the private key of the target business; The target form with the digital signature is sent to a blockchain node.
5. A form generating device, characterized in that: include: A receiving unit, configured to receive a creation request for a target form, wherein the creation request carries a component identifier and business requirement information; The component identifier is used to indicate the target form component required to construct the target form; A processing unit, configured to obtain, from a form component module set according to the component identifier, a target form component module for creating the target form component, wherein the target form component module includes a plurality of target form subcomponents; The processing unit is further used to obtain the first attribute configuration information of each target form subcomponent, and generate the target form component according to the first attribute configuration information of each target form subcomponent; The processing unit is further used to obtain the second attribute configuration information and component behavior information of the target form component according to the business demand information, and predict the component layout scheme of the target form according to the second attribute configuration information and the component behavior information to obtain the target component layout scheme of the target form; The processing unit is further used to generate the target form from the target form component according to the target component layout scheme, and the target form component is displayed in the target form; Wherein, the number of the target form components is multiple, and when the processing unit predicts the component layout scheme of the target form according to the second attribute configuration information and the component behavior information to obtain the target component layout scheme of the target form, it can be specifically used to: Get the data interaction logic between every two target form components; Preprocessing the data interaction logic between each two target form components to obtain a first vector of the data interaction logic between each two target form components; Preprocessing the second attribute configuration information and component behavior information of each target form component to obtain a second vector of each target form component; According to the first vector of the data interaction logic between each two target form components and the second vector of each target form component, calling a preset component layout model to predict a component layout scheme for the target form, and obtaining a target component layout scheme for the target form; Before acquiring the target form component module for creating the target form component from the form component module set according to the component identifier, the processing unit may be specifically configured to: When receiving a module creation request for a target form component module, determining one or more target form subcomponents for constructing the target form component module from a basic component library, the target form component module being used to create a target form component; Get the interaction logic between every two target form sub-components and the attribute information of each target form sub-component; Configuring first attribute configuration information for each target form subcomponent according to the interaction logic between each target form subcomponent and the attribute information of each target form subcomponent, and generating a target form component module based on each target form subcomponent and the corresponding first attribute configuration information; A component identifier is added to the target form component module, and the target form component module after the component identifier is added is stored in a form component module collection.
6. A computer device, characterized in that: comprising a memory for storing a computer program; The processor calls the computer program in the memory to execute the form generation method as described in any one of claims 1 to 4.
7. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a processor, the form generation method according to any one of claims 1 to 4 is executed.
