Card generation method, device, computer equipment, storage medium and product
By automatically generating data interaction codes, the problem of low card generation efficiency in the existing technology is solved, and the effect of quickly generating cards is achieved.
Patent Information
- Application Number
- CN202411932037.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-08
AI Technical Summary
In the prior art, developing card codes need to be written manually, resulting in inefficient card generation.
The data interaction code is automatically generated based on the first card layout information and the card data source, and then the card is generated.
Save card development time and improve card development efficiency. Users only need to determine the card layout information and data source to generate cards.
Smart Images

Figure CN119781769A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of artificial intelligence technology, and in particular to a card generation method, device, computer equipment, storage medium and product. Background Art
[0002] Cards are increasingly used in mobile phones and other terminals. For example, a service card is displayed on the desktop of the terminal, and the service card is used to display at least one recommended service. Therefore, before the terminal or the application with the card in the terminal goes online, it is necessary to generate a card (or develop a card).
[0003] In the related art, developers often manually develop card codes. However, manually developing card codes by developers takes a long time, which results in low efficiency in card generation. Summary of the invention
[0004] The embodiments of the present application provide a card generation method, device, computer equipment, storage medium and product. The technical solution is as follows:
[0005] On the one hand, an embodiment of the present application provides a card generation method, the method comprising:
[0006] Determine first interface structure information based on first card layout information, where the first card layout information is used to indicate a first card layout, and the first interface structure information is used to indicate a structure of a plurality of data options included in a card interface corresponding to the first card layout;
[0007] Generate a first data interaction code based on the first interface structure information and a card data source, the card data source is used to provide card data for the multiple data options, and the first data interaction code is used to be executed so that the multiple data options perform data interaction with the card data source;
[0008] Based on the first data interaction code, a first card is generated.
[0009] On the other hand, an embodiment of the present application provides a card generation device, the device comprising:
[0010] A first determination module, configured to determine first interface structure information based on first card layout information, wherein the first card layout information is used to indicate a first card layout, and the first interface structure information is used to indicate a structure of a plurality of data options included in a card interface corresponding to the first card layout;
[0011] A first generating module, configured to generate a first data interaction code based on the first interface structure information and a card data source, wherein the card data source is configured to provide card data for the plurality of data options, and the first data interaction code is configured to be executed so that the plurality of data options perform data interaction with the card data source;
[0012] The second generating module is used to generate a first card based on the first data interaction code.
[0013] On the other hand, an embodiment of the present application provides a computer device, which includes a processor and a memory, wherein the memory stores at least one computer instruction, and the at least one computer instruction is loaded and executed by the processor to implement the card generation method described in the above aspects.
[0014] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one computer instruction, and the at least one computer instruction is used to be executed by a processor to implement the card generation method as described in the above aspects.
[0015] On the other hand, an embodiment of the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to implement the card generation method described in the above aspects.
[0016] In an embodiment of the present application, the core code of the card is the data interaction code, and the data interaction code is automatically generated based on the first card layout information and the card data source; therefore, when the user needs to develop a card, the user only needs to determine the first card layout information and the card data source to generate the data interaction code, and then generate the card based on the data interaction code. The user does not need to manually write the data interaction code for the card, which saves the card development time and thus improves the card development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a flowchart of a card generation method shown in an exemplary embodiment of the present application;
[0018] Figure 2 is a schematic diagram of a card generation method shown in an exemplary embodiment of the present application;
[0019] Figure 3 is a schematic diagram of a card generation method shown in an exemplary embodiment of the present application;
[0020] Figure 4is a schematic diagram of a card generation method shown in an exemplary embodiment of the present application;
[0021] Figure 5 is a schematic diagram of a card generation method shown in an exemplary embodiment of the present application;
[0022] Figure 6 is a structural block diagram of a card generating device shown in an exemplary embodiment of the present application;
[0023] Figure 7 It is a structural block diagram of a computer device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0025] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0026] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the first card layout information, layout adjustment information, interaction adjustment information and card layout pictures involved in this application are all obtained with full authorization.
[0027] The card generation method of the embodiment of the present application can be executed by a computer device with a code generation function, and the computer device can be a personal computer or a tablet computer, etc. In the following embodiments, the execution subject of the card generation method is a computer device as an example for description.
[0028] After the computer device generates a card, it will apply the card in the terminal; therefore, a card refers to a complete unit that can interact independently and is used to display a certain type of specific information in the terminal, and the card contains page layout code and data interaction code. The page layout code is used to be executed to obtain a card interface corresponding to the card layout, and the card interface includes a structure of multiple data options. The data interaction code is used to be executed so that multiple data options interact with the card data source, and the card data source is used to provide card data for multiple data options.
[0029] In one possible implementation, the card is a service card. The page layout code included in the service card is used to be executed to obtain the card interface of the service card, and the card interface of the service card displays the recommended service; the data interaction code included in the service card is used for the recommended service to interact with the data source of the service card (the application corresponding to the recommended service); for example, the recommended service is an itinerary service (an itinerary with a high-speed rail ticket), and the user clicks on the itinerary service, then the service card will obtain the corresponding itinerary information (detailed information of the high-speed rail ticket) from the application corresponding to the itinerary service.
[0030] In another possible implementation, a takeaway card, the page layout code included in the takeaway card is executed to obtain the card interface of the takeaway card, and the card interface of the takeaway card displays at least one of the recommended takeaway summary information and the status information of the ongoing takeaway order, and the status information of the takeaway order is used to indicate the status of the takeaway order; for example, the status information of the takeaway order can be that the order has been placed, the merchant is preparing the goods, and the delivery is in progress. The data interaction code included in the takeaway card is used for the displayed information to interact with the data source of the takeaway card (takeaway application); for example, when the user clicks on the recommended takeaway summary information, the takeaway card will obtain the takeaway details information corresponding to the takeaway summary information from the takeaway application.
[0031] In another possible implementation, the card is a taxi card, and the page layout code included in the taxi card is executed to obtain the card interface of the taxi card, and the card interface of the taxi card displays at least one of the recommended taxi service and the status information of the ongoing taxi order, and the status information of the taxi order is used to indicate the status of the taxi order; for example, the status information of the taxi order can be that the driver is on his way or has boarded the car, etc. The data interaction code included in the taxi card is used to perform data interaction between the displayed information and the data source of the taxi card (taxi application); for example, when the user clicks on the taxi service, it will jump to the taxi application and display the main interface of the taxi application, so that the user can take a taxi based on the main interface of the taxi application.
[0032] Please refer to Figure 1 , which shows a flowchart of a card generation method provided by an exemplary embodiment of the present application. The method may include the following steps:
[0033] Step 101: The computer device determines first interface structure information based on first card layout information, where the first card layout information is used to indicate a first card layout, and the first interface structure information is used to indicate a structure of multiple data options included in a card interface corresponding to the first card layout.
[0034] The card interface includes multiple data options, which may be text, pictures, or videos, etc.; accordingly, the first card layout information includes information such as the location, size, and color of the multiple data options. Prior to this step, the computer device needs to obtain the first card layout information. In one possible implementation, the user may describe the desired card in the form of a picture; accordingly, the step for the computer device to obtain the first card layout information may be: the computer device determines a card layout picture, which is a picture corresponding to the first card layout; based on the card layout picture, the first card layout information is obtained through a layout information extraction model. Among them, the card layout picture may be a design drawing or a hand-drawn drawing, etc.; the layout picture may also be a picture taken by the user, etc. For example, please refer to Figure 2 , the user designs the layout picture such as the design drawing or hand-drawn drawing, and then determines the first card layout information based on the layout picture.
[0035] The layout information extraction model includes a picture segmentation function and a content layout extraction function; accordingly, the step of the computer device obtaining the first card layout information through the layout information extraction model based on the card layout picture can be: the computer device inputs the layout picture into the layout information extraction model, segments the layout picture through the layout information extraction model to obtain multiple picture areas, extracts the layout information of the multiple picture areas through the layout information extraction model, and obtains the first card layout information.
[0036] In an embodiment of the present application, the user only needs to submit a layout picture to generate the first card layout information through the layout information extraction model, and generate the first card layout code through the second code generation model. The user does not need to manually write the first card layout code, which saves the development time of the card layout code and improves the card development efficiency.
[0037] In another possible implementation, the user may describe the desired card by text input; accordingly, the step of the computer device acquiring the first card layout information may be: the computer device acquires the input text information, and determines the first card layout information based on the input text information. For example, the computer device determines the input text information as the first card layout information, or the computer device extracts layout-related information from the input text information, and determines the layout-related information as the first card layout information.
[0038] In another possible implementation, the user describes the desired card by voice input; accordingly, the step of the computer device acquiring the first card layout information may be: the computer device acquires the input voice information, and determines the first card layout information based on the input voice information. For example, the computer device converts the input voice information into text information, and then determines the converted text information as the first card layout information, or the computer device extracts layout-related information from the converted text information, and determines the layout-related information as the first card layout information.
[0039] In another possible implementation, the user describes the desired card through video input; accordingly, the step for the computer device to obtain the first card layout information may be: the computer device obtains the input video, determines the card layout picture from the input video, and then obtains the first card layout information based on the card layout picture through the layout information extraction model.
[0040] In an embodiment of the present application, the first card layout code can be generated by describing the desired card through text input, voice input or video input without relying on layout pictures, thereby saving time in designing or drawing layout pictures and further improving the card development efficiency.
[0041] The interaction types of different data options correspond to different structures. The interaction type of data options is used to indicate whether the data options can interact with the card data source. For example, if the interaction types include interactive and non-interactive, the structure of the data options includes a first data structure and a second data structure. The first data structure is a data structure corresponding to the interactive data options, and the second data structure is a data structure corresponding to the non-interactive data options.
[0042] In a possible implementation, this step can be implemented by the following steps 1011-1013, including:
[0043] Step 1011: The computer device determines multiple data options of the card based on the first card layout information, where the multiple data options are options in the card interface.
[0044] The computer device obtains a card interface by running the first card layout code, and determines multiple data options from the card interface, wherein the multiple data options include a title and a card option. For example, if the card is a microblog card, the title is "hot events", and the card option is microblog information of recommended hot events, etc.
[0045] Step 1012: The computer device determines the interaction type of the multiple data options based on the location information of the multiple data options, where the interaction type is used to indicate whether the data option can interact with the card data source.
[0046] The computer device determines a first data option and a second data option from the multiple data options based on location information of the multiple data options, determines the interaction type of the first data option as non-interactive, and determines the interaction type of the second data option as interactive.
[0047] Since the title in the card interface is a non-interactive data option, and the other options are interactive data options; therefore, the computer device determines that the data option located at the position corresponding to the title is the first data option, and determines that the data options located at other positions are the second data option based on the position information of multiple data options.
[0048] One point that needs to be explained is that the computer device can also be assisted by the user to determine the interaction types of multiple data options; accordingly, this step can be: the computer device displays an interaction type setting interface, the interaction type setting interface includes multiple data options and candidate interaction types corresponding to each data option, and the user can select an interaction type from the candidate interaction types corresponding to each data option; the computer device obtains the selected interaction type for each data option.
[0049] Step 1013: The computer device determines first interface structure information based on the multiple data options and the interaction types of the multiple data options.
[0050] In one possible implementation, a computer device combines a plurality of data options and interaction types of the plurality of data options into first interface structure information. In another possible implementation, the computer device determines the structure information of the plurality of data options based on the interaction types of the plurality of data options, and combines the plurality of data options and the structure information of the plurality of data options into first interface structure information. For example, for any data option, when the interaction type of the data option is interactive, the computer device determines the structure information of the data option as first structure information, and the first structure information is used to make the displayed data option interactive; when the interaction type of the data option is non-interactive, the computer device determines the structure information of the data option as second structure information, and the second structure information is used to make the displayed data option non-interactive.
[0051] Step 102: The computer device generates a first data interaction code based on the first interface structure information and the card data source, where the card data source is used to provide card data for multiple data options, and the first data interaction code is used to be executed to enable the multiple data options to interact with the card data source.
[0052] The card data source is the application corresponding to the card or the application corresponding to the information displayed in the card; for example, if the card is a service card and the service card displays recommended services, then the card data source is the application corresponding to the recommended service; for another example, if the card is a takeaway card, then the card data source is the takeaway application; for another example, if the card service is a taxi card, then the card data source is the taxi application.
[0053] The multiple data options include a first data option and a second data option, the first data option is a non-interactive data option, and the second data option is an interactive data option; the interactive data option is used to interact with the card data source, that is, the first data interaction code is used to be executed to enable the second data option among the multiple data options to interact with the card data source.
[0054] In a possible implementation, this step can be implemented by following steps 1021-1023, including:
[0055] Step 1021: The computer device obtains card data from the card data source, where the card data is data displayed in a structure of multiple data options.
[0056] The computer device automatically requests the API of the card data source, and sends a data acquisition request to the card data source through the API; the card data source receives the data acquisition request, obtains the card data from the database in response to the data acquisition request, and sends the card data to the computer device. For example, please continue to refer to Figure 2 The computer device obtains API data (card data) from the card data source through an API data request (data acquisition request).
[0057] For example, if the card is a service card, which is used to display recommended services, the card data may be service information obtained from an application corresponding to the recommended service. For another example, if the card is a takeaway card, which is used to display recommended takeaway summary information, the card data may be takeaway detail information corresponding to the takeaway summary information obtained from the takeaway application.
[0058] Step 1022: The computer device extracts multiple card sub-data from the card data, and matches the multiple card sub-data with multiple data options to obtain card sub-data corresponding to the multiple data options. Different data options correspond to different card sub-data, and the data options are used to display the card sub-data corresponding to the data options.
[0059] The computer device can extract and match the card sub-data with the help of the data processing model; accordingly, this step can be: the computer device extracts multiple card sub-data from the card data based on the card data and multiple data options through the data processing model, and matches the multiple card sub-data with the multiple data options to obtain the card sub-data corresponding to the multiple data options. For example, please continue to refer to Figure 2 , the computer device performs interface matching from the API data (card data) to obtain the card sub-data corresponding to each data option.
[0060] Step 1023: The computer device generates a first data interaction code through a first code generation model based on the multiple data options and the card sub-data corresponding to the multiple data options.
[0061] When the first data interaction code is generated by the first code generation model, the generated first data interaction code also needs to be constrained by the second coding specification information; accordingly, this step can be: the computer device determines the second coding specification information, and the second coding specification information is used to indicate the coding specification that the first data interaction code needs to meet; based on the second coding specification information, multiple data options and the card sub-data corresponding to the multiple data options, the first data interaction code is generated by the first code generation model, and the first data interaction code meets the coding specification indicated by the second coding specification information. Among them, the second coding specification information and the first coding specification information can be the same or different. In the embodiment of the present application, the second coding specification information is not specifically limited.
[0062] The first data interaction code includes at least one of a data request code, a data extraction code, and a data matching code; the data request code is used to obtain card data from a card data source, the data extraction code is used to extract multiple card sub-data from the card data, and the data matching code is used to match multiple card sub-data with multiple data options. In this step, the first data interaction code includes three items: a data request code, a data extraction code, and a data matching code. Accordingly, this step can be implemented by the following steps 10231-10232, including:
[0063] Step 10231: The computer device generates a data request code, a data extraction code and a data matching code through a first code generation model based on multiple data options and multiple card sub-data corresponding to the multiple data options.
[0064] Different data options correspond to different card sub-data; the computer device inputs the address information of the card data source, card data, multiple card sub-data, multiple data options and multiple card sub-data corresponding to the multiple data options into the first code generation model, and outputs a data request code, a data extraction code and a data matching code; wherein the data request code is used to obtain card data from the card data source, the data extraction code is used to extract multiple card sub-data from the card data, and the data matching code is used to match multiple card sub-data with multiple data options.
[0065] Step 10232: The computer device generates a first data interaction code based on the data request code, the data extraction code and the data matching code.
[0066] The computer device combines the data request code, the data extraction code and the data matching code into a first data interaction code. For example, please continue to refer to Figure 2 , the computer device generates a data request code, a data extraction code and a data matching code, and these three codes form a first data interaction code. For another example, please continue to refer to Figure 3 , the computer device determines a first data interaction code.
[0067] It should be noted that the second code generation model and the first code generation model can be the same code generation model or two different code generation models; when the second code generation model and the first code generation model are the same code generation model, card layout code and data interaction code can be generated through one code generation model, which simplifies the card generation process.
[0068] One point that needs to be explained is that the first code generation model can be trained by other devices and then deployed to the computer device, or it can be trained by the computer device; wherein, the step of training the first code generation model by the computer device can be: the computer device determines multiple second sample data, the second sample data includes sub-data and data interaction codes corresponding to the data options, and performs model training based on the multiple second sample data through a supervised training method to obtain the first code generation model.
[0069] Step 103: The computer device generates a first card based on the first data interaction code.
[0070] In some embodiments, the card includes a card layout code and a data interaction code; therefore, after the computer device obtains the first card layout information, it is also necessary to generate a first card layout code based on the first card layout information, and the first card layout code is used to be executed to obtain a card interface corresponding to the first card layout; accordingly, this step can be: the computer device generates a first card based on the first card layout code and the first data interaction code.
[0071] In a possible implementation, the computer device generates the first card layout code by means of the second code generation model; accordingly, the step of generating the first card layout code by the computer device based on the first card layout information may be: the computer device generates the first card layout code by means of the second code generation model based on the first card layout information. Figure 3 , the computer device generates a first card layout code based on the layout picture through a second code generation model.
[0072] When the first card layout code is generated by the second code generation model, the generated first card layout code can also be constrained by the first coding specification information; accordingly, this step can be: the computer device determines the first coding specification information, and the first coding specification information is used to indicate the coding specification that the first card layout code needs to meet; based on the first card layout information and the first coding specification information, the first card layout code is generated by the second code generation model, and the first card layout code meets the coding specification indicated by the first coding specification information.
[0073] The first encoding specification information includes at least one of single-byte character encoding specification information, ANSI encoding specification information, and UNICOD encoding specification information; the single-byte character encoding specification information may be ISO-8859-1, and ISO-8859-1 is used to constrain each byte to be directly used as a NUICODE character (character in the code). The ANSI encoding specification information may be GB2312, BIG5, Shift_JIS, or ISO-8859-2, and the ANSI encoding specification information is used to indicate that when a UNICODE character string is converted into a "byte string" through ANSI encoding, a UNICODE character may be converted into one byte or multiple bytes according to the regulations of each encoding. UNICOD encoding specification information can be UTF-8, UTF-16 or UnicodeBig, etc.; UNICOD encoding specification information is similar to ANSI encoding specification information. When a string is converted into a "byte string" through UNICODE encoding, a UNICODE character may be converted into one byte or multiple bytes; the difference from ANSI encoding specification information is that these "UNICODE encodings" can handle all UNICODE characters, and the difference between UNICODE characters and the converted bytes can be calculated.
[0074] One point that needs to be explained is that the second code generation model can be trained by other devices and then deployed to the computer device, or it can be trained by the computer device; wherein, the step of the computer device training the second code generation model can be: the computer device determines a plurality of first sample data, the first sample data includes card layout information and a card layout code corresponding to the card layout information, and performs model training based on the plurality of first sample data through a supervised training method to obtain the second code generation model.
[0075] In some embodiments, the computer device generates the first card based on the first card layout code and the first data interaction code. The steps may include: the computer device determines the first card code of the card based on the first card layout code and the first data interaction code; and generates the first card based on the first card code. For example, the computer device combines the first card layout code and the first data interaction code into a first card code; compiles the first card code to obtain a target application corresponding to the card, and runs the target application to obtain the first card. For example, please continue to refer to Figure 3 , the computer device generates a first card for recommending popular two-dimensional videos.
[0076] In one possible implementation, during the process of generating the first card based on the first card code, the computer device may also test the first card code to obtain the first card that passes the test; accordingly, the steps for the computer device to generate the first card based on the first card code may be: the computer device compiles the first card code to obtain a target program corresponding to the card; deploys the target program to a target platform, and runs the target program in the target platform to display a second card; and tests the second card to obtain the first card.
[0077] If the card interface of the second card includes multiple data options, then when the multiple data options included in the card interface of the second card are the same as the data options included in the card interface corresponding to the first card layout, it is determined that the first card layout code is correct; if the multiple data options included in the card interface of the second card are different from the multiple data options included in the card interface of the first card layout, the first card layout code is adjusted, and then the testing process is performed again based on the adjusted first card layout code until the data options included in the card interface of the second card are the same as the data options included in the card interface corresponding to the first card layout, at which time the testing of the first card layout code is completed.
[0078] The card interface of the second card includes a plurality of data options in which an interactive data option is used for data interaction with a card data source. The computer device obtains card data from the card data source based on the interactive data option, and when the obtained card data is the same as the theoretical card data, determines that the first data interaction code is correct; when the obtained card data is different from the theoretical card data, adjusts the first data interaction code, and then performs the test process again based on the adjusted first data interaction code, until the card data obtained from the card data source based on the interactive data option is the same as the theoretical card data, at which point the test of the first data interaction code ends.
[0079] When the first card layout code test and the first data interaction code test are completed, the final first card layout code and the final first data interaction code are combined into a second card code, and the second card code is compiled to obtain a target program corresponding to the card. The target program is the installation package of the card that has passed the final test. Other terminals can display the card by installing the target program.
[0080] The card generation method provided in the embodiment of the present application can help developers quickly turn a certain functional requirement into a card, quickly verify the actual effect, and reduce the difficulty of communication and collaboration among multiple teams required in the original card development process, thereby quickly realizing an executable card and improving the iteration speed of the card.
[0081] For example, please refer to Figure 2 The computer device combines the first card layout code and the first data interaction code into a first card code (this process can be called card engineering), and then performs an online preview (displaying the card interface) and a testing process based on the first card code to finally obtain the first card.
[0082] In an embodiment of the present application, the card includes a card layout code and a data interaction code, and the second code generation model can generate a card layout code based on the first card layout information, and the first code generation model can generate a data interaction code based on the interface structure information (determined based on the first card layout information) and the card data source. In this way, when a user needs to develop a card, the user only needs to determine the first card layout information and the card data source to generate the card with the help of two code generation models. The user does not need to manually write the card code, which saves the card development time and improves the card development efficiency.
[0083] Please refer to Figure 4 , which shows a flowchart of a card generation method provided by an exemplary embodiment of the present application. The method may include the following steps:
[0084] Step 401: The computer device generates a first card layout code through a second code generation model based on first card layout information, the first card layout information is used to indicate a first card layout, and the first card layout code is used to be executed to obtain a card interface corresponding to the first card layout.
[0085] In some embodiments, this step is the same as the process of "the computer device generates the first card layout code through the second code generation model based on the first card layout information" in step 103, and will not be repeated here.
[0086] Step 402: The computer device determines first interface structure information based on the first card layout information, where the first interface structure information is used to indicate the structure of multiple data options included in the card interface.
[0087] In some embodiments, this step is the same as step 101 and will not be repeated here.
[0088] Step 403: The computer device generates a first data interaction code based on the first interface structure information and the card data source, where the card data source is used to provide card data for multiple data options, and the first data interaction code is used to be executed to enable the multiple data options to interact with the card data source.
[0089] In some embodiments, this step is the same as step 102 and will not be repeated here.
[0090] Step 404: The computer device determines layout adjustment information, where the layout adjustment information is used to adjust the first card layout.
[0091] The layout adjustment information can be used to adjust at least one of the position, size and color of the data option. In a possible implementation, the computer device can adjust the card layout during the test; accordingly, this step can be: the computer device determines the first card code of the card based on the first card layout code and the first data interaction code; compiles the first card code to obtain the target program corresponding to the card; deploys the target program to the target platform, and runs the target program in the target platform to display the second card; based on the displayed second card, obtains the layout adjustment information.
[0092] Among them, the step of obtaining layout adjustment information based on the displayed second card by the computer device can be: the displayed second card is an editable card interface, the first editing information is obtained based on the editable card interface, and the first editing information is determined as the layout adjustment information; for example, if the user adjusts the size of a data option in the editable card interface, the layout adjustment information is to adjust the size of the data option.
[0093] Step 405: Based on the layout adjustment information, the computer device adjusts the first card layout code to obtain a second card layout code. The second card layout code is used to be executed to obtain a card interface corresponding to the second card layout. The second card layout is the card layout obtained after adjusting the first card layout.
[0094] In one possible implementation, the second code generation model not only has the function of generating the card layout code, but also has the function of adjusting the card layout code; accordingly, this step may be: the computer device generates the second card layout code through the second code generation model based on the first card layout code and the layout adjustment information.
[0095] In another possible implementation, the computer device first adjusts the first layout information based on the layout adjustment information, and then generates the card layout code through the second code generation model; accordingly, this step may be: the computer device adjusts the first card layout information based on the layout adjustment information to obtain the second card layout information, the second card layout information is used to indicate the second card layout, and generates the second card layout code through the second code generation model based on the second card layout information.
[0096] Step 406: The computer device generates a first card based on the second card layout code and the first data interaction code.
[0097] In some embodiments, the process by which the computer device generates the first card based on the second card layout code and the first data interaction code is similar to the process by which the computer device generates the first card based on the first card layout code and the first data interaction code in step 103, and is not repeated here.
[0098] In the embodiment of the present application, after the card development is completed, the second code generation model can be combined again to perform secondary editing on the layout of the generated card, thereby improving the efficiency of secondary development of the card.
[0099] Please refer to Figure 5 , which shows a flowchart of a card generation method provided by an exemplary embodiment of the present application. The method may include the following steps:
[0100] Step 501: The computer device generates a first card layout code through a second code generation model based on first card layout information, the first card layout information is used to indicate a first card layout, and the first card layout code is used to be executed to obtain a card interface corresponding to the first card layout.
[0101] In some embodiments, this step is the same as the process of "the computer device generates the first card layout code through the second code generation model based on the first card layout information" in step 103, and will not be repeated here.
[0102] Step 502: The computer device determines first interface structure information based on the first card layout information, where the first interface structure information is used to indicate the structure of multiple data options included in the card interface.
[0103] In some embodiments, this step is the same as step 101 and will not be repeated here.
[0104] Step 503: The computer device generates a first data interaction code based on the first interface structure information and the card data source, where the card data source is used to provide card data for multiple data options, and the first data interaction code is used to be executed to enable the multiple data options to interact with the card data source.
[0105] In some embodiments, this step is the same as step 102 and will not be repeated here.
[0106] Step 504: The computer device determines interaction adjustment information, where the interaction adjustment information is used to adjust the structure of the multiple data options.
[0107] The interaction adjustment information can also be used to add data options, delete data options, or change the structure of data options, etc. In a possible implementation, the computer device can adjust the data interaction logic during the test; accordingly, this step can be: the computer device determines the first card code of the card based on the first card layout code and the first data interaction code; compiles the first card code to obtain the target program corresponding to the card; deploys the target program to the target platform, and runs the target program in the target platform to display the second card; based on the displayed second card, obtains the interaction adjustment information.
[0108] Among them, the step of obtaining the interactive adjustment information based on the displayed second card by the computer device can be: the displayed second card is an editable card interface, the second editing information is obtained based on the editable card interface, and the second editing information is determined as the interactive adjustment information; for example, the user adds a data option in the editable card interface, and the interactive adjustment information is to add the data option.
[0109] Step 505: The computer device adjusts the first data interaction code based on the interaction adjustment information to obtain a second data interaction code, where the second data interaction code is used to be executed so that the multiple data options can interact with the card data source.
[0110] In a possible implementation, the first code generation model not only has the function of generating data interaction code, but also has the function of adjusting the data interaction code; accordingly, this step may be: the computer device generates the second data interaction code through the first code generation model based on the first data interaction code and the interaction adjustment information.
[0111] In another possible implementation, the computer device first adjusts the first interface structure information based on the interaction adjustment information, and then generates the data interaction code through the first code generation model; correspondingly, this step can be: the computer device adjusts the first interface structure information based on the interaction adjustment information to obtain the second interface structure information, and generates the second data interaction code through the first code generation model based on the second interface structure information and the card data source.
[0112] Step 506: The computer device generates a first card based on the first card layout code and the second data interaction code.
[0113] In some embodiments, the process by which the computer device generates the first card based on the first card layout code and the second data interaction code is similar to the process by which the computer device generates the first card based on the first card layout code and the first data interaction code in step 103, and is not repeated here.
[0114] In the embodiment of the present application, after the card development is completed, the first code generation model can be combined again to perform secondary editing on the data interaction logic of the generated card, thereby improving the efficiency of secondary development of the card.
[0115] Please refer to Figure 6 , which shows a structural block diagram of a card generation device provided by an exemplary embodiment of the present application. The device includes:
[0116] A first determination module 601 is used to determine first interface structure information based on first card layout information, where the first card layout information is used to indicate a first card layout, and the first interface structure information is used to indicate a structure of multiple data options included in a card interface corresponding to the first card layout;
[0117] A first generating module 602 is used to generate a first data interaction code based on the first interface structure information and a card data source, wherein the card data source is used to provide card data for the multiple data options, and the first data interaction code is used to be executed so that the multiple data options perform data interaction with the card data source;
[0118] The second generating module 603 is used to generate a first card based on the first data interaction code.
[0119] In another possible implementation, the first generation module 602 is used to obtain card data from the card data source, where the card data is the data displayed in the structure of the multiple data options; extract multiple card sub-data from the card data, and match the multiple card sub-data with the multiple data options to obtain card sub-data corresponding to the multiple data options, different data options correspond to different card sub-data, and the data options are used to display the card sub-data corresponding to the data options; based on the multiple data options and the card sub-data corresponding to the multiple data options, generate the first data interaction code through a first code generation model.
[0120] In another possible implementation, the first generation module 602 is used to generate a data request code, a data extraction code and a data matching code through the first code generation model based on the multiple data options and the multiple card sub-data corresponding to the multiple data options, the data request code is used to obtain the card data from the card data source, the data extraction code is used to extract the multiple card sub-data from the card data, and the data matching code is used to match the multiple card sub-data with the multiple data options; based on the data request code, the data extraction code and the data matching code, the first data interaction code is generated.
[0121] In another possible implementation, the first generation module 602 is used to extract the multiple card sub-data from the card data based on the card data and the multiple data options through a data processing model, and match the multiple card sub-data with the multiple data options to obtain the card sub-data corresponding to the multiple data options.
[0122] In another possible implementation, the device further includes:
[0123] A second determining module is used to determine a card layout picture, where the card layout picture is a picture corresponding to the first card layout;
[0124] An acquisition module is used to acquire the first card layout information based on the card layout picture through a layout information extraction model.
[0125] In another possible implementation, the device further includes:
[0126] A third generating module, configured to generate a first card layout code through a second code generating model based on the first card layout information, wherein the first card layout code is used to be executed to obtain the card interface;
[0127] The second generating module 603 is used to generate the first card based on the first card layout code and the first data interaction code.
[0128] In another possible implementation, the second generation module 603 is used to determine the first card code of the card based on the first card layout code and the first data interaction code; and generate the first card based on the first card code.
[0129] In another possible implementation, the second generation module 603 is used to compile the first card code to obtain a target program corresponding to the card; deploy the target program to a target platform, and run the target program in the target platform to display a second card; and test the second card to obtain the first card.
[0130] In another possible implementation, the second generation module 603 is used to determine layout adjustment information, and the layout adjustment information is used to adjust the first card layout; based on the layout adjustment information, the first card layout code is adjusted to obtain a second card layout code, and the second card layout code is used to be executed to obtain a card interface corresponding to the second card layout, and the second card layout is a card layout obtained after the first card layout is adjusted; based on the second card layout code and the first data interaction code, the first card is generated.
[0131] In another possible implementation, the second generation module 603 is configured to generate the second card layout code through the second code generation model based on the first card layout code and the layout adjustment information; or,
[0132] The second generation module 603 is used to adjust the first card layout information based on the layout adjustment information to obtain second card layout information, where the second card layout information is used to indicate the second card layout, and generate the second card layout code through the second code generation model based on the second card layout information.
[0133] In another possible implementation, the second generation module 603 is used to determine interaction adjustment information, where the interaction adjustment information is used to adjust the structure of the multiple data options; based on the interaction adjustment information, the first data interaction code is adjusted to obtain the second data interaction code; based on the first card layout code and the second data interaction code, the first card is generated.
[0134] In another possible implementation, the second generating module 603 is configured to generate the second data interaction code through the first code generation model based on the first data interaction code and the interaction adjustment information; or,
[0135] The second generation module 603 is used to adjust the first interface structure information to obtain second interface structure information based on the interaction adjustment information, and generate the second data interaction code through the first code generation model based on the second interface structure information and the card data source.
[0136] In another possible implementation, the first determination module 601 is used to determine multiple data options of the card based on the first card layout information, where the multiple data options are options in the card interface; determine interaction types of the multiple data options based on location information of the multiple data options, where the interaction type is used to indicate whether the data options can interact with the card data source; and determine the first interface structure information based on the multiple data options and the interaction types of the multiple data options.
[0137] In an embodiment of the present application, the core code of the card is the data interaction code, and the data interaction code is automatically generated based on the first card layout information and the card data source; therefore, when the user needs to develop a card, the user only needs to determine the first card layout information and the card data source to generate the data interaction code, and then generate the card based on the data interaction code. The user does not need to manually write the data interaction code for the card, which saves the card development time and thus improves the card development efficiency.
[0138] It should be noted that the card generation device provided in the above embodiment only uses the division of the above functional modules as an example when performing card generation. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the card generation device provided in the above embodiment and the card generation method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0139] See also Figure 7 , Figure 7 7 is a schematic diagram of a computer device provided by an exemplary embodiment of the present application. The computer device may also include one or more of the following components: a processor 710 , a memory 720 , and a display screen 730 .
[0140] The processor 710 uses various interfaces and lines to connect the various parts of the entire computer device 700, and executes various functions and processes data of the computer device 700 by running or executing instructions, programs, code sets or instruction sets stored in the memory 720, and calling data stored in the memory 720. Optionally, the processor 710 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 710 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a neural network processor (NPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen 730; the NPU is used to implement artificial intelligence (AI) functions; and the modem is used to process wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor 710, but may be implemented separately through a computer program product.
[0141] The memory 720 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 720 includes a non-transitory computer-readable storage medium. The memory 720 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 720 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc.; the data storage area may store data (such as audio data, a phone book), etc., created according to the use of the computer device 700.
[0142] The display screen 730 is a display component for displaying a user interface. Optionally, the display screen 730 is a display screen with a touch function, through which the user can use any suitable object such as a finger, a touch pen, etc. to perform touch operations on the display screen 730.
[0143] The display screen 730 is usually arranged on the front panel of the computer device 700. The display screen 730 can be designed as a full screen, a curved screen, a special-shaped screen, a double-sided screen or a folding screen. The display screen 730 can also be designed as a combination of a full screen and a curved screen, a combination of a special-shaped screen and a curved screen, etc., which is not limited in this embodiment.
[0144] In addition, those skilled in the art can understand that the structure of the computer device 700 shown in the above drawings does not constitute a limitation on the computer device 700, and the computer device 700 may include more or fewer components than shown in the drawings, or combine certain components, or arrange the components differently. For example, the computer device 700 also includes a Wifi module, an audio acquisition device, a speaker, a radio frequency circuit, an input unit, a sensor, an audio circuit, a Bluetooth module, a power supply, and other components, which will not be described in detail here.
[0145] An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one computer instruction, and the at least one computer instruction is used to be executed by a processor to implement the card generation method as described in the above embodiment.
[0146] On the other hand, an embodiment of the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to implement the card generation method described in the above embodiment.
[0147] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0148] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A card generation method, characterized in that: The method comprises: Determine first interface structure information based on first card layout information, where the first card layout information is used to indicate a first card layout, and the first interface structure information is used to indicate a structure of a plurality of data options included in a card interface corresponding to the first card layout; Generate a first data interaction code based on the first interface structure information and a card data source, wherein the card data source is used to provide card data for the multiple data options, and the first data interaction code is used to be executed so that the multiple data options perform data interaction with the card data source; Based on the first data interaction code, a first card is generated.
2. The method according to claim 1, characterized in that The generating a first data interaction code based on the first interface structure information and the card data source includes: Acquire card data from the card data source, the card data being data displayed in the structure of the plurality of data options; Extracting a plurality of card sub-data from the card data, and matching the plurality of card sub-data with the plurality of data options to obtain the card sub-data corresponding to the plurality of data options, wherein different data options correspond to different card sub-data, and the data options are used to display the card sub-data corresponding to the data options; Based on the multiple data options and the card sub-data corresponding to the multiple data options, the first data interaction code is generated by a first code generation model.
3. The method according to claim 2, characterized in that The generating the first data interaction code by using a first code generation model based on the multiple data options and the card sub-data corresponding to the multiple data options includes: Based on the multiple data options and the multiple card sub-data corresponding to the multiple data options, a data request code, a data extraction code and a data matching code are generated by the first code generation model, wherein the data request code is used to obtain the card data from the card data source, the data extraction code is used to extract the multiple card sub-data from the card data, and the data matching code is used to match the multiple card sub-data with the multiple data options; The first data interaction code is generated based on the data request code, the data extraction code and the data matching code.
4. The method according to claim 2, characterized in that: The extracting a plurality of card sub-data from the card data and matching the plurality of card sub-data with the plurality of data options to obtain the card sub-data corresponding to the plurality of data options includes: Based on the card data and the multiple data options, the multiple card sub-data are extracted from the card data through a data processing model, and the multiple card sub-data are matched with the multiple data options to obtain the card sub-data corresponding to the multiple data options.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Determine a card layout picture, where the card layout picture is a picture corresponding to the first card layout; Based on the card layout picture, the first card layout information is acquired through a layout information extraction model.
6. The method according to claim 1, characterized in that The method further comprises: Based on the first card layout information, generating a first card layout code by a second code generation model, wherein the first card layout code is used to be executed to obtain the card interface; The step of generating a first card based on the first data interaction code includes: The first card is generated based on the first card layout code and the first data interaction code.
7. The method according to claim 6, characterized in that The generating the first card based on the first card layout code and the first data interaction code includes: determining a first card code of the card based on the first card layout code and the first data interaction code; Based on the first card code, the first card is generated.
8. The method according to claim 7, characterized in that The step of generating the first card based on the first card code includes: Compiling the first card code to obtain a target program corresponding to the card; Deploying the target program to a target platform, and running the target program in the target platform to display a second card; The second card is tested to obtain the first card.
9. The method according to claim 6 or 8, characterized in that: The generating the first card based on the first card layout code and the first data interaction code includes: Determine layout adjustment information, where the layout adjustment information is used to adjust the first card layout; Based on the layout adjustment information, the first card layout code is adjusted to obtain a second card layout code, the second card layout code is used to be executed to obtain a card interface corresponding to a second card layout, and the second card layout is a card layout obtained after adjusting the first card layout; The first card is generated based on the second card layout code and the first data interaction code.
10. The method according to claim 9, characterized in that The adjusting the first card layout code to obtain the second card layout code based on the layout adjustment information includes: Based on the first card layout code and the layout adjustment information, the second card layout code is generated by the second code generation model; or, Based on the layout adjustment information, the first card layout information is adjusted to obtain second card layout information, where the second card layout information is used to indicate the second card layout, and the second card layout code is generated by the second code generation model based on the second card layout information.
11. The method according to claim 6, characterized in that The generating the first card based on the first card layout code and the first data interaction code includes: determining interaction adjustment information, where the interaction adjustment information is used to adjust the structure of the plurality of data options; Based on the interaction adjustment information, adjusting the first data interaction code to obtain a second data interaction code; The first card is generated based on the first card layout code and the second data interaction code.
12. The method according to claim 11, characterized in that The adjusting the first data interaction code to obtain the second data interaction code based on the interaction adjustment information includes: Based on the first data interaction code and the interaction adjustment information, the second data interaction code is generated by the first code generation model; or, Based on the interaction adjustment information, the first interface structure information is adjusted to obtain the second interface structure information, and based on the second interface structure information and the card data source, the second data interaction code is generated through the first code generation model.
13. The method according to any one of claims 1 to 4, characterized in that: The determining the first interface structure information based on the first card layout information includes: Based on the first card layout information, determine a plurality of data options of the card, where the plurality of data options are options in the card interface; Determining, based on the location information of the multiple data options, interaction types of the multiple data options, the interaction types being used to indicate whether the data options can interact with the card data source; The first interface structure information is determined based on the multiple data options and interaction types of the multiple data options.
14. A card generating device, characterized in that: The device comprises: A first determination module, configured to determine first interface structure information based on first card layout information, wherein the first card layout information is used to indicate a first card layout, and the first interface structure information is used to indicate a structure of a plurality of data options included in a card interface corresponding to the first card layout; A first generating module, configured to generate a first data interaction code based on the first interface structure information and a card data source, wherein the card data source is configured to provide card data for the plurality of data options, and the first data interaction code is configured to be executed so that the plurality of data options perform data interaction with the card data source; The second generating module is used to generate a first card based on the first data interaction code.
15. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one computer instruction, and the at least one computer instruction is loaded and executed by the processor to implement the card generation method according to any one of claims 1 to 13.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer instruction, and the at least one computer instruction is used to be executed by a processor to implement the card generation method according to any one of claims 1 to 13.
17. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium; a processor reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to implement the card generation method as described in any one of claims 1 to 13.