Data processing method and device, electronic equipment and readable medium

By acquiring page design data, determining page components, their layout attributes, and relative position information, and generating a page to be displayed, the problem of page layout disorder and inconsistency is solved, improving the accuracy of converting design data into pages and the efficiency of software design and development.

CN119045815APending Publication Date: 2024-11-29腾安基金销售(深圳)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311553398.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-17
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

During the page design process, the low precision of converting domain-specific languages ​​into page code leads to disordered page layouts and inconsistencies with the design drafts, affecting the execution efficiency of software design and development.

Method used

By acquiring page design data, determining page components and their layout attributes and relative position information, generating the page to be displayed, and establishing relative positional constraints between components, the consistency of page layout and conversion accuracy can be improved.

Benefits of technology

It improves the accuracy of converting design data into pages, avoids page layout errors, and enhances the execution efficiency of the software design and development process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119045815A_ABST
    Figure CN119045815A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, electronic equipment and a readable medium. The method comprises the steps of obtaining page design data of a to-be-displayed page, wherein the page design data comprises a page layout of the to-be-displayed page and element attributes of page elements; according to element attributes of page elements in the page design data, determining page components corresponding to the page elements and layout attributes of the page components in the to-be-displayed page; according to the layout attribute of the page component and the page layout of the to-be-displayed page, determining layout constraint information of the to-be-displayed page, the layout constraint information including relative position information of the page component relative to other page components in the to-be-displayed page; and generating a to-be-displayed page according to the layout attribute of the page component and the relative position information of the page component in the layout constraint information. The method can improve the execution efficiency in the software design and development process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the popularity of application software and the improvement of users' requirements for user experience, the page design of various application software has gradually become an important issue in the software development process. Nowadays, page design is usually produced by professional designers and then handed over to developers for implementation.

[0003] In the related art, the visual design of a page is usually generated by using a design tool and converted into page code through a domain-specific language. After the page code is corrected and edited again, the executable code of the page is generated to display the page.

[0004] However, in such processes, the conversion accuracy of the domain-specific language into page code is not high, and problems such as the converted page layout being disordered and inconsistent with the design draft often occur, resulting in the converted page being unusable and the need to redevelop the page based on the design data, which is not conducive to the execution efficiency of the software design and development process. Summary of the invention

[0005] Based on the above technical problems, the present application provides a data processing method, device, electronic device and readable medium to improve the execution efficiency in the software design and development process.

[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0007] According to one aspect of an embodiment of the present application, a data processing method is provided, including:

[0008] Acquire page design data of the page to be displayed, wherein the page design data includes the page layout of the page to be displayed and element attributes of page elements;

[0009] Determine, according to the element attributes of the page elements in the page design data, the page components corresponding to the page elements and the layout attributes of the page components in the page to be displayed;

[0010] Determining layout constraint information of the page to be displayed according to the layout attributes of the page component and the page layout of the page to be displayed, wherein the layout constraint information includes relative position information of the page component with respect to other page components in the page to be displayed;

[0011] The page to be displayed is generated according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information.

[0012] According to one aspect of an embodiment of the present application, a data processing device is provided, including:

[0013] A data acquisition module is configured to acquire page design data of a page to be displayed, wherein the page design data includes a page layout of the page to be displayed and element attributes of page elements;

[0014] An attribute determination module, configured to determine, according to the element attributes of the page elements in the page design data, the page components corresponding to the page elements and the layout attributes of the page components in the page to be displayed;

[0015] A constraint determination module, configured to determine layout constraint information of the page to be displayed according to the layout attributes of the page component and the page layout of the page to be displayed, wherein the layout constraint information includes relative position information of the page component with respect to other page components in the page to be displayed;

[0016] The page generation module is configured to generate the page to be displayed according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information.

[0017] In some embodiments of the present application, based on the above technical solution, the attribute determination module is specifically configured to: obtain the page component corresponding to the page element according to the element type in the element attributes and the correspondence between the element type and the page component; determine the layout attributes of the page component in the page to be displayed according to the element position information in the element attributes, and the element position information is used to indicate the position of the page element in the page to be displayed.

[0018] In some embodiments of the present application, based on the above technical solution, the attribute determination module is specifically configured as follows: if there is a corresponding page component for the element type in the element attributes, then the page component corresponding to the element type is obtained as the page component of the page element; if there is no corresponding page component for the element type in the element attributes, then according to the component tag of the page element, the page component corresponding to the component tag is obtained as the page component of the page element, and the component tag is used to indicate the correspondence between the page element and the page component.

[0019] In some embodiments of the present application, based on the above technical solution, the attribute determination module is specifically configured to: obtain the component template corresponding to the component name according to the component name of the page component corresponding to the component tag; replace the corresponding information in the component template with the element attributes of the page element, and generate a page component corresponding to the page element.

[0020] In some embodiments of the present application, based on the above technical solution, the page element includes a sub-page element; the attribute determination module is specifically configured to: according to the component name of the page component corresponding to the component tag, obtain the component resolution strategy corresponding to the component name and the component template corresponding to the component name; according to the component resolution strategy, respectively parse the element attributes of the page element and the element attributes of the sub-page element to obtain attribute information; replace the corresponding information in the component template with the attribute information to generate a page component corresponding to the page element and a sub-page component of the sub-page element.

[0021] In some embodiments of the present application, based on the above technical solution, the attribute determination module is specifically configured to: obtain the positioning information of the page component in the page to be displayed from the element position information according to the layout type of the page component, and the layout type is used to indicate the positioning method of the positioning information; obtain the element layout direction and component spacing of the page component in the page to be displayed according to the element position information in the element attributes; generate the layout attributes of the page component in the page to be displayed according to the positioning information, the element layout direction and the component spacing of the page component.

[0022] In some embodiments of the present application, based on the above technical solution, the layout type includes two key point positions; the attribute determination module is specifically configured to: according to the layout type corresponding to the page element, obtain the upper left coordinate and lower right coordinate of the page element in the page to be displayed as the positioning information of the page element in the page to be displayed.

[0023] In some embodiments of the present application, based on the above technical solution, the layout type includes key point positions and width values; the attribute determination module is specifically configured to: according to the layout type corresponding to the page element, obtain the specified point coordinates and width value of the page element in the page to be displayed as the positioning information of the page element in the page to be displayed.

[0024] In some embodiments of the present application, based on the above technical solution, the page design data also includes an element relationship tree, and the element relationship tree is used to indicate the dependency relationship between page elements; the attribute determination module is specifically configured as: if there is no element position information in the element attribute, then the parent element and sibling elements of the page element are determined according to the dependency relationship between the page elements in the element relationship tree; according to the element position information of the parent element and the sibling elements and the proportional relationship between the element size and the element size of the page element, the positioning information of the page component in the page to be displayed is determined.

[0025] In some embodiments of the present application, based on the above technical solution, the page design data also includes an element relationship tree, and the element relationship tree is used to indicate the dependency relationship between page elements; the attribute determination module is specifically configured to: determine the component type of the page component corresponding to the page element according to the element attribute of the page element, and the component type is used to indicate the information type of the information displayed in the page component; determine the positioning information of the page component in the page to be displayed according to the positioning strategy corresponding to the component type.

[0026] In some embodiments of the present application, based on the above technical solution, the constraint determination module is further configured to: determine, according to the page layout of the page to be displayed, the first associated component adjacent to the page component on the horizontal axis and the second associated component adjacent to the page component on the vertical axis in the page layout of the page to be displayed; determine the relative component spacing between the page component and the first associated component and the second associated component according to the layout properties of the page component, the layout properties of the first associated component and the layout properties of the second associated component; determine the layout constraint information of the page to be displayed according to the relative component spacing between each page component.

[0027] In some embodiments of the present application, based on the above technical solution, the page generation module is also configured to: receive a page upload request from a client; upload the code file and resource file of the page to be displayed to a page server according to the page upload request to construct the page to be displayed; generate page access information of the page to be displayed according to a page construction response of the page server, and the page access information is used to access the page to be displayed on the page server; send an upload identifier corresponding to the page upload request to the client, and the upload identifier is used to obtain the page access information.

[0028] In some embodiments of the present application, based on the above technical solution, the data acquisition module is specifically configured to: generate an element relationship tree of page elements in the page to be displayed according to the dependency relationship between page elements in the page to be displayed; filter and merge the page elements and element attributes of the page elements according to the hierarchical relationship between page elements in the element relationship tree to obtain page design data of the page to be displayed.

[0029] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute a data processing method as in the above technical solution by executing the executable instructions.

[0030] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the data processing method in the above technical solution is implemented.

[0031] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data processing method provided in the above-mentioned various optional implementations.

[0032] In an embodiment of the present application, when generating a page to be displayed, first obtain page design data including the page layout of the page to be displayed and the element attributes of the page elements, then determine the page components corresponding to the page elements and the layout attributes of the page components in the page to be displayed according to the element attributes of the page elements in the page design data, and also determine the layout constraint information including the relative position information between the page components in the page to be displayed according to the layout attributes of the page components and the page layout of the page to be displayed, and finally generate the page to be displayed according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information. By establishing constraint information including the relative position relationship between the components in the page during the process of generating the page to be displayed, and then generating the page to be displayed according to the constraint information, it is possible to avoid confusion in the page layout and improve the consistency between the page to be displayed and the page layout in the page design data, thereby improving the accuracy of converting the design data into pages and avoiding the page development work caused by the unavailability of the converted pages, which is conducive to improving the execution efficiency in the software design and development process.

[0033] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0035] Figure 1 Schematic diagram of a system architecture applied to a data processing solution according to an embodiment of the present application.

[0036] Figure 2 This is a schematic flowchart of the process of converting a design draft into page code in an embodiment of the present application.

[0037] Figure 3 A flow chart of a data processing method according to an embodiment of the present application is shown.

[0038] Figure 4 This is a schematic flowchart of the deployment process of the page to be displayed in an embodiment of the present application.

[0039] Figure 5 A flow chart of a data processing method according to an embodiment of the present application is shown.

[0040] Figure 6 A flow chart of a data processing method according to an embodiment of the present application is shown.

[0041] Figure 7 A flow chart of a data processing method according to an embodiment of the present application is shown.

[0042] Figure 8 A flow chart of a data processing method according to an embodiment of the present application is shown.

[0043] Fig. 9 The following is a schematic flowchart of determining layout constraint information in an embodiment of the present application.

[0044] Fig.10 It is a schematic flowchart of the overall process of data processing in the embodiment of the present application.

[0045] Fig.11 The block diagram schematically shows the composition of the data processing device in the embodiment of the present application.

[0046] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0047] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.

[0048] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0049] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0050] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0051] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0052] It should be understood that the solution of the present application can be applied in the process of software page design and development, and is specifically applied in the process of converting page design data into software page code. Specifically, in the process of software page design and development, designers usually design the performance and layout of the page, and the page layout usually includes what content to be displayed in the page and the location, form, size of each content, and the relationship with other elements. Information. Designers usually use design software specifically used for design work to design, and these design software will output design data and become design drafts. The description form of the page in the design draft is usually different from the description form used in the development process. Therefore, after the design draft is completed, the design draft needs to be converted into the description form of the page in the development process, for example, the design logic language used in the design draft is converted into a development logic language. The design logic language itself is usually a domain-specific language, or it will be converted into a domain-specific language. Domain Specific Language (DSL) is a computer programming language with limited expressiveness for a specific domain. That is to say, the page design described by the domain specific language is limited to the design field and cannot be directly used in the development field. The design language needs to be converted into a general programming language used in the development field so that it can run in a unified manner with the developed system. The solution of this application can be applied in the process of converting a design draft into a page described by a program code.

[0053] With the popularization of application software and the improvement of user experience requirements, the page design of various application software has gradually become an important issue in the software development process. Nowadays, page design is usually produced by professional designers and then handed over to developers for implementation. In related technologies, the visual design draft of the page is usually generated by using a design tool and converted into page code through a domain-specific language. After the page code is corrected and edited twice, the executable code of the page is generated to display the page. However, in this process, the conversion accuracy of the process in which the domain-specific language is converted into the page code is not high. There are often problems such as the layout of the converted page being disordered and inconsistent with the design draft, which makes the converted page unusable and needs to be redeveloped according to the design data, which is not conducive to the execution efficiency in the software design and development process.

[0054] Based on this, the technical solution of the embodiment of the present application proposes a data processing solution. Specifically, Figure 1As shown, the system architecture 100 applied to the data processing solution according to the embodiment of the present application may include a terminal device 110, a network 120, a server 130 and a server 140. The terminal device 110 may include a smart phone, a tablet computer, a laptop computer, an intelligent voice interaction device, a smart home appliance, a vehicle terminal, an aircraft, etc. The server 130 and the server 140 are servers that provide various front-end and back-end service functions. They can be independent physical servers, or server clusters or distributed systems composed of multiple physical servers. They can also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network) and big data and artificial intelligence platforms. The network 120 can be a communication medium of various connection types that can provide communication links between the terminal device 110, the server 130 and the server 140, for example, it can be a wired communication link or a wireless communication link.

[0055] According to the implementation needs, the system architecture in the embodiment of the present application can have any number of terminal devices, networks and servers. For example, the server 130 and the server 140 can be a server group composed of multiple server devices. In addition, the technical solution provided in the embodiment of the present application can be applied to the terminal device 110, can also be applied to the server 130, or can be implemented by the terminal device 110 and the server 130 together, and the present application does not make special restrictions on this. In the embodiment of the present application, the server 130 can be a server that provides data processing services, and the server 140 can be a server that provides page deployment and display functions, and the terminal device 110 can be a terminal used by a designer or developer, on which design software or a data processing terminal is deployed, so as to communicate with the server 130. The designer or developer uploads the design draft to the server through the terminal device 110 and makes a request to convert the design draft into a page code, and the server 130 converts the received design draft into a page code according to the request. The server will deploy the converted page code to server 140, and server 140 will provide the access address of the deployed page to terminal device 110 through server 130. Terminal device 110 accesses the deployed page according to the received access address to check the conversion result and view the page effect of the design draft.

[0056] Specifically, see Figure 2 , Figure 2 Schematic flow chart of the process of converting a design draft into page code in the embodiment of the present application. Figure 2As shown, after the design draft is submitted to the server, a part of the logic processing will be performed first, which mainly includes parsing the data of the design draft according to the corresponding rules, so as to generate an intermediate description using the domain-specific language DSL. Specifically, the design draft usually adopts the description form of the design software. Through the interface provided by the design software, the various elements in the design draft can be obtained, and these elements are converted to obtain the intermediate description. Subsequently, the intermediate description needs to undergo further logic processing, which mainly includes the process of converting the description of the DSL into page code, such as replacing each element with the corresponding code component, and determining the layout of these components in the page, so as to obtain the page code matching the design draft. In the process of conversion, part of the content can be entrusted to the artificial intelligence model to optimize and adjust the generated code, for example, through models such as OpenAI and Qpilot to optimize the code content or related descriptions. The code output by the logic processing and artificial intelligence model is integrated according to the code logic to obtain the final page code.

[0057] The implementation details of the technical solution of the embodiment of the present application are described in detail below: Figure 3 A flow chart of a data processing method according to an embodiment of the present application is shown. The data processing method can be specifically executed by a server having a function of converting design data into page code, for example, by a server or terminal device where a system for performing page verification testing is located. Figure 3 As shown, the data processing method at least includes steps S310 to S340, which are described in detail as follows:

[0058] Step S310, obtaining page design data of the page to be displayed, wherein the page design data includes the page layout of the page to be displayed and element attributes of page elements.

[0059] In this embodiment, the page design data is the data generated after the designer designs the page to be displayed, and can also be considered as data generated according to the design draft. The page design data will include the page layout of the page to be displayed and the element attributes of the page elements. The page layout includes the distribution status of the page elements in the page to be displayed, such as the pixel coordinates in the page. Page elements refer to various design-end components contained in the page to be displayed, which are usually described in the design-end language. These page elements include visible elements and invisible elements. Visible elements refer to elements that can be directly seen in the page to be displayed, such as text, pictures, and interactive buttons, while invisible elements are structural elements of the page to be displayed, such as containers or forms for placing other elements. The specific information or status of different page elements is described by the element attributes of the page elements. Element attributes include the type, content, position, description information, relationship with other elements, and size of the page element.

[0060] Step S320, determining the page component corresponding to the page element and the layout attribute of the page component in the page to be displayed according to the element attribute of the page element in the page design data.

[0061] Page components are development-side components corresponding to page elements. These page components can be written by code on the development side. For some page elements, there will be corresponding page components on the development side. For example, if there is a button element in the page design data, there will also be a corresponding button component on the development side for this button element. The button element in the page design data mainly describes the page design content such as the position, size, color of the button and the text on the button, and the button component on the development side will also contain this information, and will further include the functions that the button component needs to implement, such as the click function of the button or the color change or dynamic effect when the pointer points to the button. The layout attributes of the page component in the page to be displayed refer to the information required to display the page component, and its own related attributes, such as attributes such as the position, size and alignment of the page component.

[0062] Step S330, determining layout constraint information of the page to be displayed according to the layout attributes of the page component and the page layout of the page to be displayed, wherein the layout constraint information includes relative position information of the page component with respect to other page components in the page to be displayed.

[0063] The server can determine the relative position relationship between each page component according to the page layout of the page to be displayed, thereby obtaining the layout constraint information. The relative position information of the page component relative to other page components in the layout constraint information generally refers to the relative position and relative distance between the page component and the closest other components. These relative positions and relative distances can be determined by the page layout of the page to be displayed. For example, the relative position and relative distance between the corresponding two page components can be directly determined according to the relative position and relative distance of the two page elements in the page layout. For example, there is a table component and an image component on the side of a button component, and the layout constraint information may include the relative position and relative distance between the button component and the table component and the image component, such as being located below the table component and the distance is 200, and being located to the right of the image component and the distance is 300, etc. The layout constraint information generally includes the relative positions between the various page components of the page to be displayed, and the layout constraint information is generally formed in a predetermined order, for example, from the bottom to the top according to the hierarchy of the page component or from the upper left to the lower right according to the layout of the page component in the page, etc.

[0064] Step S340: generating the page to be displayed according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information.

[0065] The server can generate a page to be displayed based on the layout properties of the page components and the relative position information of the page components in the layout constraint information. Specifically, the server will package the code of each page component, the description file of the corresponding layout properties, the resource files such as pictures required by the component content, and the files of relative position information into a page file package of the page to be displayed, and deploy the page file package to the corresponding server for user access to check the display effect of the generated page to be displayed. In some embodiments, for some pictures that meet specific requirements, such as background resources with rounded corners or strokes, the server will also convert the corresponding element attributes into a specified file through an additional model, such as into an XML file, and package other files of the page to be displayed into the final page file package.

[0066] In an embodiment of the present application, when generating a page to be displayed, first obtain page design data including the page layout of the page to be displayed and the element attributes of the page elements, then determine the page components corresponding to the page elements and the layout attributes of the page components in the page to be displayed according to the element attributes of the page elements in the page design data, and also determine the layout constraint information including the relative position information between the page components in the page to be displayed according to the layout attributes of the page components and the page layout of the page to be displayed, and finally generate the page to be displayed according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information. By establishing constraint information including the relative position relationship between the components in the page during the process of generating the page to be displayed, and then generating the page to be displayed according to the constraint information, it is possible to avoid confusion in the page layout and improve the consistency between the page to be displayed and the page layout in the page design data, thereby improving the accuracy of converting the design data into pages and avoiding the page development work caused by the unavailability of the converted pages, which is conducive to improving the execution efficiency in the software design and development process.

[0067] In some optional embodiments, based on the embodiments of the present application, after generating the page to be displayed according to the layout attributes of the page component and the relative position information of the page component in the layout constraint information, the server further deploys the generated page to be displayed to the page server to display the page to be displayed. Specifically, the server will receive a page upload request from the client. The client will initiate a page upload request by requesting a page. The submission interface provided by the server will be implemented in the request page. The submission interface is triggered in the page upload request, and the server will upload the code file and resource file of the page to be displayed to the page server according to the page upload request to build the page to be displayed. Specifically, the server will decompress the code file and resource file, pull the code library required in the file, merge the decompressed file with the pulled code library into an upload file and push it to the warehouse of the page server. After receiving the submission of the warehouse, the page server will execute the construction process of the uploaded page to be displayed, and execute the script plug-in after the construction is completed, and then call the server's R&D interface to notify the server that the construction is completed. The server's R&D interface will trigger a page construction response, and the server will generate page access information for the page to be displayed based on the page server's page construction response. The page access information is used to access the page to be displayed on the page server. For example, it can be an access link to the page to be displayed and a QR code for the access link. The page access information and the corresponding upload identifier will be written to the server's cache. After the server uploads the code file and resource file of the page to be displayed to the page server, it will send an upload identifier corresponding to the page upload request to the client. The client can poll the server's cache based on the upload identifier through the result query interface provided by the server to obtain the page access information generated by the server. Specifically, for ease of introduction, please refer to Figure 4 , Figure 4 Schematic flow chart of the deployment process of the page to be displayed in the embodiment of the present application. Figure 4As shown, the web page will request to submit the compressed file of the page to be displayed. The server obtains the compressed file through the submission interface and decompresses it, and then submits it to the warehouse through the submission command of the warehouse. The page server obtains the submitted file from the warehouse and executes the script plug-in to complete the deployment of the page to be displayed. Subsequently, the page server notifies the server of the completion of the deployment through the development interface. The server obtains the access link of the page to be displayed, and then generates a QR code image of the link. The link and the QR code image will be written to the server's cache, and the web page can search the server's cache through the result interface according to the upload identifier to obtain the access link and the QR code image. By uploading the code file and resource file of the page to be displayed to the page server for deployment according to the user's request, and providing the page access information of the page to be displayed to the client, the result of the generated page to be displayed can be quickly detected, which is conducive to improving the efficiency of design and modification.

[0068] In some optional embodiments, based on the embodiments of the present application, in the process of obtaining the page design data of the page to be displayed, the server will generate an element relationship tree of the page elements in the page to be displayed according to the dependency relationship between the page elements in the page to be displayed, and then filter and merge the page elements and the element attributes of the page elements according to the hierarchical relationship between the page elements in the element relationship tree to obtain the page design data of the page to be displayed. Specifically, the server will convert the design draft code written in the design language into an intermediate representation as the page design data of the page to be displayed. First, the server will parse the design draft of the page to be displayed through the interface of the design language. The design draft of the page to be displayed will contain the dependency relationship between the page elements, and the element relationship tree of the page elements can be generated according to these dependency relationships. For example, a container contains a table component, a text component and a button component, then in the element relationship tree, the nodes of the table component, the text component and the button component are at the same level, and their common upper node is the node of the corresponding container. For the hierarchical relationship between page elements in the element relationship tree, the server will filter and merge the page elements and the element attributes of the page elements by removing invalid levels, merging redundant levels, merging pictures, and attribute conversion, thereby forming the page design data of the page to be displayed. Specifically, there are often useless blank elements or repeated elements in the design draft, which can be identified and deleted or merged in the element relationship tree. In addition, the same pictures at the same level can be merged into one picture. Attribute conversion is the conversion between the design language of the design draft and the domain-specific language of the intermediate representation. In this embodiment, by generating page design data, the language rules of the design end can be isolated from the rules of the development end. When the rules of the design end change, it is only necessary to adjust the conversion logic between the design end and the page design data, without modifying the conversion logic between the page design data and various development languages, thereby enhancing the flexibility of the solution.

[0069] In the embodiments of the present application, it is also proposed to Figure 3 Other embodiments that refine the technical solution of the embodiment shown in the figure are as follows Figure 5 As shown, in a data processing method of an embodiment of the present application, the following steps may be specifically included:

[0070] Step S510, obtaining page design data of the page to be displayed, wherein the page design data includes the page layout of the page to be displayed and element attributes of page elements.

[0071] Optionally, the implementation details of step S510 are the same as Figure 3 The step S310 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.

[0072] Step S520, obtaining a page component corresponding to the page element according to the element type in the element attribute and the correspondence between the element type and the page component;

[0073] Step S530: determining the layout attributes of the page component in the page to be displayed according to the element position information in the element attributes, wherein the element position information is used to indicate the position of the page element in the page to be displayed.

[0074] In this embodiment, in the process of determining the page component and layout attributes, the server will obtain the page component corresponding to the page element according to the element type in the element attribute and the corresponding relationship between the element type and the page component. The element type is usually divided according to the type of information displayed by the page element or the purpose of the page element. For example, according to the information displayed, the element type can include text elements, image elements or link elements, etc., and according to the purpose, it can include container elements or content elements, etc. The corresponding relationship between the element type and the page component is usually a predetermined corresponding relationship. For example, the text element in the page element will correspond to the text component in the page component. Specifically, there will be a directly corresponding page component for some page elements, such as a text component or an image component. There is no directly corresponding component for some components. For such components, the server will pre-deploy corresponding custom components. For example, for a picture with rounded corners, the picture component directly corresponding to the picture element does not support the display of the rounded corner picture well, and the rounded corner picture component corresponding to the rounded corner picture will be pre-deployed in the server. The information of the element type and the rounded corner picture will be included in the element attribute.

[0075] Element position information is information for indicating the position of a page element in a page to be displayed, such as coordinate information. The server determines the layout attributes of the corresponding page component in the page to be displayed according to the position of the page element in the page to be displayed. Layout attributes are information for describing the position of the page component in the page to be displayed. It is understandable that the position described by the layout attributes and the position described by the element position information are usually the same or similar positions in the page to be displayed, or the positions with the same or similar relative positions. Therefore, the server can directly determine the layout attributes of the page component in the page to be displayed according to the element position information in the element attributes of the page element. For example, when the size of the page to be displayed remains unchanged, the positioning data in the element position information can be directly used as the positioning data of the layout attributes, or the positioning data in the layout attributes can be calculated according to the positioning data in the element position information according to the scaling ratio of the page to be displayed. In an embodiment of the present application, the page element is converted into a page component and its layout attributes according to the element attributes in the page design data, and no complex model is required to carry out the conversion process, which is conducive to improving the processing speed of the solution.

[0076] Step S540, determining layout constraint information of the page to be displayed according to the layout attributes of the page component and the page layout of the page to be displayed, wherein the layout constraint information includes relative position information of the page component with respect to other page components in the page to be displayed.

[0077] Optionally, the implementation details of step S540 are the same as Figure 3 The step S330 shown in FIG. 1 is consistent with the step S330 shown in FIG. 1 and will not be repeated here.

[0078] Step S550: generating the page to be displayed according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information.

[0079] Optionally, the implementation details of step S550 are the same as Figure 3 The step S340 shown in FIG. 1 is consistent with the step S340 shown in FIG. 1 and will not be repeated here.

[0080] In an embodiment of the present application, when generating a page to be displayed, first obtain page design data including the page layout of the page to be displayed and the element attributes of the page elements, then determine the page components corresponding to the page elements and the layout attributes of the page components in the page to be displayed according to the element attributes of the page elements in the page design data, and also determine the layout constraint information including the relative position information between the page components in the page to be displayed according to the layout attributes of the page components and the page layout of the page to be displayed, and finally generate the page to be displayed according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information. By establishing constraint information including the relative position relationship between the components in the page during the process of generating the page to be displayed, and then generating the page to be displayed according to the constraint information, it is possible to avoid confusion in the page layout and improve the consistency between the page to be displayed and the page layout in the page design data, thereby improving the accuracy of converting the design data into pages and avoiding the page development work caused by the unavailability of the converted pages, which is conducive to improving the execution efficiency in the software design and development process.

[0081] In the embodiments of the present application, it is also proposed to Figure 5 Other embodiments that refine the technical solution of the embodiment shown in the figure are as follows Figure 6 As shown, in a data processing method of an embodiment of the present application, the following steps may be specifically included:

[0082] Step S610, obtaining page design data of the page to be displayed, wherein the page design data includes the page layout of the page to be displayed and element attributes of page elements.

[0083] Optionally, the implementation details of step S610 are the same as Figure 3 The step S310 shown in FIG. 1 is consistent with the step S310 shown in FIG. 1 and will not be described in detail.

[0084] In this embodiment, for a part of the page elements in the page design data on the design side, there are corresponding native components on the development side, such as text boxes or buttons. For the other part, the element type of the page element itself in the page to be displayed may not have a corresponding page component, that is, some page elements are specific elements or combination elements on the design side, and there is no direct corresponding component on the development side. The development side will additionally deploy corresponding specific page components for such page elements. However, such page elements need to be additionally marked in the page design data of the page to be displayed for identification. For each page element, the server will check whether there is a corresponding page component for the element type in the element attributes. If so, step S620 will be executed. If not, step S630 will be executed.

[0085] Step S620: Acquire a page component corresponding to the element type as the page component of the page element.

[0086] Optionally, the implementation details of step S620 are the same as Figure 5 The step S520 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.

[0087] Step S630: According to the component tag of the page element, a page component corresponding to the component tag is obtained as the page component of the page element, wherein the component tag is used to indicate the corresponding relationship between the page element and the page component.

[0088] Specifically, component tags are similar to element types and can be used to represent corresponding page components. The server can retrieve the corresponding page component from a predetermined correspondence as the page component of the page element based on the component tag of the page element. Page elements with component tags are usually not strictly componentized on the development side, but these components are reused in specific scenarios. The development side will deploy corresponding specified page components for such page elements. Usually, these specified page components are written separately for the page elements and deployed on the server. Component tags can be manually annotated in the page design data of the page to be displayed, or they can be recognized by an artificial intelligence model or by adding additional annotations to the element attributes of the page element. By converting the specified page element into the corresponding page component through the component tag, page elements that do not have a native corresponding component can also be directly determined and converted into page components, thereby increasing the types of elements in the process of converting page elements into page components and improving the flexibility of the solution.

[0089] Step S640: Determine the layout attributes of the page component in the page to be displayed according to the element position information in the element attributes, wherein the element position information is used to indicate the position of the page element in the page to be displayed.

[0090] Optionally, the implementation details of step S640 are the same as Figure 5 The step S530 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.

[0091] Step S650, determining layout constraint information of the page to be displayed according to the layout attributes of the page component and the page layout of the page to be displayed, wherein the layout constraint information includes relative position information of the page component with respect to other page components in the page to be displayed.

[0092] Optionally, the implementation details of step S650 are the same as Figure 3 The step S330 shown in FIG. 1 is consistent with the step S330 shown in FIG. 1 and will not be repeated here.

[0093] Step S660: Generate the page to be displayed according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information.

[0094] Optionally, the implementation details of step S660 are the same as Figure 3 The step S340 shown in FIG. 1 is consistent with the step S340 shown in FIG. 1 and will not be repeated here.

[0095] In an embodiment of the present application, when generating a page to be displayed, first obtain page design data including the page layout of the page to be displayed and the element attributes of the page elements, then determine the page components corresponding to the page elements and the layout attributes of the page components in the page to be displayed according to the element attributes of the page elements in the page design data, and also determine the layout constraint information including the relative position information between the page components in the page to be displayed according to the layout attributes of the page components and the page layout of the page to be displayed, and finally generate the page to be displayed according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information. By establishing constraint information including the relative position relationship between the components in the page during the process of generating the page to be displayed, and then generating the page to be displayed according to the constraint information, it is possible to avoid confusion in the page layout and improve the consistency between the page to be displayed and the page layout in the page design data, thereby improving the accuracy of converting the design data into pages and avoiding the page development work caused by the unavailability of the converted pages, which is conducive to improving the execution efficiency in the software design and development process.

[0096] In some optional embodiments, based on the embodiments of the present application, in the process of obtaining the page component corresponding to the component tag as the page component of the page element according to the component tag of the page element, the server specifically obtains the component template corresponding to the component name according to the component name of the page component corresponding to the component tag, and then replaces the corresponding information in the component template by the element attribute of the page element to generate the page component corresponding to the page element. The page element of the page to be displayed usually contains child elements, which are supplements to the parent element. For example, the child elements of the avatar element may contain decorative elements of the avatar, such as avatar frames or dynamic effects. In this embodiment, after determining the corresponding page component of the page element, the server does not need to perform specific analysis operations on its child elements. Specifically, the page element contains two categories, one of which is that after determining the page component of the page element, the server does not need to further analyze the child elements of the element, because the determined page component already contains the component corresponding to its child elements. The other element is that after determining the page component of the page element, the server needs to parse its child elements, but does not need to parse the specific information of the child elements. For example, for a component with a specific layout, the server will only parse the layout of the sub-elements, but will not parse the specific content of the sub-elements. Regardless of whether the sub-elements are text or images, the components of these sub-elements are already supported in the determined page components, but their layout needs to be parsed by the server. For these two types of elements, the server can directly obtain the corresponding component template based on the component name of the page component. The component template can be considered as the standard implementation code of the component, and the server needs to replace the corresponding information in the component template according to the element attributes of the page element, such as filling in various information such as the component name and size, so as to generate the page component of the page element.

[0097] In some optional embodiments, based on the embodiments of the present application, the page element includes a sub-page element; in the process of obtaining the page component corresponding to the component tag as the page component of the page element according to the component tag of the page element, the server first obtains the component parsing strategy corresponding to the component name and the component template corresponding to the component name according to the component name of the page component corresponding to the component tag, and then parses the element attributes of the page element and the element attributes of the sub-page element according to the component parsing strategy, respectively, to obtain attribute information, and finally replaces the corresponding information in the component template with the attribute information to generate the page component corresponding to the page element and the sub-page component of the sub-page element. In this embodiment, the server needs to further parse the sub-page elements of the page element. For example, a custom button component has a specific background and text. In the page design data, the button component is usually composed of multiple elements, such as background elements, text elements and button body elements. After determining the button component corresponding to the button element, the server also needs to further parse the sub-page elements of the button element, that is, the background element and the text element, and specifically needs to parse out the background information used in the background element and the text content contained in the text element. For such elements, a pre-established component parsing strategy will be deployed in the server, for example, it may be a portable parsing code for the element. The server can obtain the corresponding component parsing strategy and component template according to the component name. According to the component parsing strategy, the server can analyze the specific content of the element attributes of the page element and the element attributes of each sub-page element as attribute information. These attribute information are then used to replace the corresponding information in the component template to generate a page component corresponding to the page element and a sub-page component of the sub-page element. It can be understood that the component template will also include a sub-template for the sub-page component. By formulating a component parsing strategy for a specific component to parse the sub-page elements, the solution's ability to parse page elements can be improved, thereby improving the solution's processing capabilities.

[0098] In the embodiments of the present application, it is also proposed to Figure 5 Other embodiments that refine the technical solution of the embodiment shown in the figure are as follows Figure 7 As shown, in a data processing method of an embodiment of the present application, the following steps may be specifically included:

[0099] Step S710, obtaining page design data of the page to be displayed, wherein the page design data includes the page layout of the page to be displayed and element attributes of the page elements.

[0100] Optionally, the implementation details of step S710 are the same as Figure 3 The step S310 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.

[0101] Step S720: Obtain the page component corresponding to the page element according to the element type in the element attribute and the correspondence between the element type and the page component.

[0102] Optionally, the implementation details of step S720 are the same as Figure 5 The step S520 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.

[0103] Step S730, according to the layout type of the page component, obtaining the positioning information of the page component in the page to be displayed from the element position information, wherein the layout type is used to indicate the positioning method of the positioning information, and the element position information is used to indicate the position of the page element in the page to be displayed;

[0104] Step S740, obtaining the element layout direction and component spacing of the page component in the page to be displayed according to the element position information in the element attribute;

[0105] Step S750: Generate layout attributes of the page component in the page to be displayed according to the positioning information of the page component, the element layout direction and the component spacing.

[0106] In this embodiment, the server parses the element position information in the element attributes to determine the layout attributes of the page component. In general, the layout attributes of a component mainly include three dimensions, component positioning, component direction and component spacing. Specifically, different types of page components have their corresponding layout types. Generally, the layout type is divided into two types, namely fixed layout and adaptive layout. Fixed layout means that the size of the component is fixed, that is, the length and width are fixed values, and usually will not change with the size of the page to be displayed, or will only scale proportionally with the page to be displayed. The adaptive layout will automatically adjust according to the position of the component, the relative position with other components, or the properties or content of the component itself. For example, a button component can be a fixed layout with a fixed size, while a text box can be an adaptive layout, and the width and length vary with the font size and string length. The positioning methods of page components of different layout types are usually different. Generally divided into three categories, two-point positioning, single-point plus width positioning and single-point positioning. Two-point positioning is to determine its position by two diagonal points of the component, such as the position of the upper left corner and the lower right corner. Single-point plus width positioning is positioning by an edge position and component width of the component, such as the position of the upper left corner of the component and the width of the component. Single-point positioning is positioning the component by a fixed point, such as the point at the upper left corner of the component. According to the information required by the layout type, the server obtains the positioning information of the page component in the page to be displayed from the element position information. For example, for two-point positioning, the coordinates of the two points in the page to be displayed are obtained. After determining the positioning information of the page component, the server can determine the element layout direction and component spacing of the page component in the page to be displayed according to the element position information. The element layout direction refers to the extension direction or arrangement direction of the component, such as horizontal or vertical. The component spacing indicates the spacing values ​​of each item of the component, such as the spacing between each element in the component. Taking the button component as an example, the component spacing may include the position of the text element in the button component in the button body element, and the position of the background element relative to the button body element. After determining the positioning information, element layout direction and component spacing of the page component, the server generates the layout properties of the page component based on this information. In this embodiment, the positioning information of the page component, the element layout direction and the component spacing are determined according to the element position information, and a specific method for determining the layout attributes is provided, which is beneficial to the operability of the solution.

[0107] Step S760, determining layout constraint information of the page to be displayed according to the layout attributes of the page component and the page layout of the page to be displayed, wherein the layout constraint information includes relative position information of the page component with respect to other page components in the page to be displayed.

[0108] Optionally, the implementation details of step S760 are the same as Figure 3The step S330 shown in FIG. 1 is consistent with the step S330 shown in FIG. 1 and will not be repeated here.

[0109] Step S770: Generate the page to be displayed according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information.

[0110] Optionally, the implementation details of step S770 are the same as Figure 3 The step S340 shown in FIG. 1 is consistent with the step S340 shown in FIG. 1 and will not be repeated here.

[0111] In an embodiment of the present application, when generating a page to be displayed, first obtain page design data including the page layout of the page to be displayed and the element attributes of the page elements, then determine the page components corresponding to the page elements and the layout attributes of the page components in the page to be displayed according to the element attributes of the page elements in the page design data, and also determine the layout constraint information including the relative position information between the page components in the page to be displayed according to the layout attributes of the page components and the page layout of the page to be displayed, and finally generate the page to be displayed according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information. By establishing constraint information including the relative position relationship between the components in the page during the process of generating the page to be displayed, and then generating the page to be displayed according to the constraint information, it is possible to avoid confusion in the page layout and improve the consistency between the page to be displayed and the page layout in the page design data, thereby improving the accuracy of converting the design data into pages and avoiding the page development work caused by the unavailability of the converted pages, which is conducive to improving the execution efficiency in the software design and development process.

[0112] In some optional embodiments, based on the embodiments of the present application, the layout type includes two key point positions; in the process of obtaining the positioning information of the page element in the page to be displayed according to the layout type corresponding to the page element, the server will obtain the upper left coordinate and the lower right coordinate of the page element in the page to be displayed according to the layout type corresponding to the page element, as the positioning information of the page element in the page to be displayed. In this embodiment, the positioning information of the page element is determined by two coordinates, so that the amount of positioning information can be simplified and the processing efficiency of the solution can be improved.

[0113] In some optional embodiments, based on the embodiments of the present application, the layout type includes the key point position and the width value; in the process of obtaining the positioning information of the page element in the page to be displayed according to the layout type corresponding to the page element, the server will obtain the coordinates and width value of the specified point of the page element in the page to be displayed according to the layout type corresponding to the page element, as the positioning information of the page element in the page to be displayed. In this embodiment, the positioning information of the page element is determined by two coordinates, so that the amount of positioning information can be simplified and the processing efficiency of the solution can be improved.

[0114] In some optional embodiments, based on the embodiments of the present application, the page design data further includes an element relationship tree, and the element relationship tree is used to indicate the dependency relationship between page elements. If the element location information does not exist in the element attribute, the server will determine the parent element and the sibling element of the page element according to the dependency relationship between the page elements in the element relationship tree, and then determine the positioning information of the page component in the page to be displayed according to the element location information of the parent element and the sibling element and the proportional relationship between the element size and the element size of the page element. Each element in the element relationship tree will combine the attributes of its parent element and sibling element to correct and adjust its own attributes. For example, if an element has the longest length in the main direction compared to all its brothers, and its length is equal to the length of its brothers and the main direction length of the parent element, then the width of this element will be set to automatically adapt; or if the width of an element in the non-main direction is set to fixed, but its width is equal to the width of its parent node, then the width of the element will be set to automatically adapt. By associating elements to correct the attributes of the elements themselves, the positioning information of page components can be determined without the element position information, thereby improving the processing capability of the solution.

[0115] In some optional embodiments, based on the embodiments of the present application, the page design data also includes an element relationship tree, which is used to indicate the dependency relationship between page elements. The server will determine the component type of the page component corresponding to the page element according to the element attributes of the page element, and the component type is used to indicate the information type of the information displayed in the page component, and then determine the positioning information of the page component in the page to be displayed according to the positioning strategy corresponding to the component type. Before the layout constraint information generation process, the server will perform component type inference, and then optimize and adjust the layout attributes of the element based on the positioning strategy corresponding to the component type. For example: if an element is inferred to be a text type, its width will be set to adaptive in its positioning strategy; or if an element is inferred to be a form type, its height value will be increased in the positioning strategy. The attributes of the element itself are corrected by the positioning strategy corresponding to the component type, so that the positioning information of the page component can be determined without the element position information, thereby improving the processing capability of the solution.

[0116] In the embodiments of the present application, it is also proposed to Figure 3 Other embodiments that refine the technical solution of the embodiment shown in the figure are as follows Figure 8 As shown, in a data processing method of an embodiment of the present application, the following steps may be specifically included:

[0117] Step S810, obtaining page design data of the page to be displayed, wherein the page design data includes the page layout of the page to be displayed and element attributes of page elements.

[0118] Optionally, the implementation details of step S810 are the same as Figure 3 The step S310 shown in FIG. 1 is consistent with the step S310 shown in FIG. 1 and will not be described in detail.

[0119] Step S820: determining, according to the element attributes of the page elements in the page design data, the page components corresponding to the page elements and the layout attributes of the page components in the page to be displayed.

[0120] Optionally, the implementation details of step S820 are the same as Figure 3 The step S320 shown in FIG. 1 is consistent with the step S320 shown in FIG. 1 and will not be repeated here.

[0121] Step S830, determining, according to the page layout of the page to be displayed, a first associated component adjacent to the page component on the horizontal axis and a second associated component adjacent to the page component on the vertical axis in the page layout of the page to be displayed;

[0122] Step S840, determining the relative component spacing between the page component and the first associated component and the second associated component according to the layout attributes of the page component, the layout attributes of the first associated component and the layout attributes of the second associated component;

[0123] Step S850, determining layout constraint information of the page to be displayed according to the relative component spacing between each page component, wherein the layout constraint information includes relative position information of the page component relative to other page components in the page to be displayed.

[0124] In this embodiment, the server determines the associated components of each page component in the page to be displayed. Specifically, for a page component, the server determines the first associated component that is adjacent to the page component on the horizontal axis and the second associated component that is adjacent to the page component on the vertical axis in the page layout of the page to be displayed. Then, the server determines the relative component spacing between the page component and the first associated component and the second associated component based on the layout attributes of the page component, the layout attributes of the first associated component, and the layout attributes of the second associated component. Specifically, the server determines the associated components of each page component in turn according to a predetermined order. Please refer to Fig. 9 , Fig. 9 FIG. 1 is a schematic flow chart of determining layout constraint information in an embodiment of the present application. Fig. 9As shown, there will be an overall parent component for the page to be displayed, which may be the top-level container of the page to be displayed. Start searching for the first child element view1, because currently only the parent element may be related to it, so associate the element with the parent element; Step 2: Start searching for the second child element view2. At this time, it is found that view2 is closest to view1 horizontally and closest to the parent element vertically, so associate the element horizontally and vertically with view1 and the parent element respectively; and so on, the association relationship of all child elements can be completed, and layout constraint information can be generated. In addition to the Euclidean distance, the "distance" here can be written as a distance function that better meets actual needs, such as: increasing the association with elements in the same row and column or reducing cross-element associations, etc.

[0125] Step S860: Generate the page to be displayed according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information.

[0126] Optionally, the implementation details of step S860 are the same as Figure 3 The step S340 shown in FIG. 1 is consistent with the step S340 shown in FIG. 1 and will not be repeated here.

[0127] In an embodiment of the present application, when generating a page to be displayed, first obtain page design data including the page layout of the page to be displayed and the element attributes of the page elements, then determine the page components corresponding to the page elements and the layout attributes of the page components in the page to be displayed according to the element attributes of the page elements in the page design data, and also determine the layout constraint information including the relative position information between the page components in the page to be displayed according to the layout attributes of the page components and the page layout of the page to be displayed, and finally generate the page to be displayed according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information. By establishing constraint information including the relative position relationship between the components in the page during the process of generating the page to be displayed, and then generating the page to be displayed according to the constraint information, it is possible to avoid confusion in the page layout and improve the consistency between the page to be displayed and the page layout in the page design data, thereby improving the accuracy of converting the design data into pages and avoiding the page development work caused by the unavailability of the converted pages, which is conducive to improving the execution efficiency in the software design and development process.

[0128] The following is an example of the implementation details of the technical solution of the embodiment of the present application:

[0129] See also Fig.10 , Fig.10 Schematic flow chart of the overall process of data processing in the embodiment of this application. Fig.10As shown, the component tree is preprocessed to form an intermediate representation. Then, each component is extracted from the intermediate representation for conversion and code generation. Each child node in the component tree is parsed. If the component has layout attributes, the server parses the layout attributes. If the component does not have layout attributes, the server determines the layout attributes based on its parent node information and sibling node information. After determining the layout attributes, the server will determine the component layout order based on the component layout on the design draft, and then generate layout constraint information for all page components based on the component layout order. Finally, for the generated code, the server can use an artificial intelligence model to optimize the code. Finally, the layout process is completed.

[0130] It should be noted that although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0131] The following introduces the device implementation of the present application, which can be used to execute the data processing method in the above embodiments of the present application. Fig.11 The block diagram schematically shows the composition of the data processing device in the embodiment of the present application. Fig.11 As shown, the data processing device 1100 may mainly include:

[0132] The data acquisition module 1110 is configured to acquire page design data of the page to be displayed, wherein the page design data includes the page layout of the page to be displayed and element attributes of the page elements;

[0133] The attribute determination module 1120 is configured to determine the page component corresponding to the page element and the layout attribute of the page component in the page to be displayed according to the element attribute of the page element in the page design data;

[0134] The constraint determination module 1130 is configured to determine the layout constraint information of the page to be displayed according to the layout attributes of the page component and the page layout of the page to be displayed, wherein the layout constraint information includes the relative position information of the page component with respect to other page components in the page to be displayed;

[0135] The page generation module 1140 is configured to generate the page to be displayed according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information.

[0136] In some embodiments of the present application, based on the above technical solution, the attribute determination module 1120 is specifically configured to: obtain the page component corresponding to the page element according to the element type in the element attributes and the correspondence between the element type and the page component; determine the layout attributes of the page component in the page to be displayed according to the element position information in the element attributes, and the element position information is used to indicate the position of the page element in the page to be displayed.

[0137] In some embodiments of the present application, based on the above technical solution, the attribute determination module 1120 is specifically configured as follows: if there is a corresponding page component for the element type in the element attributes, then the page component corresponding to the element type is obtained as the page component of the page element; if there is no corresponding page component for the element type in the element attributes, then according to the component tag of the page element, the page component corresponding to the component tag is obtained as the page component of the page element, and the component tag is used to indicate the correspondence between the page element and the page component.

[0138] In some embodiments of the present application, based on the above technical solution, the attribute determination module 1120 is specifically configured to: obtain the component template corresponding to the component name according to the component name of the page component corresponding to the component tag; replace the corresponding information in the component template with the element attributes of the page element, and generate a page component corresponding to the page element.

[0139] In some embodiments of the present application, based on the above technical solution, the page element includes a sub-page element; the attribute determination module 1120 is specifically configured to: according to the component name of the page component corresponding to the component tag, obtain the component resolution strategy corresponding to the component name and the component template corresponding to the component name; according to the component resolution strategy, respectively parse the element attributes of the page element and the element attributes of the sub-page element to obtain attribute information; replace the corresponding information in the component template with the attribute information to generate a page component corresponding to the page element and a sub-page component of the sub-page element.

[0140] In some embodiments of the present application, based on the above technical solution, the attribute determination module 1120 is specifically configured as: according to the layout type of the page component, obtaining the positioning information of the page component in the page to be displayed from the element position information, and the layout type is used to indicate the positioning method of the positioning information; according to the element position information in the element attributes, obtaining the element layout direction and component spacing of the page component in the page to be displayed; according to the positioning information, the element layout direction and the component spacing of the page component, generating the layout attributes of the page component in the page to be displayed.

[0141] In some embodiments of the present application, based on the above technical solution, the layout type includes two key point positions; the attribute determination module 1120 is specifically configured to: according to the layout type corresponding to the page element, obtain the upper left coordinate and lower right coordinate of the page element in the page to be displayed as the positioning information of the page element in the page to be displayed.

[0142] In some embodiments of the present application, based on the above technical solution, the layout type includes key point positions and width values; the attribute determination module 1120 is specifically configured to: according to the layout type corresponding to the page element, obtain the specified point coordinates and width value of the page element in the page to be displayed as the positioning information of the page element in the page to be displayed.

[0143] In some embodiments of the present application, based on the above technical solution, the page design data also includes an element relationship tree, and the element relationship tree is used to indicate the dependency relationship between page elements; the attribute determination module 1120 is specifically configured as: if there is no element position information in the element attribute, then the parent element and sibling elements of the page element are determined according to the dependency relationship between the page elements in the element relationship tree; according to the element position information of the parent element and the sibling elements and the proportional relationship between the element size and the element size of the page element, the positioning information of the page component in the page to be displayed is determined.

[0144] In some embodiments of the present application, based on the above technical solution, the page design data also includes an element relationship tree, and the element relationship tree is used to indicate the dependency relationship between page elements; the attribute determination module 1120 is specifically configured to: determine the component type of the page component corresponding to the page element according to the element attribute of the page element, and the component type is used to indicate the information type of the information displayed in the page component; determine the positioning information of the page component in the page to be displayed according to the positioning strategy corresponding to the component type.

[0145] In some embodiments of the present application, based on the above technical solution, the constraint determination module 1130 is further configured to: determine, according to the page layout of the page to be displayed, the first associated component that is adjacent to the page component on the horizontal axis and the second associated component that is adjacent to the page component on the vertical axis in the page layout of the page to be displayed; determine the relative component spacing between the page component and the first associated component and the second associated component according to the layout properties of the page component, the layout properties of the first associated component and the layout properties of the second associated component; determine the layout constraint information of the page to be displayed according to the relative component spacing between each page component.

[0146] In some embodiments of the present application, based on the above technical solution, the page generation module 1140 is also configured to: receive a page upload request from a client; upload the code file and resource file of the page to be displayed to a page server according to the page upload request to construct the page to be displayed; generate page access information of the page to be displayed according to a page construction response of the page server, and the page access information is used to access the page to be displayed on the page server; send an upload identifier corresponding to the page upload request to the client, and the upload identifier is used to obtain the page access information.

[0147] In some embodiments of the present application, based on the above technical solution, the data acquisition module 1110 is specifically configured to: generate an element relationship tree of page elements in the page to be displayed according to the dependency relationship between page elements in the page to be displayed; filter and merge the page elements and element attributes of the page elements according to the hierarchical relationship between page elements in the element relationship tree to obtain page design data of the page to be displayed.

[0148] It should be noted that the device provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which the module performs the operation has been described in detail in the method embodiment and will not be repeated here.

[0149] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.

[0150] It should be noted that Fig.12 The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0151] like Fig.12 As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM) 1203. Various programs and data required for system operation are also stored in the RAM 1203. The CPU 1201, ROM 1202 and RAM 1203 are connected to each other through a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.

[0152] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed so that a computer program read therefrom is installed into the storage section 1208 as needed.

[0153] In particular, according to an embodiment of the present application, the process described in the method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 1209, and / or installed from a removable medium 1211. When the computer program is executed by a central processing unit (CPU) 1201, various functions defined in the system of the present application are executed.

[0154] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CompactDisc Read-OnlyMemory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0155] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0156] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0157] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation method of the present application.

[0158] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.

[0159] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A data processing method, It is characterized in that include: Acquire page design data of the page to be displayed, wherein the page design data includes the page layout of the page to be displayed and element attributes of page elements; Determine, according to the element attributes of the page elements in the page design data, the page components corresponding to the page elements and the layout attributes of the page components in the page to be displayed; Determining layout constraint information of the page to be displayed according to the layout attributes of the page component and the page layout of the page to be displayed, wherein the layout constraint information includes relative position information of the page component with respect to other page components in the page to be displayed; The page to be displayed is generated according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information.

2. The method according to claim 1, It is characterized in that The step of determining, according to the element attributes of the page elements in the page design data, the page components corresponding to the page elements and the layout attributes of the page components in the page to be displayed includes: According to the element type in the element attribute and the correspondence between the element type and the page component, obtaining the page component corresponding to the page element; The layout attribute of the page component in the page to be displayed is determined according to the element position information in the element attribute, wherein the element position information is used to indicate the position of the page element in the page to be displayed.

3. The method according to claim 2, It is characterized in that The acquiring the page component corresponding to the page element according to the element type in the element attribute and the correspondence between the element type and the page component includes: If there is a corresponding page component for the element type in the element attribute, then obtaining the page component corresponding to the element type as the page component of the page element; If there is no corresponding page component for the element type in the element attribute, then according to the component tag of the page element, the page component corresponding to the component tag is obtained as the page component of the page element, and the component tag is used to indicate the correspondence between the page element and the page component.

4. The method according to claim 3, It is characterized in that The step of obtaining, according to the component tag of the page element, a page component corresponding to the component tag as the page component of the page element includes: According to the component name of the page component corresponding to the component tag, obtaining the component template corresponding to the component name; The corresponding information in the component template is replaced by the element attributes of the page element to generate a page component corresponding to the page element.

5. The method according to claim 3, It is characterized in that The page element includes a sub-page element; and obtaining, according to the component tag of the page element, a page component corresponding to the component tag as the page component of the page element, includes: According to the component name of the page component corresponding to the component tag, obtaining the component parsing strategy corresponding to the component name and the component template corresponding to the component name; According to the component parsing strategy, the element attributes of the page element and the element attributes of the sub-page element are parsed respectively to obtain attribute information; The corresponding information in the component template is replaced by the attribute information to generate a page component corresponding to the page element and a sub-page component of the sub-page element.

6. The method according to claim 2, It is characterized in that The determining, according to the element position information in the element attribute, the layout attribute of the page component in the page to be displayed includes: According to the layout type of the page component, obtaining the positioning information of the page component in the page to be displayed from the element position information, wherein the layout type is used to indicate the positioning method of the positioning information; According to the element position information in the element attribute, the element layout direction and component spacing of the page component in the page to be displayed are obtained; The layout attributes of the page component in the page to be displayed are generated according to the positioning information of the page component, the element layout direction and the component spacing.

7. The method according to claim 6, It is characterized in that The layout type includes two key point positions; and obtaining the positioning information of the page element in the page to be displayed according to the layout type corresponding to the page element includes: According to the layout type corresponding to the page element, the upper left coordinate and the lower right coordinate of the page element in the page to be displayed are obtained as the positioning information of the page element in the page to be displayed.

8. The method according to claim 6, It is characterized in that The layout type includes key point positions and width values; and obtaining positioning information of the page element in the page to be displayed according to the layout type corresponding to the page element includes: According to the layout type corresponding to the page element, the coordinates of a designated point and a width value of the page element in the to-be-displayed page are obtained as positioning information of the page element in the to-be-displayed page.

9. The method according to claim 6, It is characterized in that The page design data also includes an element relationship tree, and the element relationship tree is used to indicate the dependency relationship between page elements; the method also includes: If the element location information does not exist in the element attribute, determining the parent element and sibling elements of the page element according to the dependency relationship between the page elements in the element relationship tree; The positioning information of the page component in the page to be displayed is determined according to the element position information and element sizes of the parent element and the sibling element and the proportional relationship between the element sizes of the page element.

10. The method according to claim 6, It is characterized in that The page design data also includes an element relationship tree, and the element relationship tree is used to indicate the dependency relationship between page elements; the method also includes: Determine, according to the element attribute of the page element, the component type of the page component corresponding to the page element, wherein the component type is used to indicate the information type of the information displayed in the page component; According to the positioning strategy corresponding to the component type, the positioning information of the page component in the page to be displayed is determined.

11. The method according to claim 1, It is characterized in that The determining, according to the layout attributes of the page component and the page layout of the page to be displayed, the layout constraint information of the page to be displayed includes: According to the page layout of the page to be displayed, determining a first associated component adjacent to the page component on the horizontal axis and a second associated component adjacent to the page component on the vertical axis in the page layout of the page to be displayed; Determining the relative component spacing between the page component and the first associated component and the second associated component according to the layout attribute of the page component, the layout attribute of the first associated component, and the layout attribute of the second associated component; The layout constraint information of the page to be displayed is determined according to the relative component spacing between the various page components.

12. The method according to claim 1, It is characterized in that After generating the page to be displayed according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information, the method further includes: Receive page upload request from client; According to the page upload request, the code file and resource file of the page to be displayed are uploaded to the page server to construct the page to be displayed; Generate page access information of the page to be displayed according to the page building response of the page server, wherein the page access information is used to access the page to be displayed on the page server; An upload identifier corresponding to the page upload request is sent to the client, where the upload identifier is used to obtain the page access information.

13. The method according to claim 1, It is characterized in that The step of obtaining the page design data of the page to be displayed includes: Generate an element relationship tree of the page elements in the page to be displayed according to the dependency relationship between the page elements in the page to be displayed; According to the hierarchical relationship between the page elements in the element relationship tree, the page elements and the element attributes of the page elements are filtered and merged to obtain the page design data of the page to be displayed.

14. A data processing device, It is characterized in that include: A data acquisition module is configured to acquire page design data of a page to be displayed, wherein the page design data includes a page layout of the page to be displayed and element attributes of page elements; An attribute determination module, configured to determine, according to the element attributes of the page elements in the page design data, the page components corresponding to the page elements and the layout attributes of the page components in the page to be displayed; A constraint determination module, configured to determine layout constraint information of the page to be displayed according to the layout attributes of the page component and the page layout of the page to be displayed, wherein the layout constraint information includes relative position information of the page component with respect to other page components in the page to be displayed; The page generation module is configured to generate the page to be displayed according to the layout attributes of the page components and the relative position information of the page components in the layout constraint information.

15. An electronic device, It is characterized in that include: processor; A memory, configured to store executable instructions of the processor; The processor is configured to execute the data processing method according to any one of claims 1 to 13 by executing the executable instructions.

16. A computer readable medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the data processing method according to any one of claims 1 to 13 is implemented.

17. A computer program product, It is characterized in that The computer program product includes a computer program, which is stored in a computer-readable storage medium. The processor of the electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device executes the data processing method as claimed in any one of claims 1 to 13.