CN113835706A - Skeleton screen generation method and device based on artificial intelligence, electronic equipment and medium - Google Patents

Skeleton screen generation method and device based on artificial intelligence, electronic equipment and medium Download PDF

Info

Publication number
CN113835706A
CN113835706A CN202111154990.0A CN202111154990A CN113835706A CN 113835706 A CN113835706 A CN 113835706A CN 202111154990 A CN202111154990 A CN 202111154990A CN 113835706 A CN113835706 A CN 113835706A
Authority
CN
China
Prior art keywords
skeleton screen
picture
initial
page
screen
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111154990.0A
Other languages
Chinese (zh)
Inventor
朱志强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202111154990.0A priority Critical patent/CN113835706A/en
Publication of CN113835706A publication Critical patent/CN113835706A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • G06F8/4441Reducing the execution time required by the program code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to the technical field of artificial intelligence, and provides a skeleton screen generation method and device based on artificial intelligence, an electronic device and a medium, wherein the method comprises the following steps: when any key value in the page configuration file meets a preset skeleton screen generation requirement, acquiring a skeleton screen automatic generation code of a target page corresponding to a key of each key value; executing a skeleton screen automatic generation code of the target page to obtain a first JSON file and a first picture of an initial skeleton screen of the target page; and receiving a second JSON file and a second picture of the initial skeleton screen reported by the server, drawing a corresponding view according to the second JSON file and the second picture, and determining the view as a target skeleton screen of the target page. According to the method and the device, the target skeleton screen is drawn according to the received second JSON file and the second picture reported by the server, the phenomenon that the client and the server need to communicate and interact for many times to generate the target skeleton screen is avoided, and the generation efficiency of the target skeleton screen is improved.

Description

Skeleton screen generation method and device based on artificial intelligence, electronic equipment and medium
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a skeleton screen generation method and device based on artificial intelligence, electronic equipment and a medium.
Background
When browsing a web page or loading a new page using a client, a situation that the page is not loaded timely often occurs. In order to avoid the situation that a user mistakenly thinks that the page is abnormal due to the fact that the blank page is directly displayed, when the page is waiting to be loaded, a skeleton screen corresponding to the final page display effect is usually displayed for the user.
However, in the existing client side for displaying the skeleton screen, the skeleton screen to be displayed is written into the client side, the server side cannot know the style of the skeleton screen displayed by the client side, and particularly when the page requirement changes, or the page changes, or a new page is added to generate the skeleton screen, the server side needs to redesign the corresponding skeleton screen code to write into the client side, so that the generation efficiency of the skeleton screen is reduced.
Therefore, there is a need for a method for generating a skeleton screen quickly.
Disclosure of Invention
In view of the above, it is necessary to provide a method, an apparatus, an electronic device, and a medium for generating a skeleton screen based on artificial intelligence, in which a target skeleton screen is drawn according to a second JSON file and a second picture reported by a received server, so that a phenomenon that a client and the server need to communicate and interact for many times to generate the target skeleton screen is avoided, and generation efficiency of the target skeleton screen is improved.
The invention provides a skeleton screen generation method based on artificial intelligence, which is applied to a client and comprises the following steps:
responding to a skeleton screen generation request of a server, and acquiring a page configuration file, wherein the page configuration file comprises at least one key value pair;
judging whether each key value in the page configuration file meets the preset requirements of automatically generating a skeleton screen;
when any key value in the page configuration file meets a preset skeleton screen generation requirement, acquiring a skeleton screen automatic generation code of a target page corresponding to a key of the any key value;
executing a skeleton screen automatic generation code of the target page to obtain a first JSON file and a first picture of an initial skeleton screen of the target page;
receiving a second JSON file and a second picture of an initial skeleton screen reported by a server, drawing a corresponding view according to the second JSON file and the second picture, and determining the view as a 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 a preset visual requirement.
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:
traversing each view node in the tree structure corresponding to the skeleton screen automatic generation code to obtain the attribute of each view;
converting the attribute of each view into a JSON format file according to a preset conversion rule to obtain the JSON file of each view;
combining a plurality of JSON files of a plurality of views to obtain a first JSON file of an initial skeleton screen of the target page;
drawing a corresponding picture according to the first JSON file of the initial skeleton screen and the display requirement corresponding to the target page in the skeleton screen generation request, and determining the picture as the first picture of the initial skeleton screen of the target page.
Optionally, the generating a request in response to the skeleton screen of the server, and the acquiring a page configuration file includes:
analyzing the message of the skeleton screen generation request to obtain message information carried by the message;
and acquiring a calling interface from the message information, and acquiring a page configuration file through the calling interface, wherein the page configuration file comprises a plurality of key value pairs.
Optionally, the determining whether each key value in the page configuration file meets a preset requirement for automatically generating a skeleton screen includes:
code that identifies each key value in the page profile;
when the code of each key value in the page configuration file is an automatic skeleton screen generation code, determining that each key value in the page configuration file meets the preset automatic skeleton screen generation requirement; or
And when the code of each key value in the page configuration file is not the automatic skeleton screen generation code, determining that each key value in the page configuration file does not meet the preset automatic skeleton screen generation requirement.
The 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 includes:
receiving a first JSON file and a first picture of an initial skeleton screen of a target page reported by a client;
identifying whether the first picture of the initial skeleton screen meets a preset visual requirement or not;
when the picture of the initial skeleton screen does not meet the preset visual requirement, adjusting a first JSON file and a first picture of the initial skeleton screen based on the preset visual requirement to obtain a second JSON file and a second picture of the initial skeleton screen;
and sending a second JSON file and a second picture of the initial skeleton screen to the client, drawing a corresponding view by the client according to the second JSON file and the second picture, and determining the view as a target skeleton screen of the target page.
Optionally, the identifying whether the first picture of the initial skeleton screen meets a preset visual requirement includes:
traversing attributes of each view in a first picture of the initial skeletal screen;
matching the attribute of each view in the first picture of the initial skeleton screen with the attribute of each view in preset view requirements;
when the attribute of each view in the first picture of the initial skeleton screen is completely matched with the attribute of each view in preset view requirements, determining that the first picture of the initial skeleton screen meets the preset visual requirements; or
Determining that the first picture of the initial skeletal screen does not meet preset visual requirements when the attributes of each view in the first picture of the initial skeletal screen do not completely match the attributes of each view in the preset view requirements.
The third aspect of the present invention provides a skeleton screen generating device based on artificial intelligence, running on a client, the device comprising:
the first acquisition module is used for responding to a skeleton screen generation request of a server and acquiring a page configuration file;
the judging module is used for judging whether each key value in the page configuration file meets the preset requirement of automatically generating the skeleton screen;
the second obtaining module is used for obtaining a skeleton screen automatic generation code of a target page corresponding to a key of any key value when any key value in the page configuration file meets a preset skeleton screen generation requirement;
the execution module is used for 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;
the determining module is used for receiving a second JSON file and a second picture of the initial skeleton screen reported by the server, drawing a corresponding view according to the second JSON file and the second picture, and determining the view as a target skeleton screen of the target page, wherein the second JSON file and the second picture of the initial skeleton screen are obtained by the server after adjusting the first JSON file and the first picture of the initial skeleton screen based on a preset visual requirement.
The fourth aspect of the present invention provides a skeleton screen generating device based on artificial intelligence, operating on a server, the device comprising:
the receiving module is used for receiving a first JSON file and a first picture of an initial skeleton screen of a target page reported by a client;
the identification module is used for identifying whether the first picture of the initial skeleton screen meets a preset visual requirement or not;
the adjusting module is used for adjusting the first JSON file and the first picture of the initial skeleton screen based on the preset visual requirement to obtain a second JSON file and a second picture of the initial skeleton screen when the picture of the initial skeleton screen does not meet the preset visual requirement;
and the sending module is used for sending 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 a target skeleton screen of the target page.
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.
A sixth aspect of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the artificial intelligence based skeleton screen generating method.
In summary, according to the method, the device, the electronic device and the medium for generating the skeleton screen based on the artificial intelligence, whether each page needs to generate the skeleton screen is determined according to the code of each key value in the page configuration file, whether each page needs to generate the skeleton screen can be determined by fast reading, a client does not need to continuously pull data from a server to determine whether each page needs to generate the skeleton screen, and the efficiency of generating the skeleton screen is improved. When any key value in the page configuration file meets the preset skeleton screen generation requirement, executing a skeleton screen automatic generation code of a target page corresponding to the key of each key value to obtain a first JSON file and a first picture of an initial skeleton screen of the target page, solving the problem that a button needs to be clicked once for each view in the initial skeleton screen when the initial skeleton screen is generated in the prior art, and improving the efficiency and accuracy of generating the initial skeleton screen by a client. Receiving a second JSON file and a second picture of an initial skeleton screen reported by a server, drawing a corresponding view according to the second JSON file and the second picture, determining the view as a target skeleton screen of the target page, drawing the target skeleton screen by the client according to the changed and optimized style, avoiding the phenomenon that the client and the server need to communicate and interact for many times to generate the target skeleton screen, saving the communication time of the client and the server, and improving the generation efficiency of the target skeleton screen of the client.
Drawings
Fig. 1 is a flowchart of a skeleton screen generation method based on artificial intelligence according to an embodiment of the present invention.
Fig. 2 is a flowchart of a skeleton screen generation method based on artificial intelligence according to a second embodiment of the present invention.
Fig. 3 is a structural diagram of a skeleton screen generating apparatus based on artificial intelligence according to a third embodiment of the present invention.
Fig. 4 is a structural diagram of a skeleton screen generating apparatus based on artificial intelligence according to a fourth embodiment of the present invention.
Fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention.
Detailed Description
In order that the above objects, features and advantages of the present invention can be more clearly understood, a detailed description of the present invention will be given below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and features of the embodiments may be combined with each other without conflict.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
Example one
Fig. 1 is a flowchart of a skeleton screen generation method based on artificial intelligence according to an embodiment of the present invention.
In this embodiment, the method for generating a skeleton screen based on artificial intelligence may be applied to an electronic device, and for an electronic device that needs to perform skeleton screen generation based on artificial intelligence, a function of skeleton screen generation based on artificial intelligence provided by the method of the present invention may be directly integrated on the electronic device, or may be run in the electronic device in a Software Development Kit (SDK) form.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning, deep learning and the like.
In this embodiment, when the client displays the page data, the page data needs to be continuously pulled from the server, and in the process of rendering the pulled page data, a skeleton screen technology needs to be used, specifically, the skeleton screen refers to that before the page data is loaded, a rough structure of the page is displayed for the user, and after the interface data is taken, the actual page content is rendered and then replaced.
In the embodiment, the server sends a skeleton screen generation request to the client, when the client receives the skeleton screen generation request, the skeleton screen generation request is analyzed to obtain a page configuration file, codes corresponding to each key value in the page configuration file are traversed, a skeleton screen page needing to be generated are determined, automatic skeleton screen generation is performed on the skeleton screen page, a first JSON file and a first picture of an initial skeleton screen are obtained, the first JSON file and the first picture of the initial skeleton screen are sent to the server, when the server receives the first JSON file and the first picture of the initial skeleton screen, the server determines whether a preset visual condition is met according to a style displayed by the first picture, when the preset visual condition is determined not to be met, the first JSON file of the initial skeleton screen is adjusted, and attributes of each view in the first JSON file are adjusted, and obtaining a skeleton screen meeting preset visual conditions, sending a second JSON file corresponding to the skeleton screen meeting the visual conditions to a client, and when the client receives the second JSON file, analyzing the second JSON file at the client and drawing a target skeleton screen.
As shown in fig. 1, the skeleton screen generation method based on artificial intelligence is specifically applied to a client, and includes the following steps, and according to different requirements, the order of the steps in the flowchart may be changed, and some may be omitted.
S11, responding to a skeleton screen generation request of a server, and acquiring a page configuration file, wherein the page configuration file comprises at least one key value pair.
In this embodiment, when a skeleton screen of a page is generated, a server sends a skeleton screen generation request to a client, specifically, the client may be a smart phone, an IPAD, or other existing intelligent device with a function of generating a skeleton screen, the server may be a skeleton screen design system, and 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 during the skeleton screen generation process, where the page configuration file includes a plurality of key value pairs, each key refers to an object in data, may be a page name, and each key value correspondingly includes a code, for example, the code may be TRUE or FALSE, and different codes represent different meanings.
In an optional embodiment, the obtaining a page configuration file in response to the skeleton screen generation request of the server includes:
analyzing the message of the skeleton screen generation request to obtain message information carried by the message;
and acquiring a calling interface from the message information, and acquiring a page configuration file through the calling interface, wherein the page configuration file comprises at least one key value pair.
In the embodiment, the configuration information of the page is stored in the page configuration file in advance in a key value pair mode, so that the efficiency of subsequently traversing the code of each key value is improved.
And S12, judging whether each key value in the page configuration file meets the preset requirements of automatically generating the skeleton screen.
In this embodiment, when determining whether each page needs a skeleton screen, each key value in the page configuration file needs to be traversed, and whether each page needs to execute automatic generation of the skeleton screen is determined according to a code corresponding to each key value.
In an optional embodiment, the determining whether each key value in the page configuration file meets a preset requirement for automatically generating a skeleton screen includes:
code that identifies each key value in the page profile;
when the code of each key value in the page configuration file is an automatic skeleton screen generation code, determining that each key value in the page configuration file meets the preset automatic skeleton screen generation requirement; or
And when the code of each key value in the page configuration file is not the automatic skeleton screen generation code, determining that each key value in the page configuration file does not meet the preset automatic skeleton screen generation requirement.
In an optional embodiment, the method further comprises:
and when each key value in the page configuration file is determined not to meet the preset requirements for automatically generating the skeleton screen, rejecting to automatically generate the skeleton screen for the target page corresponding to the key of each key value in the page configuration file.
Exemplarily, if the code of each key value is a TRUE code, it is determined that the page corresponding to each key value needs a skeleton screen; and if the code of each key value is FALSE, determining that the page corresponding to each key value does not need a skeleton screen.
In the embodiment, whether each page needs to generate the skeleton screen is determined according to the code of each key value in the page configuration file, whether each page needs to generate the skeleton screen can be determined by fast reading, the client does not need to continuously pull data from the server to determine whether each page needs to generate the skeleton screen, and the efficiency of generating the skeleton screen is improved.
And S13, when any key value in the page configuration file meets the preset skeleton screen generation requirement, acquiring the skeleton screen automatic generation code of the target page corresponding to the key of the any key value.
In this embodiment, a skeleton screen generation requirement may be preset, specifically, the preset skeleton screen generation requirement is set based on a requirement of a visual designer at a server, for example, if a page a needs to generate a skeleton screen, a code of a key value corresponding to the page a is set to a code that meets the preset skeleton screen generation requirement.
In this embodiment, the automatic skeleton screen generation code means that a skeleton screen can be generated according to the automatic skeleton screen generation code, and specifically, the automatic skeleton screen generation code may be stored in a preset code database in advance, or may be associated with each key value corresponding key in advance and stored in a page configuration file.
In an optional embodiment, the obtaining of the skeleton screen automatic generation code of the target page corresponding to the key of any one key value includes:
identifying a page name corresponding to a key of any key value;
and acquiring a skeleton screen automatic generation code of the corresponding target page based on the page name.
In the embodiment, when any key value is determined to meet the preset skeleton screen generation requirement, the skeleton screen automatic generation code of the target page is obtained through the page name corresponding to the key of each key value, pertinence is achieved, and the accuracy of the obtained skeleton screen automatic generation code of the target page is ensured.
And S14, 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.
In this embodiment, if each key value meets a preset skeleton screen generation request, it is determined that a target page corresponding to each key value needs to generate a skeleton screen, and a first JSON file and a first picture of an initial skeleton screen are generated by executing a skeleton screen automatic generation code of the target page.
In this embodiment, because the first JSON file and the first picture of the initial skeleton screen are obtained by executing the skeleton screen to automatically generate the code, the problem that a button needs to be clicked once for each view in the initial skeleton screen when the initial skeleton screen is generated in the prior art is solved, and the efficiency and accuracy of generating the initial skeleton screen by the client are improved.
In an optional embodiment, 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:
traversing each view node in the tree structure corresponding to the skeleton screen automatic generation code to obtain the attribute of each view;
converting the attribute of each view into a JSON format file according to a preset conversion rule to obtain the JSON file of each view;
combining a plurality of JSON files of a plurality of views to obtain a first JSON file of an initial skeleton screen of the target page;
drawing a corresponding picture according to the first JSON file of the initial skeleton screen and the display requirement corresponding to the target page in the skeleton screen generation request, and determining the picture as the first picture of the initial skeleton screen of the target page.
In this embodiment, the skeleton screen automatically generates codes and arranges the codes in a tree structure.
Specifically, the attributes of each view include one or more of the following combinations: size, location, and type.
In other alternative embodiments, the attributes of each view may include fill requirements, view text, and text style, among other attributes.
In this embodiment, the display requirement refers to the color displayed on the initial skeleton screen by each view.
In this embodiment, a conversion rule may be preset, specifically, the preset conversion rule is preset based on an attribute of each view in the target page, where the attribute of each view is an XML file, and the first JSON format file is generated based on text content by converting the XML file corresponding to the attribute of each view into the text content.
In the embodiment, compared with the XML file, the JSON format file can quickly see the content therein, is more efficient in writing, transmission or analysis, and can simultaneously support multiple voices, and the corresponding first JSON format file is generated by traversing each view node in the tree structure recursively through the XML file corresponding to the attribute of each view, thereby improving the efficiency of subsequently drawing the target skeleton screen.
And S15, receiving a second JSON file and a second picture of the initial skeleton screen reported by the server, drawing a corresponding view according to the second JSON file and the second picture, and determining the view as a target skeleton screen of the target page, wherein the second JSON file and the second picture of the initial skeleton screen are obtained by the server adjusting the first JSON file and the first picture of the initial skeleton screen based on a preset visual requirement.
In this embodiment, the second JSON file is obtained by adjusting, by the server, the first JSON file according to the first picture corresponding to the initial skeleton screen; and the target skeleton screen is obtained by drawing after the second JSON file is analyzed.
In an optional embodiment, the drawing a corresponding view according to the second JSON file and the second picture, and determining the view as a target skeleton screen of the target page includes:
traversing the second JSON file based on the second picture to obtain the attribute of the view corresponding to each view node;
and according to the attribute of the view corresponding to each view node, drawing the corresponding view by adopting a drawing method in a preset drawing tool, and determining the view as a target skeleton screen of the target page.
In this embodiment, the preset drawing tool may be a canvas tool provided by a client, and the drawing method in the canvas tool is adopted to draw the corresponding view according to the attribute of the view corresponding to each view node.
In the embodiment, a skeleton screen generation request is sent to a client through a server, the client determines a first JSON file and a first picture of an initial skeleton screen based on the skeleton screen generation request, the server can adjust the first JSON file and the first picture of the initial skeleton screen reported by the client and send a second JSON file and a second picture obtained by adjustment to the client, the client analyzes the second JSON file to draw a target skeleton screen, the server can change an optimization style according to the initial skeleton screen reported by the client, the client draws the target skeleton screen according to the optimized style, the phenomenon that the client and the server need to communicate and interact for many times to obtain the target skeleton screen is avoided, the communication time between the client and the server is saved, and meanwhile, corresponding skeleton screen codes do not need to be redesigned for page demand change, page change or newly added pages, and the first JSON file of the initial skeleton screen is directly modified, so that the generation efficiency of the target skeleton screen of the client is improved.
In summary, in the method for generating a skeleton screen based on artificial intelligence according to the embodiment, whether each page needs to generate the skeleton screen is determined according to the code of each key value in the page configuration file, whether each page needs to generate the skeleton screen can be determined by fast reading, and a client does not need to continuously pull data from a server to determine whether each page needs to generate the skeleton screen, so that the efficiency of generating the skeleton screen is improved. When any key value in the page configuration file meets the preset skeleton screen generation requirement, executing a skeleton screen automatic generation code of a target page corresponding to the key of each key value to obtain a first JSON file and a first picture of an initial skeleton screen of the target page, solving the problem that a button needs to be clicked once for each view in the initial skeleton screen when the initial skeleton screen is generated in the prior art, and improving the efficiency and accuracy of generating the initial skeleton screen by a client. Receiving a second JSON file and a second picture of an initial skeleton screen reported by a server, drawing a corresponding view according to the second JSON file and the second picture, determining the view as a target skeleton screen of the target page, drawing the target skeleton screen by the client according to the changed and optimized style, avoiding the phenomenon that the client and the server need to communicate and interact for many times to generate the target skeleton screen, saving the communication time of the client and the server, and improving the generation efficiency of the target skeleton screen of the client.
Example two
Fig. 2 is a flowchart of a skeleton screen generation method based on artificial intelligence according to a second embodiment of the present invention.
In this embodiment, the method for generating a skeleton screen based on artificial intelligence may be applied to an electronic device, and for an electronic device that needs to perform skeleton screen generation based on artificial intelligence, a function of skeleton screen generation based on artificial intelligence provided by the method of the present invention may be directly integrated on the electronic device, or may be run in the electronic device in a Software Development Kit (SDK) form.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning, deep learning and the like.
In this embodiment, when the client displays the page data, the page data needs to be continuously pulled from the server, and in the process of rendering the pulled page data, a skeleton screen technology needs to be used, specifically, the skeleton screen refers to that before the page data is loaded, a rough structure of the page is displayed for the user, and after the interface data is taken, the actual page content is rendered and then replaced.
In the embodiment, the server sends a skeleton screen generation request to the client, when the client receives the skeleton screen generation request, the skeleton screen generation request is analyzed to obtain a page configuration file, codes corresponding to each key value in the page configuration file are traversed, a skeleton screen page needing to be generated are determined, automatic skeleton screen generation is performed on the skeleton screen page, a first JSON file and a first picture of an initial skeleton screen are obtained, the first JSON file and the first picture of the initial skeleton screen are sent to the server, when the server receives the first JSON file and the first picture of the initial skeleton screen, the server determines whether a preset visual condition is met according to a style displayed by the first picture, when the preset visual condition is determined not to be met, the first JSON file of the initial skeleton screen is adjusted, and attributes of each view in the first JSON file are adjusted, and obtaining a skeleton screen meeting preset visual conditions, sending a second JSON file corresponding to the skeleton screen meeting the visual conditions to a client, and when the client receives the second JSON file, analyzing the second JSON file at the client and drawing a target skeleton screen.
As shown in fig. 2, the skeleton screen generation method based on artificial intelligence is applied to a server, and specifically includes the following steps, and according to different requirements, the order of the steps in the flowchart may be changed, and some may be omitted.
S21, receiving a first JSON file and a first picture of an initial skeleton screen of a target page reported by a client.
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, and specifically, the first JSON file includes JSON files of multiple views, and the JSON file of each view is obtained by the server converting the attribute of each view according to a preset conversion rule. And the attribute of each view is obtained by the server side traversing each view node in the tree structure corresponding to the automatic generation code of the skeleton screen of the target page.
The first picture of the initial skeleton screen is obtained by drawing the first JSON file of the initial skeleton screen through a bottom layer drawing method by the client.
And S22, identifying whether the first picture of the initial skeleton screen meets the preset visual requirement.
In this embodiment, the visual requirement may be preset, and specifically, the preset visual requirement may be set according to each skeleton screen automatic generation code for generating a skeleton screen page according to each requirement, or may also be set according to each page visual requirement for generating a skeleton screen page according to each requirement.
In an optional embodiment, the identifying whether the first picture of the initial skeletal screen meets a preset visual requirement includes:
traversing attributes of each view in a first picture of the initial skeletal screen;
matching the attribute of each view in the first picture of the initial skeleton screen with the attribute of each view in preset view requirements;
when the attribute of each view in the first picture of the initial skeleton screen is completely matched with the attribute of each view in preset view requirements, determining that the first picture of the initial skeleton screen meets the preset visual requirements; or
Determining that the first picture of the initial skeletal screen does not meet preset visual requirements when the attributes of each view in the first picture of the initial skeletal screen do not completely match the attributes of each view in the preset view requirements.
S23, when the picture of the initial skeleton screen does not meet the preset visual requirement, adjusting the first JSON file and the first picture of the initial skeleton screen based on the preset visual requirement to obtain a second JSON file and a second picture of the initial skeleton screen.
In the embodiment, whether the style of the initial skeleton screen needs to be changed or not is determined by presetting a visual requirement, if the style needs to be changed, the view of the style needing to be changed in the first JSON file is changed based on the first picture of the initial skeleton screen, and the second JSON file and the second picture corresponding to the optimal skeleton screen are obtained, so that the problem that the skeleton screen is slowly generated due to the fact that a server redesigns a skeleton screen code when the existing style is changed is solved.
And S24, sending the second JSON file and the second picture of the initial skeleton screen to the client, drawing a corresponding view by the client according to the second JSON file and the second picture, and determining the view as a target skeleton screen of the target page.
In this embodiment, when the server determines that the picture of the initial skeleton screen does not meet the preset visual requirement, the attribute of each view in the first JSON file of the initial skeleton screen is adjusted according to the visual requirement, specifically, the attribute of each view includes: size, location, type, fill requirements, view text, and text style, among other attributes.
In this embodiment, the server sends the adjusted second JSON file and second picture of the initial skeleton screen to the client, and the client can draw the target skeleton screen of the target page directly according to the second JSON file and second picture, so that the number of interactions between the client and the server is reduced, the communication cost is saved, and the generation efficiency of the skeleton screen is further improved.
In summary, in the method for generating a skeleton screen based on artificial intelligence according to this embodiment, a first JSON file and a first picture of an initial skeleton screen of a target page reported by a client are received, whether the first picture of the initial skeleton screen meets a visual requirement is identified, if not, a view in the first JSON file, which needs to be changed in style, is changed based on the first picture of the initial skeleton screen, so as to obtain a second JSON file corresponding to an optimal skeleton screen.
EXAMPLE III
Fig. 3 is a structural diagram of a skeleton screen generating apparatus based on artificial intelligence according to a third embodiment of the present invention.
In some embodiments, the artificial intelligence based skeleton screen generating apparatus 30 may include a plurality of functional modules composed of program code segments. Program code for various program segments in the artificial intelligence based skeletal screen generation apparatus 30 may be stored in a memory of the electronic device and executed by the at least one processor to perform functions of artificial intelligence based skeletal screen generation (described in detail with respect to fig. 1).
In this embodiment, the skeleton screen generating device 30 based on artificial intelligence runs on a client, and can be divided into a plurality of functional modules according to the functions executed by the client. The functional module may include: a first obtaining module 301, a determining module 302, a second obtaining module 303, an executing module 304 and a determining module 305. The module referred to herein is a series of computer readable instruction segments stored in a memory that can be executed by at least one processor and that can perform a fixed function. In the present embodiment, the functions of the modules will be described in detail in the following embodiments.
In this embodiment, when the client displays the page data, the page data needs to be continuously pulled from the server, and in the process of rendering the pulled page data, a skeleton screen technology needs to be used, specifically, the skeleton screen refers to that before the page data is loaded, a rough structure of the page is displayed for the user, and after the interface data is taken, the actual page content is rendered and then replaced.
In the embodiment, the server sends a skeleton screen generation request to the client, when the client receives the skeleton screen generation request, the skeleton screen generation request is analyzed to obtain a page configuration file, codes corresponding to each key value in the page configuration file are traversed, a skeleton screen page needing to be generated are determined, automatic skeleton screen generation is performed on the skeleton screen page, a first JSON file and a first picture of an initial skeleton screen are obtained, the first JSON file and the first picture of the initial skeleton screen are sent to the server, when the server receives the first JSON file and the first picture of the initial skeleton screen, the server determines whether a preset visual condition is met according to a style displayed by the first picture, when the preset visual condition is determined not to be met, the first JSON file of the initial skeleton screen is adjusted, and attributes of each view in the first JSON file are adjusted, and obtaining a skeleton screen meeting preset visual conditions, sending a second JSON file corresponding to the skeleton screen meeting the visual conditions to a client, and when the client receives the second JSON file, analyzing the second JSON file at the client and drawing a target skeleton screen.
The first obtaining module 301 is configured to obtain a page configuration file in response to a skeleton screen generation request of a server, where the page configuration file includes at least one key value pair.
In this embodiment, when a skeleton screen of a page is generated, a server sends a skeleton screen generation request to a client, specifically, the client may be a smart phone, an IPAD, or other existing intelligent device with a function of generating a skeleton screen, the server may be a skeleton screen design system, and 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 during the skeleton screen generation process, where the page configuration file includes a plurality of key value pairs, each key refers to an object in data, may be a page name, and each key value correspondingly includes a code, for example, the code may be TRUE or FALSE, and different codes represent different meanings.
In an optional embodiment, the first obtaining module 301, in response to a skeleton screen generation request of a server, obtains a page configuration file including:
analyzing the message of the skeleton screen generation request to obtain message information carried by the message;
and acquiring a calling interface from the message information, and acquiring a page configuration file through the calling interface, wherein the page configuration file comprises at least one key value pair.
In the embodiment, the configuration information of the page is stored in the page configuration file in advance in a key value pair mode, so that the efficiency of subsequently traversing the code of each key value is improved.
A determining module 302, configured to determine whether each key value in the page configuration file meets a preset requirement for automatically generating a skeleton screen.
In this embodiment, when determining whether each page needs a skeleton screen, each key value in the page configuration file needs to be traversed, and whether each page needs to execute automatic generation of the skeleton screen is determined according to a code corresponding to each key value.
In an optional embodiment, the determining module 302 determines whether each key value in the page configuration file meets a preset requirement for automatically generating a skeleton screen, including:
code that identifies each key value in the page profile;
when the code of each key value in the page configuration file is an automatic skeleton screen generation code, determining that each key value in the page configuration file meets the preset automatic skeleton screen generation requirement; or
And when the code of each key value in the page configuration file is not the automatic skeleton screen generation code, determining that each key value in the page configuration file does not meet the preset automatic skeleton screen generation requirement.
In an optional embodiment, when it is determined that each key value in the page configuration file does not meet a preset requirement for automatically generating a skeleton screen, automatically generating the skeleton screen for a target page corresponding to the key of each key value in the page configuration file is rejected.
Exemplarily, if the code of each key value is a TRUE code, it is determined that the page corresponding to each key value needs a skeleton screen; and if the code of each key value is FALSE, determining that the page corresponding to each key value does not need a skeleton screen.
In the embodiment, whether each page needs to generate the skeleton screen is determined according to the code of each key value in the page configuration file, whether each page needs to generate the skeleton screen can be determined by fast reading, the client does not need to continuously pull data from the server to determine whether each page needs to generate the skeleton screen, and the efficiency of generating the skeleton screen is improved.
A second obtaining module 303, configured to obtain, when any key value in the page configuration file meets a preset skeleton screen generation requirement, a skeleton screen automatic generation code of a target page corresponding to a key of the any key value.
In this embodiment, a skeleton screen generation requirement may be preset, specifically, the preset skeleton screen generation requirement is set based on a requirement of a visual designer at a server, for example, if a page a needs to generate a skeleton screen, a code of a key value corresponding to the page a is set to a code that meets the preset skeleton screen generation requirement.
In this embodiment, the automatic skeleton screen generation code means that a skeleton screen can be generated according to the automatic skeleton screen generation code, and specifically, the automatic skeleton screen generation code may be stored in a preset code database in advance, or may be associated with each key value corresponding key in advance and stored in a page configuration file.
In an optional embodiment, the obtaining, by the second obtaining module 303, the skeleton screen automatic generation code of the target page corresponding to the key of the any one key value includes:
identifying a page name corresponding to a key of any key value;
and acquiring a skeleton screen automatic generation code of the corresponding target page based on the page name.
In the embodiment, when any key value is determined to meet the preset skeleton screen generation requirement, the skeleton screen automatic generation code of the target page is obtained through the page name corresponding to the key of each key value, pertinence is achieved, and the accuracy of the obtained skeleton screen automatic generation code of the target page is ensured.
And the execution module 304 is configured to execute 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.
In this embodiment, if each key value meets a preset skeleton screen generation request, it is determined that a target page corresponding to each key value needs to generate a skeleton screen, and a first JSON file and a first picture of an initial skeleton screen are generated by executing a skeleton screen automatic generation code of the target page.
In this embodiment, because the first JSON file and the first picture of the initial skeleton screen are obtained by executing the skeleton screen to automatically generate the code, the problem that a button needs to be clicked once for each view in the initial skeleton screen when the initial skeleton screen is generated in the prior art is solved, and the efficiency and accuracy of generating the initial skeleton screen by the client are improved.
In an optional embodiment, the executing module 304 executes the skeleton screen automatic generation code of the target page, and obtaining the first JSON file and the first picture of the initial skeleton screen of the target page includes:
traversing each view node in the tree structure corresponding to the skeleton screen automatic generation code to obtain the attribute of each view;
converting the attribute of each view into a JSON format file according to a preset conversion rule to obtain the JSON file of each view;
combining a plurality of JSON files of a plurality of views to obtain a first JSON file of an initial skeleton screen of the target page;
drawing a corresponding picture according to the first JSON file of the initial skeleton screen and the display requirement corresponding to the target page in the skeleton screen generation request, and determining the picture as the first picture of the initial skeleton screen of the target page.
In this embodiment, the skeleton screen automatically generates codes and arranges the codes in a tree structure.
Specifically, the attributes of each view include one or more of the following combinations: size, location, and type.
In other alternative embodiments, the attributes of each view may include fill requirements, view text, and text style, among other attributes.
In this embodiment, the display requirement refers to the color displayed on the initial skeleton screen by each view.
In this embodiment, a conversion rule may be preset, specifically, the preset conversion rule is preset based on an attribute of each view in the target page, where the attribute of each view is an XML file, and the first JSON format file is generated based on text content by converting the XML file corresponding to the attribute of each view into the text content.
In the embodiment, compared with the XML file, the JSON format file can quickly see the content therein, is more efficient in writing, transmission or analysis, and can simultaneously support multiple voices, and the corresponding first JSON format file is generated by traversing each view node in the tree structure recursively through the XML file corresponding to the attribute of each view, thereby improving the efficiency of subsequently drawing the target skeleton screen.
The determining module 305 is configured to receive a second JSON file and a 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 a target skeleton screen of the target page, where the second JSON file and the second picture of the initial skeleton screen are obtained by the server adjusting the first JSON file and the first picture of the initial skeleton screen based on a preset visual requirement.
In this embodiment, the second JSON file is obtained by adjusting, by the server, the first JSON file according to the first picture corresponding to the initial skeleton screen; and the target skeleton screen is obtained by drawing after the second JSON file is analyzed.
In an optional embodiment, the determining module 305 draws a corresponding view according to the second JSON file and the second picture, and determining the view as a target skeleton screen of the target page includes:
traversing the second JSON file based on the second picture to obtain the attribute of the view corresponding to each view node;
and according to the attribute of the view corresponding to each view node, drawing the corresponding view by adopting a drawing method in a preset drawing tool, and determining the view as a target skeleton screen of the target page.
In this embodiment, the preset drawing tool may be a canvas tool provided by a client, and the drawing method in the canvas tool is adopted to draw the corresponding view according to the attribute of the view corresponding to each view node.
In the embodiment, a skeleton screen generation request is sent to a client through a server, the client determines a first JSON file and a first picture of an initial skeleton screen based on the skeleton screen generation request, the server can adjust the first JSON file and the first picture of the initial skeleton screen reported by the client and send a second JSON file and a second picture obtained by adjustment to the client, the client analyzes the second JSON file to draw a target skeleton screen, the server can change an optimization style according to the initial skeleton screen reported by the client, the client draws the target skeleton screen according to the optimized style, the phenomenon that the client and the server need to communicate and interact for many times to obtain the target skeleton screen is avoided, the communication time between the client and the server is saved, and meanwhile, corresponding skeleton screen codes do not need to be redesigned for page demand change, page change or newly added pages, and the first JSON file of the initial skeleton screen is directly modified, so that the generation efficiency of the target skeleton screen of the client is improved.
In summary, in the method for generating a skeleton screen based on artificial intelligence according to the embodiment, whether each page needs to generate the skeleton screen is determined according to the code of each key value in the page configuration file, whether each page needs to generate the skeleton screen can be determined by fast reading, and a client does not need to continuously pull data from a server to determine whether each page needs to generate the skeleton screen, so that the efficiency of generating the skeleton screen is improved. When any key value in the page configuration file meets the preset skeleton screen generation requirement, executing a skeleton screen automatic generation code of a target page corresponding to the key of each key value to obtain a first JSON file and a first picture of an initial skeleton screen of the target page, solving the problem that a button needs to be clicked once for each view in the initial skeleton screen when the initial skeleton screen is generated in the prior art, and improving the efficiency and accuracy of generating the initial skeleton screen by a client. Receiving a second JSON file and a second picture of an initial skeleton screen reported by a server, drawing a corresponding view according to the second JSON file and the second picture, determining the view as a target skeleton screen of the target page, drawing the target skeleton screen by the client according to the changed and optimized style, avoiding the phenomenon that the client and the server need to communicate and interact for many times to generate the target skeleton screen, saving the communication time of the client and the server, and improving the generation efficiency of the target skeleton screen of the client.
Example four
Fig. 4 is a structural diagram of a skeleton screen generating apparatus based on artificial intelligence according to a fourth embodiment of the present invention.
In some embodiments, the artificial intelligence based skeleton screen generating apparatus 40 may include a plurality of functional modules composed of program code segments. Program code of various program segments in the artificial intelligence based skeletal screen generation apparatus 40 may be stored in a memory of the electronic device and executed by the at least one processor to perform functions of artificial intelligence based skeletal screen generation (described in detail with reference to fig. 2).
In this embodiment, the skeleton screen generating device 40 based on artificial intelligence may be divided into a plurality of functional modules according to the functions executed by the skeleton screen generating device. The functional module may include: a receiving module 401, an identifying module 402, an adjusting module 403 and a sending module 404. The module referred to herein is a series of computer readable instruction segments stored in a memory that can be executed by at least one processor and that can perform a fixed function. In the present embodiment, the functions of the modules will be described in detail in the following embodiments.
In this embodiment, when the client displays the page data, the page data needs to be continuously pulled from the server, and in the process of rendering the pulled page data, a skeleton screen technology needs to be used, specifically, the skeleton screen refers to that before the page data is loaded, a rough structure of the page is displayed for the user, and after the interface data is taken, the actual page content is rendered and then replaced.
In the embodiment, the server sends a skeleton screen generation request to the client, when the client receives the skeleton screen generation request, the skeleton screen generation request is analyzed to obtain a page configuration file, codes corresponding to each key value in the page configuration file are traversed, a skeleton screen page needing to be generated are determined, automatic skeleton screen generation is performed on the skeleton screen page, a first JSON file and a first picture of an initial skeleton screen are obtained, the first JSON file and the first picture of the initial skeleton screen are sent to the server, when the server receives the first JSON file and the first picture of the initial skeleton screen, the server determines whether a preset visual condition is met according to a style displayed by the first picture, when the preset visual condition is determined not to be met, the first JSON file of the initial skeleton screen is adjusted, and attributes of each view in the first JSON file are adjusted, and obtaining a skeleton screen meeting preset visual conditions, sending a second JSON file corresponding to the skeleton screen meeting the visual conditions to a client, and when the client receives the second JSON file, analyzing the second JSON file at the client and drawing a target skeleton screen.
The receiving module 401 is configured to receive a first JSON file and a first picture of an initial skeleton screen of a target page reported by a client.
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, and specifically, the first JSON file includes JSON files of multiple views, and the JSON file of each view is obtained by the server converting the attribute of each view according to a preset conversion rule. And the attribute of each view is obtained by the server side traversing each view node in the tree structure corresponding to the automatic generation code of the skeleton screen of the target page.
The first picture of the initial skeleton screen is obtained by drawing the first JSON file of the initial skeleton screen through a bottom layer drawing method by the client.
An identifying module 402, configured to identify whether the first picture of the initial skeleton screen meets a preset visual requirement.
In this embodiment, the visual requirement may be preset, and specifically, the preset visual requirement may be set according to each skeleton screen automatic generation code for generating a skeleton screen page according to each requirement, or may also be set according to each page visual requirement for generating a skeleton screen page according to each requirement.
In an optional embodiment, the identifying module 402 for identifying whether the first picture of the initial skeletal screen meets a preset visual requirement includes:
traversing attributes of each view in a first picture of the initial skeletal screen;
matching the attribute of each view in the first picture of the initial skeleton screen with the attribute of each view in preset view requirements;
when the attribute of each view in the first picture of the initial skeleton screen is completely matched with the attribute of each view in preset view requirements, determining that the first picture of the initial skeleton screen meets the preset visual requirements; or
Determining that the first picture of the initial skeletal screen does not meet preset visual requirements when the attributes of each view in the first picture of the initial skeletal screen do not completely match the attributes of each view in the preset view requirements.
An adjusting module 403, configured to adjust the first JSON file and the first picture of the initial skeleton screen based on the preset visual requirement to obtain a second JSON file and a second picture of the initial skeleton screen when the picture of the initial skeleton screen does not meet the preset visual requirement.
In the embodiment, whether the style of the initial skeleton screen needs to be changed or not is determined by presetting a visual requirement, if the style needs to be changed, the view of the style needing to be changed in the first JSON file is changed based on the first picture of the initial skeleton screen, and the second JSON file and the second picture corresponding to the optimal skeleton screen are obtained, so that the problem that the skeleton screen is slowly generated due to the fact that a server redesigns a skeleton screen code when the existing style is changed is solved.
A sending module 404, configured to send the second JSON file and the second picture of the initial skeleton screen to the client, where 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.
In this embodiment, when the server determines that the picture of the initial skeleton screen does not meet the preset visual requirement, the attribute of each view in the first JSON file of the initial skeleton screen is adjusted according to the visual requirement, specifically, the attribute of each view includes: size, location, type, fill requirements, view text, and text style, among other attributes.
In this embodiment, the server sends the adjusted second JSON file and second picture of the initial skeleton screen to the client, and the client can draw the target skeleton screen of the target page directly according to the second JSON file and second picture, so that the number of interactions between the client and the server is reduced, the communication cost is saved, and the generation efficiency of the skeleton screen is further improved.
In summary, in the framework screen generation apparatus based on artificial intelligence according to this embodiment, a first JSON file and a first picture of an initial framework screen of a target page reported by a client are received, whether the first picture of the initial framework screen meets a visual requirement is identified, if not, a view in the first JSON file, which needs to be changed in style, is changed based on the first picture of the initial framework screen, so as to obtain a second JSON file corresponding to an optimal framework screen.
EXAMPLE five
Fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention. In the preferred embodiment of the present invention, the electronic device 5 comprises a memory 51, at least one processor 52, at least one communication bus 53 and a transceiver 54.
It will be appreciated by those skilled in the art that the configuration of the electronic device shown in fig. 5 does not constitute a limitation of the embodiment of the present invention, and may be a bus-type configuration or a star-type configuration, and the electronic device 5 may include more or less hardware or software than those shown, or different component arrangements.
In some embodiments, the electronic device 5 is an electronic device capable of automatically performing numerical calculation and/or information processing according to instructions set or stored in advance, and the hardware thereof includes but is not limited to a microprocessor, an application specific integrated circuit, a programmable gate array, a digital processor, an embedded device, and the like. The electronic device 5 may also include a client device, which includes, but is not limited to, any electronic product that can interact with a client through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device, for example, a personal computer, a tablet computer, a smart phone, a digital camera, and the like.
It should be noted that the electronic device 5 is only an example, and other existing or future electronic products, such as those that can be adapted to the present invention, should also be included in the scope of the present invention, and are included herein by reference.
In some embodiments, the memory 51 is used for storing program codes and various data, such as the artificial intelligence-based skeleton screen generating apparatus 30 or the artificial intelligence-based skeleton screen generating apparatus 40 installed in the electronic device 5, and realizing 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 (Electrically-Erasable Programmable Read-Only Memory (EEPROM)), an optical Read-Only disk (CD-ROM) or other optical disk Memory, a magnetic disk Memory, a tape Memory, or any other medium readable by a computer capable of carrying or storing data.
In some embodiments, the at least one processor 52 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged 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. The at least one processor 52 is a Control Unit (Control Unit) of the electronic device 5, connects various components of the electronic device 5 by using various interfaces and lines, 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.
In some embodiments, the at least one communication bus 53 is arranged to enable connection communication between the memory 51 and the at least one processor 52, etc.
Although not shown, the electronic device 5 may further include a power source (such as a battery) for supplying power to each component, and optionally, the power source may be logically connected to the at least one processor 52 through a power management device, so as to implement functions of managing charging, discharging, and power consumption through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 5 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The integrated unit implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, an electronic device, or a network device) or a processor (processor) to execute parts of the methods according to the embodiments of the present invention.
In a further embodiment, in conjunction with fig. 3 or fig. 4, the at least one processor 52 may execute the operating device of the electronic device 5 and various installed application programs (such as the artificial intelligence based skeleton screen generating device 30 or the artificial intelligence based skeleton screen generating device 40), program codes, and the like, for example, the modules described above.
The memory 51 has program code stored therein, and the at least one processor 52 can call the program code stored in the memory 51 to perform related functions. For example, the modules described in fig. 3 or fig. 4 are program code stored in the memory 51 and executed by the at least one processor 52, so as to implement the functions of the modules for the purpose of artificial intelligence-based skeleton screen generation.
Illustratively, 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 accomplish the present application. The one or more modules/units may be a series of computer readable instruction segments capable of performing certain functions, which are used to describe the execution of the program code in the electronic device 5. For example, the program code may be divided into a first acquiring module 301, a determining module 302, a second acquiring module 303, an executing module 304, and a determining module 305, or the program code may be divided into a receiving module 401, an identifying module 402, an adjusting module 403, and a transmitting module 404.
In one embodiment of the present invention, the memory 51 stores a plurality of computer readable instructions that are executed by the at least one processor 52 to implement the functionality of artificial intelligence based skeletal screen generation.
Specifically, the method for implementing the instruction by the at least one processor 52 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 or fig. 2, which is not repeated herein.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or that the singular does not exclude the plural. A plurality of units or means recited in the present invention may also be implemented by one unit or means through software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A skeleton screen generation method based on artificial intelligence is applied to a client side and is characterized by comprising the following steps:
responding to a skeleton screen generation request of a server, and acquiring a page configuration file, wherein the page configuration file comprises at least one key value pair;
judging whether each key value in the page configuration file meets the preset requirements of automatically generating a skeleton screen;
when any key value in the page configuration file meets a preset skeleton screen generation requirement, acquiring a skeleton screen automatic generation code of a target page corresponding to a key of the any key value;
executing a skeleton screen automatic generation code of the target page to obtain a first JSON file and a first picture of an initial skeleton screen of the target page;
receiving a second JSON file and a second picture of an initial skeleton screen reported by a server, drawing a corresponding view according to the second JSON file and the second picture, and determining the view as a 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 a preset visual requirement.
2. The artificial intelligence based skeleton screen generation method of claim 1, wherein the executing the skeleton screen automatic generation code of the target page, and obtaining the first JSON file and the first picture of the initial skeleton screen of the target page comprises:
traversing each view node in the tree structure corresponding to the skeleton screen automatic generation code to obtain the attribute of each view;
converting the attribute of each view into a JSON format file according to a preset conversion rule to obtain the JSON file of each view;
combining a plurality of JSON files of a plurality of views to obtain a first JSON file of an initial skeleton screen of the target page;
drawing a corresponding picture according to the first JSON file of the initial skeleton screen and the display requirement corresponding to the target page in the skeleton screen generation request, and determining the picture as the first picture of the initial skeleton screen of the target page.
3. The artificial intelligence based skeleton screen generation method of claim 1, wherein the obtaining a page configuration file in response to a skeleton screen generation request of a server comprises:
analyzing the message of the skeleton screen generation request to obtain message information carried by the message;
and acquiring a calling interface from the message information, and acquiring a page configuration file through the calling interface, wherein the page configuration file comprises a plurality of key value pairs.
4. The artificial intelligence based skeletal screen generation method of claim 1, wherein the determining whether each key value in the page configuration file meets a preset automatic skeletal screen generation requirement comprises:
code that identifies each key value in the page profile;
when the code of each key value in the page configuration file is an automatic skeleton screen generation code, determining that each key value in the page configuration file meets the preset automatic skeleton screen generation requirement; or
And when the code of each key value in the page configuration file is not the automatic skeleton screen generation code, determining that each key value in the page configuration file does not meet the preset automatic skeleton screen generation requirement.
5. A skeleton screen generation method based on artificial intelligence is applied to a server side, and is characterized by comprising the following steps:
receiving a first JSON file and a first picture of an initial skeleton screen of a target page reported by a client;
identifying whether the first picture of the initial skeleton screen meets a preset visual requirement or not;
when the picture of the initial skeleton screen does not meet the preset visual requirement, adjusting a first JSON file and a first picture of the initial skeleton screen based on the preset visual requirement to obtain a second JSON file and a second picture of the initial skeleton screen;
and sending a second JSON file and a second picture of the initial skeleton screen to the client, drawing a corresponding view by the client according to the second JSON file and the second picture, and determining the view as a target skeleton screen of the target page.
6. The artificial intelligence based skeletal screen generation method of claim 5, wherein the identifying whether the first picture of the initial skeletal screen meets preset visual requirements comprises:
traversing attributes of each view in a first picture of the initial skeletal screen;
matching the attribute of each view in the first picture of the initial skeleton screen with the attribute of each view in preset view requirements;
when the attribute of each view in the first picture of the initial skeleton screen is completely matched with the attribute of each view in preset view requirements, determining that the first picture of the initial skeleton screen meets the preset visual requirements; or
Determining that the first picture of the initial skeletal screen does not meet preset visual requirements when the attributes of each view in the first picture of the initial skeletal screen do not completely match the attributes of each view in the preset view requirements.
7. The utility model provides a skeleton screen generates device based on artificial intelligence, its characterized in that runs in the client, the device includes:
the server comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for responding to a skeleton screen generation request of a server and acquiring a page configuration file, and the page configuration file comprises at least one key value pair;
the judging module is used for judging whether each key value in the page configuration file meets the preset requirement of automatically generating the skeleton screen;
the second obtaining module is used for obtaining a skeleton screen automatic generation code of a target page corresponding to a key of any key value when any key value in the page configuration file meets a preset skeleton screen generation requirement;
the execution module is used for 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;
the determining module is used for receiving a second JSON file and a second picture of the initial skeleton screen reported by the server, drawing a corresponding view according to the second JSON file and the second picture, and determining the view as a target skeleton screen of the target page, wherein the second JSON file and the second picture of the initial skeleton screen are obtained by the server after adjusting the first JSON file and the first picture of the initial skeleton screen based on a preset visual requirement.
8. The utility model provides a skeleton screen generates device based on artificial intelligence, its characterized in that, operates in the server side, the device includes:
the receiving module is used for receiving a first JSON file and a first picture of an initial skeleton screen of a target page reported by a client;
the identification module is used for identifying whether the first picture of the initial skeleton screen meets a preset visual requirement or not;
the adjusting module is used for adjusting the first JSON file and the first picture of the initial skeleton screen based on the preset visual requirement to obtain a second JSON file and a second picture of the initial skeleton screen when the picture of the initial skeleton screen does not meet the preset visual requirement;
and the sending module is used for sending 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 a target skeleton screen of the target page.
9. An electronic device, characterized in that the electronic device comprises a processor and a memory, the processor being configured to implement the artificial intelligence based skeletal screen generation method of any of claims 1 to 4 or of claims 5 or 6 when executing a computer program stored in the memory.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the artificial intelligence based skeleton screen generation method of any one of claims 1 to 4 or of claims 5 or 6.
CN202111154990.0A 2021-09-29 2021-09-29 Skeleton screen generation method and device based on artificial intelligence, electronic equipment and medium Pending CN113835706A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111154990.0A CN113835706A (en) 2021-09-29 2021-09-29 Skeleton screen generation method and device based on artificial intelligence, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111154990.0A CN113835706A (en) 2021-09-29 2021-09-29 Skeleton screen generation method and device based on artificial intelligence, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN113835706A true CN113835706A (en) 2021-12-24

Family

ID=78967634

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111154990.0A Pending CN113835706A (en) 2021-09-29 2021-09-29 Skeleton screen generation method and device based on artificial intelligence, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN113835706A (en)

Similar Documents

Publication Publication Date Title
CN110795219B (en) Resource scheduling method and system suitable for multiple computing frameworks
CN113095995B (en) Webpage watermark adding method and device, electronic equipment and storage medium
US20220036241A1 (en) Method, device and storage medium for training a deep learning framework
CN113282795A (en) Data structure chart generating and updating method and device, electronic equipment and storage medium
CN111797157A (en) Data processing method and system, electronic equipment and storage medium
CN112612462A (en) Method and device for adjusting phone configuration, electronic equipment and storage medium
CN111651158A (en) Form page generation method, device, terminal and storage medium
CN113835706A (en) Skeleton screen generation method and device based on artificial intelligence, electronic equipment and medium
CN115061895A (en) Business process arranging method and device, electronic equipment and storage medium
CN114881313A (en) Behavior prediction method and device based on artificial intelligence and related equipment
CN115237706A (en) Buried point data processing method and device, electronic equipment and storage medium
CN114239538A (en) Assertion processing method and device, computer equipment and storage medium
CN114925674A (en) File compliance checking method and device, electronic equipment and storage medium
CN114637564B (en) Data visualization method and device, electronic equipment and storage medium
CN113268478A (en) Big data analysis method and device, electronic equipment and storage medium
CN114036218A (en) Data model switching method and device, server and storage medium
CN113674065A (en) Service contact-based service recommendation method and device, electronic equipment and medium
CN114298313A (en) Artificial intelligence computer vision reasoning method
Tian Application and analysis of artificial intelligence graphic element algorithm in digital media art design
CN113377708A (en) Method and device for converting two-dimensional design drawing into three-dimensional design drawing
CN114461717A (en) Automatic data comparison method and device, electronic equipment and storage medium
CN113687813A (en) AI image recognition-based product prototype processing method and device and related equipment
CN115291987A (en) Page generation method and device, electronic equipment and storage medium
CN113722590B (en) Medical information recommendation method, device, equipment and medium based on artificial intelligence
CN115062081A (en) Data management method, device, electronic equipment and medium based on artificial intelligence

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination