Method, device, equipment and storage medium for generating interface file

CN114138262BActive Publication Date: 2024-11-08CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111435533.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-29
Publication Date
2024-11-08
Estimated Expiration
2041-11-29

AI Technical Summary

Technical Problem

[0003]本发明的主要目的为提供一种界面文件的生成方法、装置、设备以及存储介质,旨在解决现有的界面文件的作用范围有限,不够灵活,难以满足各种应用场景的需要的问题

Benefits of technology

[0048] The beneficial effects of the present invention: by obtaining the preset template to be configured and the corresponding target table, converting the table content into the corresponding code text, and converting the table relationship into the language relationship between the code text, Obtain the code file; convert the code file into the corresponding language object according to the preset rules in the preset template; replace the language object with the preset string replacement method in the preset template. Describe the placeholder tag to get the interface file. This achieves the automatic generation of interface files without developers having to spend too much energy, and the way to generate interface files only requires obtaining the corresponding preset templates and corresponding target tables. It is highly flexible and can cope with various scenarios. Large range of action.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114138262B_ABST
    Figure CN114138262B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of data processing technology, and provides a method, device, equipment and storage medium for generating an interface file, wherein the method comprises: obtaining a preset template to be configured, obtaining the table relationship and table content of a target table based on the preset template, and converting the code file into a code file, converting the code file into a corresponding language object according to a preset rule in the preset template, and replacing the placeholder tag with the language object in the preset template by a preset string replacement method to obtain an interface file. Thus, the automatic generation of the interface file is realized, without the developer spending too much effort, and the method of generating the interface file only needs to obtain the corresponding preset template and the corresponding target table, which is highly flexible, can cope with various scenarios, and has a wide range of applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a method, device, equipment and storage medium for generating an interface file. Background Art

[0002] Insurance industry system files are often used in various application scenarios, such as insurance notices, health notices, and smart questions and answers during the insurance stage. There are many types of insurance products and the subject categories are complex, so different interface files often need to be customized according to different categories of products. At present, many insurance companies on the market have developed different interface files for different products, but these interface files have limited scope and are not flexible enough to meet the needs of various application scenarios. Summary of the invention

[0003] The main purpose of the present invention is to provide a method, device, equipment and storage medium for generating an interface file, aiming to solve the problem that the existing interface files have a limited scope of application, are not flexible enough and are difficult to meet the needs of various application scenarios.

[0004] The present invention provides a method for generating an interface file, comprising:

[0005] Obtaining a preset template to be configured; wherein the preset template includes a placeholder tag, and the placeholder tag is used to occupy the position of the language object;

[0006] Acquire a corresponding target table based on the preset template;

[0007] Acquire the table content and the table relationship between each cell in the target table; the table relationship includes the hierarchical relationship and the relationship of merged cells;

[0008] Convert the table contents into corresponding code characters, and convert the table relations into language relations between the code characters to obtain a code file;

[0009] Convert the code file into a corresponding language object according to the rules preset in the preset template;

[0010] In the preset template, the language object replaces the placeholder tag through a preset string replacement method to obtain an interface file.

[0011] Furthermore, the step of acquiring the corresponding target table based on the preset template further includes:

[0012] receiving table information of the target table;

[0013] Setting a hyperlink of the target table in the preset template based on the table information;

[0014] The target table is obtained through the hyperlink.

[0015] Furthermore, the steps of converting the table contents into corresponding code characters, and converting the table relations into language relations between the code characters to obtain a code file include:

[0016] The table header in the table content is used as the abstract class code text through the API provided by java poi, and the corresponding table body is used as the implementation class code text of the abstract class, so as to obtain the code text;

[0017] Based on the abstract class code characters, the implementation class code characters and the table relationship, a language relationship between the code characters is obtained;

[0018] The language relationship is converted into logical code text corresponding to Java, and the code text is combined to obtain the code file.

[0019] Furthermore, after the step of obtaining the preset template to be configured, the step further includes:

[0020] Read the real-time display image of the preset template based on the preset Iframe technology, and display it in real time;

[0021] Determine whether a modification instruction from the user is received;

[0022] If so, the parameters in the preset template are modified based on the modification instruction.

[0023] Furthermore, after the step of replacing the placeholder tag with the language object by a preset string replacement method in the preset template to obtain the interface file, the method further includes:

[0024] Receive the form replacement instruction uploaded by the user and the replacement form information to be replaced;

[0025] Obtaining a first keyword in the hyperlink to obtain the table relationship and table content;

[0026] The first keyword is replaced with a second keyword for obtaining the replacement table information; wherein the second keyword is used to obtain the table relationship and table content of the replacement table information.

[0027] Furthermore, after the step of replacing the placeholder tag with the language object by a preset string replacement method in the preset template to obtain the interface file, the method further includes:

[0028] The interface file is sent to the front end for display, and a screenshot of the screen displayed on the front end is taken using a preset screenshot tool to obtain an interface display image;

[0029] Determine whether the interface display image is consistent with the content of the interface file;

[0030] If they are inconsistent, get the first length and width of the image displayed on the front end;

[0031] The second length and width of the interface file are adjusted according to the first length and width, so that the interface display image includes the interface file.

[0032] Furthermore, the step of determining whether the interface display image is consistent with the content of the interface file includes:

[0033] Grayscale the interface display image and the interface file to obtain a first grayscale image and a second grayscale image;

[0034] Calculate the average grayscale value A of all pixels in the mth column or mth row of the first grayscale image m 1, and calculating the average value B1 of the grayscale values ​​of all pixels in the first grayscale image; and

[0035] Calculate the average grayscale value A of all pixels in the mth column or the mth row of the second grayscale image m 2, and calculating the average value B2 of the grayscale values ​​of all pixels in the first grayscale image;

[0036] According to the formula Calculate the overall variance of the mth column or mth row of the first grayscale image and the overall variance of the mth column or mth row of the second grayscale image Where N is the total number of columns or rows in the grayscale image, i = 1 or 2;

[0037] According to the formula Obtain the difference in overall variance between the mth column or the mth row of the first grayscale image and the second grayscale image

[0038] According to the difference in the population variances Determine whether the interface display diagram is consistent with the interface file.

[0039] The present invention also provides a device for generating an interface file, comprising:

[0040] A first acquisition module is used to acquire a preset template to be configured; wherein the preset template includes a placeholder tag, and the placeholder tag is used to occupy the position of the language object;

[0041] A second acquisition module, used to acquire a corresponding target table based on the preset template;

[0042] A third acquisition module is used to acquire the table content in the target table and the table relationship between each cell; the table relationship includes a hierarchical relationship and a relationship between merged cells;

[0043] A first conversion module is used to convert the table content into corresponding code characters, and convert the table relationship into a language relationship between the code characters to obtain a code file;

[0044] A second conversion module, used to convert the code file into a corresponding language object according to the rules preset in the preset template;

[0045] The filling module is used to replace the placeholder tag with the language object in the preset template through a preset string replacement method to obtain an interface file.

[0046] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0047] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods are implemented.

[0048] The beneficial effects of the present invention are as follows: by obtaining a preset template to be configured and a corresponding target table, converting the table content into corresponding code text, and converting the table relationship into a language relationship between the code text, a code file is obtained; according to the preset rules in the preset template, the code file is converted into a corresponding language object; in the preset template, the language object replaces the placeholder tag through a preset string replacement method to obtain an interface file. Thus, the automatic generation of the interface file is realized without the developer spending too much effort, and the method of generating the interface file only needs to obtain the corresponding preset template and the corresponding target table, which is highly flexible, can cope with various scenarios, and has a wide range of applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a flow chart of a method for generating an interface file according to an embodiment of the present invention;

[0050] Figure 2 It is a schematic block diagram of the structure of a device for generating an interface file according to an embodiment of the present invention;

[0051] Figure 3 A schematic block diagram of the structure of a computer device according to an embodiment of the present application.

[0052] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] It should be noted that all directional indications in the embodiments of the present invention (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly. The connection can be a direct connection or an indirect connection.

[0055] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone.

[0056] In addition, in the present invention, descriptions such as "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0057] Reference Figure 1 The present invention proposes a method for generating an interface file, comprising:

[0058] S1: Obtain a preset template to be configured; wherein the preset template includes a placeholder tag, and the placeholder tag is used to occupy the position of the language object;

[0059] S2: Acquire a corresponding target table based on the preset template;

[0060] S3: Acquire the table content in the target table and the table relationship between each cell; the table relationship includes a hierarchical relationship and a relationship between merged cells;

[0061] S4: converting the table content into corresponding code characters, and converting the table relationship into a language relationship between the code characters, to obtain a code file;

[0062] S5: converting the code file into a corresponding language object according to the rules preset in the preset template;

[0063] S6: Using a preset string replacement method in the preset template, the language object replaces the placeholder tag to obtain an interface file.

[0064] As described in step S1 above, a preset template to be configured is obtained. The preset template includes a placeholder tag, which is used to occupy the position of the language object. The preset template is an interface file framework set by the developer, which can be defined by the developer in real time, for example, the content of the interface file can be edited in the form of custom buttons or custom tags. The button functions provided include paragraph buttons, list buttons, insert link buttons, font buttons, etc. Or you can directly write a tag to edit, for example The words in the middle of the placeholder tag automatically become a separate paragraph. Edit the text in the paragraph and add styles. Locate the mouse cursor to determine which placeholder tag is currently in, and find the code corresponding to the placeholder tag. Insert the html style attribute in <> to become<pstyle="***;"> .

[0065] As described in the above step S2, the corresponding target table is obtained based on the preset template. The specific acquisition method is to input the table information of the target table in the preset template, which can be to obtain the corresponding target table, and then parse the target table in the preset template to obtain the corresponding table relationship and table content. In another embodiment, it is also possible to obtain the storage location where the table relationship and table content in the table information are located, and then obtain the table relationship and table content of the target table from the storage location, wherein the table relationship and table content are pre-read by the table parsing program, wherein the table parsing program can be java's POI "Poor Obfuscation Implementation, a simplified version of fuzzy implementation", or other parsing programs. This article preferably uses java's POI implementation, which can convert the table parsing program into code familiar to back-end development.

[0066] As described in step S3 above, the table content in the target table and the table relationship between each cell are obtained; the table relationship includes the hierarchical relationship and the relationship of merged cells. The target table can be parsed by Java or Python to obtain the corresponding table relationship and table content.

[0067] As described in the above step S4, the table content is converted into corresponding code characters, and the table relationship is converted into the language relationship between the code characters to obtain a code file. Specifically, the table relationship includes hierarchical relationships and the characteristics of merged cells, which are converted into parent-child relationships and containment and holding relationships in the Java language. First, through the API (Application Programming Interface) provided by Java's Poi (Poor Obfuscation Implementation, a concise version of the fuzzy implementation), the file is read into the memory, the table header is used as an abstract class, the specific table body is used as the implementation class of the abstract class, the value of the table header is used as the attribute of the abstract class, and the value of the table body is used as the value of the attribute. If there are multiple specific categories, the table will describe the merged cells, the number of rows of subsequent values, and the number of groups of the array in the corresponding Java object, thereby realizing the conversion of the table into a Java code file.

[0068] As described in step S5 above, the code file is converted into a corresponding language object according to the preset rules in the preset template. The preset rules are to instantiate the content in the code file into a class, for example, the code file can be converted into a corresponding language object by creating an object through a new statement, a newInstance method of a Class class, a newInstance method of a Constructor class, calling a clone() method of an object, deserialization, and other means.

[0069] As described in the above step S6, the language object replaces the placeholder tag in the preset template through the preset string replacement method to obtain the interface file. After obtaining the language object, fill it into the preset template to obtain the corresponding interface file, and the filling method is to input and sort each language object according to the format in the preset template to obtain the corresponding interface file. It should be noted that the interface file represents the content of the display screen, and the interface file can be directly regarded as the display screen, but due to the limitation of the display interface, and the relevant personnel may need to add some other instructions or interface design, the content in the interface file is only a part of the display screen. Therefore, it is only necessary to obtain the corresponding interface file, and the subsequent display part is not limited, and the relevant personnel can make reasonable designs according to their needs. Thereby, the automatic generation of the interface file is realized, without the need for developers to spend too much energy, and the method of generating the interface file only needs to obtain the corresponding preset template and the corresponding target table, which is highly flexible and can cope with various scenarios and has a wide range of effects.

[0070] In one embodiment, the step S2 of acquiring the corresponding target table based on the preset template includes:

[0071] S201: receiving table information of the target table;

[0072] S202: Setting a hyperlink of the target table in the preset template based on the table information;

[0073] S203: Acquire the target table through the hyperlink.

[0074] As described in the above steps S201-S202, the target table is obtained, that is, obtained through a hyperlink, and a hyperlink is set in the preset template, and the hyperlink is obtained based on the table information of the target table. In addition, if the same type of interface file needs to be set later, it is only necessary to replace the target table, that is, only by finding the version number and template number in the hyperlink, the automatic update and automatic filling of the writing template can be realized.

[0075] In one embodiment, the step S4 of converting the table contents into corresponding code characters and converting the table relations into language relations between the code characters to obtain a code file includes:

[0076] S401: using an interface provided by a Java parsing program to take a table header in the table content as an abstract class code text, and taking a corresponding table body as an implementation class code text of the abstract class, thereby obtaining the code text;

[0077] S402: Based on the abstract class code characters, the implementation class code characters and the table relationship, a language relationship between the code characters is obtained;

[0078] S403: Convert the language relationship into logical code text corresponding to Java, and combine the code text to obtain the code file.

[0079] As described in the above steps S401-S402, the table relationship of the code file including the hierarchical relationship and the characteristics of the merged cells is obtained, and it is converted into the parent-child relationship and the containing holding relationship in the Java language. First, through the interface api (Application Programming Interface) provided by the Java parsing program poi (Poor Obfuscation Implementation, a concise version of the fuzzy implementation), the file is read into the memory, the table header is used as the abstract class code text, the specific table body is used as the implementation class code text of the abstract class, the table header value is used as the attribute of the abstract class, and the table body value is used as the attribute value. If there are multiple specific categories, the table will describe the merged cells, the number of rows of subsequent values, and the number of groups in the array in the Java object, so as to realize the conversion of the table into a Java code file.

[0080] In one embodiment, after the step S1 of obtaining the preset template to be configured, the method further includes:

[0081] S211: reading the real-time display image of the preset template based on the preset Iframe technology, and displaying it in real time;

[0082] S212: Determine whether a modification instruction from the user is received;

[0083] S213: If yes, modify the parameters in the preset template based on the modification instruction.

[0084] As described in the above steps S211-S213, the modification of the interface file is realized, and a style display diagram can be generated through the IFrame technology of the front end. The developer can view the effect of the configuration at any time when configuring the template, and can click the link to view. The effect of this display is the same as the actual display effect. Therefore, in the process of automatically generating the interface file, the developer can monitor the process of automatically generating the interface file, so as to find problems in the preset template in time, so that the developer can make adjustments, thereby optimizing the preset template and the interface file, and making the effect of the automatically generated interface file better. IFrame is an HTML tag, which is equivalent to a document in a document, or a floating frame (FRAME). Its elements will create an inline frame (i.e., an inline frame) containing another document. Real-time display of the interface file can be achieved at the front end.

[0085] In one embodiment, after the step S6 of replacing the placeholder tag with the language object in the preset template by a preset string replacement method to obtain the interface file, the method further includes:

[0086] S701: receiving a table replacement instruction uploaded by a user and information of a replacement table to be replaced;

[0087] S702: Acquire the first keyword in the hyperlink to obtain the table relationship and table content;

[0088] S703: Replace the first keyword with a second keyword for obtaining the replacement table information; wherein the second keyword is used to obtain the table relationship and table content of the replacement table information.

[0089] As described in the above steps S701-S703, the rapid generation of the same type of interface files is achieved. That is, the table replacement instruction uploaded by the user and the table information to be replaced are received, and the keywords of the hyperlink are searched for replacement, wherein the keywords include the basic information of the table, such as the name information and location information of the table, so as to obtain the corresponding first keyword, and then replace the second keyword corresponding to the basic information of the replacement table information. It should be noted that the replacement table information and the table information in the hyperlink should be the same type of table for easy replacement, otherwise it is easy to cause the generated interface file to fail to meet the requirements.

[0090] In one embodiment, after the step S6 of replacing the placeholder tag with the language object in the preset template by a preset string replacement method to obtain the interface file, the method further includes:

[0091] S711: Send the interface file to the front end for preview display, and take a screenshot of the front end preview display screen by using a preset screenshot tool to obtain an interface display image;

[0092] S712: Determine whether the interface display image is consistent with the content of the interface file;

[0093] S713: If they are inconsistent, obtaining the first length and width of the image displayed on the front end;

[0094] S714: Adjusting the second length and width of the interface file according to the first length and width, so that the interface display image includes the interface file.

[0095] As described in the above steps S711-S714, the detection of the display interface image is realized. Due to the limitations of the display interface of the front end and the fact that the app end may make other modifications to the screen, the content in the interface display image is inconsistent with the interface file. Therefore, it is necessary to detect whether the interface display image and the interface file are consistent. The detection method can be through text recognition or image recognition. The image recognition method will be described in detail later and will not be repeated here. Then, when there is inconsistency, the first length and width of the front end display image, that is, the length and width, are obtained, and the interface file is adjusted according to the first length and width so that the interface display image includes the interface file, thereby realizing accurate display of the interface file.

[0096] In one embodiment, the step S712 of determining whether the interface display image is consistent with the content of the interface file includes:

[0097] S7121: grayscale the interface display image and the interface file to obtain a first grayscale image and a second grayscale image;

[0098] S7122: Calculate the average grayscale value A of all pixels in the mth column or the mth row of the first grayscale image. m 1, and calculating the average value B1 of the grayscale values ​​of all pixels in the first grayscale image; and

[0099] S7123: Calculate the average grayscale value A of all pixels in the mth column or the mth row of the second grayscale image m 2, and calculating the average value B2 of the grayscale values ​​of all pixels in the first grayscale image;

[0100] According to S7124: Calculate the overall variance of the mth column or mth row of the first grayscale image and the overall variance of the mth column or mth row of the second grayscale image Where N is the total number of columns or rows in the grayscale image, i = 1 or 2;

[0101] S7125: According to the formula Obtain the difference in overall variance between the mth column or the mth row of the first grayscale image and the second grayscale image

[0102] S7126: According to the difference of the population variance Determine whether the interface display diagram is consistent with the interface file.

[0103] As described in the above steps S7121-S7126, the comparison of the interface display image and the interface file is realized. Among them, grayscale refers to representing a color as a grayscale color. For example, in the RGB model, if R=G=B, the color represents a grayscale color, and the value of R=G=B is called the grayscale value. Therefore, each pixel of the grayscale image only needs one byte to store the grayscale value (also known as intensity value, brightness value), thereby reducing the storage amount. The grayscale range is, for example, 0-255 (when the values ​​of R, G, and B are all 0-255, of course, it will also change with the change of the value range of R, G, and B). The method of grayscale processing can be any method, such as component method, maximum value method, average value method, weighted average method, etc. Among them, since there are only 256 kinds of grayscale values, image comparison on this basis can greatly reduce the amount of calculation. Then calculate the average value A of the grayscale values ​​of all pixels in the mth column or mth row of the grayscale image m , and calculate the average grayscale value B of all pixels in the grayscale image. The process of calculating the average grayscale value Am of all pixels in the mth column or mth row of the grayscale image includes: collecting the grayscale values ​​of all pixels in the mth column or mth row of the grayscale image, summing the grayscale values ​​of all pixels in the mth column or mth row, and dividing the sum of the grayscale values ​​obtained by the summing by the number of all pixels in the mth column or mth row to obtain the average grayscale value Am of all pixels in the mth column or mth row of the grayscale image. The process of calculating the average grayscale value B of all pixels in the grayscale image includes: calculating the sum of the grayscale values ​​of all pixels in the grayscale image, and then dividing the sum of the grayscale values ​​by the number of pixels to obtain the average grayscale value B of all pixels in the grayscale image. According to the formula Calculate the overall variance of the mth column or mth row of the grayscale image Where N is the total number of columns or rows in the grayscale image. In this application, the overall variance is used to measure the average grayscale value A of the pixel points in the mth column or mth row of the grayscale image. m The difference between i and the average grayscale value B of all pixels in the grayscale image.

[0104] According to the formula Get the difference in the overall variance of the mth column or mth row of the two grayscale images in, is the population variance of the mth column or mth row of the first grayscale image, is the population variance of the mth column or mth row of the second grayscale image. The difference in population variance It reflects the difference in grayscale values ​​of the mth column or mth row of two grayscale images. When it is smaller, for example, 0, it indicates Equal to or approximately equal to It can be considered that the grayscale value of the mth column or mth row of the first grayscale image is the same or approximately the same as the grayscale value of the mth column or mth row of the second grayscale image (approximate judgment is made to save computing power, and because the overall variances of two different images are generally not equal, the accuracy of this judgment is very high), otherwise it is considered that the grayscale value of the mth column or mth row of the first grayscale image is different from the grayscale value of the mth column or mth row of the second grayscale image. Taking into account the system error and the possibility of differences in the table frame lines, a variance preset value can be set. When it is greater than the variance preset value, it is determined whether the interface display image and the interface file are consistent. When it is less than the variance preset value, it is determined that the interface display image and the interface file are inconsistent.

[0105] Reference Figure 2 The present invention also provides a device for generating an interface file, comprising:

[0106] The first acquisition module 10 is used to acquire a preset template to be configured; wherein the preset template includes a placeholder tag, and the placeholder tag is used to occupy the position of the language object;

[0107] A second acquisition module 20, configured to acquire a corresponding target table based on the preset template;

[0108] A third acquisition module 30 is used to acquire the table content in the target table and the table relationship between each cell; the table relationship includes a hierarchical relationship and a relationship between merged cells;

[0109] A first conversion module 40 is used to convert the table content into corresponding code characters, and convert the table relationship into a language relationship between the code characters to obtain a code file;

[0110] A second conversion module 50, configured to convert the code file into a corresponding language object according to a rule preset in the preset template;

[0111] The filling module 60 is used to replace the placeholder tag with the language object in the preset template through a preset string replacement method to obtain an interface file.

[0112] The beneficial effects of the present invention are as follows: by obtaining a preset template to be configured and a corresponding target table, converting the table content into corresponding code text, and converting the table relationship into a language relationship between the code text, a code file is obtained; according to the preset rules in the preset template, the code file is converted into a corresponding language object; in the preset template, the language object replaces the placeholder tag through a preset string replacement method to obtain an interface file. Thus, the automatic generation of the interface file is realized without the developer spending too much effort, and the method of generating the interface file only needs to obtain the corresponding preset template and the corresponding target table, which is highly flexible, can cope with various scenarios, and has a wide range of applications.

[0113] Reference Figure 3 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store various target tables, etc. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the method for generating an interface file described in any of the above embodiments can be implemented.

[0114] Those skilled in the art will understand that Figure 3 The structure shown in is merely a block diagram of a portion of the structure related to the present application solution and does not constitute a limitation on the computer device to which the present application solution is applied.

[0115] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for generating an interface file described in any of the above embodiments can be implemented.

[0116] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0117] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.

[0118] The embodiments of the present application can acquire and process relevant data 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.

[0119] 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.

[0120] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of the claims of the present invention.

Claims

1. A method for generating an interface file, characterized in that: include: Obtaining a preset template to be configured; wherein the preset template includes a placeholder tag, and the placeholder tag is used to occupy the position of the language object; Acquire a corresponding target table based on the preset template; Acquire the table content and the table relationship between each cell in the target table; the table relationship includes the hierarchical relationship and the relationship of merged cells; Convert the table contents into corresponding code characters, and convert the table relations into language relations between the code characters to obtain a code file; Convert the code file into a corresponding language object according to the rules preset in the preset template; In the preset template, the language object replaces the placeholder tag by a preset string replacement method to obtain an interface file; After the step of replacing the placeholder tag with the language object by a preset string replacement method in the preset template to obtain the interface file, the method further includes: The interface file is sent to the front end for display, and a screenshot of the screen displayed on the front end is taken using a preset screenshot tool to obtain an interface display image; Determine whether the interface display image is consistent with the content of the interface file; If they are inconsistent, get the first length and width of the image displayed on the front end; Adjust the second length and width of the interface file according to the first length and width, so that the interface display image includes the interface file; The step of determining whether the interface display image is consistent with the content of the interface file comprises: Grayscale the interface display image and the interface file to obtain a first grayscale image and a second grayscale image; Calculate the average grayscale value of all pixels in the mth column or mth row of the first grayscale image 1, and calculating the average value B1 of the grayscale values ​​of all pixels in the first grayscale image; and Calculate the average grayscale value of all pixels in the mth column or mth row of the second grayscale image 2, and calculating the average value B2 of the grayscale values ​​of all pixels in the first grayscale image; According to the formula , calculate the overall variance of the mth column or mth row of the first grayscale image and the overall variance of the mth column or mth row of the second grayscale image , where N is the total number of columns or rows in the grayscale image, i = 1 or 2; According to the formula , obtain the difference in overall variance between the mth column or the mth row of the first grayscale image and the second grayscale image ; According to the difference in the population variances Determine whether the interface display diagram is consistent with the interface file.

2. The method for generating an interface file according to claim 1, characterized in that: The step of acquiring the corresponding target table based on the preset template also includes: receiving table information of the target table; Setting a hyperlink of the target table in the preset template based on the table information; The target table is obtained through the hyperlink.

3. The method for generating an interface file according to claim 1, characterized in that: The steps of converting the table contents into corresponding code characters, and converting the table relations into language relations between the code characters to obtain a code file include: Using the interface provided by the Java parsing program, the table header in the table content is used as the abstract class code text, and the corresponding table body is used as the implementation class code text of the abstract class, thereby obtaining the code text; Based on the abstract class code characters, the implementation class code characters and the table relationship, a language relationship between the code characters is obtained; The language relationship is converted into logical code text corresponding to Java, and the code text is combined to obtain the code file.

4. The method for generating an interface file according to claim 1, characterized in that: After the step of obtaining the preset template to be configured, the method further includes: Read the real-time display image of the preset template based on the preset Iframe technology, and display it in real time; Determine whether a modification instruction from the user is received; If so, the parameters in the preset template are modified based on the modification instruction.

5. The method for generating an interface file according to claim 2, characterized in that: After the step of replacing the placeholder tag with the language object by a preset string replacement method in the preset template to obtain the interface file, the method further includes: Receive the form replacement instruction uploaded by the user and the replacement form information to be replaced; Obtaining a first keyword in the hyperlink to obtain the table relationship and table content; The first keyword is replaced with a second keyword for obtaining the replacement table information; wherein the second keyword is used to obtain the table relationship and table content of the replacement table information.

6. A device for generating an interface file, used to implement the method according to any one of claims 1 to 5, characterized in that: include: A first acquisition module is used to acquire a preset template to be configured; wherein the preset template includes a placeholder tag, and the placeholder tag is used to occupy the position of the language object; A second acquisition module, used to acquire a corresponding target table based on the preset template; A third acquisition module is used to acquire the table content in the target table and the table relationship between each cell; the table relationship includes a hierarchical relationship and a relationship between merged cells; A first conversion module is used to convert the table content into corresponding code characters, and convert the table relationship into a language relationship between the code characters to obtain a code file; A second conversion module, used to convert the code file into a corresponding language object according to the rules preset in the preset template; The filling module is used to replace the placeholder tag with the language object in the preset template through a preset string replacement method to obtain an interface file.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.