CN111324352A - Code generation method of application page and related equipment - Google Patents

Code generation method of application page and related equipment Download PDF

Info

Publication number
CN111324352A
CN111324352A CN202010127326.6A CN202010127326A CN111324352A CN 111324352 A CN111324352 A CN 111324352A CN 202010127326 A CN202010127326 A CN 202010127326A CN 111324352 A CN111324352 A CN 111324352A
Authority
CN
China
Prior art keywords
control
page
target application
page image
attribute information
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
CN202010127326.6A
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 Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202010127326.6A priority Critical patent/CN111324352A/en
Publication of CN111324352A publication Critical patent/CN111324352A/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

Abstract

The embodiment of the application discloses a code generation method of an application page and related equipment, wherein the method is applied to the technical field of data processing and comprises the following steps: and acquiring a page image corresponding to a pre-stored target application from the specified directory, calling a control identification model to identify the type of each control in the page image, and outputting attribute information of each control. Furthermore, the terminal device can generate a control information file corresponding to the page image based on the attribute information of each control, and generate a code corresponding to the page image according to the control information file and the type of each control in the page image, which is beneficial to improving the generation efficiency of the page code corresponding to the target application.

Description

Code generation method of application page and related equipment
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a code generation method for an application page and a related device.
Background
With the rapid development of network technology, the variety and number of applications are increasing. Most applications are almost always concerned with displaying pages for ease of use by the user. Some information, such as text, pictures or videos, can be displayed to the user on the display page. At present, if an application program similar to a target application (e.g., a social application, a reading application, etc.) is to be developed, a technician needs to develop a page (i.e., write a page code corresponding to each page) one by one, and page development is the most time-consuming in program development, and usually, after a designer designs a design image of a page, the technician writes a corresponding page code according to the design image. However, the manual writing of page codes takes much labor and time, and is extremely inefficient.
Disclosure of Invention
The embodiment of the application provides a code generation method of an application page and related equipment, and generation efficiency of a page code corresponding to a target application can be improved.
In a first aspect, an embodiment of the present application provides a method for generating a code of an application page, where the method includes:
acquiring a page image corresponding to a target application stored in advance from a specified directory;
calling a control identification model to identify the type of each control in the page image and outputting attribute information of each control, wherein the attribute information is matched with the type of the corresponding control;
generating a control information file corresponding to the page image based on the attribute information of each control, wherein the control information file comprises the attribute information of each control;
and generating a code corresponding to the page image according to the control information file and the type of each control in the page image.
In an embodiment, a specific implementation manner of generating a code corresponding to the page image according to the control information file and the type of each control in the page image is as follows: determining a target template code corresponding to each control in the page image based on a corresponding relation between the pre-established template code and the type of the control; performing parameter configuration on the target template codes corresponding to the controls according to the attribute information of the controls included in the control information file;
and integrating the target template codes after the parameters are configured into codes corresponding to the page images.
In one embodiment, before a page image corresponding to a pre-stored target application is acquired from a specified directory, when the start of the target application is detected, page skipping corresponding to the target application can be triggered based on a preset control strategy; intercepting the page after the jump, and storing the page image obtained by the interception to a specified directory; and triggering the step of acquiring the page image corresponding to the pre-stored target application from the specified directory after detecting that all the pages of the target application are completely displayed.
In an embodiment, the specific implementation manner of triggering the page jump corresponding to the target application based on the preset control policy when the target application is detected to be started is as follows: when the starting of the target application is detected, calling a control identification model to determine a touch control in a page corresponding to the target application; and touching the touch control according to the touch control mode matched with the touch control so as to jump the page corresponding to the target application.
In one embodiment, the touchable control is touched according to a touch manner matched with the touchable control, so that before a page corresponding to the target application jumps, whether the function of the touchable control is a non-exit function can be detected; and if the function of the touch control is detected to be a non-exit function, triggering and executing the step of touching the touch control according to the touch control mode matched with the touch control so as to jump the page corresponding to the target application.
In one embodiment, the non-exit function is a link function, and after the touchable control is touched in a touch manner matched with the touchable control, the user can jump to a second page linked to the touchable control correspondingly, and record a uniform resource locator URL of a first page where the touchable control is located; acquiring a preset operation depth of a link corresponding to the touch control; recording the current operation depth in the process of triggering the control aiming at the second page; and when the current operation depth is equal to the preset operation depth, returning to the first page based on the recorded URL.
In an embodiment, the specific implementation manner of intercepting the skipped page is as follows: detecting whether the display of the page after the jump is complete; and if the display of the page after the jump is detected to be complete, intercepting the page after the jump.
In an embodiment, before performing parameter configuration on the target template code corresponding to each control according to the attribute information of each control included in the control information file, it may further be detected whether the attribute information of each control included in the control information file is complete, and if so, the step of performing parameter configuration on the target template code corresponding to each control according to the attribute information of each control included in the control information file is triggered; if the attribute information of any control is detected to be incomplete, determining missing information corresponding to the attribute information of any control, and supplementing the attribute information of any control by adopting preset information matched with the missing information.
In a second aspect, an embodiment of the present application provides an apparatus for generating a code of an application page, where the apparatus includes:
the acquisition module is used for acquiring a page image corresponding to a pre-stored target application from the specified directory;
the processing module is used for calling a control identification model to identify the type of each control in the page image and outputting attribute information of each control, and the attribute information is matched with the type of the corresponding control;
the processing module is further configured to generate a control information file corresponding to the page image based on the attribute information of each control, where the control information file includes the attribute information of each control;
and the processing module is further used for generating codes corresponding to the page images according to the control information files and the types of the controls in the page images.
In a third aspect, an embodiment of the present application provides a terminal device, where the terminal device includes a processor, an output device, an input device, a communication interface, and a memory, where the output device, the input device, the communication interface, and the memory are connected to each other. Wherein the output device is controlled by the processor for outputting and/or displaying data information, the input device is used for receiving operation instruction information sent by a user, the communication interface is controlled by the processor for sending and receiving messages, the memory is used for storing a computer program for supporting a terminal device to execute the method, the computer program comprises program instructions, and the processor is configured for calling the program instructions to execute the method of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program, the computer program comprising program instructions that, when executed by a processor, cause the processor to perform the method of the first aspect.
In the embodiment of the application, the terminal device can acquire the page image corresponding to the pre-stored target application from the specified directory, call the control identification model to identify the type of each control in the page image, and output the attribute information of each control. Furthermore, the terminal device can generate a control information file corresponding to the page image based on the attribute information of each control, and generate a code corresponding to the page image according to the control information file and the type of each control in the page image, which is beneficial to improving the generation efficiency of the page code corresponding to the target application.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for generating a code of an application page according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating another method for generating code for an application page according to an embodiment of the present application;
FIG. 3 is a page diagram of another application page provided by an embodiment of the present application;
FIG. 4 is a schematic block diagram of a code generation apparatus for an application page according to an embodiment of the present application;
fig. 5 is a schematic block diagram of a terminal device according to an embodiment of the present application.
Detailed Description
Referring to fig. 1, fig. 1 is a schematic flowchart of a method for generating a code of an application page, where the method is applied to a terminal device, and as shown in the figure, the method for generating a code of an application page may include:
s101: and acquiring a page image corresponding to a target application stored in advance from the specified directory.
In one embodiment, all page images corresponding to the target application may be obtained in advance, and stored in a designated directory in the terminal device. The page image may be obtained by a user, for example, the user manually introduces the page image; the method also can be used for the terminal equipment to capture the display page of the target application when the target application runs, and the captured image is the page image.
The designated directory is preset by a developer and is used for storing a page image corresponding to a target application, for example, the designated directory may be a designated folder, a designated disk, or the like, which is not specifically limited in the present application.
S102: and calling a control identification model to identify the type of each control in the page image and outputting the attribute information of each control, wherein the attribute information is matched with the type of the corresponding control.
Wherein the attribute information includes one or more of position information, color information and size information of the corresponding control. In one embodiment, the initial control identification model can be trained through the control training sample to obtain a control identification model, and the control identification model can identify a control image and determine the type and attribute information of the control corresponding to the control image. The control training sample is a control image marked with corresponding type and attribute information. For example, the initial control identification model may be a convolutional neural network model CNN or other neural network model, and the present solution is not limited in this respect.
The attribute information extracted by each type of control is different, and in this case, the control identification model can identify the type of each control in the page image, extract the attribute information matched with the corresponding type for each control, and output the attribute information corresponding to each control.
For example, if the type of the control is a text button, the control identification model may extract the position and the title information of the text control, that is, the attribute information matched with the text control includes the position and the title information. For another example, if the type of the control is a picture button, the control identification model may extract a picture and a position, that is, the attribute information matched with the picture button includes the picture and the position.
S103: and generating a control information file corresponding to the page image based on the attribute information of each control, wherein the control information file comprises the attribute information of each control.
In one embodiment, the attribute information of each control in the page image can be integrated according to a preset format, so as to obtain a control information file corresponding to the page image.
S104: and generating a code corresponding to the page image according to the control information file and the type of each control in the page image.
In an embodiment, the terminal device may determine a target template code corresponding to each control in the page image based on a pre-established correspondence between the template code and the type of the control, perform parameter configuration on the target template code corresponding to each control according to attribute information of each control included in the control information file, and further integrate the target template codes after each parameter configuration into a code corresponding to the page image.
Illustratively, at least one template code is set in advance according to the type of the control, and a corresponding relationship between the template code and the type of the control is established, for example, a template code a corresponding to a text button, a template code B corresponding to a picture button, and a template code C corresponding to a text control. For this situation, when generating a page code corresponding to a certain page Y1, a target template code matched with each control may be determined from at least one preset template code based on the type of each control in the page Y1, and further parameters of the control in the corresponding target template code are initialized based on the attribute information of each control, and so on, until the target template codes corresponding to all the controls in the page Y1 are initialized, so as to obtain the page code corresponding to the page Y1.
In an embodiment, before performing parameter configuration on a target template code corresponding to each control according to attribute information of each control included in a control file, a terminal device may further detect whether the attribute information of each control included in the control file is complete, and if so, trigger execution of a step of performing parameter configuration on the target template code corresponding to each control according to the attribute information of each control included in the control file; if the attribute information of any control is detected to be incomplete, determining the missing information corresponding to the attribute information of any control, and supplementing the attribute information of any control by adopting the preset information matched with the missing information.
The attribute information output by the control identification model is different for each type of control, and correspondingly, the preset information preset for each type of control is also different. Illustratively, the type of the control a is a text button, and then the attribute information of the control a includes a position and title information, and accordingly, preset information preset for the control of the text button is related to the title information and the position, for example, the preset information may be empty text, or preset text information, for example, "0, 0, 0, 0".
For example, for a control a of a text control type, if the terminal device detects that the attribute information of the control a is incomplete, and the corresponding missing information is header information, in this case, preset information corresponding to the header information may be obtained for replacement, and the attribute information of the control a is supplemented, and the preset information corresponding to the header information may be replaced by, for example, a blank text. For another example, if the terminal device detects that the attribute information of the control a is incomplete, and the corresponding missing information is location information, in this case, the preset information corresponding to the header information may be obtained instead of the corresponding missing information, and the attribute information of the control a is supplemented, and the preset information corresponding to the header information may be preset location information, such as "0, 0, 0, 0".
In the embodiment of the application, the terminal device can acquire the page image corresponding to the pre-stored target application from the specified directory, call the control identification model to identify the type of each control in the page image, and output the attribute information of each control. Furthermore, the terminal device can generate a control information file corresponding to the page image based on the attribute information of each control, and generate a code corresponding to the page image according to the control information file and the type of each control in the page image, which is beneficial to improving the generation efficiency of the page code corresponding to the target application.
Referring to fig. 2, fig. 2 is a schematic flowchart of another method for generating a code of an application page, where the method is applied to a terminal device, and as shown in the figure, the method for generating a code of an application page may include:
s201: and when the starting of the target application is detected, triggering page skipping corresponding to the target application based on a preset control strategy.
In one embodiment, when detecting that the target application is started, the specific implementation manner of triggering page jump corresponding to the target application based on the preset control policy by the terminal device is as follows: when the target application is detected to be started, calling the control identification model to determine the touch control in the page corresponding to the target application, and touching the touch control according to the touch control mode matched with the touch control so as to enable the page corresponding to the target application to jump.
The touchable control can be a link, a click-type control, and the like, and the touch manner can include clicking, sliding, voice, text input, and the like.
In an embodiment, the terminal device may further detect whether the function of the touch-enabled control is a non-exit function before the touch-enabled control is touched in the touch-enabled manner matched with the touch-enabled control, and if the function of the touch-enabled control is detected to be the non-exit function, trigger execution of the step of touching the touch-enabled control in the touch-enabled manner matched with the touch-enabled control to cause the page corresponding to the target application to jump.
In an embodiment, in the process that the terminal device executes step S201 to trigger the page jump corresponding to the target application based on the preset control policy, the control identification model is called to detect each control in the current page, and if it is detected that the type of any control in the current page is the exit type, the control of the exit type is not triggered, the control is directly skipped, and the next control is continuously detected. By adopting the method, the target application can be prevented from exiting in advance in the process of triggering the page jump corresponding to the target application based on the preset control strategy, the controls of other applications are prevented from being identified after exiting the target application, so that the subsequent identification is meaningless, and the identification effectiveness is favorably ensured.
S202: intercepting the page after the jump, and storing the page image obtained by the interception to an appointed directory.
S203: and after detecting that all pages of the target application are completely displayed, acquiring a page image corresponding to the target application stored in advance from the specified directory.
In an embodiment, the non-exit function is a link function, and after the terminal device touches the touch-controllable control in accordance with the touch manner matched with the touch-controllable control, the terminal device may jump to a second page corresponding to the link of the touch-controllable control, and record a uniform resource locator URL of a first page where the touch-controllable control is located. Further, a preset operation depth of a link corresponding to the touch control is obtained, the current operation depth is recorded in the process of triggering the control for the second page, and when the current operation depth is equal to the preset operation depth, the URL based on the record is returned to the first page.
The link function refers to a function that can jump from the first page where the touch-controllable control is located to another page (i.e., the second page) after responding to the touch operation on the touch-controllable control. The first page where the touch-controllable control is located may refer to an initial page where the touch-controllable control is located, and the second page may refer to any page that is opened or jumped after the terminal responds to the touch operation for the touch-controllable control.
For example, the first page is the playlist page 30 shown in fig. 3, wherein the control 301 is a touchable control. After determining that the function of the touch-controllable control is a link function, the terminal device responds to the touch operation, obtains that the preset operation depth of the link corresponding to the control 301 is 3 times, further may record the URL of the current playlist page, and jumps from the playlist page 30 to the second page 31 (i.e., music playback page) shown in fig. 3, and further continues to execute control triggering on the music playback page (i.e., based on making the page jump). In the process of triggering the control on the music playing page, the current operation depth of the link may be recorded, and when the current operation depth is detected to be equal to 3 times, the current operation depth is returned to the playlist page 30 according to the recorded URL.
In an embodiment, in a case that the current operation depth is smaller than a preset operation depth, if the terminal detects that there is no operable control in the current test page, the terminal may also return to the first page according to the recorded URL. The current test page may be the same as or different from the second page. Under the condition that the two are different, the current test page can be any page jumped by the second page.
For example, the first page is the playlist page 30 shown in fig. 3, the current test page is the lyric display page, and the recorded current operation depth is smaller than the preset operation depth. In this case, the terminal detects that there is no control that can be triggered (i.e., no operable control) in the lyric presentation page, and can jump from the lyric presentation page to the playlist page 30 as shown in fig. 3 according to the URL of the previously recorded playlist page 30.
In an embodiment, a specific implementation manner of intercepting the skipped page by the terminal device may be: detecting whether the display of the page after the jump is complete; and if the display of the page after the jump is detected to be complete, intercepting the page after the jump.
S204: and calling a control identification model to identify the type of each control in the page image and outputting the attribute information of each control, wherein the attribute information is matched with the type of the corresponding control.
S205: and generating a control information file corresponding to the page image based on the attribute information of each control, wherein the control information file comprises the attribute information of each control.
S206: and generating a code corresponding to the page image according to the control information file and the type of each control in the page image. For specific implementation of steps S204 to S206, reference may be made to the related description of steps S102 to S104 in the foregoing embodiment, and details are not repeated here.
In the embodiment of the application, when the terminal device detects that the target application is started, the terminal device triggers page skipping corresponding to the target application based on a preset control strategy, intercepts the skipped page, stores the intercepted page image to the specified directory, and acquires the page image corresponding to the target application stored in advance from the specified directory after detecting that all pages of the target application are completely displayed. Further, the terminal device may call the control identification model to identify the type of each control in the page image, and output attribute information of each control. Further, the terminal device may generate a control information file corresponding to the page image based on the attribute information of each control, and generate a code corresponding to the page image according to the control information file and the type of each control in the page image. By adopting the mode, the target application can automatically jump and screen capture, the page image of the target application can be automatically acquired without manual supply, and the acquisition efficiency of the page image is improved.
The embodiment of the application also provides a code generation device of the application page. The apparatus includes means for performing the method described in fig. 1 or fig. 2 above. Specifically, referring to fig. 4, it is a schematic block diagram of a code generation apparatus for an application page provided in this embodiment of the present application. The code generation device of the application page of the embodiment comprises:
the acquiring module 40 is configured to acquire a page image corresponding to a pre-stored target application from a specified directory;
the processing module 41 is configured to invoke a control identification model to identify the type of each control in the page image, and output attribute information of each control, where the attribute information is matched with the type of the corresponding control;
the processing module 41 is further configured to generate a control information file corresponding to the page image based on the attribute information of each control, where the control information file includes the attribute information of each control;
the processing module 41 is further configured to generate a code corresponding to the page image according to the control information file and the type of each control in the page image.
In an embodiment, the processing module 41 is specifically configured to determine, based on a correspondence between a template code and a type of a control, a target template code corresponding to each control in the page image; performing parameter configuration on the target template codes corresponding to the controls according to the attribute information of the controls included in the control information file; and integrating the target template codes after the parameters are configured into codes corresponding to the page images.
In an embodiment, the processing module 41 is further configured to trigger a page jump corresponding to the target application based on a preset control policy when it is detected that the target application is started; intercepting the page after the jump, and storing the page image obtained by the interception to a specified directory; and after detecting that all the pages of the target application are completely displayed, triggering the obtaining module 40 to obtain a page image corresponding to the target application stored in advance from the specified directory.
In an embodiment, the processing module 41 is further specifically configured to, when it is detected that the target application is started, invoke a control identification model to determine a touch-controllable control in a page corresponding to the target application; and touching the touch control according to the touch control mode matched with the touch control so as to jump the page corresponding to the target application.
In one embodiment, the processing module 41 is further configured to detect whether the function of the touchable control is a non-exit function; and if the function of the touch control is detected to be a non-exit function, triggering and executing the step of touching the touch control according to the touch control mode matched with the touch control so as to jump the page corresponding to the target application.
In an embodiment, the non-exit function is a link function, and the processing module 41 is further configured to jump to a second page linked to the touch-controllable control, and record a uniform resource locator URL of a first page where the touch-controllable control is located; acquiring a preset operation depth of a link corresponding to the touch control; recording the current operation depth in the process of triggering the control aiming at the second page; and when the current operation depth is equal to the preset operation depth, returning to the first page based on the recorded URL.
In an embodiment, the processing module 41 is further specifically configured to detect whether the display of the skipped page is complete; and if the display of the page after the jump is detected to be complete, intercepting the page after the jump.
In an embodiment, the processing module 41 is further configured to detect whether the attribute information of each control included in the control file is complete, and if so, trigger execution of the step of performing parameter configuration on the target template code corresponding to each control according to the attribute information of each control included in the control file; if the attribute information of any control is detected to be incomplete, determining missing information corresponding to the attribute information of any control, and supplementing the attribute information of any control by adopting preset information matched with the missing information.
It should be noted that the functions of each functional module of the code generation apparatus for an application page described in the embodiment of the present application may be specifically implemented according to the method in the method embodiment described in fig. 1 or fig. 2, and a specific implementation process thereof may refer to the description related to the method embodiment of fig. 1 or fig. 2, which is not described again here.
In the embodiment of the present application, the obtaining module 40 obtains a page image corresponding to a pre-stored target application from a specified directory, and the processing module 41 invokes a control identification model to identify the type of each control in the page image, and outputs attribute information of each control. Further, the processing module 41 generates a control information file corresponding to the page image based on the attribute information of each control, and generates a code corresponding to the page image according to the control information file and the type of each control in the page image, which is beneficial to improving the generation efficiency of the page code corresponding to the target application.
Referring to fig. 5, fig. 5 is a schematic block diagram of a terminal device according to an embodiment of the present application, and as shown in fig. 5, the terminal device includes a processor 501, a memory 502, an input device 503, and an output device 504. The processor 501, the memory 502, the input device 503 and the output device 504 may be connected by a bus or other means, and fig. 5 shows an example of the connection by the bus in the embodiment of the present application. Wherein the memory 502 is adapted to store a computer program comprising program instructions and the processor 501 is adapted to execute the program instructions stored by the memory 502. Wherein the processor 501 is configured to call the program instruction to perform: acquiring a page image corresponding to a target application stored in advance from a specified directory; calling a control identification model to identify the type of each control in the page image and outputting attribute information of each control, wherein the attribute information is matched with the type of the corresponding control; generating a control information file corresponding to the page image based on the attribute information of each control, wherein the control information file comprises the attribute information of each control; and generating a code corresponding to the page image according to the control information file and the type of each control in the page image.
In an embodiment, the processor 501 is specifically configured to determine, based on a correspondence between a template code and a type of a control that are established in advance, a target template code corresponding to each control in the page image; performing parameter configuration on the target template codes corresponding to the controls according to the attribute information of the controls included in the control information file; and integrating the target template codes after the parameters are configured into codes corresponding to the page images.
In an embodiment, the processor 501 is further configured to trigger a page jump corresponding to a target application based on a preset control policy when the target application is detected to be started; intercepting the page after the jump, and storing the page image obtained by the interception to a specified directory; and acquiring a page image corresponding to the target application stored in advance from the specified directory after detecting that all pages of the target application are completely displayed.
In an embodiment, the processor 501 is further specifically configured to, when it is detected that a target application is started, invoke a control identification model to determine a touch-enabled control in a page corresponding to the target application; and touching the touch control according to the touch control mode matched with the touch control so as to jump the page corresponding to the target application.
In one embodiment, the processor 501 is further configured to detect whether the function of the touchable control is a non-exit function; and if the function of the touch control is detected to be a non-exit function, triggering and executing the step of touching the touch control according to the touch control mode matched with the touch control so as to jump the page corresponding to the target application.
In an embodiment, the non-exit function is a link function, and the processor 501 is further configured to jump to a second page linked to the touch-controllable control, and record a uniform resource locator URL of a first page where the touch-controllable control is located; acquiring a preset operation depth of a link corresponding to the touch control;
recording the current operation depth in the process of triggering the control aiming at the second page; and when the current operation depth is equal to the preset operation depth, returning to the first page based on the recorded URL.
In an embodiment, the processor 501 is further specifically configured to detect whether the display of the skipped page is complete; and if the display of the page after the jump is detected to be complete, intercepting the page after the jump.
In an embodiment, the processor 501 is further configured to detect whether the attribute information of each control included in the control file is complete, and if so, trigger execution of the step of performing parameter configuration on the target template code corresponding to each control according to the attribute information of each control included in the control file; if the attribute information of any control is detected to be incomplete, determining missing information corresponding to the attribute information of any control, and supplementing the attribute information of any control by adopting preset information matched with the missing information.
It should be understood that, in the embodiment of the present Application, the Processor 501 may be a Central Processing Unit (CPU), and the Processor 501 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 502 may include both read-only memory and random access memory, and provides instructions and data to the processor 501. A portion of the memory 502 may also include non-volatile random access memory. For example, the memory 502 may also store device type information.
Input devices 503 may include a touch pad, fingerprint sensor, microphone, etc., and output devices 504 may include a display (LCD, etc.), speakers, etc.
In specific implementation, the processor 501, the memory 502, the input device 503, and the output device 504 described in this embodiment of the present application may execute the implementation described in the method embodiment described in fig. 1 or fig. 2 provided in this embodiment of the present application, and may also execute the implementation of the data processing-based separation apparatus described in this embodiment of the present application, which is not described herein again.
In the embodiment of the application, the processor 501 obtains a page image corresponding to a pre-stored target application from a specified directory, and the processor 501 calls a control identification model to identify the type of each control in the page image and outputs attribute information of each control. Further, the processor 501 generates a control information file corresponding to the page image based on the attribute information of each control, and generates a code corresponding to the page image according to the control information file and the type of each control in the page image, which is beneficial to improving the generation efficiency of the page code corresponding to the target application.
In another embodiment of the present application, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program comprising program instructions that when executed by a processor implement: acquiring a page image corresponding to a target application stored in advance from a specified directory; calling a control identification model to identify the type of each control in the page image and outputting attribute information of each control, wherein the attribute information is matched with the type of the corresponding control; generating a control information file corresponding to the page image based on the attribute information of each control, wherein the control file comprises the attribute information of each control; and generating a code corresponding to the page image according to the control information file and the type of each control in the page image.
The computer-readable storage medium may be an internal storage unit of the terminal device according to any of the foregoing embodiments, for example, a hard disk or a memory of the terminal device. The computer readable storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the terminal device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the terminal device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the terminal device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the invention has been described with reference to a number of embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A code generation method of an application page, characterized in that the method comprises:
acquiring a page image corresponding to a target application stored in advance from a specified directory;
calling a control identification model to identify the type of each control in the page image and outputting attribute information of each control, wherein the attribute information is matched with the type of the corresponding control;
generating a control information file corresponding to the page image based on the attribute information of each control, wherein the control information file comprises the attribute information of each control;
and generating a code corresponding to the page image according to the control information file and the type of each control in the page image.
2. The method according to claim 1, wherein the generating a code corresponding to the page image according to the control information file and the type of each control in the page image comprises:
determining a target template code corresponding to each control in the page image based on a corresponding relation between the pre-established template code and the type of the control;
performing parameter configuration on the target template codes corresponding to the controls according to the attribute information of the controls included in the control information file;
and integrating the target template codes after the parameters are configured into codes corresponding to the page images.
3. The method according to claim 1, wherein before the obtaining of the page image corresponding to the pre-stored target application from the specified directory, the method further comprises:
when the starting of the target application is detected, triggering page skipping corresponding to the target application based on a preset control strategy;
intercepting the page after the jump, and storing the page image obtained by the interception to a specified directory;
and triggering the step of acquiring the page image corresponding to the pre-stored target application from the specified directory after detecting that all the pages of the target application are completely displayed.
4. The method according to claim 3, wherein when it is detected that a target application is started, triggering page jump corresponding to the target application based on a preset control policy comprises:
when the starting of the target application is detected, calling a control identification model to determine a touch control in a page corresponding to the target application;
and touching the touch control according to the touch control mode matched with the touch control so as to jump the page corresponding to the target application.
5. The method of claim 4, wherein before the touchable control is touched in a manner matched with the touchable control to jump to the page corresponding to the target application, the method further comprises:
detecting whether the function of the touch control is a non-exit function;
and if the function of the touch control is detected to be a non-exit function, triggering and executing the step of touching the touch control according to the touch control mode matched with the touch control so as to jump the page corresponding to the target application.
6. The method of claim 5, wherein the non-exit function is a link function, and wherein after the touchable control is touched in a manner that matches the touchable control, the method further comprises:
skipping to a second page correspondingly linked with the touch control, and recording a Uniform Resource Locator (URL) of a first page where the touch control is located;
acquiring a preset operation depth of a link corresponding to the touch control;
recording the current operation depth in the process of triggering the control aiming at the second page;
and when the current operation depth is equal to the preset operation depth, returning to the first page based on the recorded URL.
7. The method of claim 3, wherein intercepting the jumped page comprises:
detecting whether the display of the page after the jump is complete;
and if the display of the page after the jump is detected to be complete, intercepting the page after the jump.
8. An apparatus for code generation of an application page, the apparatus comprising:
the acquisition module is used for acquiring a page image corresponding to a pre-stored target application from the specified directory;
the processing module is used for calling a control identification model to identify the type of each control in the page image and outputting attribute information of each control, and the attribute information is matched with the type of the corresponding control;
the processing module is further configured to generate a control information file corresponding to the page image based on the attribute information of each control, where the control information file includes the attribute information of each control;
and the processing module is further used for generating codes corresponding to the page images according to the control information files and the types of the controls in the page images.
9. A terminal device, characterized in that it comprises a processor and a memory, said processor and said memory being interconnected, wherein said memory is adapted to store a computer program comprising program instructions, said processor being configured to invoke said program instructions to perform the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, which is executed by a processor to implement the method of any one of claims 1-7.
CN202010127326.6A 2020-02-27 2020-02-27 Code generation method of application page and related equipment Pending CN111324352A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010127326.6A CN111324352A (en) 2020-02-27 2020-02-27 Code generation method of application page and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010127326.6A CN111324352A (en) 2020-02-27 2020-02-27 Code generation method of application page and related equipment

Publications (1)

Publication Number Publication Date
CN111324352A true CN111324352A (en) 2020-06-23

Family

ID=71167373

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010127326.6A Pending CN111324352A (en) 2020-02-27 2020-02-27 Code generation method of application page and related equipment

Country Status (1)

Country Link
CN (1) CN111324352A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113157310A (en) * 2021-04-01 2021-07-23 北京三快在线科技有限公司 Configuration information acquisition method, device, equipment and computer readable storage medium
CN113704655A (en) * 2021-08-05 2021-11-26 上海硬通网络科技有限公司 Page operation control setting method and device and storage medium
CN113742553A (en) * 2021-09-03 2021-12-03 上海哔哩哔哩科技有限公司 Data processing method and device
WO2023193633A1 (en) * 2022-04-06 2023-10-12 北京字节跳动网络技术有限公司 Image analysis methods and apparatuses, computer device and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113157310A (en) * 2021-04-01 2021-07-23 北京三快在线科技有限公司 Configuration information acquisition method, device, equipment and computer readable storage medium
CN113704655A (en) * 2021-08-05 2021-11-26 上海硬通网络科技有限公司 Page operation control setting method and device and storage medium
CN113742553A (en) * 2021-09-03 2021-12-03 上海哔哩哔哩科技有限公司 Data processing method and device
CN113742553B (en) * 2021-09-03 2024-03-19 上海哔哩哔哩科技有限公司 Data processing method and device
WO2023193633A1 (en) * 2022-04-06 2023-10-12 北京字节跳动网络技术有限公司 Image analysis methods and apparatuses, computer device and storage medium

Similar Documents

Publication Publication Date Title
CN111324352A (en) Code generation method of application page and related equipment
US9342237B2 (en) Automated testing of gesture-based applications
EP2680110A1 (en) Method and apparatus for processing multiple inputs
KR20210040196A (en) Actionable content displayed on a touch screen
CN107748615B (en) Screen control method and device, storage medium and electronic equipment
WO2016095689A1 (en) Recognition and searching method and system based on repeated touch-control operations on terminal interface
WO2019019628A1 (en) Test method, apparatus, test device and medium for mobile application
KR102625254B1 (en) Electronic device and method providing information associated with image to application through input unit
CN107741902B (en) Program application detection method and program application detection device
CN111077996B (en) Information recommendation method and learning device based on click-to-read
CN104636322A (en) Text copying method and text copying device
CN103886025A (en) Method and device for displaying pictures in webpage
US20140267011A1 (en) Mobile device event control with digital images
CN108256071B (en) Method and device for generating screen recording file, terminal and storage medium
CN104063424B (en) Web page picture shows method and demonstration device
WO2017211202A1 (en) Method, device, and terminal device for extracting data
CN109213668B (en) Operation recording method and device and terminal
CN110806913A (en) Webpage screenshot method, device and equipment
CN108845924B (en) Control response area display control method, electronic device, and storage medium
WO2016018682A1 (en) Processing image to identify object for insertion into document
CN110874216B (en) Complete code generation method, device, equipment and storage medium
JP5204343B1 (en) Test system and program
CN115543831A (en) Test script generation method, device, equipment and storage medium
CN114253841A (en) Test script generation method and device and storage medium
CN110221756B (en) Method, device, terminal and storage medium for processing application data

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