Artificial intelligence-based skeleton screen generation method, device, electronic device and medium
Through an artificial intelligence-based method, the skeleton screen is generated directly based on the JSON files and pictures reported on the server, which solves the problem of multiple communication and interaction between the client and the server in the existing technology, and realizes efficient skeleton screen generation.
Patent Information
- Application Number
- CN202111154990.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2041-09-29
AI Technical Summary
In the prior art, when generating a skeleton screen, the client and the server need to communicate and interact multiple times, resulting in inefficient generation. Especially when page requirements change or new pages are added, the skeleton screen code needs to be redesigned.
Through an artificial intelligence-based method, the target skeleton screen is drawn based on the JSON files and pictures reported on the received server, avoiding multiple communication and interactions between the client and the server, and improving the generation efficiency of the skeleton screen.
It realizes the rapid generation of skeleton screens, saves communication time between the client and the server, improves the generation efficiency of target skeleton screens, and does not require redesigning the skeleton screen code.
Smart Images

Figure CN113835706B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an artificial intelligence-based skeleton screen generation method, device, electronic equipment and medium. Background Art
[0002] When browsing the web or using a client to load a new page, the page often fails to load in time. To avoid directly displaying a blank page and causing users to mistakenly believe that there is something wrong with the page, a skeleton screen corresponding to the final page display effect is usually displayed to users while waiting for the page to load.
[0003] However, the existing client displays the skeleton screen by writing the skeleton screen to be displayed into the client, and the server cannot know the style of the skeleton screen displayed by the client. Especially when the page requirements change, or the page changes, or a new page is added to generate a skeleton screen, the server needs to redesign the corresponding skeleton screen code and write it into the client, resulting in a decrease in the generation efficiency of the skeleton screen.
[0004] Therefore, it is necessary to propose a method that can quickly generate a skeleton screen. Summary of the invention
[0005] In view of the above content, it is necessary to propose a skeleton screen generation method, device, electronic device and medium based on artificial intelligence. By drawing the target skeleton screen according to the second JSON file and the second picture reported by the received server, the phenomenon that the client and the server need to communicate and interact multiple times to generate the target skeleton screen is avoided, thereby improving the generation efficiency of the target skeleton screen.
[0006] A first aspect of the present invention provides a skeleton screen generation method based on artificial intelligence, which is applied to a client, and the method comprises:
[0007] In response to a skeleton screen generation request from the server, a page configuration file is obtained, wherein the page configuration file includes at least one key-value pair;
[0008] Determine whether each key value in the page configuration file meets the preset automatic skeleton screen generation requirements;
[0009] When any key value in the page configuration file meets the preset skeleton screen generation requirement, the skeleton screen automatic generation code of the target page corresponding to the key of the any key value is obtained;
[0010] Execute the skeleton screen automatic generation code of the target page to obtain the first JSON file and the first picture of the initial skeleton screen of the target page;
[0011] Receive the second JSON file and the second picture of the initial skeleton screen reported by the server, draw a corresponding view according to the second JSON file and the second picture, and determine the view as the target skeleton screen of the target page, wherein the second JSON file and the second picture of the initial skeleton screen are obtained by adjusting the first JSON file and the first picture of the initial skeleton screen by the server based on preset visual requirements.
[0012] Optionally, the executing the skeleton screen automatic generation code of the target page to obtain the first JSON file and the first picture of the initial skeleton screen of the target page includes:
[0013] Traversing each view node in the tree structure corresponding to the skeleton screen automatic generation code to obtain the attributes of each view;
[0014] Convert the attributes of each view into a JSON format file according to the preset conversion rules to obtain a JSON file for each view;
[0015] Merging multiple JSON files of multiple views to obtain a first JSON file of the initial skeleton screen of the target page;
[0016] According to the first JSON file of the initial skeleton screen and in accordance with the display requirements corresponding to the target page in the skeleton screen generation request, a corresponding picture is drawn, and the picture is determined as the first picture of the initial skeleton screen of the target page.
[0017] Optionally, in response to the skeleton screen generation request from the server, obtaining the page configuration file includes:
[0018] Parsing the message of the skeleton screen generation request to obtain the message information carried by the message;
[0019] A calling interface is obtained from the message information, and a page configuration file is obtained through the calling interface, wherein the page configuration file includes a plurality of key-value pairs.
[0020] Optionally, the determining whether each key value in the page configuration file meets a preset requirement for automatically generating a skeleton screen includes:
[0021] A code identifying each key value in the page configuration file;
[0022] When the code of each key value in the page configuration file is a skeleton screen automatic generation code, determining that each key value in the page configuration file meets a preset skeleton screen automatic generation requirement; or
[0023] When the code of each key value in the page configuration file is not a skeleton screen automatic generation code, it is determined that each key value in the page configuration file does not meet the preset skeleton screen automatic generation requirement.
[0024] A second aspect of the present invention provides a skeleton screen generation method based on artificial intelligence, which is applied to a server, and the method comprises:
[0025] Receive a first JSON file and a first picture of the initial skeleton screen of the target page reported by the client;
[0026] Identifying whether the first image of the initial skeleton screen meets preset visual requirements;
[0027] When the image of the initial skeleton screen does not meet the preset visual requirement, adjusting the first JSON file and the first image of the initial skeleton screen based on the preset visual requirement to obtain a second JSON file and a second image of the initial skeleton screen;
[0028] The second JSON file and the second picture of the initial skeleton screen are sent to the client, and the client draws a corresponding view according to the second JSON file and the second picture, and determines the view as the target skeleton screen of the target page.
[0029] Optionally, the identifying whether the first image of the initial skeleton screen meets a preset visual requirement includes:
[0030] Traversing the attributes of each view in the first picture of the initial skeleton screen;
[0031] Matching the attribute of each view in the first picture of the initial skeleton screen with the attribute of each view in the preset view requirement;
[0032] When the attribute of each view in the first picture of the initial skeleton screen completely matches the attribute of each view in the preset view requirement, determining that the first picture of the initial skeleton screen meets the preset visual requirement; or
[0033] When the attribute of each view in the first picture of the initial skeleton screen does not completely match the attribute of each view in the preset view requirement, it is determined that the first picture of the initial skeleton screen does not meet the preset visual requirement.
[0034] A third aspect of the present invention provides a skeleton screen generation device based on artificial intelligence, which runs on a client, and the device includes:
[0035] A first acquisition module, configured to acquire a page configuration file in response to a skeleton screen generation request from a server;
[0036] A judgment module, used to judge whether each key value in the page configuration file meets the preset requirements for automatically generating a skeleton screen;
[0037] A second acquisition module is used to acquire the skeleton screen automatic generation code of the target page corresponding to the key of any key value when any key value in the page configuration file meets the preset skeleton screen generation requirement;
[0038] An execution module, used for executing the skeleton screen automatic generation code of the target page, and obtaining a first JSON file and a first picture of the initial skeleton screen of the target page;
[0039] A determination module is used to receive a second JSON file and a second image of the initial skeleton screen reported by the server, and to draw a corresponding view according to the second JSON file and the second image, and to determine the view as the target skeleton screen of the target page, wherein the second JSON file and the second image of the initial skeleton screen are obtained by adjusting the first JSON file and the first image of the initial skeleton screen by the server based on preset visual requirements.
[0040] A fourth aspect of the present invention provides a skeleton screen generation device based on artificial intelligence, which runs on a server, and the device includes:
[0041] A receiving module, used for receiving a first JSON file and a first picture of an initial skeleton screen of a target page reported by a client;
[0042] An identification module, used to identify whether the first image of the initial skeleton screen meets the preset visual requirements;
[0043] An adjustment module, configured to adjust the first JSON file and the first image of the initial skeleton screen based on the preset visual requirements to obtain a second JSON file and a second image of the initial skeleton screen when the image of the initial skeleton screen does not meet the preset visual requirements;
[0044] A sending module is used to send a second JSON file and a second picture of the initial skeleton screen to the client, and the client draws a corresponding view according to the second JSON file and the second picture, and determines the view as a target skeleton screen of the target page.
[0045] A fifth aspect of the present invention provides an electronic device, comprising a processor and a memory, wherein the processor is configured to implement the artificial intelligence-based skeleton screen generation method when executing a computer program stored in the memory.
[0046] A sixth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for generating a skeleton screen based on artificial intelligence is implemented.
[0047] In summary, the artificial intelligence-based skeleton screen generation method, device, electronic device and medium of the present invention can quickly determine whether each page needs to generate a skeleton screen by determining whether each page needs to generate a skeleton screen according to the code of each key value in the page configuration file, without the client constantly pulling data from the server to determine whether each page needs to generate a skeleton screen, thereby improving the efficiency of generating the skeleton screen. When it is determined that any key value in the page configuration file meets the preset skeleton screen generation requirements, the skeleton screen automatic generation code of the target page corresponding to the key of each key value is executed to obtain the first JSON file and the first picture of the initial skeleton screen of the target page, which solves the problem of the prior art that when generating the initial skeleton screen, a button needs to be clicked once for each view in the initial skeleton screen, thereby improving the efficiency and accuracy of the client generating the initial skeleton screen. Receive the second JSON file and the second image of the initial skeleton screen reported by the server, draw the corresponding view according to the second JSON file and the second image, and determine the view as the target skeleton screen of the target page. The client draws the target skeleton screen according to the changed and optimized style, avoiding the phenomenon that the client and the server need to communicate and interact multiple times to generate the target skeleton screen, saving the communication time between the client and the server, and improving the generation efficiency of the target skeleton screen of the client. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a flow chart of the skeleton screen generation method based on artificial intelligence provided in the first embodiment of the present invention.
[0049] Figure 2 This is a flow chart of a skeleton screen generation method based on artificial intelligence provided in Embodiment 2 of the present invention.
[0050] Figure 3 It is a structural diagram of an artificial intelligence-based skeleton screen generation device provided in Example 3 of the present invention.
[0051] Figure 4 It is a structural diagram of an artificial intelligence-based skeleton screen generation device provided in Example 4 of the present invention.
[0052] Figure 5 It is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION
[0053] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0055] Embodiment 1
[0056] Figure 1 It is a flow chart of the skeleton screen generation method based on artificial intelligence provided in the first embodiment of the present invention.
[0057] In this embodiment, the artificial intelligence-based skeleton screen generation method can be applied to electronic devices. For electronic devices that need to perform artificial intelligence-based skeleton screen generation, the artificial intelligence-based skeleton screen generation function provided by the method of the present invention can be directly integrated into the electronic device, or run in the electronic device in the form of a software development kit (Software Development Kit, SDK).
[0058] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0059] The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. Artificial intelligence software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, as well as machine learning and deep learning.
[0060] In this embodiment, when the client displays page data, it is necessary to continuously pull page data from the server. In the process of rendering the pulled page data, skeleton screen technology is required. Specifically, the skeleton screen refers to showing the user the approximate structure of the page before the page data is loaded, and rendering the actual page content after obtaining the interface data and then replacing it.
[0061] In this embodiment, the server sends a skeleton screen generation request to the client. When the client receives the skeleton screen generation request, the client parses the skeleton screen generation request, obtains a page configuration file, traverses the code corresponding to each key value in the page configuration file, determines that a skeleton screen page needs to be generated, and automatically generates a skeleton screen for the skeleton screen page to obtain a first JSON file and a first image of an initial skeleton screen, and sends the first JSON file and the first image of the initial skeleton screen to the server. When the server receives the first JSON file and the first image of the initial skeleton screen, the server determines whether a preset visual condition is met according to a style displayed by the first image. When it is determined that the preset visual condition is not met, the server adjusts the first JSON file of the initial skeleton screen, adjusts the properties of each view in the first JSON file, obtains a skeleton screen that meets the preset visual condition, and sends a second JSON file corresponding to the skeleton screen that meets the visual condition to the client. When the client receives the second JSON file, the client parses the second JSON file and draws the target skeleton screen.
[0062] like Figure 1 As shown, the artificial intelligence-based skeleton screen generation method is specific and applied to the client, including the following steps. According to different requirements, the order of the steps in the flowchart can be changed and some can be omitted.
[0063] S11, in response to a skeleton screen generation request from a server, obtaining a page configuration file, wherein the page configuration file includes at least one key-value pair.
[0064] In this embodiment, when the skeleton screen of the page is generated, the server sends a skeleton screen generation request to the client. Specifically, the client may be a smart phone, an IPAD or other existing smart devices with the function of generating a skeleton screen. The server may be a skeleton screen design system. During the skeleton screen generation process, the client receives the skeleton screen generation request sent by the server, and parses the skeleton screen generation request to obtain a page configuration file, wherein the page configuration file includes multiple key-value pairs, each key refers to an object in the data, which may be a page name, and each key value includes a code, for example, the code may be TRUE or FALSE, and different codes represent different meanings.
[0065] In an optional embodiment, in response to the skeleton screen generation request from the server, obtaining the page configuration file includes:
[0066] Parsing the message of the skeleton screen generation request to obtain the message information carried by the message;
[0067] A calling interface is obtained from the message information, and a page configuration file is obtained through the calling interface, wherein the page configuration file includes at least one key-value pair.
[0068] In this embodiment, the configuration information of the page is stored in advance in the page configuration file in the form of key-value pairs, thereby improving the efficiency of the subsequent code traversal of each key value.
[0069] S12, determining whether each key value in the page configuration file meets a preset requirement for automatically generating a skeleton screen.
[0070] In this embodiment, when determining whether each page needs a skeleton screen, it is necessary to traverse each key value in the page configuration file, and determine whether each page needs to automatically generate a skeleton screen according to the code corresponding to each key value.
[0071] In an optional embodiment, the determining whether each key value in the page configuration file meets the preset automatic skeleton screen generation requirement includes:
[0072] A code identifying each key value in the page configuration file;
[0073] When the code of each key value in the page configuration file is a skeleton screen automatic generation code, determining that each key value in the page configuration file meets a preset skeleton screen automatic generation requirement; or
[0074] When the code of each key value in the page configuration file is not a skeleton screen automatic generation code, it is determined that each key value in the page configuration file does not meet the preset skeleton screen automatic generation requirement.
[0075] In an optional embodiment, the method further includes:
[0076] When it is determined that each key value in the page configuration file does not meet the preset requirement for automatically generating a skeleton screen, automatically generating a skeleton screen for the target page corresponding to the key of each key value in the page configuration file is rejected.
[0077] Exemplarily, if the code of each key value is a TRUE code, it is determined that the page corresponding to each key value requires a skeleton screen; if the code of each key value is FALSE, it is determined that the page corresponding to each key value does not require a skeleton screen.
[0078] In this embodiment, by determining whether a skeleton screen needs to be generated for each page based on the code of each key value in the page configuration file, it is possible to quickly determine whether a skeleton screen needs to be generated for each page. There is no need for the client to continuously pull data from the server to determine whether a skeleton screen needs to be generated for each page, thereby improving the efficiency of generating skeleton screens.
[0079] S13, when any key value in the page configuration file meets the preset skeleton screen generation requirement, the skeleton screen automatic generation code of the target page corresponding to the key of the any key value is obtained.
[0080] In this embodiment, the skeleton screen generation requirements can be preset. Specifically, the preset skeleton screen generation requirements are set based on the needs of the visual designer on the server side. For example, if page A needs to generate a skeleton screen, the code of the key value corresponding to page A is set to a code that meets the preset skeleton screen generation requirements.
[0081] In this embodiment, the skeleton screen automatic generation code means that the skeleton screen can be generated according to the skeleton screen automatic generation code. Specifically, the skeleton screen automatic generation code can be pre-stored in a preset code database, or pre-associated with each key value corresponding key and stored in a page configuration file.
[0082] In an optional embodiment, the step of obtaining the skeleton screen automatic generation code of the target page corresponding to the key of any key value includes:
[0083] Identify the page name corresponding to the key of any key value;
[0084] The skeleton screen of the corresponding target page is automatically generated based on the page name.
[0085] In this embodiment, when it is determined that any key value meets the preset skeleton screen generation requirements, the skeleton screen automatic generation code of the target page is obtained through the page name corresponding to the key of each key value, which is targeted and ensures the accuracy of the skeleton screen automatic generation code of the target page.
[0086] S14, executing the skeleton screen automatic generation code of the target page to obtain a first JSON file and a first picture of the initial skeleton screen of the target page.
[0087] In this embodiment, if each key value satisfies the preset skeleton screen generation request, it is determined that the target page corresponding to each key value needs to generate a skeleton screen, and the skeleton screen automatic generation code of the target page is executed to generate the first JSON file and the first picture of the initial skeleton screen.
[0088] In this embodiment, since the first JSON file and the first image of the initial skeleton screen are obtained by executing the skeleton screen automatic generation code, the problem of the prior art that a button needs to be clicked once for each view in the initial skeleton screen when generating the initial skeleton screen is solved, and the efficiency and accuracy of the client in generating the initial skeleton screen is improved.
[0089] In an optional embodiment, the step of automatically generating a code for the skeleton screen of the target page to obtain a first JSON file and a first image of the initial skeleton screen of the target page includes:
[0090] Traversing each view node in the tree structure corresponding to the skeleton screen automatic generation code to obtain the attributes of each view;
[0091] Convert the attributes of each view into a JSON format file according to the preset conversion rules to obtain a JSON file for each view;
[0092] Merging multiple JSON files of multiple views to obtain a first JSON file of the initial skeleton screen of the target page;
[0093] According to the first JSON file of the initial skeleton screen and in accordance with the display requirements corresponding to the target page in the skeleton screen generation request, a corresponding picture is drawn, and the picture is determined as the first picture of the initial skeleton screen of the target page.
[0094] In this embodiment, the skeleton screen automatically generates codes in a tree structure layout.
[0095] Specifically, the attributes of each view include one or a combination of the following: size, position, and type.
[0096] In some other optional embodiments, the attributes of each view also include other attributes such as fill requirements, view text and text style.
[0097] In this embodiment, the display requirement refers to the color of each view displayed on the initial skeleton screen.
[0098] In this embodiment, conversion rules can be set in advance. Specifically, the preset conversion rules are pre-set based on the attributes of each view in the target page, wherein the attributes of each view are XML files. By converting the XML file corresponding to the attributes of each view into text content, a first JSON format file is generated based on the text content.
[0099] In this embodiment, compared with XML files, JSON format files can quickly see the content therein, and are more efficient in writing, transmitting or parsing, and can support multiple voices at the same time. By recursively traversing each view node in the tree structure through the XML file corresponding to the attribute of each view, a corresponding first JSON format file is generated, thereby improving the efficiency of subsequent drawing of the target skeleton screen.
[0100] S15, receiving the second JSON file and the second picture of the initial skeleton screen reported by the server, and drawing a corresponding view according to the second JSON file and the second picture, and determining the view as the target skeleton screen of the target page, wherein the second JSON file and the second picture of the initial skeleton screen are obtained by adjusting the first JSON file and the first picture of the initial skeleton screen by the server based on preset visual requirements.
[0101] In this embodiment, the second JSON file is obtained by adjusting the first JSON file by the server according to the first picture corresponding to the initial skeleton screen; the target skeleton screen is obtained by drawing after parsing the second JSON file.
[0102] In an optional embodiment, drawing a corresponding view according to the second JSON file and the second image, and determining the view as a target skeleton screen of the target page includes:
[0103] Traversing the second JSON file based on the second image to obtain properties of the view corresponding to each view node;
[0104] According to the properties of the view corresponding to each view node, a drawing method in a preset drawing tool is used to draw the corresponding view, and the view is determined as the target skeleton screen of the target page.
[0105] In this embodiment, the preset drawing tool may be a canvas tool provided by the client, and the drawing method in the canvas tool is used to draw the corresponding view according to the attributes of the view corresponding to each view node.
[0106] In this embodiment, a skeleton screen generation request is sent to the client through the server, and the client determines the first JSON file and the first image of the initial skeleton screen based on the skeleton screen generation request. The server can adjust the first JSON file and the first image of the initial skeleton screen reported by the client, and send the adjusted second JSON file and the second image to the client. The client parses the second JSON file to draw the target skeleton screen. The server can change the optimization style according to the initial skeleton screen reported by the client, and the client draws the target skeleton screen according to the changed and optimized style, thereby avoiding the phenomenon that the client and the server need to communicate and interact multiple times to obtain the target skeleton screen, saving the communication time between the client and the server. At the same time, there is no need to redesign the corresponding skeleton screen code for page requirement changes, page changes or new pages, and modifications are directly made to the first JSON file of the initial skeleton screen, thereby improving the generation efficiency of the target skeleton screen of the client.
[0107] In summary, the skeleton screen generation method based on artificial intelligence described in this embodiment can quickly determine whether each page needs to generate a skeleton screen by determining whether each page needs to generate a skeleton screen according to the code of each key value in the page configuration file, without the client constantly pulling data from the server to determine whether each page needs to generate a skeleton screen, thereby improving the efficiency of generating the skeleton screen. When it is determined that any key value in the page configuration file meets the preset skeleton screen generation requirements, the skeleton screen automatic generation code of the target page corresponding to the key of each key value is executed to obtain the first JSON file and the first picture of the initial skeleton screen of the target page, which solves the problem that the existing technology needs to click a button once for each view in the initial skeleton screen when generating the initial skeleton screen, thereby improving the efficiency and accuracy of the client generating the initial skeleton screen. The second JSON file and the second picture of the initial skeleton screen reported by the server are received, and the corresponding view is drawn according to the second JSON file and the second picture, and the view is determined as the target skeleton screen of the target page. The client draws the target skeleton screen according to the modified and optimized style, thereby avoiding the phenomenon that the client and the server need to communicate and interact multiple times to generate the target skeleton screen, saving the communication time between the client and the server, and improving the generation efficiency of the target skeleton screen of the client.
[0108] Embodiment 2
[0109] Figure 2 This is a flow chart of a skeleton screen generation method based on artificial intelligence provided in Embodiment 2 of the present invention.
[0110] In this embodiment, the artificial intelligence-based skeleton screen generation method can be applied to electronic devices. For electronic devices that need to perform artificial intelligence-based skeleton screen generation, the artificial intelligence-based skeleton screen generation function provided by the method of the present invention can be directly integrated into the electronic device, or run in the electronic device in the form of a software development kit (Software Development Kit, SDK).
[0111] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0112] The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. Artificial intelligence software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, as well as machine learning and deep learning.
[0113] In this embodiment, when the client displays page data, it is necessary to continuously pull page data from the server. In the process of rendering the pulled page data, skeleton screen technology is required. Specifically, the skeleton screen refers to showing the user the approximate structure of the page before the page data is loaded, and rendering the actual page content after obtaining the interface data and then replacing it.
[0114] In this embodiment, the server sends a skeleton screen generation request to the client. When the client receives the skeleton screen generation request, the client parses the skeleton screen generation request, obtains a page configuration file, traverses the code corresponding to each key value in the page configuration file, determines that a skeleton screen page needs to be generated, and automatically generates a skeleton screen for the skeleton screen page to obtain a first JSON file and a first image of an initial skeleton screen, and sends the first JSON file and the first image of the initial skeleton screen to the server. When the server receives the first JSON file and the first image of the initial skeleton screen, the server determines whether a preset visual condition is met according to a style displayed by the first image. When it is determined that the preset visual condition is not met, the server adjusts the first JSON file of the initial skeleton screen, adjusts the properties of each view in the first JSON file, obtains a skeleton screen that meets the preset visual condition, and sends a second JSON file corresponding to the skeleton screen that meets the visual condition to the client. When the client receives the second JSON file, the client parses the second JSON file and draws the target skeleton screen.
[0115] like Figure 2 As shown, the skeleton screen generation method based on artificial intelligence is applied to the server, and specifically includes the following steps. According to different requirements, the order of the steps in the flowchart can be changed, and some can be omitted.
[0116] S21, receiving a first JSON file and a first picture of an initial skeleton screen of a target page reported by a client.
[0117] In this embodiment, the first JSON file of the initial skeleton screen is obtained by the client executing the skeleton screen automatic generation code of the target page. Specifically, the first JSON file contains JSON files of multiple views, and the JSON file of each view is obtained by the server converting the attributes of each view according to a preset conversion rule. The attributes of each view are obtained by the server traversing each view node in the tree structure corresponding to the skeleton screen automatic generation code of the target page.
[0118] The first picture of the initial skeleton screen refers to the picture drawn by the client through the underlying drawing method according to the first JSON file of the initial skeleton screen.
[0119] S22, identifying whether the first image of the initial skeleton screen meets preset visual requirements.
[0120] In this embodiment, visual requirements may be preset. Specifically, the preset visual requirements may be set according to the skeleton screen automatic generation code for each skeleton screen page that needs to be generated, or may be set according to the page visual requirements for each skeleton screen page that needs to be generated.
[0121] In an optional embodiment, the identifying whether the first image of the initial skeleton screen meets the preset visual requirements includes:
[0122] Traversing the attributes of each view in the first picture of the initial skeleton screen;
[0123] Matching the attribute of each view in the first picture of the initial skeleton screen with the attribute of each view in the preset view requirement;
[0124] When the attribute of each view in the first picture of the initial skeleton screen completely matches the attribute of each view in the preset view requirement, determining that the first picture of the initial skeleton screen meets the preset visual requirement; or
[0125] When the attribute of each view in the first picture of the initial skeleton screen does not completely match the attribute of each view in the preset view requirement, it is determined that the first picture of the initial skeleton screen does not meet the preset visual requirement.
[0126] S23, when the image of the initial skeleton screen does not meet the preset visual requirement, adjusting the first JSON file and the first image of the initial skeleton screen based on the preset visual requirement to obtain a second JSON file and a second image of the initial skeleton screen.
[0127] In this embodiment, by pre-setting visual requirements, it is determined whether the initial skeleton screen needs to change its style. If the style needs to be changed, the view that needs to be changed in the first JSON file is changed based on the first image of the initial skeleton screen to obtain the second JSON file and the second image corresponding to the optimal skeleton screen, thereby solving the problem of slow skeleton screen generation caused by the server redesigning the skeleton screen code when changing the style.
[0128] S24, sending the second JSON file and the second picture of the initial skeleton screen to the client, the client draws a corresponding view according to the second JSON file and the second picture, and determines the view as the target skeleton screen of the target page.
[0129] In this embodiment, when the server determines that the image of the initial skeleton screen does not meet the preset visual requirements, the properties of each view in the first JSON file of the initial skeleton screen are adjusted according to the visual requirements. Specifically, the properties of each view include: size, position, type, filling requirements, view text and text style and other properties.
[0130] In this embodiment, the server sends the adjusted second JSON file and second image of the initial skeleton screen to the client, and the client can directly draw the target skeleton screen of the target page according to the second JSON file and the second image, thereby reducing the number of interactions between the client and the server, saving communication costs, and thus improving the generation efficiency of the skeleton screen.
[0131] To summarize, the artificial intelligence-based skeleton screen generation method described in this embodiment receives the first JSON file and the first image of the initial skeleton screen of the target page reported by the client, and identifies whether the first image of the initial skeleton screen meets the visual requirements. If not, the view that needs to be changed in the first JSON file is changed based on the first image of the initial skeleton screen to obtain the second JSON file corresponding to the optimal skeleton screen. This solves the problem of slow skeleton screen generation caused by the server redesigning the skeleton screen code when changing the style. The second JSON file and the second image of the initial skeleton screen are sent to the client, which reduces the number of interactions between the client and the server, saves communication costs, and thus improves the generation efficiency of the skeleton screen.
[0132] Embodiment 3
[0133] Figure 3 It is a structural diagram of an artificial intelligence-based skeleton screen generation device provided in Example 3 of the present invention.
[0134] In some embodiments, the artificial intelligence-based skeleton screen generation device 30 may include a plurality of functional modules composed of program code segments. The program code of each program segment in the artificial intelligence-based skeleton screen generation device 30 may be stored in the memory of the electronic device and executed by the at least one processor to execute (see Figure 1 Description) Function of skeleton screen generation based on artificial intelligence.
[0135] In this embodiment, the artificial intelligence-based skeleton screen generation device 30 runs on the client and can be divided into multiple functional modules according to the functions it performs. The functional modules may include: a first acquisition module 301, a judgment module 302, a second acquisition module 303, an execution module 304 and a determination module 305. The module referred to in the present invention refers to a series of computer-readable instruction segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.
[0136] In this embodiment, when the client displays page data, it is necessary to continuously pull page data from the server. In the process of rendering the pulled page data, skeleton screen technology is required. Specifically, the skeleton screen refers to showing the user the approximate structure of the page before the page data is loaded, and rendering the actual page content after obtaining the interface data and then replacing it.
[0137] In this embodiment, the server sends a skeleton screen generation request to the client. When the client receives the skeleton screen generation request, the client parses the skeleton screen generation request, obtains a page configuration file, traverses the code corresponding to each key value in the page configuration file, determines that a skeleton screen page needs to be generated, and automatically generates a skeleton screen for the skeleton screen page to obtain a first JSON file and a first image of an initial skeleton screen, and sends the first JSON file and the first image of the initial skeleton screen to the server. When the server receives the first JSON file and the first image of the initial skeleton screen, the server determines whether a preset visual condition is met according to a style displayed by the first image. When it is determined that the preset visual condition is not met, the server adjusts the first JSON file of the initial skeleton screen, adjusts the properties of each view in the first JSON file, obtains a skeleton screen that meets the preset visual condition, and sends a second JSON file corresponding to the skeleton screen that meets the visual condition to the client. When the client receives the second JSON file, the client parses the second JSON file and draws the target skeleton screen.
[0138] The first acquisition module 301 is used to acquire a page configuration file in response to a skeleton screen generation request from a server, wherein the page configuration file includes at least one key-value pair.
[0139] In this embodiment, when the skeleton screen of the page is generated, the server sends a skeleton screen generation request to the client. Specifically, the client may be a smart phone, an IPAD or other existing smart devices with the function of generating a skeleton screen. The server may be a skeleton screen design system. During the skeleton screen generation process, the client receives the skeleton screen generation request sent by the server, and parses the skeleton screen generation request to obtain a page configuration file, wherein the page configuration file includes multiple key-value pairs, each key refers to an object in the data, which may be a page name, and each key value includes a code, for example, the code may be TRUE or FALSE, and different codes represent different meanings.
[0140] In an optional embodiment, the first acquisition module 301 acquires the page configuration file in response to the skeleton screen generation request of the server, including:
[0141] Parsing the message of the skeleton screen generation request to obtain the message information carried by the message;
[0142] A calling interface is obtained from the message information, and a page configuration file is obtained through the calling interface, wherein the page configuration file includes at least one key-value pair.
[0143] In this embodiment, the configuration information of the page is stored in advance in the page configuration file in the form of key-value pairs, thereby improving the efficiency of the subsequent code traversal of each key value.
[0144] The judgment module 302 is used to judge whether each key value in the page configuration file meets the preset automatic skeleton screen generation requirement.
[0145] In this embodiment, when determining whether each page needs a skeleton screen, it is necessary to traverse each key value in the page configuration file, and determine whether each page needs to automatically generate a skeleton screen according to the code corresponding to each key value.
[0146] In an optional embodiment, the judging module 302 judges whether each key value in the page configuration file meets the preset automatic skeleton screen generation requirement, including:
[0147] A code identifying each key value in the page configuration file;
[0148] When the code of each key value in the page configuration file is a skeleton screen automatic generation code, determining that each key value in the page configuration file meets a preset skeleton screen automatic generation requirement; or
[0149] When the code of each key value in the page configuration file is not a skeleton screen automatic generation code, it is determined that each key value in the page configuration file does not meet the preset skeleton screen automatic generation requirement.
[0150] In an optional embodiment, when it is determined that each key value in the page configuration file does not meet the preset requirement for automatically generating a skeleton screen, automatically generating a skeleton screen for the target page corresponding to the key of each key value in the page configuration file is rejected.
[0151] Exemplarily, if the code of each key value is a TRUE code, it is determined that the page corresponding to each key value requires a skeleton screen; if the code of each key value is FALSE, it is determined that the page corresponding to each key value does not require a skeleton screen.
[0152] In this embodiment, by determining whether a skeleton screen needs to be generated for each page based on the code of each key value in the page configuration file, it is possible to quickly determine whether a skeleton screen needs to be generated for each page. There is no need for the client to continuously pull data from the server to determine whether a skeleton screen needs to be generated for each page, thereby improving the efficiency of generating skeleton screens.
[0153] The second acquisition module 303 is used to acquire the skeleton screen automatic generation code of the target page corresponding to the key of any key value when any key value in the page configuration file meets the preset skeleton screen generation requirement.
[0154] In this embodiment, the skeleton screen generation requirements can be preset. Specifically, the preset skeleton screen generation requirements are set based on the needs of the visual designer on the server side. For example, if page A needs to generate a skeleton screen, the code of the key value corresponding to page A is set to a code that meets the preset skeleton screen generation requirements.
[0155] In this embodiment, the skeleton screen automatic generation code means that the skeleton screen can be generated according to the skeleton screen automatic generation code. Specifically, the skeleton screen automatic generation code can be pre-stored in a preset code database, or pre-associated with each key value corresponding key and stored in a page configuration file.
[0156] In an optional embodiment, the second acquisition module 303 acquires the skeleton screen automatic generation code of the target page corresponding to the key of the arbitrary key value, including:
[0157] Identify the page name corresponding to the key of any key value;
[0158] The skeleton screen of the corresponding target page is automatically generated based on the page name.
[0159] In this embodiment, when it is determined that any key value meets the preset skeleton screen generation requirements, the skeleton screen automatic generation code of the target page is obtained through the page name corresponding to the key of each key value, which is targeted and ensures the accuracy of the skeleton screen automatic generation code of the target page.
[0160] The execution module 304 is used to execute the skeleton screen automatic generation code of the target page to obtain the first JSON file and the first picture of the initial skeleton screen of the target page.
[0161] In this embodiment, if each key value satisfies the preset skeleton screen generation request, it is determined that the target page corresponding to each key value needs to generate a skeleton screen, and the skeleton screen automatic generation code of the target page is executed to generate the first JSON file and the first picture of the initial skeleton screen.
[0162] In this embodiment, since the first JSON file and the first image of the initial skeleton screen are obtained by executing the skeleton screen automatic generation code, the problem of the prior art that a button needs to be clicked once for each view in the initial skeleton screen when generating the initial skeleton screen is solved, and the efficiency and accuracy of the client in generating the initial skeleton screen is improved.
[0163] In an optional embodiment, the execution module 304 executes the skeleton screen automatic generation code of the target page to obtain the first JSON file and the first picture of the initial skeleton screen of the target page, including:
[0164] Traversing each view node in the tree structure corresponding to the skeleton screen automatic generation code to obtain the attributes of each view;
[0165] Convert the attributes of each view into a JSON format file according to the preset conversion rules to obtain a JSON file for each view;
[0166] Merging multiple JSON files of multiple views to obtain a first JSON file of the initial skeleton screen of the target page;
[0167] According to the first JSON file of the initial skeleton screen and in accordance with the display requirements corresponding to the target page in the skeleton screen generation request, a corresponding picture is drawn, and the picture is determined as the first picture of the initial skeleton screen of the target page.
[0168] In this embodiment, the skeleton screen automatically generates codes in a tree structure layout.
[0169] Specifically, the attributes of each view include one or a combination of the following: size, position, and type.
[0170] In some other optional embodiments, the attributes of each view also include other attributes such as fill requirements, view text and text style.
[0171] In this embodiment, the display requirement refers to the color of each view displayed on the initial skeleton screen.
[0172] In this embodiment, conversion rules can be set in advance. Specifically, the preset conversion rules are pre-set based on the attributes of each view in the target page, wherein the attributes of each view are XML files. By converting the XML file corresponding to the attributes of each view into text content, a first JSON format file is generated based on the text content.
[0173] In this embodiment, compared with XML files, JSON format files can quickly see the content therein, and are more efficient in writing, transmitting or parsing, and can support multiple voices at the same time. By recursively traversing each view node in the tree structure through the XML file corresponding to the attribute of each view, a corresponding first JSON format file is generated, thereby improving the efficiency of subsequent drawing of the target skeleton screen.
[0174] The determination module 305 is used to receive the second JSON file and the second image of the initial skeleton screen reported by the server, and draw a corresponding view according to the second JSON file and the second image, and determine the view as the target skeleton screen of the target page, wherein the second JSON file and the second image of the initial skeleton screen are obtained by adjusting the first JSON file and the first image of the initial skeleton screen by the server based on preset visual requirements.
[0175] In this embodiment, the second JSON file is obtained by adjusting the first JSON file by the server according to the first picture corresponding to the initial skeleton screen; the target skeleton screen is obtained by drawing after parsing the second JSON file.
[0176] In an optional embodiment, the determining module 305 draws a corresponding view according to the second JSON file and the second image, and determines the view as a target skeleton screen of the target page, including:
[0177] Traversing the second JSON file based on the second image to obtain properties of the view corresponding to each view node;
[0178] According to the properties of the view corresponding to each view node, a drawing method in a preset drawing tool is used to draw the corresponding view, and the view is determined as the target skeleton screen of the target page.
[0179] In this embodiment, the preset drawing tool may be a canvas tool provided by the client, and the drawing method in the canvas tool is used to draw the corresponding view according to the attributes of the view corresponding to each view node.
[0180] In this embodiment, a skeleton screen generation request is sent to the client through the server, and the client determines the first JSON file and the first image of the initial skeleton screen based on the skeleton screen generation request. The server can adjust the first JSON file and the first image of the initial skeleton screen reported by the client, and send the adjusted second JSON file and the second image to the client. The client parses the second JSON file to draw the target skeleton screen. The server can change the optimization style according to the initial skeleton screen reported by the client, and the client draws the target skeleton screen according to the changed and optimized style, thereby avoiding the phenomenon that the client and the server need to communicate and interact multiple times to obtain the target skeleton screen, saving the communication time between the client and the server. At the same time, there is no need to redesign the corresponding skeleton screen code for page requirement changes, page changes or new pages, and modifications are directly made to the first JSON file of the initial skeleton screen, thereby improving the generation efficiency of the target skeleton screen of the client.
[0181] In summary, the skeleton screen generation method based on artificial intelligence described in this embodiment can quickly determine whether each page needs to generate a skeleton screen by determining whether each page needs to generate a skeleton screen according to the code of each key value in the page configuration file, without the client constantly pulling data from the server to determine whether each page needs to generate a skeleton screen, thereby improving the efficiency of generating the skeleton screen. When it is determined that any key value in the page configuration file meets the preset skeleton screen generation requirements, the skeleton screen automatic generation code of the target page corresponding to the key of each key value is executed to obtain the first JSON file and the first picture of the initial skeleton screen of the target page, which solves the problem that the existing technology needs to click a button once for each view in the initial skeleton screen when generating the initial skeleton screen, thereby improving the efficiency and accuracy of the client generating the initial skeleton screen. The second JSON file and the second picture of the initial skeleton screen reported by the server are received, and the corresponding view is drawn according to the second JSON file and the second picture, and the view is determined as the target skeleton screen of the target page. The client draws the target skeleton screen according to the modified and optimized style, thereby avoiding the phenomenon that the client and the server need to communicate and interact multiple times to generate the target skeleton screen, saving the communication time between the client and the server, and improving the generation efficiency of the target skeleton screen of the client.
[0182] Embodiment 4
[0183] Figure 4 It is a structural diagram of an artificial intelligence-based skeleton screen generation device provided in Example 4 of the present invention.
[0184] In some embodiments, the artificial intelligence-based skeleton screen generation device 40 may include a plurality of functional modules composed of program code segments. The program code of each program segment in the artificial intelligence-based skeleton screen generation device 40 may be stored in the memory of the electronic device and executed by the at least one processor to execute (see Figure 2 Description) Function of skeleton screen generation based on artificial intelligence.
[0185] In this embodiment, the artificial intelligence-based skeleton screen generation device 40 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: a receiving module 401, a recognition module 402, an adjustment module 403 and a sending module 404. The module referred to in the present invention refers to a series of computer-readable instruction segments that can be executed by at least one processor and can complete a fixed function, which is stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.
[0186] In this embodiment, when the client displays page data, it is necessary to continuously pull page data from the server. In the process of rendering the pulled page data, skeleton screen technology is required. Specifically, the skeleton screen refers to showing the user the approximate structure of the page before the page data is loaded, and rendering the actual page content after obtaining the interface data and then replacing it.
[0187] In this embodiment, the server sends a skeleton screen generation request to the client. When the client receives the skeleton screen generation request, the client parses the skeleton screen generation request, obtains a page configuration file, traverses the code corresponding to each key value in the page configuration file, determines that a skeleton screen page needs to be generated, and automatically generates a skeleton screen for the skeleton screen page to obtain a first JSON file and a first image of an initial skeleton screen, and sends the first JSON file and the first image of the initial skeleton screen to the server. When the server receives the first JSON file and the first image of the initial skeleton screen, the server determines whether a preset visual condition is met according to a style displayed by the first image. When it is determined that the preset visual condition is not met, the server adjusts the first JSON file of the initial skeleton screen, adjusts the properties of each view in the first JSON file, obtains a skeleton screen that meets the preset visual condition, and sends a second JSON file corresponding to the skeleton screen that meets the visual condition to the client. When the client receives the second JSON file, the client parses the second JSON file and draws the target skeleton screen.
[0188] The receiving module 401 is used to receive a first JSON file and a first picture of an initial skeleton screen of a target page reported by a client.
[0189] In this embodiment, the first IJSON file of the initial skeleton screen is obtained by the client executing the skeleton screen automatic generation code of the target page. Specifically, the first JSON file contains JSON files of multiple views, and the JSON file of each view is obtained by the server converting the attributes of each view according to a preset conversion rule. The attributes of each view are obtained by the server traversing each view node in the tree structure corresponding to the skeleton screen automatic generation code of the target page.
[0190] The first picture of the initial skeleton screen refers to the picture drawn by the client through the underlying drawing method according to the first JSON file of the initial skeleton screen.
[0191] The identification module 402 is used to identify whether the first image of the initial skeleton screen meets the preset visual requirements.
[0192] In this embodiment, visual requirements may be preset. Specifically, the preset visual requirements may be set according to the skeleton screen automatic generation code for each skeleton screen page that needs to be generated, or may be set according to the page visual requirements for each skeleton screen page that needs to be generated.
[0193] In an optional embodiment, the identification module 402 identifies whether the first image of the initial skeleton screen meets the preset visual requirements, including:
[0194] Traversing the attributes of each view in the first picture of the initial skeleton screen;
[0195] Matching the attribute of each view in the first picture of the initial skeleton screen with the attribute of each view in the preset view requirement;
[0196] When the attribute of each view in the first picture of the initial skeleton screen completely matches the attribute of each view in the preset view requirement, determining that the first picture of the initial skeleton screen meets the preset visual requirement; or
[0197] When the attribute of each view in the first picture of the initial skeleton screen does not completely match the attribute of each view in the preset view requirement, it is determined that the first picture of the initial skeleton screen does not meet the preset visual requirement.
[0198] The adjustment module 403 is used to adjust the first JSON file and the first image of the initial skeleton screen based on the preset visual requirements to obtain the second JSON file and the second image of the initial skeleton screen when the image of the initial skeleton screen does not meet the preset visual requirements.
[0199] In this embodiment, by pre-setting visual requirements, it is determined whether the initial skeleton screen needs to change its style. If the style needs to be changed, the view that needs to be changed in the first JSON file is changed based on the first image of the initial skeleton screen to obtain the second JSON file and the second image corresponding to the optimal skeleton screen, thereby solving the problem of slow skeleton screen generation caused by the server redesigning the skeleton screen code when changing the style.
[0200] The sending module 404 is used to send the second JSON file and the second picture of the initial skeleton screen to the client, and the client draws a corresponding view according to the second JSON file and the second picture, and determines the view as the target skeleton screen of the target page.
[0201] In this embodiment, when the server determines that the image of the initial skeleton screen does not meet the preset visual requirements, the properties of each view in the first JSON file of the initial skeleton screen are adjusted according to the visual requirements. Specifically, the properties of each view include: size, position, type, filling requirements, view text and text style and other properties.
[0202] In this embodiment, the server sends the adjusted second JSON file and second image of the initial skeleton screen to the client, and the client can directly draw the target skeleton screen of the target page according to the second JSON file and the second image, thereby reducing the number of interactions between the client and the server, saving communication costs, and thus improving the generation efficiency of the skeleton screen.
[0203] To summarize, the artificial intelligence-based skeleton screen generation device described in this embodiment receives the first JSON file and the first image of the initial skeleton screen of the target page reported by the client, and identifies whether the first image of the initial skeleton screen meets the visual requirements. If not, the view that needs to be changed in the first JSON file is changed based on the first image of the initial skeleton screen to obtain the second JSON file corresponding to the optimal skeleton screen, which solves the problem of slow skeleton screen generation caused by the server redesigning the skeleton screen code when changing the style. The second JSON file and the second image of the initial skeleton screen are sent to the client, which reduces the number of interactions between the client and the server, saves communication costs, and thus improves the generation efficiency of the skeleton screen.
[0204] Embodiment 5
[0205] See also Figure 5 FIG. 2 is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. In a preferred embodiment of the present invention, the electronic device 5 includes a memory 51 , at least one processor 52 , at least one communication bus 53 and a transceiver 54 .
[0206] Those skilled in the art should understand that Figure 5 The structure of the electronic device shown does not constitute a limitation of the embodiments of the present invention, and may be a bus structure or a star structure. The electronic device 5 may also include more or less other hardware or software than shown in the figure, or a different arrangement of components.
[0207] In some embodiments, the electronic device 5 is an electronic device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits, programmable gate arrays, digital processors, and embedded devices. The electronic device 5 may also include client devices, which include but are not limited to any electronic product that can interact with a client through a keyboard, mouse, remote control, touchpad, or voice-controlled device, such as a personal computer, tablet computer, smart phone, digital camera, etc.
[0208] It should be noted that the electronic device 5 is only an example, and other existing or future electronic products that are suitable for the present invention should also be included in the protection scope of the present invention and included here by reference.
[0209] In some embodiments, the memory 51 is used to store program codes and various data, such as the artificial intelligence-based skeleton screen generation device 30 or the artificial intelligence-based skeleton screen generation device 40 installed in the electronic device 5, and realize high-speed and automatic access to programs or data during the operation of the electronic device 5. The memory 51 includes a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0210] In some embodiments, the at least one processor 52 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The at least one processor 52 is the control core (Control Unit) of the electronic device 5, and uses various interfaces and lines to connect various components of the entire electronic device 5, and executes various functions and processes data of the electronic device 5 by running or executing programs or modules stored in the memory 51, and calling data stored in the memory 51.
[0211] In some embodiments, the at least one communication bus 53 is configured to implement connection and communication between the memory 51 and the at least one processor 52, etc.
[0212] Although not shown, the electronic device 5 may also include a power source (such as a battery) for supplying power to each component. Optionally, the power source may be logically connected to the at least one processor 52 through a power management device, so that the power management device can manage charging, discharging, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device 5 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0213] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0214] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, electronic device, or network device, etc.) or a processor to execute a part of the method described in each embodiment of the present invention.
[0215] In a further embodiment, in combination Figure 3 or Figure 4 The at least one processor 52 can execute the operating device of the electronic device 5 and various installed application programs (such as the artificial intelligence-based skeleton screen generation device 30 or the artificial intelligence-based skeleton screen generation device 40), program codes, etc., for example, the above-mentioned modules.
[0216] The memory 51 stores program codes, and the at least one processor 52 can call the program codes stored in the memory 51 to execute related functions. For example, Figure 3 or Figure 4 The modules described in the figure are program codes stored in the memory 51 and are executed by the at least one processor 52, thereby realizing the functions of the modules to achieve the purpose of skeleton screen generation based on artificial intelligence.
[0217] Exemplarily, the program code may be divided into one or more modules / units, which are stored in the memory 51 and executed by the processor 52 to complete the present application. The one or more modules / units may be a series of computer-readable instruction segments capable of completing specific functions, which are used to describe the execution process of the program code in the electronic device 5. For example, the program code may be divided into a first acquisition module 301, a judgment module 302, a second acquisition module 303, an execution module 304, and a determination module 305, or the program code may be divided into a receiving module 401, an identification module 402, an adjustment module 403, and a sending module 404.
[0218] In one embodiment of the present invention, the memory 51 stores a plurality of computer-readable instructions, and the plurality of computer-readable instructions are executed by the at least one processor 52 to implement the function of skeleton screen generation based on artificial intelligence.
[0219] Specifically, the specific implementation method of the at least one processor 52 for the above instructions can refer to Figure 1 or Figure 2 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0220] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0221] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0222] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0223] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "including" does not exclude other units or, and the singular does not exclude the plural. The multiple units or devices stated in the present invention can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0224] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A skeleton screen generation method based on artificial intelligence, applied to the client, characterized in that: The method comprises: In response to a skeleton screen generation request from the server, a page configuration file is obtained, wherein the page configuration file includes at least one key-value pair; Determine whether each key value in the page configuration file meets the preset automatic skeleton screen generation requirements; When any key value in the page configuration file meets the preset skeleton screen generation requirement, the skeleton screen automatic generation code of the target page corresponding to the key of the any key value is obtained; Executing the skeleton screen automatic generation code of the target page to obtain the first JSON file and the first picture of the initial skeleton screen of the target page, including: traversing each view node in the tree structure corresponding to the skeleton screen automatic generation code to obtain the attributes of each view; converting the attributes of each view into a JSON format file according to a preset conversion rule to obtain the JSON file of each view; merging multiple JSON files of multiple views to obtain the first JSON file of the initial skeleton screen of the target page; according to the first JSON file of the initial skeleton screen, according to the display requirements corresponding to the target page in the skeleton screen generation request, drawing a corresponding picture, and determining the picture as the first picture of the initial skeleton screen of the target page, wherein the preset conversion rule is pre-set based on the attributes of each view in the target page; Receive the second JSON file and the second picture of the initial skeleton screen reported by the server, draw a corresponding view according to the second JSON file and the second picture, and determine the view as the target skeleton screen of the target page, wherein the second JSON file and the second picture of the initial skeleton screen are obtained by adjusting the first JSON file and the first picture of the initial skeleton screen by the server based on preset visual requirements.
2. The method for generating a skeleton screen based on artificial intelligence according to claim 1, characterized in that: The step of obtaining a page configuration file in response to a skeleton screen generation request from the server includes: Parsing the message of the skeleton screen generation request to obtain the message information carried by the message; A calling interface is obtained from the message information, and a page configuration file is obtained through the calling interface, wherein the page configuration file includes a plurality of key-value pairs.
3. The method for generating a skeleton screen based on artificial intelligence according to claim 1, characterized in that: The step of judging whether each key value in the page configuration file meets the preset requirement of automatically generating a skeleton screen includes: A code identifying each key value in the page configuration file; When the code of each key value in the page configuration file is a skeleton screen automatic generation code, determining that each key value in the page configuration file meets a preset skeleton screen automatic generation requirement; or When the code of each key value in the page configuration file is not a skeleton screen automatic generation code, it is determined that each key value in the page configuration file does not meet the preset skeleton screen automatic generation requirement.
4. A skeleton screen generation method based on artificial intelligence, applied to the server, characterized in that: The method comprises: Receive a first JSON file and a first image of an initial skeleton screen of a target page reported by a client, wherein the first JSON file of the initial skeleton screen is obtained by the client executing the skeleton screen automatic generation code of the target page, the first JSON file includes JSON files of multiple views, and the JSON file of each view is obtained by the server converting the attributes of each view according to a preset conversion rule, and the first image of the initial skeleton screen of the target page is obtained by drawing a corresponding image according to the first JSON file of the initial skeleton screen and the display requirements corresponding to the target page in the skeleton screen generation request, wherein the preset conversion rule is pre-set based on the attributes of each view in the target page; Identifying whether the first image of the initial skeleton screen meets preset visual requirements; When the image of the initial skeleton screen does not meet the preset visual requirement, adjusting the first JSON file and the first image of the initial skeleton screen based on the preset visual requirement to obtain a second JSON file and a second image of the initial skeleton screen; The second JSON file and the second picture of the initial skeleton screen are sent to the client, and the client draws a corresponding view according to the second JSON file and the second picture, and determines the view as the target skeleton screen of the target page.
5. The method for generating a skeleton screen based on artificial intelligence as claimed in claim 4, characterized in that: The step of identifying whether the first image of the initial skeleton screen meets the preset visual requirements includes: Traversing the attributes of each view in the first picture of the initial skeleton screen; Matching the attribute of each view in the first picture of the initial skeleton screen with the attribute of each view in the preset view requirement; When the attribute of each view in the first picture of the initial skeleton screen completely matches the attribute of each view in the preset view requirement, determining that the first picture of the initial skeleton screen meets the preset visual requirement; or When the attribute of each view in the first picture of the initial skeleton screen does not completely match the attribute of each view in the preset view requirement, it is determined that the first picture of the initial skeleton screen does not meet the preset visual requirement.
6. A skeleton screen generation device based on artificial intelligence, characterized in that: Running on the client, the device is used to implement the skeleton screen generation method based on artificial intelligence as described in any one of claims 1 to 3, and the device includes: A first acquisition module, configured to acquire a page configuration file in response to a skeleton screen generation request from a server, wherein the page configuration file includes at least one key-value pair; A judgment module, used to judge whether each key value in the page configuration file meets the preset requirements for automatically generating a skeleton screen; A second acquisition module is used to acquire the skeleton screen automatic generation code of the target page corresponding to the key of any key value when any key value in the page configuration file meets the preset skeleton screen generation requirement; An execution module, used for executing the skeleton screen automatic generation code of the target page, and obtaining a first JSON file and a first picture of the initial skeleton screen of the target page; A determination module is used to receive a second JSON file and a second image of the initial skeleton screen reported by the server, and to draw a corresponding view according to the second JSON file and the second image, and to determine the view as the target skeleton screen of the target page, wherein the second JSON file and the second image of the initial skeleton screen are obtained by adjusting the first JSON file and the first image of the initial skeleton screen by the server based on preset visual requirements.
7. A skeleton screen generation device based on artificial intelligence, characterized in that: Running on the server side, the device is used to implement the skeleton screen generation method based on artificial intelligence as claimed in claim 4 or 5, and the device includes: A receiving module, used for receiving a first JSON file and a first picture of an initial skeleton screen of a target page reported by a client; An identification module, used to identify whether the first image of the initial skeleton screen meets the preset visual requirements; An adjustment module, configured to adjust the first JSON file and the first image of the initial skeleton screen based on the preset visual requirements to obtain a second JSON file and a second image of the initial skeleton screen when the image of the initial skeleton screen does not meet the preset visual requirements; A sending module is used to send a second JSON file and a second picture of the initial skeleton screen to the client, and the client draws a corresponding view according to the second JSON file and the second picture, and determines the view as a target skeleton screen of the target page.
8. An electronic device, characterized in that: The electronic device comprises a processor and a memory, and the processor is used to implement the skeleton screen generation method based on artificial intelligence as claimed in any one of claims 1 to 3 or claim 4 or 5 when executing the computer program stored in the memory.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the skeleton screen generation method based on artificial intelligence as claimed in any one of claims 1 to 3 or as claimed in claim 4 or 5 is implemented.
Citation Information
Patent Citations
Animation processing method and device and storage medium
CN108010112A