CN114444000A - Page layout file generation method and device, electronic equipment and readable storage medium - Google Patents

Page layout file generation method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN114444000A
CN114444000A CN202011200719.1A CN202011200719A CN114444000A CN 114444000 A CN114444000 A CN 114444000A CN 202011200719 A CN202011200719 A CN 202011200719A CN 114444000 A CN114444000 A CN 114444000A
Authority
CN
China
Prior art keywords
target
layout file
page
equipment
display
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
CN202011200719.1A
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202011200719.1A priority Critical patent/CN114444000A/en
Publication of CN114444000A publication Critical patent/CN114444000A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • 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)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application is applicable to the technical field of data processing, and provides a method and a device for generating a page layout file, an electronic device and a readable storage medium, wherein the method comprises the following steps: acquiring target parameters corresponding to target equipment; the target parameters comprise display parameters of all components in the target page; importing the target parameters into an original layout file associated with the target page to generate a target layout file corresponding to the target device; the display parameters of all components in the target page in the original layout file are in a state to be configured; and sending the target layout file to the target equipment so as to enable the target equipment to display the target page. The technical scheme provided by the application can solve the problems that the existing page display technology cannot give consideration to both the page development difficulty and the applicability of the page layout file.

Description

Page layout file generation method and device, electronic equipment and readable storage medium
Technical Field
The present application belongs to the technical field of data processing, and in particular, to a method and an apparatus for generating a page layout file, an electronic device, and a readable storage medium.
Background
With the continuous development of electronic device technology, the number and types of electronic devices are increasing, and there are not only electronic devices with strong processing capability but also mobile devices with trend toward lightweight and higher portability on the market, and the display interface sizes of different types of electronic devices are different.
In order to adapt to the difference of the sizes of the display interfaces of different electronic devices, the conventional page display technology needs to configure various different sizes for each page control of the same page so as to match the size of the page control with the size of the display interface of the electronic device, thereby greatly increasing the difficulty of page development; if the size of each page component in the developed and generated page layout file is in a default configuration, the file for displaying the page layout is required to have layout calculation capability, and for a part of equipment with limited calculation capability, the task of layout calculation cannot be completed, so that the applicability of the page layout file is low. Therefore, the existing page display technology cannot simultaneously consider both the page development difficulty and the applicability of the page layout file.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating a page layout file, an electronic device and a computer-readable storage medium, which can solve the problem that the existing page display technology cannot simultaneously consider both the page development difficulty and the applicability of the page layout file.
In a first aspect, an embodiment of the present application provides a method for generating a page layout file, which is applied to a first device, and includes:
the first equipment acquires a target parameter corresponding to target equipment; the target parameters comprise display parameters of all components in the target page;
the first equipment imports the target parameters into an original layout file associated with the target page to generate a target layout file corresponding to the target equipment; the display parameters of all components in the target page in the original layout file are in a state to be configured;
and the first equipment sends the target layout file to the target equipment so as to enable the target equipment to display the target page.
The embodiment of the application has the following beneficial effects: the method comprises the steps that target parameters corresponding to target equipment needing to display a target page are obtained through first equipment, namely page layout calculation operation of the target equipment is executed, so that display parameters of the target page when the target page is displayed on the target equipment are determined, the first equipment imports the target parameters into an original layout file associated with the target page, configuration is conducted on the display parameters of all components in the original layout file, a target layout file matched with a display module of the target equipment is obtained, then the first equipment can send the target layout file to the target equipment, and the target equipment can display the target page according to the received target layout file. Compared with the prior page display technology, the embodiment does not need a developer to manually configure display parameters for different target devices and generate a plurality of page layout files, but can obtain the target parameters related to the target devices through the first device, and page layout calculation is finished by the first device, so that the configuration operation of the developer is reduced, and the page development difficulty is reduced; meanwhile, the task of page layout calculation is not completed by the target device but is executed by the first device, so that the target device does not need to have the page layout calculation capability, and the target device can directly generate a target page according to the target layout file, so that the applicability of the generated target layout file is improved, the requirement on the calculation capability of the target device is reduced, and the two aspects of page development difficulty and the applicability of the page layout file are considered.
In a possible implementation manner of the first aspect, the obtaining, by the first device, a target parameter corresponding to a target device includes:
the first device starts a device simulation program associated with the target device so as to run the same operating system as the target device on the first device;
the first device calls the operating system to load the original layout file, so that page layout calculation is carried out on each component in the original layout file through the operating system, and display parameters of each component are determined;
the first device generates the target parameter based on the display parameter of each of the components.
In a possible implementation manner of the first aspect, the obtaining, by the first device, a target parameter corresponding to a target device includes:
the first equipment responds to the compiling instruction of the target page, runs a preset parameter measurement script and determines equipment parameters corresponding to a plurality of preset equipment models; the device models comprise the device model of the target device; the target parameters corresponding to the target equipment are contained in the plurality of equipment parameters;
correspondingly, the importing, by the first device, the target parameter into the original layout file associated with the target page to generate a target layout file corresponding to the target device includes:
the first equipment respectively imports each equipment parameter into the original layout file to generate a plurality of page layout files respectively matched with each equipment model; the plurality of page layout files include the target layout file corresponding to the target device.
In a possible implementation manner of the first aspect, the first device is a server responding to application downloading, and the generating method further includes:
the first equipment receives an original layout file uploaded by second equipment of a development user;
correspondingly, the first equipment acquires a target parameter corresponding to the target equipment; the target parameters comprise display parameters of each component in the target page, and the display parameters comprise:
and the first equipment runs a preset parameter measurement script and determines a target parameter corresponding to the target equipment.
In a possible implementation manner of the first aspect, the running, by the first device, a preset parameter measurement script to determine a target parameter corresponding to the target device includes:
and the first equipment responds to a downloading request initiated by the target equipment, runs the parameter measurement script and determines target parameters corresponding to the target equipment.
In a possible implementation manner of the first aspect, the running, by the first device, a preset parameter measurement script to determine a target parameter corresponding to the target device includes:
if the preset layout updating time is reached, the first device runs the parameter measurement script and respectively outputs device parameters corresponding to a plurality of layout files to be configured, which are suitable for the target device; the plurality of layout files to be configured comprise the original layout file; the plurality of layout files to be configured are uploaded layout files from the last layout updating time to the current layout updating time; the device parameters corresponding to the layout files to be configured comprise target parameters;
correspondingly, the sending, by the first device, the target layout file to the target device includes:
and the first equipment responds to a downloading request initiated by the target equipment and sends the target layout file to the target equipment.
In a possible implementation manner of the first aspect, the acquiring, by the first device, a target parameter corresponding to the target device, where the first device is another device interconnected with the target device, includes:
the first equipment responds to a measurement instruction initiated by target equipment, runs a preset parameter measurement script and determines a target parameter corresponding to the target equipment; the measurement instructions include the raw layout file.
In a second aspect, an embodiment of the present application provides an apparatus for generating a page layout file, including:
the target parameter acquiring unit is used for acquiring target parameters corresponding to the target equipment; the target parameters comprise display parameters of all components in the target page;
a target layout file generation unit, configured to import the target parameter into an original layout file associated with the target page, and generate a target layout file corresponding to the target device; the display parameters of all components in the target page in the original layout file are in a state to be configured;
and the target layout file sending unit is used for sending the target layout file to the target equipment so as to enable the target equipment to display the target page.
In a possible implementation manner of the second aspect, the target parameter obtaining unit includes:
an operating system building unit, configured to start an equipment simulation program associated with the target equipment, so as to run an operating system that is the same as the target equipment on the first equipment;
the component measurement application running unit is used for calling the operating system to load the original layout file, so that the page layout calculation is carried out on each component in the original layout file through the operating system, and the display parameter of each component is determined;
and the display parameter packaging unit is used for generating the target parameters based on the display parameters of the components.
In a possible implementation manner of the second aspect, the target parameter obtaining unit includes:
the compiling instruction response unit is used for responding to the compiling instruction of the target page, running a preset parameter measurement script and determining equipment parameters corresponding to a plurality of preset equipment models; the device models comprise the device model of the target device; the plurality of device parameters comprise the target parameters corresponding to the target device;
correspondingly, the target layout file generating unit includes:
the compiling instruction execution unit is used for respectively importing all the equipment parameters into the original layout file and generating a plurality of page layout files respectively matched with all the equipment models; the plurality of page layout files include the target layout file corresponding to the target device.
In a possible implementation manner of the second aspect, the generating device of the page layout file is a server responding to an application download, and the generating device of the page layout file further includes:
the original layout file receiving unit is used for receiving an original layout file uploaded by second equipment of a development user;
correspondingly, the target parameter acquiring unit comprises:
and the parameter measurement script running unit is used for running a preset parameter measurement script and determining a target parameter corresponding to the target equipment.
In a possible implementation manner of the second aspect, the parameter measurement script execution unit includes:
and the download request response unit is used for responding to a download request initiated by the target equipment, running the parameter measurement script and determining the target parameters corresponding to the target equipment.
Optionally, the parameter measurement script execution unit includes:
the layout updating triggering unit is used for running the parameter measurement script by the first equipment and respectively outputting equipment parameters corresponding to a plurality of layout files to be configured, which are suitable for the target equipment, if the preset layout updating time is reached; the plurality of layout files to be configured comprise the original layout file; the plurality of layout files to be configured are uploaded layout files from the last layout updating time to the current layout updating time; the device parameters corresponding to the layout files to be configured comprise target parameters;
correspondingly, the target layout file sending unit is specifically configured to: and responding to a downloading request initiated by the target equipment, and sending the target layout file to the target equipment.
In a possible implementation manner of the second aspect, the generating device of the page layout file is a device in the same local area network as a target device, and the target parameter obtaining unit includes:
a measurement instruction response unit, configured to run a preset parameter measurement script by the first device in response to a measurement instruction initiated by a target device, and determine a target parameter corresponding to the target device; the measurement instructions include the original layout file.
In a third aspect, an embodiment of the present application provides a page display method, which is applied to a target device, and includes:
the target equipment responds to display operation initiated by a user, if a layout file corresponding to the display operation is an original layout file, a measurement instruction containing the original layout file is generated, and the measurement instruction is sent to first equipment interconnected with the target equipment; the display parameters of all components in the target page in the original layout file are in a state to be configured;
the target device receives a target layout file fed back by the first device based on the original layout file;
and the target equipment displays a target page based on the target layout file.
In a fourth aspect, an embodiment of the present application provides a display device for a page, including:
a display operation response unit, configured to respond to a display operation initiated by a user, generate a measurement instruction including an original layout file if a layout file corresponding to the display operation is the original layout file, and send the measurement instruction to a first device interconnected with the target device; the display parameters of all components in the target page in the original layout file are in a state to be configured;
a target layout file receiving unit, configured to receive a target layout file fed back by the first device based on the original layout file;
and the target page display unit is used for displaying a target page based on the target layout file by the target equipment.
In a fifth aspect, an embodiment of the present application provides an electronic device, a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements a method for generating a page layout file according to any one of the first aspect or a method for displaying a page according to any one of the third aspect when executing the computer program.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, and the computer program is configured to, when executed by a processor, implement a method for generating a page layout file according to any one of the first aspect and a method for displaying a page according to any one of the third aspect.
In a fifth aspect, an embodiment of the present application provides a computer program product, which, when run on an electronic device, causes the electronic device to perform a method for generating a page layout file according to any one of the above first aspects or a method for displaying a page according to any one of the third aspects.
In a sixth aspect, an embodiment of the present application provides a chip system, which includes a processor, where the processor is coupled with a memory, and the processor executes a computer program stored in the memory to implement the method for generating a page layout file according to any one of the first aspects or the method for displaying a page according to any one of the third aspects.
It is understood that the beneficial effects of the second to sixth aspects can be seen from the description of the first aspect, and are not described herein again.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
FIG. 2 is a block diagram of a software architecture of an electronic device according to an embodiment of the present application;
FIG. 3 is a schematic view of a display of a same operation page by different electronic devices according to an embodiment of the present application;
fig. 4 is a schematic diagram of a connection between a first device and a target device according to an embodiment of the present application;
FIG. 5 is a flowchart illustrating an implementation of a method for generating a page layout file according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a destination page provided by an embodiment of the present application;
FIG. 7 is a schematic diagram illustrating a page development process according to an embodiment of the present application;
FIG. 8 is a flowchart illustrating an implementation of a method for generating a page layout file according to another embodiment of the present application;
FIG. 9 is a schematic diagram of an operating system running a simulation provided by an embodiment of the present application;
FIG. 10 is a flowchart illustrating an implementation of a method for generating a page layout file according to another embodiment of the present application;
FIG. 11 is a diagram illustrating a first device responding to a compile instruction according to an embodiment of the present application;
FIG. 12 is an interactive flowchart of a method for generating a page layout file according to yet another embodiment of the present application;
FIG. 13 is an interaction flow diagram of a method for generating a page layout file according to an embodiment of the present application;
fig. 14 is a flowchart illustrating an implementation of a method for displaying a page on a target device side according to an embodiment of the present application;
fig. 15 is a block diagram of a structure of a device for generating a page layout file according to an embodiment of the present application;
fig. 16 is a block diagram of a display device of a page provided in an embodiment of the present application;
fig. 17 is a block diagram illustrating a structure of an apparatus for generating a page layout file according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The method for generating the page layout file provided in the embodiment of the present application may be applied to electronic devices such as a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, and a Personal Digital Assistant (PDA), and the embodiment of the present application does not limit the specific type of the electronic device.
For example, the electronic device may be a Station (ST) in a WLAN, and may be a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with Wireless communication capability, a computing device or other processing device connected to a Wireless modem, a computer, a laptop, a handheld communication device, a handheld computing device, and/or other devices for communicating on a Wireless system, and a next generation communication system, such as a Mobile terminal in a 5G Network or a Mobile terminal in a future evolved Public Land Mobile Network (PLMN) Network, and so on.
Fig. 1 shows a schematic structural diagram of an electronic device 100.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identification Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
The I2C interface is a bi-directional synchronous serial bus that includes a serial data line (SDA) and a Serial Clock Line (SCL). In some embodiments, processor 110 may include multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces, respectively. For example: the processor 110 may be coupled to the touch sensor 180K via an I2C interface, such that the processor 110 and the touch sensor 180K communicate via an I2C bus interface to implement the touch functionality of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface, so as to receive phone calls through the bluetooth headset.
The PCM interface may also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled by a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to implement a function of answering a call through a bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus used for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit the audio signal to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a bluetooth headset.
MIPI interfaces may be used to connect processor 110 with peripheral devices such as display screen 194, camera 193, and the like. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the capture functionality of electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transmit data between the electronic device 100 and a peripheral device. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The interface may also be used to connect other electronic devices, such as AR devices and the like.
It should be understood that the connection relationship between the modules according to the embodiment of the present invention is only illustrative, and is not limited to the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140, and supplies power to the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), etc. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that electronic device 100 can communicate with networks and other devices through wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, with N being a positive integer greater than 1. The display screen 194 may include a touch panel as well as other input devices.
The electronic device 100 may implement a photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV and other formats. In some embodiments, the electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor, which processes input information quickly by referring to a biological neural network structure, for example, by referring to a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent recognition of the electronic device 100 can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the storage capability of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, phone book, etc.) created during use of the electronic device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The electronic apparatus 100 can listen to music through the speaker 170A or listen to a handsfree call.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the electronic apparatus 100 receives a call or voice information, it can receive voice by placing the receiver 170B close to the ear of the person.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 170C by speaking the user's mouth near the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C to achieve a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, perform directional recording, and so on.
The headphone interface 170D is used to connect a wired headphone. The headset interface 170D may be the USB interface 130, or may be a 3.5mm open mobile electronic device platform (OMTP) standard interface, a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used for sensing a pressure signal, and converting the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A can be of a wide variety, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a sensor comprising at least two parallel plates having an electrically conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic apparatus 100 may also calculate the touched position from the detection signal of the pressure sensor 180A. In some embodiments, the touch operations that are applied to the same touch position but different touch operation intensities may correspond to different operation instructions. For example: and when the touch operation with the touch operation intensity smaller than the first pressure threshold value acts on the short message application icon, executing an instruction for viewing the short message. And when the touch operation with the touch operation intensity larger than or equal to the first pressure threshold value acts on the short message application icon, executing an instruction of newly building the short message.
The gyro sensor 180B may be used to determine the motion attitude of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., x, y, and z axes) may be determined by gyroscope sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects a shake angle of the electronic device 100, calculates a distance to be compensated for by the lens module according to the shake angle, and allows the lens to counteract the shake of the electronic device 100 through a reverse movement, thereby achieving anti-shake. The gyroscope sensor 180B may also be used for navigation, somatosensory gaming scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude, aiding in positioning and navigation, from barometric pressure values measured by barometric pressure sensor 180C.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip holster using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the opening and closing state of the leather sheath or the opening and closing state of the flip cover, the automatic unlocking of the flip cover is set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. The method can also be used for identifying the posture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and the like.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, taking a picture of a scene, electronic device 100 may utilize range sensor 180F to range for fast focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light to the outside through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there are no objects near the electronic device 100. The electronic device 100 can utilize the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear for talking, so as to automatically turn off the screen to achieve the purpose of saving power. The proximity light sensor 180G may also be used in a holster mode, a pocket mode automatically unlocks and locks the screen.
The ambient light sensor 180L is used to sense the ambient light level. Electronic device 100 may adaptively adjust the brightness of display screen 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 can utilize the collected fingerprint characteristics to unlock the fingerprint, access the application lock, photograph the fingerprint, answer an incoming call with the fingerprint, and so on.
The temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 implements a temperature processing strategy using the temperature detected by temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 performs a reduction in performance of a processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, the electronic device 100 heats the battery 142 when the temperature is below another threshold to avoid the low temperature causing the electronic device 100 to shut down abnormally. In other embodiments, when the temperature is lower than a further threshold, the electronic device 100 performs boosting on the output voltage of the battery 142 to avoid abnormal shutdown due to low temperature.
The touch sensor 180K is also called a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the electronic device 100, different from the position of the display screen 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, the bone conduction sensor 180M may acquire a vibration signal of the human vocal part vibrating the bone mass. The bone conduction sensor 180M may also contact the human body pulse to receive the blood pressure pulsation signal. In some embodiments, the bone conduction sensor 180M may also be disposed in a headset, integrated into a bone conduction headset. The audio module 170 may analyze a voice signal based on the vibration signal of the bone mass vibrated by the sound part acquired by the bone conduction sensor 180M, so as to implement a voice function. The application processor can analyze heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 180M, so as to realize the heart rate detection function.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration cues, as well as for touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also respond to different vibration feedback effects in response to touch operations applied to different areas of the display screen 194. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card can be brought into and out of contact with the electronic apparatus 100 by being inserted into the SIM card interface 195 or being pulled out of the SIM card interface 195. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. The same SIM card interface 195 can be inserted with multiple cards at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
The software system of the electronic device 100 may employ a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention uses an Android system with a layered architecture as an example to exemplarily illustrate a software structure of the electronic device 100.
Fig. 2 is a block diagram of a software structure of an electronic device according to an embodiment of the present application.
The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer from top to bottom.
The application layer may include a series of application packages.
As shown in fig. 2, the application package may include applications such as camera, gallery, calendar, phone call, map, navigation, WLAN, bluetooth, music, video, short message, etc.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
Content providers are used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The phone manager is used to provide communication functions of the electronic device. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a short dwell, and does not require user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scrollbar text in a status bar at the top of the system, such as a notification of a running application in the background, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, sounding a prompt tone, vibrating the electronic device, flashing an indicator light, etc.
The Android Runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), Media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, and the like.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The following describes exemplary workflow of the software and hardware of the electronic device 100 in connection with capturing a photo scene.
When the touch sensor 180K receives a touch operation, a corresponding hardware interrupt is issued to the kernel layer. The kernel layer processes the touch operation into an original input event (including touch coordinates, a time stamp of the touch operation, and other information). The raw input events are stored at the kernel layer. And the application program framework layer acquires the original input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation, and taking a control corresponding to the click operation as a control of a camera application icon as an example, the camera application calls an interface of an application framework layer, starts the camera application, further starts a camera drive by calling a kernel layer, and captures a still image or a video through the camera 193.
The first embodiment is as follows:
the electronic equipment can install various types of application programs, and different application programs correspond to different operation pages so as to provide services matched with the application programs or respond to the operation of the user. Therefore, when a developer generates an installation data package of an application program, the installation data package needs to include a page layout file of each operation page, and the page layout file is used for building any operation page of the application program. The operating page includes a plurality of operable components and the like, one component may be formed by a plurality of controls having a cascade relationship (for example, there are upper and lower cascades or same cascade, and the like), that is, different cascades of the controls, and each control has corresponding spatial information when displayed, so that in the process of developing the operating page, it is necessary to determine the display position and size information of each component in the operating page on the display module of the electronic device, that is, a page design (User Interface, UI) layout file, which is simply referred to as a page layout file.
With the continuous development of electronic devices, the types and the number of the electronic devices are increasing, and the shapes, the sizes, the resolutions, and the like of the display modules of the electronic devices of different types are different. In the process of developing the operation page, the page layout file needs to be adjusted corresponding to the display modules with different shapes, sizes and resolutions, so that the operation page displayed based on the page layout file is matched with the display module. Exemplarily, fig. 3 shows a display schematic diagram of a same operation page by different electronic devices according to an embodiment of the present application, which is shown in fig. 3 (a), where the electronic device is a smart phone, and the display module displays an image preview page in an image browsing application; referring to fig. 3 (b), the electronic device is a smart watch, and also displays an image preview page, where the number of previewable images, menu components, and the like are different in display position and display size. However, the number of models of the electronic device is huge, and if a developer needs to manually configure corresponding page layout files for electronic devices of different models on the same operation page, the development difficulty of the operation page is greatly increased, and one application program often includes a plurality of operation pages, so that the difficulty of application development and the workload of development are increased, thereby reducing the efficiency of application development and prolonging the period of application development.
In order to solve the problem of high development difficulty of the operation page, in the process of developing the operation page, only the cascade relation and/or the relative position relation between the components in the page can be defined, the display position and the size information of each component do not need to be specified, and the task of page layout can be handed to the electronic equipment for displaying the operation page to be executed. Because the original page layout file issued by the developer often only contains the cascade relationship and/or the relative position relationship among the components in the page, the electronic device can be obtained through multiple times of loop traversal and nested calculation according to the cascade relationship and/or the relative position relationship among the components in the process of calculating the specific position and the size of the components, and the calculation process of realizing the UI framework is UI layout calculation or is called UI dynamic layout. In order to implement the UI layout calculation, the electronic device is required to have a certain calculation capability to implement the UI layout calculation, for example, the calculation capability, the executable content, the hardware storage space, and the like need to be greater than a certain preset value, however, for a part of lightweight electronic devices, in order to tend to be lightweight and more portable, the volume and the weight of the device are smaller, correspondingly, the device performance of the type of electronic device is often lower (for example, the device is embodied in weaker calculation capability, the executable memory, and the hardware storage space are less), the above type of electronic device cannot implement the UI layout calculation task, or the UI layout calculation consumes too long time, the display frame rate of an operation page is reduced, the rendering time is prolonged, and therefore the user experience is reduced, if the UI layout calculation task needs to be implemented, more memories need to be configured and the hard disk needs to be expanded, for light-weight equipment, the difficulty in arranging components is greatly increased.
Therefore, according to the conventional page layout file generation technology, if corresponding page layout files are configured for electronic equipment of different models, the difficulty of page development is greatly increased, and the development experience of developers is not friendly; if the display position and the display size of the component in the page layout file are configured by default, the electronic device is required to have UI layout calculation capability, and the method is not suitable for part of light-weight electronic devices, so that the application range of the page layout file is reduced, and the conventional page layout file generation method cannot simultaneously take account of two aspects of page development difficulty and file application range.
Therefore, in order to overcome the defects of the conventional page layout file generation technology, the present application provides a page layout file generation method, which is specifically detailed as follows: fig. 4 shows a schematic connection diagram between a first device and a target device according to an embodiment of the present disclosure, and referring to fig. 4, an execution subject of the method for generating a page layout file is an electronic device, where the electronic device is specifically a first device with certain computing capability, and the first device may be an electronic device with certain computing capability, such as a smart phone, a tablet computer, a computer, or a server, and the first device is used for generating the page layout file. The first device and the target device may establish a communication connection, and the generated page layout file may be sent to the target device through the communication connection, where the target device may be an electronic device such as a smart phone, a tablet computer, a computer, and a smart watch, the target device may be an electronic device with a certain computing capability, or an electronic device with a weak computing capability (such as a smart watch or other wearable devices), and the target device may generate a target page based on the page layout file. Fig. 5 shows a flowchart of an implementation of a method for generating a page layout file according to an embodiment of the present application, where the method for generating a page layout is applied to a first electronic device, and is detailed as follows:
in S501, the first device obtains a target parameter corresponding to a target device; the target parameters comprise display parameters of all components in the target page.
In this embodiment, the first device may be a development device of a developer, that is, a device for developing a target page, or may be a server providing a download service, so as to respond to a download request of the target device for a page layout file of the target page. The first device may obtain module parameters of the target device related to the display module in various ways, so that the first device performs page layout calculation according to the module parameters of the display module. The obtaining of the module parameters of the display module may specifically include the following modes:
mode 1: the first device may query the device model of the target device, and obtain device parameters related to the target device according to the device model, that is, the target parameters. Since the target parameter is specifically a parameter related to a display module of the target device, for example, information such as an aspect ratio, a size, a resolution, and the like of the display module, and is a hardware parameter of the target device, the target parameter is generally kept unchanged after the target device leaves a factory. Based on this, the first device may obtain the parameter related to the display module, that is, the module parameter, from the hardware parameter by obtaining the device model of the target device and querying the hardware parameter corresponding to the device model. For example, if the first device needs to generate an operation page suitable for the device model of Mate30, the first device may obtain the hardware parameter of Mate30, and query the obtained hardware parameter as: "running the memory: 6GB, hard disk capacity: 128G, screen size: 6.62 inches, screen resolution: 2340 × 1080 pixels … ″, the first device extracts the parameters related to the display module from the hardware parameters, i.e., "screen size: 6.62 inches, screen resolution: 2340 × 1080 pixels ", get the module parameters.
Mode 2: the target device may send a page obtaining request to the first device, where the page obtaining request may carry a device identifier of the target device, and the device identifier may be a device model, a unique identification code, and the like of the target device. The first device may analyze the page acquisition request, extract the device identifier carried in the page acquisition request, determine the device model of the target device based on the device identifier, and obtain a parameter, i.e., a module parameter, related to the display module of the target device based on the device model.
In a possible implementation manner, after obtaining the device model of the target device, the first device may determine a calculation processing parameter of the target device, for example, obtain an index parameter related to a calculation capability, such as a memory capacity, a hard disk capacity, and a processing rate of the processor, of the target device. If the first device detects that the calculation processing parameters of the target device meet the preset layout execution conditions, the first device indicates that the target device has page layout capability, and can send the original layout file with default configuration page component sizes and positions to the target device with the calculation processing parameters meeting the layout execution conditions without configuring a page layout file containing the sizes and the positions of all the page components for the target device; otherwise, if the calculation processing parameter does not satisfy the layout execution condition, the module parameter of the target device is obtained, and the subsequent operation is executed.
Mode 3: the target device may send a page obtaining request to the first device, where the page obtaining request may carry a module parameter of the target device. In this case, the first device may extract the module parameter directly from the page get request without determining the module parameter of the target device by the device model.
Mode 4: the first device may establish a communication connection with a plurality of testers including a tester of the same model as the target device. In this case, the first device may establish a communication connection with a tester associated with the device model of the target device, and send a parameter acquisition request to the tester, after receiving the parameter acquisition request, the tester may feed back a parameter related to the display module, that is, the module parameter, to the first device, and the first device may acquire the module parameter of the target device through the parameter fed back by the tester.
Mode 5: the first device may operate a device simulator related to the target device, that is, an operating environment related to the target device is built on the first device, and parameters related to a display module of the target device, that is, module parameters, are acquired through the built operating environment.
It should be noted that, other existing manners capable of obtaining the parameters related to the display module of the target device are within the scope of the present application.
In a possible implementation manner, if the first device cannot obtain the module parameters of the target device, the parameter obtaining abnormal information may be output, so that a developer on the target page may process a situation that the module parameters cannot be obtained, for example, the developer inputs the module parameters in a manual configuration manner, or inputs the device model of another device associated with the target device, where the another device associated with the target device may belong to the same type of device, or may belong to the same series of devices, for example, the device model of the target device is Mate40, and the device belonging to the same series as the target device may be Mate40Pro, or may be Mate 30.
In this embodiment, after obtaining the module parameters associated with the target device, the first device may perform page layout calculation on the target page based on the module parameters, determine display parameters (the display parameters may include a display position, a display size, an operation mode, and the like) of each component in the target page, obtain the target parameters associated with the target device according to the display parameters of all the components in the target page, transfer the process of page layout calculation from the target device to the first device, and execute the process, thereby reducing the requirement on the calculation capability of the target device.
In this embodiment, the target page may include a plurality of components, and for example, fig. 6 shows a schematic diagram of the target page provided in an embodiment of the present application. Referring to fig. 6, the target page is specifically a short video editing page, and the short video editing page includes a plurality of components, which are a return control 601, a video preview playing interface 602, a next step editing control 603, a video progress dragging component 604, and the like. Each component has a fixed display position and display size on the target page, and certainly, a part of the components also include a control component connected in a downstream manner, for example, when a menu bar is opened, a plurality of selectable items can be popped up, so the display parameters also include a visual state, a cascade manner, an operable state and the like of each component when the target page is displayed, and each component is associated with a corresponding display parameter. For example, the obtained display parameters may specifically be:
“child”:[{
“x”:“55”,
“y”:“25”,
“width”:“400”,
“height”:“50”,
“id”:“testid”,
“visiable”:“true”,
“touchable”:“true”,
“draggable”:“false”;
wherein, the 'child' is a sub-component of the component belonging to another component in the target page, namely the component has an upper-linked parent component, and the 'testid' is a component name corresponding to the component in the target page; "x" and "y" are used to indicate the corresponding display positions, i.e. the positioning points, on the target device; "width" and "height" are used to indicate the display size of the component, width and height, respectively; "id" is the device identification of the target device with which the component is associated, and may be, for example, a device model number; "visible" is whether the component is in a visible state when the target page is displayed, if the visible state is True, the component is indicated to be in the visible state, and if the visible state is False, the component is indicated to be in the invisible state; "touchable" is the operable state of the component, if the operable state is True, it means that the component is operable component, if the visual state is False, it means that the component is not operable component; "dragable" is the draggable state of the component, if the operable state is True, the component is represented as draggable, if the visible state is False, the component is represented as non-draggable.
In a possible implementation manner, after determining the module parameter of the display module in the target device, the first device may import the module parameter into the layout calculation script related to the target page, so as to determine the display parameter of each component in the target page, for example, determine the display position of the component according to the aspect ratio of the display module, determine the display size of the component according to the resolution of the display module, and encapsulate all the components and the associated display parameters, so as to obtain the target parameter related to the target page and related to the target device.
In this embodiment, the triggering manner for the first device to acquire the target parameter of the target device may be automatic triggering or passive triggering. The specific implementation mode can be as follows:
the case of automatically triggering to acquire the target parameter may be: the first device may specifically be a development device of an operation page of the application program, and in this case, the first device may receive a target device list preset by a developer, where the target device list includes multiple devices that can be installed by the application program. The first device may store original layout files of a plurality of developed operation pages, and configure the to-be-converted identifier for the original layout file without generating the page layout file, for example, configure the to-be-converted identifier with a bit value of "0" for the original layout file without generating the page layout file. The first device may determine an original layout file that needs to be subjected to page layout calculation by recognizing the identifier to be converted. If the first device detects that the original layout file in which the page layout file is not generated is currently stored, the operation of S501 may be automatically executed, for example, page layout calculation is performed on the original layout file that is just generated, so as to obtain a page layout file in which the component size can be configured. When the original layout file is converted into the page layout file, the device parameters (i.e., the above-mentioned target parameters) of each device in the target device list may be obtained, and the page layout files associated with each target device in the target device list may be generated respectively.
In one possible implementation, the first device may store a layout conversion schedule corresponding to the original layout file. The layout conversion schedule includes all target devices included in the target device list and conversion completion identifiers of the page layout files associated with the target devices. Table 1 shows a layout conversion schedule provided in an embodiment of the present application. Referring to table 1, the layout conversion schedule includes a plurality of target devices that need to perform page layout calculation, and the target devices in the layout conversion schedule may be specifically determined according to a target device list of preset values. It should be noted that, if the target device list is updated, for example, a new model of target device is added or a part of target devices is deleted, the layout conversion schedule may be updated synchronously, so that the number and model of the target devices included in the layout conversion schedule and the target device list are kept consistent. Within the layout schedule list, each target device may be associated with a conversion completion flag to determine whether the first device has generated a page layout file associated with the target device. If not, if a preset layout conversion condition is met (for example, the first device may identify an unconverted target device in the layout conversion schedule according to a preset cycle), then the operations in S501 to S502 are automatically performed to generate a page layout file associated with the unconverted target device.
Figure BDA0002754617190000171
TABLE 1
The manner for acquiring the target parameter by passive triggering may be: the first device may generate the conversion instruction in response to a user-initiated conversion operation. The conversion instruction may carry an equipment identifier of the target equipment and an original layout file of the target page, and the first equipment executes a generation process of the triggered page layout file according to the equipment identifier of the conversion instruction and the original layout file, that is, executes the operations of S501 to S503. In this case, the first device may store a target device list, and may configure, for the newly uploaded original layout file, a plurality of page layout files respectively matched with the target devices.
In S502, the first device imports the target parameter into an original layout file associated with the target page, and generates a target layout file corresponding to the target device; and the display parameters of all the components in the target page in the original layout file are in a state to be configured.
In this embodiment, the first device may store an original layout file of the target page. The display parameters are not configured for each component in the original layout file, namely the display parameters of each component are in a state to be configured. The original layout file may define a relative positional relationship and a cascade relationship between the components, and may also define contents such as functions, operation logics, jump paths, and the like of the components, that is, specific display positions and display sizes are not specified. Comparing the original layout file with a finally generated target layout file, wherein the target layout file specifies specific display positions and final display sizes of each component in a target page, and if the specific display sizes can be 'x': 55 ',' y ': 25', 'width': 400 ',' height ': 50', the display parameters are in a configuration completion state; in the original layout file, only the relative positions are limited, for example, the top of the page, the length-width ratio of 8:1, and the like are all configured with specific display values, that is, the display parameters are in a state to be configured. The original layout file cannot be used for directly generating a target page, and the target page can be generated only after the configuration of display parameters in the target page is completed; and the target layout file can be directly used for generating a target page because the display parameters are configured.
In this embodiment, after obtaining the target parameter matched with the target device, the first device may import the target parameter into the original layout file corresponding to the target page, so as to generate the target layout file capable of being directly displayed. The original layout file may include a page identifier of the target page, and the first device may identify the original layout file associated with the target page from the multiple original layout files according to the page identifier, and import the target parameter into the original layout file associated with the target page.
In a possible implementation manner, the target parameter includes a component name of each component and a display parameter associated with the component name, the first device may search a phrase segment associated with the component name from the original layout file, and assign the display parameter associated with the component name to a sentence corresponding to the phrase segment, thereby completing the configuration operation on the page component, and identify the state of the configured component as a configured state, perform the configuration operation on each component in the target page in the manner described above, and import the display parameters of all the components into the completed original layout file, that is, the original layout file in which the display parameter of each component is changed to the configured state, as the target layout file. The display parameters of each component in the target layout file are matched with the target equipment, so that a target page can be displayed on the target equipment.
In S503, the first device sends the target layout file to the target device, so that the target device displays the target page.
In this embodiment, the first device may establish a communication connection with the target device, and send the target layout file to the target device through the established communication connection, and after receiving the target layout file, the target device may run the target layout file to display the target page on the target device.
In a possible implementation manner, the target page may be an operation page in an application, and in this case, the first device may package a page layout file of each operation page in the application, and generate an installation package corresponding to the application. The first device may send an installation package including a target layout file of a target page to the target device, where the target device runs the installation package to locally install the application program, and when the first device starts the application program, the first device may call a target layout file associated with each operation page (i.e., the target page) to display the corresponding operation page.
In this embodiment, the target device is specifically a device for displaying a target page, and since the process of page layout calculation is completed by the first device, the target device can directly display the target page without performing page layout calculation by only receiving a target layout file sent by the target device and having completed page layout calculation, so that the requirement on the calculation capability of the target device is greatly reduced, and the application range of the page layout file is improved.
In this embodiment, the first device is specifically a device with page layout calculation capability; the target device may be a device with page layout calculation capability or a device without page layout calculation capability, where the calculation capability of the target device is not limited, but all electronic devices capable of displaying the operation page may be used.
Exemplarily, fig. 7 shows a schematic page development flow provided by an embodiment of the present application. Referring to fig. 7, the operation page may specifically include the following three types of devices from development to final display, respectively: the system comprises a development terminal used by a page developer, a server providing user downloading and a user terminal capable of displaying an operation page. The page development process may specifically include the following steps:
the development terminal 1 is used for performing development operation on a target page, an operation object of the development terminal can be a developer, the developer can generate an original layout file of the operation page in a development process, and display parameters of components of the target page in the original layout file are in a state to be configured. The development terminal may store the original layout file and import the original layout file into the device parameters associated with the user terminal, thereby generating a page layout file (i.e., equivalent to the target layout file described above) matching the user terminal. Of course, the development terminal may send the original layout file to the server.
2.1 if the development terminal generates the page layout file of the user terminal, the page layout file can be directly sent to the user terminal, the user terminal can locally generate an operation page after receiving the page layout file, the operation page can be displayed without performing page layout calculation, and the developer does not need to configure the display parameters of the components, and the development terminal can calculate the display parameters of each component of the page layout file by obtaining the module parameters of the display module of the user terminal, so as to generate the device parameters (namely the target parameters) associated with the user terminal, thereby reducing the configuration operation of the developer and lowering the development difficulty.
2.2 if the development terminal does not generate the page layout file associated with the user terminal, the original layout file can be sent to the server. The server can be connected with a plurality of different user terminals and receives downloading tasks initiated by the plurality of different user terminals. The server may generate a page layout file (i.e., the above-mentioned target layout file) associated with each user terminal according to the original layout file uploaded by the development terminal.
And 3, the server responds to the downloading request of the user terminal and sends the page layout file corresponding to the user terminal so that the user terminal can generate a corresponding operation page (namely the target page) according to the page layout file. Similarly, the generation operation of the page layout file is completed through the server, and developers do not need to manually configure the display parameters of all components in the page, so that the configuration operation of the developers is reduced, and the development difficulty is reduced.
Therefore, the first device may be a development terminal in a page development process, or may be a server responding to page downloading.
As can be seen from the above, in the method for generating a page layout file according to the embodiment of the present application, the first device may obtain the target parameter corresponding to the target device that needs to display the target page, that is, execute the page layout calculation operation of the target device, so as to determine the display parameter when the target page is displayed on the target device, the first device imports the target parameter into the original layout file associated with the target page, configures the display parameter of each component in the original layout file, obtains the target layout file matched with the display module of the target device, and then the first device may send the target layout file to the target device, and the target device may display the target page according to the received target layout file. Compared with the prior page display technology, the embodiment does not need a developer to manually configure display parameters for different target devices to generate a plurality of page layout files, but can obtain the target parameters related to the target devices through the first device, and the page layout calculation is finished by the first device, so that the configuration operation of the developer is reduced, and the page development difficulty is reduced; meanwhile, the task of page layout calculation is not completed by the target device but is executed by the first device, so that the target device does not need to have the page layout calculation capability, and the target device can directly generate a target page according to the target layout file, so that the applicability of the generated target layout file is improved, the requirement on the calculation capability of the target device is reduced, and the two aspects of page development difficulty and the applicability of the page layout file are considered.
Example two:
fig. 8 shows an implementation flowchart of a method for generating a page layout file according to another embodiment of the present application, and compared with the previous embodiment, in this embodiment, the first device may locally build a simulation operating system corresponding to the target device to obtain a target parameter corresponding to the target device. In this case, the method for generating the page layout file specifically includes:
in S801, the first device starts a device simulation program associated with the target device to run the same operating system as the target device on the first device.
In this embodiment, the first device may specifically be a development device of a developer, and may also be a server that responds to a target device to perform a target page downloading operation, for example, a server in a cloud application marketplace.
In this embodiment, the first device may run the same operating system as the target device on the first device through the device simulation program. Illustratively, fig. 9 shows a schematic diagram of an operating system running a simulation provided by an embodiment of the present application. Referring to fig. 9, the first device is specifically a computer, the target device may be a smart watch, and the computer may set up an operating system corresponding to the smart phone on an original operating system of the computer through a device simulation program, and an operating interface corresponding to the smart watch is an operating interface for running a virtual smart phone on the computer.
In one possible implementation, the first device may store multiple device simulation programs, with different device simulation programs associated with corresponding device models. The first device may obtain a device model of the target device, select a device simulation program associated with the device model of the target device from the plurality of device simulation programs, and run the device simulation program associated with the device model of the target device, thereby running the same operating system as the target device on the first device.
In S802, the first device calls the operating system to load the original layout file, so as to perform page layout calculation on each component in the original layout file through the operating system, and determine a display parameter of each component.
In this embodiment, after the device simulation program is run by the first device, two operating systems are run, which are the local systems that the first device has originally run, and the other embedded system that is built by running the device simulation program depending on the local systems, that is, the operating system that is the same as the target device.
In this embodiment, the first device may load the original layout file by controlling the same operating system as the target device, so as to expand the component tree included in the original layout file, where the component tree is specifically composed of components in the target page, and defines the cascade relationship and the relative position relationship between the components. The component tree can be displayed in the form of a log, or in the form of other various file formats, such as a JavaScript object notation (json) or extensible markup language xml file.
In this embodiment, when the first device expands the component tree included in the original layout file, the first device performs page layout calculation to respectively determine a specific display position, a display size, and the like of each component in the component tree in the operating system, so as to determine a corresponding display parameter when each component is displayed on the target device. Optionally, when the operating system is called to run the original layout file, a target page may be displayed in the operating system that runs on the first device and is the same as the target device, and the first device may obtain the display parameters of each component through the displayed target page.
In this embodiment, the obtained display parameter may be associated with a component identifier of a corresponding component, so that when subsequently imported into the original layout file, the definition language segment associated with the component may be determined according to the component identifier, and the display parameter is imported into the definition language segment associated with the component, thereby implementing configuration of the page parameter in the original layout file. For example, the component name of a certain component is "tested", and the display parameters of the component obtained in the above manner are: and when the display parameters are imported, the first device can locate the definition language section corresponding to the "testid" from the original layout file, and add the display parameters to the definition language section corresponding to the "testid" to realize the configuration operation of the display parameters.
Since the operating system identical to the target device runs on the first device, the computing capability of the operating system is not limited to the target device, and therefore the operating system running on the first device can perform page layout computation through the computing capability of the first device, so that the display parameters of each component are determined and obtained.
In S803, the first device generates the target parameter based on the display parameter of each of the components.
In this embodiment, after determining the display parameters of each component in the target page, the first device may package the display parameters of all the components to obtain the target parameters.
In S804, the first device imports the target parameter into the original layout file associated with the target page, and generates a target layout file corresponding to the target device.
In this embodiment, when the first device imports the target parameter into the original layout file, the system identifier of the associated operating system may be marked. In this case, the first device may obtain a target parameter associated with the system identifier, and import the target parameter into the original layout file to generate a target layout file corresponding to the target device.
In this embodiment, since the implementation manner of S805 is completely the same as that of S503 in the first embodiment, for a specific description, reference may be made to the related description of S503, which is not described herein again.
In S805, the first device sends the target layout file to the target device, so that the target device displays the target page.
In this embodiment, since the implementation manner of S805 is completely the same as that of S503 in the first embodiment, for a specific description, reference may be made to the related description of S503, which is not described herein again.
It should be noted that the operation of obtaining the target parameter in this embodiment may be applied to a development stage of the original layout file, that is, before the original layout file is generated and published, the device simulation program may be run to obtain the target parameter, and the target parameter is imported into the original layout file to be published to generate the target layout file, and the target generated file is published, that is, uploaded to a server providing a download service. The embodiment may also be applied to a server providing a download service, that is, the server receives the original layout files uploaded by each development terminal, runs the device simulation program on the server to obtain the target parameters, and generates the target layout file corresponding to the target device, so as to send the target layout file corresponding to the target device when receiving a download request of the target device.
In the embodiment of the application, the device simulation program is run on the first device to build the operating system which is the same as the target device, the operating system is not limited by the original computing capability of the target device, and the page layout calculation can be executed, so that the target parameters are obtained, the purpose of automatically generating the page layout file associated with the target device is realized, and the configuration operation and the page development difficulty are reduced.
Example three:
fig. 10 is a flowchart illustrating an implementation of a method for generating a page layout file according to yet another embodiment of the present application, where in this embodiment, an obtaining operation of a target parameter of a target device is performed by a first device in response to a compiling instruction of an original layout file, that is, the first device is specifically a terminal device used by a developer developing a target page. In this case, the method for generating the page layout file specifically includes:
in S1001, the first device runs a preset parameter measurement script in response to the compiling instruction of the target page, and determines device parameters corresponding to a plurality of preset device models; the device models comprise the device model of the target device; the plurality of device parameters include the target parameter corresponding to the target device.
In this embodiment, a developer may develop an original layout file of a target page on a first device, and when the developer develops the original layout file, display parameters of each component in the target page may be in a default configuration, that is, in a state to be configured. The original layout file can be suitable for all electronic equipment, only the electronic equipment can execute page layout calculation, and a target page can be generated after the display parameters of all components are configured. After the developer completes the development of the original layout file, the compiling operation can be executed, the first device can generate a corresponding compiling instruction in response to the compiling operation, and the compiling process is executed, at this time, the first device does not receive the target device specified by the developer, and the display parameters of each component in the original layout file are still in a state to be configured.
In this embodiment, the first device stores a preset target device list, where the target device list includes device models of a plurality of different electronic devices, and the target device list may specifically define which electronic devices the target device may display, that is, an electronic device that may display a target page, and the device models of the target device include, that is, the target page may be displayed on the target device.
In this embodiment, the first device may obtain, according to the target device list, device parameters corresponding to different device models through a preset parameter measurement script, where the device parameters include display parameters of components when a target page is displayed on the electronic device corresponding to the device model.
In a possible implementation manner, the manner of obtaining the device parameter corresponding to any device model through the parameter measurement script includes: the first device imports module parameters related to a display module of the electronic device corresponding to the device model into the parameter measurement script, and the parameter measurement script can perform page layout calculation on a target page according to the module parameters, so that the corresponding display parameters are determined when each component is displayed on the display module of the electronic device corresponding to the device model. Of course, the manner in which the first device obtains the device parameter may refer to the implementation manner of S501 in the first embodiment, and is not described herein again.
In S1002, the first device imports each device parameter into the original layout file, and generates a plurality of page layout files respectively matched with each device model; the plurality of page layout files include the target layout file corresponding to the target device.
In this embodiment, when the first device responds to the compiling instruction, not only the target parameters associated with the first device are determined, but also device parameters of a plurality of preset device models are obtained, that is, the compiling instruction is used to output the page layout files corresponding to all the device models that can be displayed by the original layout file, and a developer does not need to perform multiple times of generating the page layout files. Illustratively, fig. 11 shows a schematic diagram of a first device responding to a compiling instruction provided by an embodiment of the present application. Referring to fig. 11, a developer may generate an original layout file through a first device, and after clicking a "compile" button, the first device may generate a compile instruction, and the first device, in response to the compile instruction, obtains device parameters of different preset device models, and introduces the device parameters into the original layout file, so as to generate a plurality of page layout files, where each page layout file corresponds to an electronic device of a device model, and the page layout files include a target layout file of a target device.
In S1003, the first device sends the target layout file to the target device, so that the target device displays the target page.
In this embodiment, since the implementation manner of S1003 is completely the same as that of S503 in the first embodiment, specific description may refer to the related description of S503, and is not repeated herein.
In the embodiment of the application, in the compiling process, the first device simultaneously generates a plurality of preset page layout files of device models, wherein the page layout files comprise target layout files suitable for target devices, developers do not need to configure display parameters of components in a target page for different device models respectively, and the development difficulty of the target page is reduced; on the other hand, a developer can simultaneously generate a plurality of different page layout files by only executing one compiling operation, so that the generation efficiency of the page layout files is greatly improved, the developer only needs to add the equipment model of the page layout file to be generated into a preset equipment model, for example, the equipment model is added into a preset target equipment list, and the first equipment can generate the corresponding page layout file.
Example four:
fig. 12 shows an interaction flowchart of a method for generating a page layout file according to yet another embodiment of the present application, where in this embodiment, an obtaining operation of a target parameter of a target device is executed after a second device of a developer uploads an original layout file of a target page to a first device, the first device is specifically a server responding to a download operation, and obtaining of the target device by the first device includes two ways, namely, online obtaining and background obtaining, respectively. For the online acquisition mode, the operation of S1201 → S1202 → S1203 → S1204 is adopted; for the background acquisition, the operation S1201 → S1205 → S1206 → S1207 is used. In this case, the method for generating the page layout file specifically includes:
in S1201, the first device receives an original layout file uploaded by a second device of the development user.
In this embodiment, the first device is a server that provides a download service, and therefore, may receive a layout file uploaded by each development user through the development device, where the uploaded layout file includes an original layout file of a target page. The second device specifically refers to an electronic device used by a development user. In the uploaded original layout file and the layout files corresponding to other pages, the display parameters of each component are in a state to be configured, that is, the specific display position, display size and the like of the component are not limited.
In S1202, the running, by the first device, of a preset parameter measurement script to determine a target parameter corresponding to the target device includes: and the first equipment responds to a downloading request initiated by the target equipment, runs the parameter measurement script and determines target parameters corresponding to the target equipment.
In this embodiment, after receiving the original layout files uploaded by the development user through the second device, the first device may store the original layout files in the memory, and not immediately configure the display parameters of the components in each original layout file, but when receiving a download request for the original layout files, perform a configuration flow of the display parameters, that is, S1202 to S1204 are a response manner for performing online acquisition of the target parameters based on the download request.
In this embodiment, when receiving a download request initiated by a target device, a first device may identify a page identifier of a target page to be downloaded from the download request, acquire an original layout file matched with the page identifier from a memory, determine components included in the original layout file, and import the components into the parameter measurement script according to module parameters of a display module of the target device to calculate display parameters of each component in the original layout file, so as to generate the target parameters.
In a possible implementation manner, when a download request of a target device is received, whether a target layout file corresponding to a device model of the target device is generated or not can be judged; if yes, executing the operation of S1204; otherwise, if the target layout file corresponding to the target device is not generated, the parameter measurement script is run to determine the operation of the target parameter corresponding to the target device. For a way of determining the target parameter, reference may be made to the related description of S501 in the first embodiment, which is not described herein again.
In S1203, the first device imports the target parameter into an original layout file associated with the target page, and generates a target layout file corresponding to the target device.
In this embodiment, since the implementation manner of S1203 is completely the same as that of S502 in the first embodiment, for a specific description, reference may be made to the related description of S502, and details are not described herein again.
In S1204, the first device sends the target layout file to the target device, so that the target device displays the target page.
In this embodiment, the first device sends the generated target layout file to the target device in response to a download request initiated by the first device.
In this embodiment, since the implementation manner of S1204 is completely the same as that of S503 in the first embodiment, specific descriptions may refer to the related description of S503, and are not described herein again.
In the embodiment of the application, when receiving a download request initiated by a target device, a first device acquires a target parameter of the target device, generates a target layout file corresponding to the target device, and sends the target layout file corresponding to the target device in response to the download request, a developer only needs to upload an original layout file with default configuration, the first device can generate a corresponding target layout file according to the target device to be downloaded, the target file is not needed to perform page layout calculation, and the developer is not needed to configure a display parameter of a component in a development process.
In S1205, the first device runs a preset parameter measurement script to determine a target parameter corresponding to the target device, including: if the preset layout updating time is reached, the first device runs the parameter measurement script and respectively outputs device parameters corresponding to a plurality of layout files to be configured, which are suitable for the target device; the plurality of layout files to be configured comprise the original layout file; the plurality of layout files to be configured are uploaded layout files from the last layout updating time to the current layout updating time; the device parameters corresponding to the plurality of layout files to be configured comprise target parameters.
In this embodiment, in addition to the online conversion mode, the first device may also perform background conversion on the original layout file. In this case, the first device may be configured with a plurality of preset layout update times, and when the first device reaches the layout update time, the first device configures the display parameters of the components included in the layout file to be configured.
In a possible implementation manner, the layout update time may be determined based on a preset update period, that is, a time interval between adjacent layout update times is a duration of the update period, for example, if the update period is 1 day, a time interval between a last layout update time and an adjacent layout update time is 1 day.
In this embodiment, the first device receives a layout file to be configured, which is uploaded by each developer, and the display parameters of each component in the layout file to be configured are in a state to be configured. The first device performs parameter configuration operation on all received layout files to be configured when a preset layout updating time is reached, and the first device performs parameter configuration operation on the layout files to be configured periodically, so that the layout files to be configured are specifically the layout files received between the last layout updating time and the current layout updating time. For example, if the previous layout update time is 1 month, 12 days, 10:00, and the update cycle is one day, the first device may reach the next layout update time at 1 month, 13 days, 10:00, and at this time, the first device may use the layout file uploaded from 1 month, 12 days, 10:00 to 1 month, 13 days, 10:00 as the layout file to be configured (since the update configuration operation is not performed in the above time period), and perform the page layout calculation operation applicable to the target device on each layout file to be configured, so as to obtain the device parameter applicable to the target device and associated with each layout file to be configured.
In a possible implementation manner, if the first device is configured with the target device list, when the first device determines the device parameters corresponding to the layout files to be configured, which are applicable to the target device, respectively, the first device also determines the device parameters corresponding to each target device in the target device list for the same layout file to be configured. For example, the target device list includes N target devices, and the first device receives M to-be-configured layout files between two adjacent layout update times, so that the first device needs to determine N × M device parameters, where each target device corresponds to device parameters of the M to-be-configured layout files; and each layout file to be configured corresponds to the device parameters respectively applicable to the N target devices.
In S1206, the first device imports the target parameter into the original layout file associated with the target page, and generates a target layout file corresponding to the target device.
In this embodiment, the first device may import the generated device parameters into the layout files to be configured corresponding to the generated device parameters, respectively, to obtain the page layout files corresponding to the layout files to be configured, and since the generated device parameters include the target parameters of the target page, the target parameters may be imported into the original layout file corresponding to the target page, so as to generate the target layout file corresponding to the target device.
In this embodiment, the first device may store the generated target devices in the database, and associate a corresponding device identifier for each target layout file, where the device identifier may be a device model suitable for the target device. At this time, the first device does not send the generated target layout file to the target device, but feeds back the target device file to the target device when receiving a download request of the target device about the target device.
In S1207, the first device sends the target layout file to the target device in response to a download request initiated by the target device.
In this embodiment, when the target device needs to download the target page, a download request about the target page may be sent to the first device, so as to obtain the target layout file related to the target page. The first device may respond to a download request of the target device and send a target layout file corresponding to the target page to the target device.
In a possible implementation manner, if the target page is an operation page in any application program, the target device may send a download request for the application program to the first device, and the first device may identify the download request as a download request for the target page and send a data packet of the application program containing the target layout file to the target device.
In the embodiment of the application, after receiving an original layout file uploaded by a second device, a first device may first store the original layout file, and when a preset layout updating time is reached, configure display parameters of each component in the original layout file, and then when receiving a download request of a target device, the first device may directly send a generated page layout file to the target device, so that response efficiency of the download request is improved. On the other hand, developers only need to upload the original layout file with default configuration, the first device can generate the corresponding target layout file according to the target device to be downloaded, page layout calculation of the target file is not needed, and the developers are not needed to configure the display parameters of the components in the development process.
Example five:
fig. 13 shows an interaction flowchart of a method for generating a page layout file according to an embodiment of the present application, and compared with the first embodiment, in this embodiment, a target parameter of a target device is obtained by performing page layout calculation on a first device interconnected with the target device, and the target device and the first device may be interconnected through a local area network or may be interconnected through the internet, where the connection mode includes a wired connection and a wireless connection, and the connection mode between the first device and the target device is not limited herein and may be any connection mode capable of implementing data interaction. In this case, the method for generating the page layout file specifically includes:
in S1301, the target device responds to a display operation initiated by a user, and determines whether a layout file corresponding to the display operation is an original layout file; and the display parameters of all the components in the target page in the original layout file are in a state to be configured.
In this embodiment, since the target device may be an electronic device with weak computing capability, such as a smart watch, smart glasses, and the like, and cannot perform the page layout calculation, when receiving the display operation initiated by the user, it needs to determine whether the layout file corresponding to the display operation is an original layout file without configuring the display parameters, and if the layout file corresponding to the display operation is the target layout file with configured display parameters, the operation of S1308 is executed; otherwise, if the layout file corresponding to the display operation is the original layout file to which the display parameters are to be configured, the operation of S1302 is executed.
In this embodiment, the layout file corresponding to the display operation may be downloaded from the server by the target device.
In S1302, if the layout file corresponding to the display operation is an original layout file, the target device determines whether to interconnect with the first device.
In this embodiment, if the target device detects that the layout file corresponding to the display operation is the original layout file, it indicates that each component in the original layout file is not configured with the display parameter corresponding to the target device, and at this time, the task of page layout calculation needs to be completed by other electronic devices, so that it may be determined whether there are other electronic devices interconnected with the target device, that is, the first device. The target device and the first device may be interconnected through a lan, or may be interconnected through the internet, where the connection mode includes a wired connection and a wireless connection, and if the lan is interconnected, the lan may specifically be a wireless lan, a wired lan, or a lan constructed based on bluetooth, near field communication NFC, or the like. If the device is interconnected with the first device, the operation of S1303 is executed; otherwise, the operation of S1309 is performed.
In S1303, if the target device is interconnected with the first device, the target device generates a measurement instruction including the original layout file, and sends the measurement instruction to the first device.
In this embodiment, if the target device is interconnected with a first device having a page layout calculation capability, a measurement instruction may be generated, the original layout file to be displayed may be encapsulated in the measurement instruction, and the measurement instruction may be sent to the first device through a local area network.
In S1304, the first device, in response to a measurement instruction initiated by a target device, runs a preset parameter measurement script, and determines a target parameter corresponding to the target device; the measurement instructions include the raw layout file.
In this embodiment, after receiving a measurement instruction sent by a target device, a first device may extract an original layout file carried in the measurement instruction, and perform page layout calculation on each component in the original layout file through a preset parameter measurement script to obtain a target parameter corresponding to the target device. For a specific manner of obtaining the target parameter, reference may be made to the related description of S501 in the first embodiment, and details are not described herein again.
In S1305, the first device imports the target parameter into the original layout file associated with the target page, and generates a target layout file corresponding to the target device.
In this embodiment, since the implementation manner of S1305 is completely the same as that of S502 in the first embodiment, specific description may refer to the related description of S502, and is not repeated herein.
In S1306, the first device sends the target layout file to the target device, so that the target device displays the target page.
In this embodiment, since the implementation manner of S1306 is completely the same as that of S503 in the first embodiment, for a specific description, reference may be made to the related description of S503, which is not described herein again.
In S1307, the target device displays a target page based on the target layout file.
In a possible implementation manner, the target device may replace the originally stored original layout file with the target layout file, and may directly display according to the target layout file when receiving the display operation on the target page next time.
In S1308, if the layout file corresponding to the display operation is a target layout file, the target device displays a target page based on the target layout file.
In this embodiment, since the layout file corresponding to the display operation is the target layout file configured with the display parameters, the target device may directly display the target page.
In S1309, if the target device is not interconnected with the first device, display exception information is generated.
In this embodiment, if no other electronic device, that is, the first device, exists in the local area network where the target device is located, display exception information may be generated to prompt the user to access another first device capable of performing page layout calculation in the local area network.
In this embodiment of the application, the target device may complete the page layout calculation through other devices that are interconnected, for example, the target device is a smart watch, which has a relatively weak calculation capability, and the smart watch may be generally connected to the smart phone through a wireless communication module (such as a bluetooth module, a Wifi module, etc.), at this time, the smart watch may send the original layout file to be configured to the smart phone (i.e., the first device), and after performing the page layout calculation through the smart phone, the target layout file that is configured is fed back to the smart watch, so as to display the target page on the smart watch, so that it can be solved that the target device that never has the calculation capability can also display the layout file of the display parameters to be configured, and the application range of the page display technology is improved.
Example six:
in the fifth embodiment, the implementation process of the method for generating a page layout file is described in terms of interaction between the first device and the target device, and in the sixth embodiment, the target device is used as an execution subject of the process to describe the implementation process of the method for generating a page layout file. Fig. 14 shows a flowchart of an implementation of a method for displaying a page on a target device side according to an embodiment of the present application, which is detailed as follows:
in S1401, the target device responds to a display operation initiated by a user, and if a layout file corresponding to the display operation is an original layout file, generates a measurement instruction including the original layout file, and sends the measurement instruction to a first device interconnected with the target device; the display parameters of all components in the target page in the original layout file are in a state to be configured;
in S1402, the target device receives a target layout file fed back by the first device based on the original layout file;
in S1403, the target device displays a target page based on the target layout file.
Example seven:
fig. 15 shows a block diagram of a device for generating a page layout file according to an embodiment of the present application, which corresponds to the method for generating a page layout file according to the foregoing embodiment.
Referring to fig. 15, the apparatus for generating a page layout file includes:
a target parameter obtaining unit 151, configured to obtain a target parameter corresponding to a target device; the target parameters comprise display parameters of all components in the target page;
a target layout file generating unit 152, configured to import the target parameter into an original layout file associated with the target page, and generate a target layout file corresponding to the target device; the display parameters of all components in the target page in the original layout file are in a state to be configured;
a target layout file sending unit 153, configured to send the target layout file to the target device, so that the target device displays the target page.
Optionally, the target parameter obtaining unit 151 includes:
an operating system building unit, configured to start an equipment simulation program associated with the target equipment, so as to run an operating system that is the same as the target equipment on the first equipment;
the component measurement application running unit is used for calling the operating system to load the original layout file, so that the page layout calculation is carried out on each component in the original layout file through the operating system, and the display parameter of each component is determined;
and the display parameter packaging unit is used for generating the target parameters based on the display parameters of the components.
Optionally, the target parameter obtaining unit 151 includes:
the compiling instruction response unit is used for responding to the compiling instruction of the target page, running a preset parameter measurement script and determining equipment parameters corresponding to a plurality of preset equipment models; the device models comprise the device model of the target device; the target parameters corresponding to the target equipment are contained in the plurality of equipment parameters;
correspondingly, the target layout file generating unit 152 includes:
the compiling instruction execution unit is used for respectively importing all the equipment parameters into the original layout file and generating a plurality of page layout files respectively matched with all the equipment models; the plurality of page layout files include the target layout file corresponding to the target device.
Optionally, the apparatus for generating a page layout file is a server responding to application download, and the apparatus for generating a page layout file further includes:
the original layout file receiving unit is used for receiving an original layout file uploaded by second equipment of a development user;
correspondingly, the target parameter acquiring unit 151 includes:
and the parameter measurement script running unit is used for running a preset parameter measurement script and determining a target parameter corresponding to the target equipment.
Optionally, the parameter measurement script execution unit includes:
and the download request response unit is used for responding to a download request initiated by the target equipment, running the parameter measurement script and determining the target parameters corresponding to the target equipment.
Optionally, the parameter measurement script execution unit includes:
the layout updating triggering unit is used for running the parameter measurement script by the first equipment and respectively outputting equipment parameters corresponding to a plurality of layout files to be configured, which are suitable for the target equipment, if the preset layout updating time is reached; the plurality of layout files to be configured comprise the original layout file; the plurality of layout files to be configured are uploaded layout files from the last layout updating time to the current layout updating time; the device parameters corresponding to the layout files to be configured comprise target parameters;
correspondingly, the target layout file sending unit 153 is specifically configured to: and responding to a downloading request initiated by the target equipment, and sending the target layout file to the target equipment.
Optionally, the device for generating the page layout file is a device interconnected with a target device, and the target parameter obtaining unit 151 includes:
a measurement instruction response unit, configured to run a preset parameter measurement script by the first device in response to a measurement instruction initiated by a target device, and determine a target parameter corresponding to the target device; the measurement instructions include the raw layout file.
Therefore, the apparatus for generating a page layout file provided in this embodiment of the present application may also obtain, by the first device, a target parameter corresponding to a target device that needs to display a target page, that is, perform a page layout calculation operation of the target device, so as to determine a display parameter when the target page is displayed on the target device, where the first device imports the target parameter into an original layout file associated with the target page, configures the display parameter of each component in the original layout file, to obtain the target layout file matched with a display module of the target device, and then the first device may send the target layout file to the target device, and the target device may display the target page according to the received target layout file. Compared with the prior page display technology, the embodiment does not need a developer to manually configure display parameters for different target devices to generate a plurality of page layout files, but can obtain the target parameters related to the target devices through the first device, and the page layout calculation is finished by the first device, so that the configuration operation of the developer is reduced, and the page development difficulty is reduced; meanwhile, the task of page layout calculation is not completed by the target device but is executed by the first device, so that the target device does not need to have the page layout calculation capability, and the target device can directly generate a target page according to the target layout file, so that the applicability of the generated target layout file is improved, the requirement on the calculation capability of the target device is reduced, and the two aspects of page development difficulty and the applicability of the page layout file are considered.
Example eight:
fig. 16 is a block diagram showing a structure of a display device for a page provided in the embodiment of the present application, corresponding to the display method for a page described in the above embodiment, and only the parts related to the embodiment of the present application are shown for convenience of explanation.
Referring to fig. 16, the display device of the page includes:
a display operation responding unit 161, configured to respond to a display operation initiated by a user, generate a measurement instruction including an original layout file if a layout file corresponding to the display operation is the original layout file, and send the measurement instruction to a first device interconnected with the target device; the display parameters of all components in the target page in the original layout file are in a state to be configured;
a target layout file receiving unit 162, configured to receive a target layout file fed back by the first device based on the original layout file;
and a target page display unit 163 for displaying a target page based on the target layout file by the target device.
Fig. 17 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 17, the electronic apparatus 17 of this embodiment includes: at least one processor 170 (only one shown in fig. 17), a memory 171, and a computer program 172 stored in the memory 171 and executable on the at least one processor 170, wherein the processor 170 executes the computer program 172 to implement the steps in any of the above-described embodiments of the method for generating a page layout file.
The electronic device 17 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The electronic device may include, but is not limited to, a processor 170, a memory 171. Those skilled in the art will appreciate that fig. 17 is merely an example of the electronic device 17, and does not constitute a limitation of the electronic device 17, and may include more or less components than those shown, or combine certain components, or different components, such as may also include input-output devices, network access devices, etc.
The Processor 170 may be a Central Processing Unit (CPU), and the Processor 170 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 171 may be an internal storage unit of the electronic device 17 in some embodiments, such as a hard disk or a memory of the electronic device 17. In other embodiments, the memory 171 may also be an external storage device of the electronic device 17, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the electronic device 17. Further, the memory 171 may also include both an internal storage unit and an external storage device of the electronic device 17. The memory 171 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 171 may also be used to temporarily store data that has been output or is to be output.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
An embodiment of the present application further provides an electronic device, including: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor implementing the steps of any of the various method embodiments described above when executing the computer program.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in 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 can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/electronic device, a recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units 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 units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (12)

1. A method for generating a page layout file is applied to a first device, and is characterized by comprising the following steps:
the first equipment acquires a target parameter corresponding to target equipment; the target parameters comprise display parameters of all components in the target page;
the first device imports the target parameters into an original layout file associated with the target page to generate a target layout file corresponding to the target device; the display parameters of all components in the target page in the original layout file are in a state to be configured;
and the first equipment sends the target layout file to the target equipment so as to enable the target equipment to display the target page.
2. The generation method according to claim 1, wherein the obtaining, by the first device, the target parameter corresponding to the target device includes:
the first device starts a device simulation program associated with the target device so as to run the same operating system as the target device on the first device;
the first device calls the operating system to load the original layout file, so that page layout calculation is carried out on each component in the original layout file through the operating system, and display parameters of each component are determined;
the first device generates the target parameter based on the display parameter of each of the components.
3. The generation method according to claim 1, wherein the obtaining, by the first device, the target parameter corresponding to the target device includes:
the first equipment responds to the compiling instruction of the target page, runs a preset parameter measurement script and determines equipment parameters corresponding to a plurality of preset equipment models; the device models comprise the device model of the target device; the target parameters corresponding to the target equipment are contained in the plurality of equipment parameters;
correspondingly, the step of importing, by the first device, the target parameter into an original layout file associated with the target page to generate a target layout file corresponding to the target device includes:
the first equipment respectively imports each equipment parameter into the original layout file to generate a plurality of page layout files respectively matched with each equipment model; the plurality of page layout files include the target layout file corresponding to the target device.
4. The generation method of claim 1, wherein the first device is a server responding to an application download, the generation method further comprising:
the first equipment receives an original layout file uploaded by second equipment of a development user;
correspondingly, the first equipment acquires a target parameter corresponding to the target equipment; the target parameters comprise display parameters of each component in the target page, and the display parameters comprise:
and the first equipment runs a preset parameter measurement script and determines a target parameter corresponding to the target equipment.
5. The generation method of claim 4, wherein the running of a preset parameter measurement script by the first device to determine the target parameter corresponding to the target device comprises:
and the first equipment responds to a downloading request initiated by the target equipment, runs the parameter measurement script and determines target parameters corresponding to the target equipment.
6. The generation method of claim 4, wherein the running of a preset parameter measurement script by the first device to determine the target parameter corresponding to the target device comprises:
if the preset layout updating time is reached, the first device runs the parameter measurement script and respectively outputs device parameters corresponding to a plurality of layout files to be configured, which are suitable for the target device; the plurality of layout files to be configured comprise the original layout file; the plurality of layout files to be configured are uploaded layout files from the last layout updating time to the current layout updating time; the device parameters corresponding to the layout files to be configured comprise target parameters;
correspondingly, the sending, by the first device, the target layout file to the target device includes:
and the first equipment responds to a downloading request initiated by the target equipment and sends the target layout file to the target equipment.
7. The generation method according to claim 1, wherein the first device is another device interconnected with the target device, and the obtaining, by the first device, the target parameter corresponding to the target device includes:
the first equipment responds to a measurement instruction initiated by target equipment, runs a preset parameter measurement script and determines a target parameter corresponding to the target equipment; the measurement instructions include the original layout file.
8. A page display method is applied to target equipment and is characterized by comprising the following steps:
the target equipment responds to display operation initiated by a user, if a layout file corresponding to the display operation is an original layout file, a measurement instruction containing the original layout file is generated, and the measurement instruction is sent to first equipment interconnected with the target equipment; the display parameters of all components in the target page in the original layout file are in a state to be configured;
the target device receives a target layout file fed back by the first device based on the original layout file;
and the target equipment displays a target page based on the target layout file.
9. An apparatus for generating a page layout file, comprising:
a target parameter acquiring unit for acquiring a target parameter of a target device;
a target layout file generation unit, configured to import the target parameter into an original layout file associated with the target page, and generate a target layout file corresponding to the target device; the display parameters of all components in the target page in the original layout file are in a state to be configured;
and the target layout file sending unit is used for sending the target layout file to the target equipment so as to enable the target equipment to display the target page.
10. A display device for a page, comprising:
the display operation response unit is used for responding to display operation initiated by a user, generating a measurement instruction containing an original layout file if the layout file corresponding to the display operation is the original layout file, and sending the measurement instruction to first equipment interconnected with target equipment; the display parameters of all components in the target page in the original layout file are in a state to be configured;
a target layout file receiving unit, configured to receive a target layout file fed back by the first device based on the original layout file;
and the target page display unit is used for displaying a target page based on the target layout file.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 8, or claim 9, when executing the computer program.
12. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 8, or 9.
CN202011200719.1A 2020-10-30 2020-10-30 Page layout file generation method and device, electronic equipment and readable storage medium Pending CN114444000A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011200719.1A CN114444000A (en) 2020-10-30 2020-10-30 Page layout file generation method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011200719.1A CN114444000A (en) 2020-10-30 2020-10-30 Page layout file generation method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN114444000A true CN114444000A (en) 2022-05-06

Family

ID=81358142

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011200719.1A Pending CN114444000A (en) 2020-10-30 2020-10-30 Page layout file generation method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114444000A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116048324A (en) * 2022-05-26 2023-05-02 荣耀终端有限公司 Desktop management method, electronic device and storage medium
CN116088882A (en) * 2023-03-31 2023-05-09 深圳市微克科技有限公司 Function configuration method, system and medium based on intelligent wearable device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116048324A (en) * 2022-05-26 2023-05-02 荣耀终端有限公司 Desktop management method, electronic device and storage medium
CN116048324B (en) * 2022-05-26 2023-10-20 荣耀终端有限公司 Desktop management method, electronic device and storage medium
CN116088882A (en) * 2023-03-31 2023-05-09 深圳市微克科技有限公司 Function configuration method, system and medium based on intelligent wearable device

Similar Documents

Publication Publication Date Title
CN109814766B (en) Application display method and electronic equipment
CN112231025B (en) UI component display method and electronic equipment
CN110134316B (en) Model training method, emotion recognition method, and related device and equipment
CN110825469A (en) Voice assistant display method and device
CN111316199B (en) Information processing method and electronic equipment
WO2020102978A1 (en) Image processing method and electronic device
WO2020029306A1 (en) Image capture method and electronic device
CN113645351A (en) Application interface interaction method, electronic device and computer-readable storage medium
WO2021258814A1 (en) Video synthesis method and apparatus, electronic device, and storage medium
CN113887264B (en) Code scanning method, system and related device
CN113254409A (en) File sharing method, system and related equipment
WO2022007707A1 (en) Home device control method, terminal device, and computer-readable storage medium
CN113961157A (en) Display interaction system, display method and equipment
CN114089932A (en) Multi-screen display method and device, terminal equipment and storage medium
CN114995715B (en) Control method of floating ball and related device
CN114444000A (en) Page layout file generation method and device, electronic equipment and readable storage medium
WO2023000746A1 (en) Augmented reality video processing method and electronic device
CN115437601A (en) Image sorting method, electronic device, program product, and medium
CN113380240B (en) Voice interaction method and electronic equipment
CN114338642B (en) File transmission method and electronic equipment
CN115964231A (en) Load model-based assessment method and device
CN114003241A (en) Interface adaptation display method and system of application program, electronic device and medium
CN113867851A (en) Electronic equipment operation guide information recording method, electronic equipment operation guide information acquisition method and terminal equipment
CN113950045A (en) Subscription data downloading method and electronic equipment
CN111339513A (en) Data sharing method and device

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