CN113127125B - Page automatic adaptation method, device, equipment and storage medium - Google Patents

Page automatic adaptation method, device, equipment and storage medium Download PDF

Info

Publication number
CN113127125B
CN113127125B CN202110433759.9A CN202110433759A CN113127125B CN 113127125 B CN113127125 B CN 113127125B CN 202110433759 A CN202110433759 A CN 202110433759A CN 113127125 B CN113127125 B CN 113127125B
Authority
CN
China
Prior art keywords
target
page
preset
width value
layout
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.)
Active
Application number
CN202110433759.9A
Other languages
Chinese (zh)
Other versions
CN113127125A (en
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.)
Kangjian Information Technology Shenzhen Co Ltd
Original Assignee
Kangjian Information Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kangjian Information Technology Shenzhen Co Ltd filed Critical Kangjian Information Technology Shenzhen Co Ltd
Priority to CN202110433759.9A priority Critical patent/CN113127125B/en
Publication of CN113127125A publication Critical patent/CN113127125A/en
Application granted granted Critical
Publication of CN113127125B publication Critical patent/CN113127125B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention relates to the technical field of computers, and discloses an automatic page adaptation method, device, equipment and storage medium, which are applied to the intelligent medical field and are used for improving the adaptation efficiency of the sizes and positions of interface design elements. The automatic page adaptation method comprises the following steps: when loading the target page, determining a target code block according to the view layout mark, the start mark and the end mark; intercepting a target sending message and a reference parameter in a target code block through a message mechanism, and calling a mapping message processing function corresponding to the target sending message according to a screen width value, the reference width value and the reference parameter to obtain target layout information; and when the processing logic corresponding to the mapping message processing function is executed, executing the target message processing function according to the target layout information through the mapping response message, and displaying the automatic adaptation page when the automatic adaptation layout of the element is detected to be finished. In addition, the invention also relates to a blockchain technology, and the automatic adaptation page can be stored in a blockchain node.

Description

Page automatic adaptation method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for automatically adapting a page.
Background
Screen adaptation is a daily development work of mobile terminals (such as ios system and android system), and most of the services of the terminals involve UI development of interface design, which means that screen adaptation is required. As the models published by iPhone are more and more, the resolution is different, and the screen adaptation is more and more important. Typically, when a UI designer designs a UI element, the UI element is designed according to the resolution of a general model (for example, iPhone 6), and other models need to be adapted according to the resolution, that is, the UI element needs to be scaled in an equal ratio.
There is currently no unified adaptation scheme in the industry, and the schemes for implementing the UI element layout are different, but in general, for various layout modes (such as a frame or an automatic layout), the size of the UI element is multiplied by a corresponding scaling when the page is laid out. This adaptation scheme is very simple, but each sentence of layout code needs to be multiplied by a scaling, and code readability and expandability are poor, resulting in low screen adaptation efficiency.
Disclosure of Invention
The invention provides an automatic page adaptation method, device, equipment and storage medium, which are used for improving the adaptation efficiency of the size and the position of an interface design element and reducing the probability of page adaptation errors.
To achieve the above object, a first aspect of the present invention provides an automatic page adaptation method, including: when loading a target page, searching the target page according to a preset view layout mark, a preset starting mark and a preset ending mark to obtain a target code block, and obtaining a reference width value corresponding to the target page and a screen width value of a terminal; acquiring layout reference information corresponding to the target page, and judging whether the screen width value is equal to the reference width value, wherein the layout reference information comprises preset element size information and preset element position information; if the screen width value is not equal to the reference width value, intercepting a target sending message and a reference parameter in the target code block through a preset message mechanism, and calling a mapping message processing function corresponding to the target sending message according to the screen width value, the reference width value and the reference parameter to obtain target layout information, wherein the reference parameter is used for indicating the element size or the element position in the layout reference information, and the target layout information is the adapted element size or the adapted element position; when the execution of the processing logic corresponding to the mapping message processing function is completed, the target message processing function is called and executed according to the target layout information through the mapping response message, and the automatic adaptation page is drawn and displayed until the automatic element adaptation layout is finished, wherein the mapping response message corresponds to the mapping message processing function one by one.
Optionally, in a first implementation manner of the first aspect of the present invention, when loading a target page, retrieving the target page according to a preset view layout mark, a preset start mark and a preset end mark to obtain a target code block, and obtaining a reference width value corresponding to the target page and a screen width value of a terminal, including: when a target page is loaded, setting a preset view layout mark as a target keyword, and matching each text element in the target page according to the target keyword to obtain a matching result, wherein the target page is a first page of a preset application program, and the preset view layout mark is used for indicating that the target page is opened for automatic screen adaptation; when the matching result is that the matching is successful, determining that the view layout mark exists in the target page, and extracting a target code block from preset code processing logic corresponding to the view layout mark according to a preset starting mark and a preset ending mark; and acquiring a reference width value corresponding to the target page, calling a preset screen size function to acquire screen size information of the terminal, and extracting the screen width value of the terminal from the screen size information according to the floating point data type.
Optionally, in a second implementation manner of the first aspect of the present invention, the obtaining layout reference information corresponding to the target page and determining whether the screen width value is equal to the reference width value, where the layout reference information includes preset element size information and preset element position information includes: reading layout reference information corresponding to the target page from a preset memory database, wherein the layout reference information comprises preset element size information and preset element position information; respectively deleting the head and tail space of the screen width value and the head and tail space of the reference width value through a preset character filtering function to obtain the screen width value with the head and tail space removed and the reference width value with the head and tail space removed; comparing the screen width value of the removed head and tail space with the reference width value of the removed head and tail space to obtain a comparison result; when the comparison result is a preset value, determining that the screen width value is equal to the reference width value; and when the comparison result is not a preset value, determining that the screen width value is not equal to the reference width value.
Optionally, in a third implementation manner of the first aspect of the present invention, the reading layout reference information corresponding to the target page from a preset memory database, where the layout reference information includes preset element size information and preset element position information includes: obtaining a reference model corresponding to the target page, setting the reference model corresponding to the target page as a target key, and reading a target value from a preset memory database according to the target key; and when the target value is not a null value, carrying out data analysis on the target value according to a preset data format to obtain layout reference information corresponding to the target page, wherein the layout reference information comprises preset element size information and preset element position information.
Optionally, in a fourth implementation manner of the first aspect of the present invention, if the screen width value is not equal to the reference width value, intercepting, by a preset message mechanism, a target sending message and a reference parameter in the target code block, and calling a mapping message processing function corresponding to the target sending message according to the screen width value, the reference width value and the reference parameter to obtain target layout information, where the reference parameter is used to indicate an element size or an element position in the layout reference information, and the target layout information is an adapted element size or an adapted element position, and includes: if the screen width value is not equal to the reference width value, intercepting a target sending message and a reference parameter in the target code block through a preset message mechanism, acquiring a first message number corresponding to the target sending message, inquiring a preset binding relation according to the first message number to acquire a first function pointer, and determining a mapping message processing function corresponding to the target sending message according to the first function pointer, wherein the reference parameter is used for indicating the element size or the element position in layout reference information; dividing the screen width value by the reference width value to obtain a proportionality coefficient, and calling the mapping message processing function according to the proportionality coefficient and the reference parameter; and multiplying the proportional coefficient and the reference parameter by the mapping message processing function to obtain a message return value, and setting the message return value as target layout information, wherein the target layout information is an adapted element size or an adapted element position.
Optionally, in a fifth implementation manner of the first aspect of the present invention, when execution of the processing logic corresponding to the mapping message processing function is completed, the target message processing function is called and executed according to the target layout information through a mapping response message, until the element automatic adaptation layout is finished, an automatic adaptation page is drawn and displayed, where the mapping response message corresponds to the mapping message processing function one-to-one, and the method includes: when the execution of the processing logic corresponding to the mapping message processing function is completed, setting the target layout information and the second message number as input parameters of a mapping response message, and recalling the mapping response message based on the input parameters, wherein the mapping response message corresponds to the mapping message processing function one by one; inquiring the preset binding relation according to a second message number in the input parameters through a mapping response message to obtain a second function pointer, determining a target message processing function corresponding to the mapping response message according to the second function pointer, calling and executing the target message processing function based on the target layout information to obtain an automatic adaptation page; and when the execution is carried out to the preset ending mark in the target code, determining that the automatic element adaptation layout is ended, and drawing and displaying the automatic element adaptation page until the automatic element adaptation layout is ended.
Optionally, in a sixth implementation manner of the first aspect of the present invention, when execution of the processing logic corresponding to the mapping message processing function is completed, the target message processing function is called and executed according to the target layout information through a mapping response message, until the element automatic adaptation layout is finished, an automatic adaptation page is drawn and displayed, and after the mapping response message corresponds to the mapping message processing function one-to-one, the page automatic adaptation method further includes: collecting page adaptation log data according to a code embedded point mark preset in the target page; and sending the page adaptation log data to a target server, and performing data processing and persistent storage on the page adaptation log data through the target server.
The second aspect of the present invention provides an automatic page adapting device, including: the searching module is used for searching the target page according to a preset view layout mark, a preset starting mark and a preset ending mark when the target page is loaded, obtaining a target code block, and obtaining a reference width value corresponding to the target page and a screen width value of a terminal; the judging module is used for acquiring layout reference information corresponding to the target page and judging whether the screen width value is equal to the reference width value or not, wherein the layout reference information comprises preset element size information and preset element position information; the interception module is used for intercepting a target sending message and a reference parameter in the target code block through a preset message mechanism if the screen width value is not equal to the reference width value, and calling a mapping message processing function corresponding to the target sending message according to the screen width value, the reference width value and the reference parameter to obtain target layout information, wherein the reference parameter is used for indicating the element size or the element position in the layout reference information, and the target layout information is the adapted element size or the adapted element position; and the display module is used for calling and executing the target message processing function according to the target layout information through the mapping response message when the execution of the processing logic corresponding to the mapping message processing function is completed, and drawing and displaying the automatic adaptation page until the automatic adaptation layout of the element is finished, wherein the mapping response message corresponds to the mapping message processing function one by one.
Optionally, in a first implementation manner of the second aspect of the present invention, the retrieving module is specifically configured to: when a target page is loaded, setting a preset view layout mark as a target keyword, and matching each text element in the target page according to the target keyword to obtain a matching result, wherein the target page is a first page of a preset application program, and the preset view layout mark is used for indicating that the target page is opened for automatic screen adaptation; when the matching result is that the matching is successful, determining that the view layout mark exists in the target page, and extracting a target code block from preset code processing logic corresponding to the view layout mark according to a preset starting mark and a preset ending mark; and acquiring a reference width value corresponding to the target page, calling a preset screen size function to acquire screen size information of the terminal, and extracting the screen width value of the terminal from the screen size information according to the floating point data type.
Optionally, in a second implementation manner of the second aspect of the present invention, the determining module includes: the reading unit is used for reading layout reference information corresponding to the target page from a preset memory database, wherein the layout reference information comprises preset element size information and preset element position information; a deleting unit, configured to delete a head space and a tail space of the screen width value and a head space and a tail space of the reference width value respectively through a preset character filtering function, so as to obtain the screen width value from which the head space and the tail space are removed and the reference width value from which the head space and the tail space are removed; the comparison unit is used for comparing the screen width value of the removed head and tail space with the reference width value of the removed head and tail space to obtain a comparison result; a first determining unit configured to determine that the screen width value is equal to the reference width value when the comparison result is a preset value; and a second determining unit configured to determine that the screen width value is not equal to the reference width value when the comparison result is not a preset value.
Optionally, in a third implementation manner of the second aspect of the present invention, the reading unit is specifically configured to: obtaining a reference model corresponding to the target page, setting the reference model corresponding to the target page as a target key, and reading a target value from a preset memory database according to the target key; and when the target value is not a null value, carrying out data analysis on the target value according to a preset data format to obtain layout reference information corresponding to the target page, wherein the layout reference information comprises preset element size information and preset element position information.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the interception module is specifically configured to: if the screen width value is not equal to the reference width value, intercepting a target sending message and a reference parameter in the target code block through a preset message mechanism, acquiring a first message number corresponding to the target sending message, inquiring a preset binding relation according to the first message number to acquire a first function pointer, and determining a mapping message processing function corresponding to the target sending message according to the first function pointer, wherein the reference parameter is used for indicating the element size or the element position in layout reference information; dividing the screen width value by the reference width value to obtain a proportionality coefficient, and calling the mapping message processing function according to the proportionality coefficient and the reference parameter; and multiplying the proportional coefficient and the reference parameter by the mapping message processing function to obtain a message return value, and setting the message return value as target layout information, wherein the target layout information is an adapted element size or an adapted element position.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the display module is specifically configured to: when the execution of the processing logic corresponding to the mapping message processing function is completed, setting the target layout information and the second message number as input parameters of a mapping response message, and recalling the mapping response message based on the input parameters, wherein the mapping response message corresponds to the mapping message processing function one by one; inquiring the preset binding relation according to a second message number in the input parameters through a mapping response message to obtain a second function pointer, determining a target message processing function corresponding to the mapping response message according to the second function pointer, calling and executing the target message processing function based on the target layout information to obtain an automatic adaptation page; and when the execution is carried out to the preset ending mark in the target code, determining that the automatic element adaptation layout is ended, and drawing and displaying the automatic element adaptation page until the automatic element adaptation layout is ended.
Optionally, in a sixth implementation manner of the second aspect of the present invention, the automatic page adapting device further includes: the acquisition module is used for acquiring page adaptation log data according to a code embedded point mark preset in the target page; and the sending module is used for sending the page adaptation log data to a target server, and carrying out data processing and persistent storage on the page adaptation log data through the target server.
A third aspect of the present invention provides an automatic page adapting device, including: a memory and at least one processor, the memory having instructions stored therein; the at least one processor invokes the instructions in the memory to cause the page auto-adaptation device to perform the page auto-adaptation method described above.
A fourth aspect of the present invention provides a computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the page auto-adaptation method described above.
According to the technical scheme, when a target page is loaded, the target page is searched according to a preset view layout mark, a preset starting mark and a preset ending mark to obtain a target code block, and a reference width value corresponding to the target page and a screen width value of a terminal are obtained; acquiring layout reference information corresponding to the target page, and judging whether the screen width value is equal to the reference width value, wherein the layout reference information comprises preset element size information and preset element position information; if the screen width value is not equal to the reference width value, intercepting a target sending message and a reference parameter in the target code block through a preset message mechanism, and calling a mapping message processing function corresponding to the target sending message according to the screen width value, the reference width value and the reference parameter to obtain target layout information, wherein the reference parameter is used for indicating the element size or the element position in the layout reference information, and the target layout information is the adapted element size or the adapted element position; when the execution of the processing logic corresponding to the mapping message processing function is completed, the target message processing function is called and executed according to the target layout information through the mapping response message, and the automatic adaptation page is drawn and displayed until the automatic element adaptation layout is finished, wherein the mapping response message corresponds to the mapping message processing function one by one. In the embodiment of the invention, a target sending message and a reference parameter in a target code block are intercepted through a preset message mechanism, and a mapping message processing function corresponding to the target sending message is called according to a screen width value, the reference width value and the reference parameter to obtain target layout information; and calling and executing a target message processing function according to the target layout information through the mapping response message, and displaying the automatic adaptation page. Repeated adaptation codes are reduced, so that code readability and expansibility are enhanced, the adaptation efficiency of the size and the position of the interface design element is improved, and the probability of page adaptation errors is reduced.
Drawings
FIG. 1 is a schematic diagram of an embodiment of a page auto-adaptation method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of another embodiment of a page auto-adaptation method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an embodiment of an automatic page adapting device according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of another embodiment of an automatic page adapting device according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an embodiment of an automatic page adapting device according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides an automatic page adaptation method, device, equipment and storage medium, which are used for improving the adaptation efficiency of the size and the position of an interface design element and reducing the probability of page adaptation errors.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
For ease of understanding, a specific flow of an embodiment of the present invention is described below, referring to fig. 1, and one embodiment of a page auto-adaptation method in an embodiment of the present invention includes:
101. and when the target page is loaded, searching the target page according to a preset view layout mark, a preset starting mark and a preset ending mark to obtain a target code block, and acquiring a reference width value corresponding to the target page and a screen width value of the terminal.
The target code blocks are used to indicate the code blocks divided according to the preset start mark and the preset end mark, and the number of the target code blocks may be 1 or more, which is not limited herein. The preset start mark and the preset end mark are each set in pairs in units of code blocks, that is, the preset start mark and the preset end mark are valid only in the target code block, for example:
the preset view layout mark may be [ uiiview fitLayout: { } ], which is used to indicate an automatically adapted target code block in the target page, wherein the target code block contains a preset start mark YES, which is used to start the automatic adaptation, and a preset end mark NO, which is used to close the automatic adaptation. The terminal performs screen auto-adaptation only for object codes divided by YES and NO. The preset START mark may be START, and the preset END mark may be END, which is not limited herein. Specifically, when loading a target page, the terminal searches the target page according to a preset view layout mark, a preset starting mark and a preset ending mark to obtain a target code block; the terminal acquires a reference width value corresponding to the target page from preset configuration information, and determines a screen width value of the terminal according to a preset screen size function.
It can be understood that the execution body of the present invention may be a page automatic adapting device, and may also be a terminal or a server, which is not limited herein. The embodiment of the invention is described by taking the terminal as an execution main body as an example.
102. And acquiring layout reference information corresponding to the target page, and judging whether the screen width value is equal to the reference width value, wherein the layout reference information comprises preset element size information and preset element position information.
Wherein, the screen width value and the reference width value are floating point numbers. For example, the standard model corresponding to the target page is iPhone-6, if the terminal model is iPhone-6, the terminal determines that the screen width value is equal to the standard width value, and if the terminal model is iPhone-X, the terminal determines that the final screen width value is not equal to the standard width value. Specifically, the terminal respectively and sequentially removes redundant characters and compares data with the screen width value and the reference width value to obtain a comparison result; when the comparison result is a preset value, the terminal determines that the screen width value is equal to the reference width value, and the terminal calls a target sending message in the target code block based on the layout reference information and/or stops the automatic screen adapting operation; when the matching result is the preset value, the terminal determines that the screen width value is not equal to the reference width value, and continues to execute step 103. The redundant characters may include space, comma, and identification number symbols, and are not limited in this particular regard.
103. If the screen width value is not equal to the reference width value, intercepting a target sending message and a reference parameter in a target code block through a preset message mechanism, and calling a mapping message processing function corresponding to the target sending message according to the screen width value, the reference width value and the reference parameter to obtain target layout information, wherein the reference parameter is used for indicating the element size or the element position in the layout reference information, and the target layout information is the adapted element size or the adapted element position.
The preset message mechanism is a run-time run in the ios system, and the run has the functions of message dynamic analysis, message redirection and message forwarding. It will be appreciated that the positioning presentation of the UI element on the terminal mainly comprises two dimensions, namely a dimension size representing the size of the element and a position origin representing the position of the element in the relevant coordinate system (i.e. the element position), for which the scaling of the UI element is mainly aimed. The preset automatic layout interface purelayout has 4 application interfaces in total, and is used for setting size and origin, and the method is specifically as follows:
autoSetDimension: toSize: relation:// for setting width and height;
AutoConstrainattribute: toAttribute: ofView: withOffset: relation:// for setting a position, including a relative position and an absolute position;
AutoPinTopToyLayOutGuideOfViewController: withInset: relation:// for adapting elements to be from the top of the page;
AutoPinToTobottom LayoutGuideOfViewController: withInset: relation:// for adapting elements to be from the bottom of the page.
Specifically, if the screen width value is not equal to the reference width value, the terminal intercepts the target transmission message and the reference parameter in the target code block through a preset message mechanism runtime, where the reference parameter is used to indicate the element size or the element position in the layout reference information, for example, when the target transmission message in the target code block is autoSetDimension, the reference parameter toSize is the element size in the layout reference information, and when the target transmission message in the target code block is autoPinToTopLayoutGuideOfViewController, autoConstrainAttribute and autopinto to bottom layguide ofview controller, the reference parameter wishoffset or wishiset is the element size in the layout reference information; the terminal calculates a proportionality coefficient according to the screen width value and the reference width value; the terminal inquires a preset binding relation to obtain a mapping message processing function corresponding to the target sending message, wherein the preset binding relation is used for indicating a mapping relation table of the target sending message and the message processing function, for example, when the target sending message is a sending message AutoSetDimensional with a set width and height, the message processing function corresponding to the target sending message is jkn_AutoSetDimensional with a message size of a relationship_IMP; the terminal calls a mapping message processing function according to the proportionality coefficient and the reference parameter, multiplies the reference parameter by the proportionality coefficient (the proportionality coefficient is the screen width value divided by the reference width value) through the mapping message processing function, or divides the reference parameter by the proportionality coefficient (the proportionality coefficient is the reference width value divided by the screen width value) through the mapping message processing function, so as to obtain the adapted element size or the adapted element position, namely the target layout information. For example, the mapping relationship between the target send message and the mapping message handling function may be
autoSetDimension:toSize:relation:->jkn_utoSetDimension:toSize:relation_IMP:。
104. When the execution of the processing logic corresponding to the mapping message processing function is completed, the target message processing function is called and executed according to the target layout information through the mapping response message until the automatic element adaptation layout is finished, the automatic adaptation page is drawn and displayed, and the mapping response message corresponds to the mapping message processing function one by one.
Specifically, when the execution of the processing logic corresponding to the mapping message processing function is completed, the terminal sends a mapping response message, for example, the mapping response message is jkn_autosetdimension: toSize: relation; the terminal inquires a preset binding relation, and inquires a target message processing function corresponding to a mapping response message, wherein the target message processing function corresponding to the mapping response message jkn_AutoSetDimensional: toSize: relation is AutoSetDimensional: toSize: relation_IMP; the terminal recalls and executes autosetDimensions according to the target layout information newSize: toSize: newSize: relation_IMP (namely target message processing function), and meanwhile, the original purelayout is called, under the condition that the purelayout code is not modified, the server realizes the automatic adaptation layout of the element size or the element position, repeated adaptation codes are reduced, the readability and expansibility of the codes are enhanced, the adaptation efficiency of the element size and the position of the interface design UI is improved, and the probability of adaptation errors is reduced.
Further, the server stores the auto-adaptation page in a blockchain database, without limitation herein.
In the embodiment of the invention, a target sending message and a reference parameter in a target code block are intercepted through a preset message mechanism, and a mapping message processing function corresponding to the target sending message is called according to a screen width value, the reference width value and the reference parameter to obtain target layout information; and calling and executing a target message processing function according to the target layout information through the mapping response message, and displaying the automatic adaptation page. Repeated adaptation codes are reduced, so that code readability and expansibility are enhanced, the adaptation efficiency of the size and the position of the interface design element is improved, and the probability of page adaptation errors is reduced. The scheme can be applied to the intelligent medical field, so that the construction of the intelligent city is promoted.
Referring to fig. 2, another embodiment of the page auto-adaptation method in the embodiment of the present invention includes:
201. and when the target page is loaded, searching the target page according to a preset view layout mark, a preset starting mark and a preset ending mark to obtain a target code block, and acquiring a reference width value corresponding to the target page and a screen width value of the terminal.
The target page can be applied to an intelligent medical scene, for example, the target page is an online registration page, an online inquiry page or an online medicine purchasing page, and the like. Further, the terminal may further obtain at least one device identifier corresponding to the terminal, convert the at least one device identifier into a terminal model, and obtain a reference model corresponding to the target page. And then, the terminal extracts a reference width value corresponding to the target page and a screen width value of the terminal from a preset configuration data table according to the terminal model and the reference model. For example, the at least one device identifier comprises iPhone10,2 and iPhone10,5, each corresponding to a terminal model number iPhone-8-Plus; or at least one device identifier comprises iPhone11,4 and iPhone11,6, each corresponding to a terminal model number iPhone-XR. The reference model may be iPhone-6 or iPhone-8, which is not limited herein.
Optionally, when the terminal loads the target page, the terminal sets a preset view layout mark as a target keyword, the terminal matches each text element in the target page according to the target keyword to obtain a matching result, the target page is a first page of a preset application program, and the preset view layout mark is used for indicating that the target page is opened for automatic screen adaptation; when the matching result is that the matching is successful, the terminal determines that a view layout mark exists in the target page, and extracts a target code block from preset code processing logic corresponding to the view layout mark according to a preset starting mark and a preset ending mark; the terminal acquires a reference width value corresponding to the target page, calls a preset screen size function to acquire screen size information of the terminal, and extracts the screen width value of the terminal from the screen size information according to the floating point data type. The preset screen size function is used for returning to the left and upper positions and rectangular areas corresponding to the width and the height, and is specifically as follows:
[UIScreen mainScreen].bounds;
The terminal extracts the screen width value of the terminal from [ UIScreen mainScreen ]. Bounds in floating point data type (f%), for example 320.0000. The screen width value of the terminal may also be extracted according to the integer data type, which is not limited herein.
202. And acquiring layout reference information corresponding to the target page, and judging whether the screen width value is equal to the reference width value, wherein the layout reference information comprises preset element size information and preset element position information.
It should be noted that, since the screen width value and/or the reference width value may have a head space and a tail space, which results in an abnormal data comparison, the terminal performs space character filtering on the screen width value and the reference width value through a preset character filtering function.
Optionally, first, the terminal reads layout reference information corresponding to the target page from a preset memory database, where the layout reference information includes preset element size information and preset element position information, and the preset memory database may be a remote service dictionary redis or a map, and is not limited herein specifically. Specifically, the terminal acquires a reference model corresponding to a target page, sets the reference model corresponding to the target page as a target key, and reads a target value from a preset memory database according to the target key; and when the target value is not a null value, the terminal performs data analysis on the target value according to a preset data format to obtain layout reference information corresponding to the target page, wherein the layout reference information comprises preset element size information and preset element position information. And secondly, respectively deleting the head and tail space of the screen width value and the head and tail space of the reference width value by the terminal through a preset character filtering function to obtain the screen width value with the head and tail space removed and the reference width value with the head and tail space removed, wherein the preset character filtering function can be trim (). And then, the terminal compares the screen width value with the head and tail space removed with the reference width value with the head and tail space removed, and a comparison result is obtained. Specifically, the terminal performs difference operation on the screen width value from which the head and tail space is removed and the reference width value from which the head and tail space is removed to obtain a target difference value; the terminal takes an absolute value of the target difference value to obtain a target absolute value; the terminal compares the target absolute value with preset precision; if the target absolute value is compared with a preset precision threshold value, and if the target absolute value is smaller than or equal to the preset precision threshold value, the terminal determines that the comparison result is the preset value; if the target absolute value is larger than the preset precision threshold value, the terminal determines that the comparison result is not the preset value. Then, when the comparison result is a preset value, the terminal determines that the screen width value is equal to the reference width value, wherein the preset value can be 1 or logical true. For example, the reference model is iPhone-6, the reference width value corresponding to the reference model is 375.0000, the terminal model is iPhone-8, the screen width value corresponding to the terminal model is 375.0000, the terminal obtains a comparison result of 1, the terminal determines that the screen width value is equal to the reference width value, and the terminal invokes a target transmission message in a target code block based on layout reference information and/or stops screen automatic adaptation processing. And finally, when the comparison result is not a preset value, the terminal determines that the screen width value is not equal to the reference width value. For example, the reference model is iPhone-6, the reference width value corresponding to the reference model is 375.0000, the terminal model is iPhone-11, the screen width value corresponding to the terminal model is 414.0000, the terminal obtains a matching result of 0, and the terminal determines that the screen width value is not equal to the reference width value.
203. If the screen width value is not equal to the reference width value, intercepting a target sending message and a reference parameter in a target code block through a preset message mechanism, acquiring a first message number corresponding to the target sending message, inquiring a preset binding relation according to the first message number to acquire a first function pointer, and determining a mapping message processing function corresponding to the target sending message according to the first function pointer, wherein the reference parameter is used for indicating the element size or the element position in the layout reference information.
That is, there is a one-to-one mapping binding relationship between the target send message and the mapping message handling function. For example, the target transmission message is autosetdimeinst: toSize: size relation (PureLayout), the size is a reference parameter, for example, the preset element size is 30×30, the mapping message processing function is jkn_autosetdimeinst: toSize: size: relation_imp, where relation is a customized first message number, and IMP is a customized implementation function (i.e., a mapping message processing function) to specifically implement an address of a code block (i.e., a preset first function pointer).
204. Dividing the screen width value by the reference width value to obtain a proportionality coefficient, and calling a mapping message processing function according to the proportionality coefficient and the reference parameter.
Wherein the scaling factor is a positive number. For example, setting iPhone8 as the reference model, the reference model corresponds to the reference width value of 375.0000, the terminal model is iPhone8P, and the terminal model corresponds to the screen width value of 414.0000, the scaling factor is 414.0000 divided by 375.0000, that is, 1.104.
205. And multiplying the proportional coefficient and the reference parameter by a mapping message processing function to obtain a message return value, and setting the message return value as target layout information, wherein the target layout information is the adapted element size or the adapted element position.
For example, the terminal calls the target sending message autosetdimeinstons: toSize: relation (PureLayout), then after intercepting the target sending message by a message mechanism preset by the terminal, redirects the target sending message to a mapping message processing function jkn_autosetdimeinstons: toSize: relay_imp, and multiplies the reference parameter size by a scaling factor through the mapping message processing function, so as to generate a new adaptation parameter newSize (i.e. a message return value), where the scaling factor is a screen width value divided by 375.0000, 375.0000 as a reference width value. When the reference size is 90×90, and the scaling factor is 1.104, the message return value obtained by the terminal is 99×99 (i.e. the target layout information), and further, the target layout information in this embodiment is the adapted element size.
206. When the execution of the processing logic corresponding to the mapping message processing function is completed, the target message processing function is called and executed according to the target layout information through the mapping response message until the automatic element adaptation layout is finished, the automatic adaptation page is drawn and displayed, and the mapping response message corresponds to the mapping message processing function one by one.
Further, the terminal respectively performs buffer processing on the target sending message, the mapping message processing function, the mapping response message and the target message processing function. When loading the target page, the terminal can also draw and splice the view according to the data such as the picture size, the picture address, the characters, the character size, the character color, the background color and the like, and is logically associated with event interaction until the automatic element adaptation layout is finished, and draw and display the automatic adaptation page.
Optionally, when execution of the processing logic corresponding to the mapping message processing function is completed, the terminal sets the target layout information and the second message number as input parameters of the mapping response message, and the terminal recalls the mapping response message based on the input parameters, wherein the mapping response message corresponds to the mapping message processing function one by one; the terminal inquires a preset binding relation according to a second message number in the input parameters through the mapping response message to obtain a second function pointer, the terminal determines a target message processing function corresponding to the mapping response message according to the second function pointer, and the terminal calls and executes the target message processing function based on the target layout information to obtain an automatic adaptation page; for example, the mapping relationship between the mapping response message and the target message handling function is jkn_autosetdimension: toSize: relation- > autoSetDimension: toSize: relation_imp:. When the terminal executes the preset ending mark in the target code, the terminal determines that the automatic element adaptation layout is ended, and the automatic element adaptation page is drawn and displayed until the automatic element adaptation layout is ended. It can be understood that the flexibility of screen adaptation is improved by setting whether to start the screen adaptation or not through a global variable (preset view layout mark). And setting a mark (preset starting mark) as YES at the beginning of a view layout mark [ UIVIew fitLayout: { } ] code block, setting a mark (preset ending mark) as NO at the end of the code block, and setting a layout code between the YES and the NO, wherein the layout code can judge whether the screen proportion needs to be automatically adapted according to the mark.
Further, the terminal collects page adaptation log data according to a code embedded point mark preset in a target page; the terminal sends the page adaptation log data to a target server, and the target server processes and durably stores the page adaptation log data. The preset code embedded point identification is to collect some page adaptation log data in the target page according to a preset flow, and the page adaptation log data are used for tracking the automatic adaptation condition of the target page, so that the reliability of the automatic adaptation of the application page is improved.
In the embodiment of the invention, a target sending message and a reference parameter in a target code block are intercepted through a preset message mechanism, and a mapping message processing function corresponding to the target sending message is called according to a screen width value, the reference width value and the reference parameter to obtain target layout information; and calling and executing a target message processing function according to the target layout information through the mapping response message, and displaying the automatic adaptation page. Repeated adaptation codes are reduced, so that code readability and expansibility are enhanced, the adaptation efficiency of the size and the position of the interface design element is improved, and the probability of page adaptation errors is reduced. The scheme can be applied to the intelligent medical field, so that the construction of the intelligent city is promoted.
The method for automatically adapting a page in the embodiment of the present invention is described above, and the apparatus for automatically adapting a page in the embodiment of the present invention is described below, referring to fig. 3, and one embodiment of the apparatus for automatically adapting a page in the embodiment of the present invention includes:
the retrieval module 301 is configured to retrieve a target page according to a preset view layout mark, a preset start mark and a preset end mark when the target page is loaded, obtain a target code block, and obtain a reference width value corresponding to the target page and a screen width value of a terminal;
the judging module 302 is configured to obtain layout reference information corresponding to the target page, and judge whether the screen width value is equal to the reference width value, where the layout reference information includes preset element size information and preset element position information;
the interception module 303 is configured to intercept, if the screen width value is not equal to the reference width value, the target sending message and the reference parameter in the target code block through a preset message mechanism, and call a mapping message processing function corresponding to the target sending message according to the screen width value, the reference width value and the reference parameter, to obtain target layout information, where the reference parameter is used to indicate an element size or an element position in the layout reference information, and the target layout information is an adapted element size or an adapted element position;
And the display module 304 is configured to call and execute the target message processing function according to the target layout information through the mapping response message when the execution of the processing logic corresponding to the mapping message processing function is completed, and draw and display the automatic adaptation page until the automatic adaptation layout of the element is completed, where the mapping response message corresponds to the mapping message processing function one by one.
Further, the auto-adaptation page is stored in a blockchain database, and is not limited herein.
In the embodiment of the invention, a target sending message and a reference parameter in a target code block are intercepted through a preset message mechanism, and a mapping message processing function corresponding to the target sending message is called according to a screen width value, the reference width value and the reference parameter to obtain target layout information; and calling and executing a target message processing function according to the target layout information through the mapping response message, and displaying the automatic adaptation page. The adaptation efficiency of the size and the position of the interface design element is improved, and the probability of page adaptation errors is reduced.
Referring to fig. 4, another embodiment of the automatic page adapting device according to the embodiment of the present invention includes:
the retrieval module 301 is configured to retrieve a target page according to a preset view layout mark, a preset start mark and a preset end mark when the target page is loaded, obtain a target code block, and obtain a reference width value corresponding to the target page and a screen width value of a terminal;
The judging module 302 is configured to obtain layout reference information corresponding to the target page, and judge whether the screen width value is equal to the reference width value, where the layout reference information includes preset element size information and preset element position information;
the interception module 303 is configured to intercept, if the screen width value is not equal to the reference width value, the target sending message and the reference parameter in the target code block through a preset message mechanism, and call a mapping message processing function corresponding to the target sending message according to the screen width value, the reference width value and the reference parameter, to obtain target layout information, where the reference parameter is used to indicate an element size or an element position in the layout reference information, and the target layout information is an adapted element size or an adapted element position;
and the display module 304 is configured to call and execute the target message processing function according to the target layout information through the mapping response message when the execution of the processing logic corresponding to the mapping message processing function is completed, and draw and display the automatic adaptation page until the automatic adaptation layout of the element is completed, where the mapping response message corresponds to the mapping message processing function one by one.
Optionally, the retrieving module 301 may be further specifically configured to:
When loading a target page, setting a preset view layout mark as a target keyword, and matching each text element in the target page according to the target keyword to obtain a matching result, wherein the target page is a first page of a preset application program, and the preset view layout mark is used for indicating that the target page is automatically adapted when a screen is started;
when the matching result is that the matching is successful, determining that a view layout mark exists in the target page, and extracting a target code block from preset code processing logic corresponding to the view layout mark according to a preset starting mark and a preset ending mark;
and acquiring a reference width value corresponding to the target page, calling a preset screen size function to acquire the screen size information of the terminal, and extracting the screen width value of the terminal from the screen size information according to the floating point data type.
Optionally, the determining module 302 may further include:
a reading unit 3021, configured to read layout reference information corresponding to the target page from a preset memory database, where the layout reference information includes preset element size information and preset element position information;
a deleting unit 3022, configured to delete the head and tail spaces of the screen width value and the head and tail spaces of the reference width value respectively by using a preset character filtering function, so as to obtain the screen width value from which the head and tail spaces are removed and the reference width value from which the head and tail spaces are removed;
A comparing unit 3023, configured to compare the screen width value from which the head and tail spaces have been removed with the reference width value from which the head and tail spaces have been removed, to obtain a comparison result;
a first determining unit 3024 for determining that the screen width value is equal to the reference width value when the comparison result is a preset value;
a second determining unit 3025 for determining that the screen width value is not equal to the reference width value when the comparison result is not a preset value.
Optionally, the reading unit 3021 may be further specifically configured to:
obtaining a reference model corresponding to a target page, setting the reference model corresponding to the target page as a target key, and reading a target value from a preset memory database according to the target key;
and when the target value is not a null value, carrying out data analysis on the target value according to a preset data format to obtain layout reference information corresponding to the target page, wherein the layout reference information comprises preset element size information and preset element position information.
Optionally, the interception module 303 may be further specifically configured to:
if the screen width value is not equal to the reference width value, intercepting a target sending message and a reference parameter in a target code block through a preset message mechanism, acquiring a first message number corresponding to the target sending message, inquiring a preset binding relation according to the first message number to acquire a first function pointer, and determining a mapping message processing function corresponding to the target sending message according to the first function pointer, wherein the reference parameter is used for indicating the element size or the element position in the layout reference information;
Dividing the screen width value by the reference width value to obtain a proportionality coefficient, and calling a mapping message processing function according to the proportionality coefficient and the reference parameter;
and multiplying the proportional coefficient and the reference parameter by a mapping message processing function to obtain a message return value, and setting the message return value as target layout information, wherein the target layout information is the adapted element size or the adapted element position.
Optionally, the display module 304 may be further specifically configured to:
when the execution of the processing logic corresponding to the mapping message processing function is completed, setting the target layout information and the second message number as input parameters of the mapping response message, and recalling the mapping response message based on the input parameters, wherein the mapping response message corresponds to the mapping message processing function one by one;
inquiring a preset binding relation according to a second message number in the input parameters through the mapping response message to obtain a second function pointer, determining a target message processing function corresponding to the mapping response message according to the second function pointer, calling and executing the target message processing function based on the target layout information to obtain an automatic adaptation page;
and when the execution is carried out to a preset end mark in the target code, determining that the automatic element adaptation layout is ended, and drawing and displaying the automatic element adaptation page until the automatic element adaptation layout is ended.
Optionally, the automatic page adapting device further includes:
the acquisition module 305 is configured to acquire page adaptation log data according to a code embedded point identifier preset in a target page;
and the sending module 306 is used for sending the page adaptation log data to a target server, and performing data processing and persistent storage on the page adaptation log data through the target server.
In the embodiment of the invention, a target sending message and a reference parameter in a target code block are intercepted through a preset message mechanism, and a mapping message processing function corresponding to the target sending message is called according to a screen width value, the reference width value and the reference parameter to obtain target layout information; and calling and executing a target message processing function according to the target layout information through the mapping response message, and displaying the automatic adaptation page. Repeated adaptation codes are reduced, so that code readability and expansibility are enhanced, the adaptation efficiency of the size and the position of the interface design element is improved, and the probability of page adaptation errors is reduced.
The page automatic adapting device in the embodiment of the present invention is described in detail from the modularization point of view in fig. 3 and fig. 4, and the page automatic adapting device in the embodiment of the present invention is described in detail from the point of view of hardware processing.
Fig. 5 is a schematic structural diagram of a page auto-adaptation device according to an embodiment of the present invention, where the page auto-adaptation device 500 may have a relatively large difference due to different configurations or performances, and may include one or more processors (central processing units, CPU) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) storing application programs 533 or data 532. Wherein memory 520 and storage medium 530 may be transitory or persistent storage. The program stored in the storage medium 530 may include one or more modules (not shown), each of which may include a series of instruction operations in the page auto-adaptation device 500. Still further, the processor 510 may be configured to communicate with the storage medium 530 and execute a series of instruction operations in the storage medium 530 on the page-adapting device 500.
The page auto-adaptation device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input/output interfaces 560, and/or one or more operating systems 531, such as Windows Serve, mac OS X, unix, linux, freeBSD, and the like. It will be appreciated by those skilled in the art that the page auto-adaptation device architecture shown in fig. 5 does not constitute a limitation of the page auto-adaptation device, and may include more or fewer components than shown, or may combine certain components, or may be arranged in a different arrangement of components.
The present invention also provides a computer readable storage medium, which may be a non-volatile computer readable storage medium, or may be a volatile computer readable storage medium, where instructions are stored in the computer readable storage medium, which when executed on a computer, cause the computer to perform the steps of the page auto-adaptation method.
The invention also provides an automatic page adaptation device, which comprises a memory and a processor, wherein the memory stores instructions which, when executed by the processor, cause the processor to execute the steps of the automatic page adaptation method in the above embodiments.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method of automatic page adaptation, the method comprising:
when loading a target page, searching the target page according to a preset view layout mark, a preset starting mark and a preset ending mark to obtain a target code block, and obtaining a reference width value corresponding to the target page and a screen width value of a terminal;
acquiring layout reference information corresponding to the target page, and judging whether the screen width value is equal to the reference width value, wherein the layout reference information comprises preset element size information and preset element position information;
if the screen width value is not equal to the reference width value, intercepting a target sending message and a reference parameter in the target code block through a preset message mechanism, and calling a mapping message processing function corresponding to the target sending message according to the screen width value, the reference width value and the reference parameter to obtain target layout information, wherein the reference parameter is used for indicating the element size or the element position in the layout reference information, and the target layout information is the adapted element size or the adapted element position;
When the execution of the processing logic corresponding to the mapping message processing function is completed, the target message processing function is called and executed according to the target layout information through the mapping response message, and the automatic adaptation page is drawn and displayed until the automatic element adaptation layout is finished, wherein the mapping response message corresponds to the mapping message processing function one by one.
2. The automatic page adaptation method according to claim 1, wherein when loading a target page, retrieving the target page according to a preset view layout mark, a preset start mark and a preset end mark to obtain a target code block, and obtaining a reference width value corresponding to the target page and a screen width value of a terminal, includes:
when a target page is loaded, setting a preset view layout mark as a target keyword, and matching each text element in the target page according to the target keyword to obtain a matching result, wherein the target page is a first page of a preset application program, and the preset view layout mark is used for indicating that the target page is opened for automatic screen adaptation;
when the matching result is that the matching is successful, determining that the view layout mark exists in the target page, and extracting a target code block from preset code processing logic corresponding to the view layout mark according to a preset starting mark and a preset ending mark;
And acquiring a reference width value corresponding to the target page, calling a preset screen size function to acquire screen size information of the terminal, and extracting the screen width value of the terminal from the screen size information according to the floating point data type.
3. The method for automatically adapting a page according to claim 1, wherein the step of obtaining layout reference information corresponding to the target page and determining whether the screen width value is equal to the reference width value, the layout reference information including preset element size information and preset element position information includes:
reading layout reference information corresponding to the target page from a preset memory database, wherein the layout reference information comprises preset element size information and preset element position information;
respectively deleting the head and tail space of the screen width value and the head and tail space of the reference width value through a preset character filtering function to obtain the screen width value with the head and tail space removed and the reference width value with the head and tail space removed;
comparing the screen width value of the removed head and tail space with the reference width value of the removed head and tail space to obtain a comparison result;
When the comparison result is a preset value, determining that the screen width value is equal to the reference width value;
and when the comparison result is not a preset value, determining that the screen width value is not equal to the reference width value.
4. The automatic page adaptation method according to claim 3, wherein the step of reading layout reference information corresponding to the target page from a preset memory database, the layout reference information including preset element size information and preset element position information, includes:
obtaining a reference model corresponding to the target page, setting the reference model corresponding to the target page as a target key, and reading a target value from a preset memory database according to the target key;
and when the target value is not a null value, carrying out data analysis on the target value according to a preset data format to obtain layout reference information corresponding to the target page, wherein the layout reference information comprises preset element size information and preset element position information.
5. The automatic page adaptation method according to claim 1, wherein if the screen width value is not equal to the reference width value, intercepting, by a preset message mechanism, a target transmission message and a reference parameter in the target code block, and calling a mapping message processing function corresponding to the target transmission message according to the screen width value, the reference width value, and the reference parameter to obtain target layout information, where the reference parameter is used to indicate an element size or an element position in layout reference information, and the target layout information is an adapted element size or an adapted element position, and includes:
If the screen width value is not equal to the reference width value, intercepting a target sending message and a reference parameter in the target code block through a preset message mechanism, acquiring a first message number corresponding to the target sending message, inquiring a preset binding relation according to the first message number to acquire a first function pointer, and determining a mapping message processing function corresponding to the target sending message according to the first function pointer, wherein the reference parameter is used for indicating the element size or the element position in layout reference information;
dividing the screen width value by the reference width value to obtain a proportionality coefficient, and calling the mapping message processing function according to the proportionality coefficient and the reference parameter;
and multiplying the proportional coefficient and the reference parameter by the mapping message processing function to obtain a message return value, and setting the message return value as target layout information, wherein the target layout information is an adapted element size or an adapted element position.
6. The method for automatically adapting a page according to claim 5, wherein when execution of the processing logic corresponding to the mapping message processing function is completed, the target message processing function is called and executed according to the target layout information through a mapping response message, until the element automatic adaptation layout is finished, the automatic adaptation page is drawn and displayed, the mapping response message corresponds to the mapping message processing function one by one, and the method comprises:
When the execution of the processing logic corresponding to the mapping message processing function is completed, setting the target layout information and the second message number as input parameters of a mapping response message, and recalling the mapping response message based on the input parameters, wherein the mapping response message corresponds to the mapping message processing function one by one;
inquiring the preset binding relation according to a second message number in the input parameters through a mapping response message to obtain a second function pointer, determining a target message processing function corresponding to the mapping response message according to the second function pointer, calling and executing the target message processing function based on the target layout information to obtain an automatic adaptation page;
and when the execution is carried out to the preset ending mark in the target code, determining that the automatic element adaptation layout is ended, and drawing and displaying the automatic element adaptation page until the automatic element adaptation layout is ended.
7. The page auto-adaptation method according to any one of claims 1 to 6, wherein when the execution of the processing logic corresponding to the mapping message processing function is completed, the target message processing function is called and executed according to the target layout information by a mapping response message until the element auto-adaptation layout is finished, and the auto-adaptation page is drawn and displayed, and the page auto-adaptation method further comprises, after the mapping response message corresponds to the mapping message processing function one by one:
Collecting page adaptation log data according to a code embedded point mark preset in the target page;
and sending the page adaptation log data to a target server, and performing data processing and persistent storage on the page adaptation log data through the target server.
8. An automatic page adapting device, characterized in that the automatic page adapting device comprises:
the searching module is used for searching the target page according to a preset view layout mark, a preset starting mark and a preset ending mark when the target page is loaded, obtaining a target code block, and obtaining a reference width value corresponding to the target page and a screen width value of a terminal;
the judging module is used for acquiring layout reference information corresponding to the target page and judging whether the screen width value is equal to the reference width value or not, wherein the layout reference information comprises preset element size information and preset element position information;
the interception module is used for intercepting a target sending message and a reference parameter in the target code block through a preset message mechanism if the screen width value is not equal to the reference width value, and calling a mapping message processing function corresponding to the target sending message according to the screen width value, the reference width value and the reference parameter to obtain target layout information, wherein the reference parameter is used for indicating the element size or the element position in the layout reference information, and the target layout information is the adapted element size or the adapted element position;
And the display module is used for calling and executing the target message processing function according to the target layout information through the mapping response message when the execution of the processing logic corresponding to the mapping message processing function is completed, and drawing and displaying the automatic adaptation page until the automatic adaptation layout of the element is finished, wherein the mapping response message corresponds to the mapping message processing function one by one.
9. A page automatic adaptation device, characterized in that the page automatic adaptation device comprises: a memory and at least one processor, the memory having instructions stored therein;
the at least one processor invoking the instructions in the memory to cause the page auto-adaptation device to perform the page auto-adaptation method of any of claims 1-7.
10. A computer readable storage medium having instructions stored thereon, which when executed by a processor, implement the page auto-adaptation method according to any of claims 1-7.
CN202110433759.9A 2021-04-22 2021-04-22 Page automatic adaptation method, device, equipment and storage medium Active CN113127125B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110433759.9A CN113127125B (en) 2021-04-22 2021-04-22 Page automatic adaptation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110433759.9A CN113127125B (en) 2021-04-22 2021-04-22 Page automatic adaptation method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113127125A CN113127125A (en) 2021-07-16
CN113127125B true CN113127125B (en) 2024-02-09

Family

ID=76778852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110433759.9A Active CN113127125B (en) 2021-04-22 2021-04-22 Page automatic adaptation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113127125B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113626126A (en) * 2021-08-18 2021-11-09 平安普惠企业管理有限公司 Application program start page adaptation method, device, equipment and medium
CN113986442A (en) * 2021-11-05 2022-01-28 北京达佳互联信息技术有限公司 Page display method and device, electronic equipment and computer readable storage medium
CN116501205B (en) * 2023-04-28 2024-04-26 重庆赛力斯凤凰智创科技有限公司 Method and device for moving covered view, electronic equipment and readable storage medium
CN117539491B (en) * 2024-01-09 2024-04-26 腾讯科技(深圳)有限公司 Page layout method, page layout device, electronic device, storage medium and program product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106776969A (en) * 2016-12-05 2017-05-31 乐视控股(北京)有限公司 Page adaptation method, device and electronic equipment
CN109783181A (en) * 2019-01-31 2019-05-21 掌阅科技股份有限公司 Screen is adapted to display methods, electronic equipment and computer storage medium
CN110096322A (en) * 2019-03-25 2019-08-06 北京辰森世纪科技股份有限公司 The method and device of adaptive terminal screen, storage medium, electronic device
CN110888574A (en) * 2019-10-12 2020-03-17 平安普惠企业管理有限公司 Self-adaption method, device and equipment for page display and computer storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106776969A (en) * 2016-12-05 2017-05-31 乐视控股(北京)有限公司 Page adaptation method, device and electronic equipment
CN109783181A (en) * 2019-01-31 2019-05-21 掌阅科技股份有限公司 Screen is adapted to display methods, electronic equipment and computer storage medium
CN110096322A (en) * 2019-03-25 2019-08-06 北京辰森世纪科技股份有限公司 The method and device of adaptive terminal screen, storage medium, electronic device
CN110888574A (en) * 2019-10-12 2020-03-17 平安普惠企业管理有限公司 Self-adaption method, device and equipment for page display and computer storage medium

Also Published As

Publication number Publication date
CN113127125A (en) 2021-07-16

Similar Documents

Publication Publication Date Title
CN113127125B (en) Page automatic adaptation method, device, equipment and storage medium
CN108427705B (en) Electronic device, distributed system log query method and storage medium
CN111274045A (en) Multi-platform docking method and device, computer equipment and readable storage medium
CN109408507B (en) Multi-attribute data processing method, device, equipment and readable storage medium
CN110532107B (en) Interface calling method, device, computer equipment and storage medium
CN111597553A (en) Process processing method, device, equipment and storage medium in virus searching and killing
CN111813744A (en) File searching method, device, equipment and storage medium
CN110109981B (en) Information display method and device for work queue, computer equipment and storage medium
CN110222046B (en) List data processing method, device, server and storage medium
EP3108400B1 (en) Virus signature matching method and apparatus
CN108427701B (en) Method for identifying help information based on operation page and application server
CN113554440A (en) Data reconciliation method, device, equipment and storage medium
CN109697234B (en) Multi-attribute information query method, device, server and medium for entity
US20230153455A1 (en) Query-based database redaction
CN117033309A (en) Data conversion method and device, electronic equipment and readable storage medium
JP4136282B2 (en) Image processing apparatus, image processing method, and storage medium
KR101828466B1 (en) Method and apparatus for providing an object-based storage interface on the storage device based on file system
CN109800273A (en) A kind of method, apparatus of data processing, computer storage medium and terminal
KR20110023580A (en) The method and system for recovering data
CN112003837B (en) Intelligent equipment adaptation method and device based on Modbus protocol and storage medium
CN110263310B (en) Data graph generation method and device and computer readable storage medium
CN111610908B (en) Method for generating frame diagram, computer equipment and readable storage medium
CN109522014B (en) Algorithm processing method based on new product development, electronic device and readable storage medium
CN113157212A (en) Flash storage method and device, intelligent wearable device and storage medium
CN112883375A (en) Malicious file identification method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant