CN111539183B - Data processing method, device, electronic equipment and storage medium - Google Patents

Data processing method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111539183B
CN111539183B CN201910108105.1A CN201910108105A CN111539183B CN 111539183 B CN111539183 B CN 111539183B CN 201910108105 A CN201910108105 A CN 201910108105A CN 111539183 B CN111539183 B CN 111539183B
Authority
CN
China
Prior art keywords
node
parameter
parameter value
determining
view
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
CN201910108105.1A
Other languages
Chinese (zh)
Other versions
CN111539183A (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.)
Alibaba Singapore Holdings Pte Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201910108105.1A priority Critical patent/CN111539183B/en
Publication of CN111539183A publication Critical patent/CN111539183A/en
Application granted granted Critical
Publication of CN111539183B publication Critical patent/CN111539183B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/957Browsing optimisation, e.g. caching or content distillation

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the application provides a data processing method, a data processing device, electronic equipment and a storage medium, so as to improve reusability. The method comprises the following steps: determining nodes in a page and a node of a higher level of the nodes; determining the parameter value of the first direction parameter of the previous node as the parameter value of the first direction parameter of the node; determining the direction information of the node according to the parameter value of the first direction parameter; and if the direction information is opposite to the default display direction of the node corresponding view, adjusting the display direction of the node corresponding view. The first direction parameters of the nodes can inherit the first direction parameters of the upper level nodes, so that each node can automatically detect and adjust the direction, the method is suitable for development of various pages, has good reusability, and can improve the development efficiency of the pages.

Description

Data processing method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data processing method and apparatus, an electronic device, and a storage medium.
Background
Chinese, english, etc. are usually left-to-right writing and reading habits, but different languages are different, e.g. arabic, hebrew, etc. are right-to-left writing and reading habits, so pages of an application need to be adjusted based on the habits of the language used.
At present, the page of an application program is usually analyzed on a front-end page based on actual conditions based on language habit adjustment, and contents such as each element in the webpage are modified step by step without reusability.
Disclosure of Invention
The embodiment of the application provides a data processing method for improving reusability.
Correspondingly, the embodiment of the application also provides a data processing device, electronic equipment and a storage medium, which are used for guaranteeing the implementation and application of the method.
To solve the above problems, an embodiment of the present application discloses a data processing method, including: determining nodes in a page and a node of a higher level of the nodes; determining the parameter value of the first direction parameter of the previous node as the parameter value of the first direction parameter of the node; determining the direction information of the node according to the parameter value of the first direction parameter; and if the direction information is opposite to the default display direction of the node corresponding view, adjusting the display direction of the node corresponding view.
Optionally, the adjusting the display direction of the node corresponding view includes: setting the attribute of the view corresponding to the node according to the direction information; and/or adjusting the view corresponding to the node through affine transformation.
Optionally, the adjusting the view corresponding to the node through affine transformation includes: carrying out affine transformation on the container view corresponding to the node, and carrying out affine transformation on each sub view corresponding to the container view.
Optionally, the determining the direction information of the node according to the parameter value of the first direction parameter includes: determining a parameter value of a second direction parameter of the node, wherein the second direction parameter is used for determining a direction of the node corresponding to the stream layout; and determining the direction information of the node according to the parameter value of the second direction parameter and the parameter value of the first direction parameter.
Optionally, the parameter values of the first direction parameter include left to right and/or right to left; the direction information of the node includes: a horizontal layout from right to left corresponding to a row direction, a horizontal layout from left to right corresponding to a row direction, a vertical layout from right to left corresponding to a column direction, and/or a vertical layout from left to right corresponding to a column direction.
Optionally, the parameter values of the second direction parameter include: a row forward parameter value, a row reverse parameter value, a column forward parameter value, and/or a column reverse parameter value.
Optionally, the method further comprises: determining a parameter value of a third direction parameter of the root node; and taking the parameter value of the third direction parameter as the parameter value of the first direction parameter of the root node.
The embodiment of the application also provides a data processing device, which comprises: the node determining module is used for determining nodes in the page and a node at the upper level of the nodes; the parameter value determining module is used for determining the parameter value of the first direction parameter of the previous node as the parameter value of the first direction parameter of the node; the direction determining module is used for determining the direction information of the node according to the parameter value of the first direction parameter; and the direction adjustment module is used for adjusting the display direction of the node corresponding view if the direction information is opposite to the default display direction of the node corresponding view.
The embodiment of the application also provides electronic equipment, which comprises: a processor; and a memory having executable code stored thereon that, when executed, causes the processor to perform a data processing method as described in one or more of the embodiments herein.
Embodiments also provide one or more machine readable media having executable code stored thereon that, when executed, cause a processor to perform a data processing method as described in one or more of the embodiments of the present application.
Compared with the prior art, the embodiment of the application has the following advantages:
in the embodiment of the application, the nodes in the page and the node at the upper level of the node are determined, then the parameter value of the first direction parameter of the node at the upper level is determined as the parameter value of the first direction parameter of the node, the first direction parameter of the node can inherit the first direction parameter of the node at the upper level, and then the direction information of the node is determined according to the parameter value of the first direction parameter, so that each node can automatically detect and adjust the direction, the method is suitable for development of various pages, has good reusability, and can improve the development efficiency of the page.
Drawings
FIG. 1 is a schematic diagram of an example of page layout adjustment in an embodiment of the present application;
FIG. 2 is a flow chart of steps of an embodiment of a data processing method of the present application;
FIG. 3 is a flowchart of steps for an example of determination of direction parameters in an embodiment of the present application;
FIG. 4 is a flowchart of steps for an example of determination of direction information in an embodiment of the present application;
FIG. 5 is a schematic diagram of another example of data processing adjustment of an embodiment of the present application;
FIG. 6 is a flowchart illustrating steps of another embodiment of a data processing method of the present application;
FIG. 7 is a flow chart of steps of yet another embodiment of a data processing method of the present application;
FIG. 8 is a block diagram of an embodiment of a data processing apparatus of the present application;
FIG. 9 is a block diagram of another embodiment of a data processing apparatus of the present application;
fig. 10 is a schematic structural diagram of an apparatus according to an embodiment of the present application.
Detailed Description
In order that the above-recited objects, features and advantages of the present application will become more readily apparent, a more particular description of the invention briefly described above will be rendered by reference to specific embodiments that are illustrated in the appended drawings.
Different languages are different in writing and reading habits, for example, chinese, english, etc. are generally Left-To-Right (LTR) writing and reading habits, whereas arabic, hebrew, etc. are Right-To-Left (RTL) writing and reading habits, and thus pages of an application program need To be adjusted based on the habits of the language used.
In general, when an application program is developed, it is developed in general english, chinese habit, or the like, and a layout (layout) is performed from left to right by default for a general page, but when a page language is adjusted to a language of habit from right to left for the sake of page generality, the content of the corresponding page is also adjusted to suit the habit of the language used. The embodiment of the application provides a data processing method, wherein a node can inherit the direction parameters of the previous level node to determine the direction information, so that the direction information of each node in a page can be automatically determined, the direction of the content in the page is conveniently set, the method is suitable for the development process of various pages, the reusability is high, and the development efficiency can be improved. The page layout refers to planning setting of page display content, and comprises setting of direction of display content in a page and the like. The pages in the embodiment of the application include front-end pages of various UI frames, such as a Weex front-end page.
Referring to fig. 1, a schematic diagram of page layout adjustment according to an embodiment of the present application is shown.
Referring to fig. 2, a flowchart of steps of one embodiment of a data processing method of the present application is shown.
Step 202, determining a node in a page and a node at a higher level of the node.
Step 204, setting the parameter value of the first direction parameter of the previous node as the parameter value of the first direction parameter of the node.
The pages of the application program can be mapped into a file composed of hierarchical nodes, so that the setting of the page layout can be realized by traversing the nodes of the pages. Thus, the method can start from the root node of the page, and thus the nodes in the corresponding node tree of the page are traversed, and direction information can be determined for each node, wherein the direction information refers to the direction of the display content of the corresponding page of the node, such as the direction of the corresponding view of the node.
In this embodiment of the present application, the first direction parameter refers to a parameter for calculating a direction of a node in a page, and the node in the page may be set to inherit the first direction parameter of a previous node, so that the previous node may be determined for the node in the page, and then a parameter value of the first direction parameter of the previous node may be obtained, and the first direction parameter is used as a parameter value of the first direction parameter of the node.
In the embodiment of the application, in order to facilitate the development of the developer, the third direction parameter may be set, where the third direction parameter refers to a direction parameter set in the development process, and the third direction parameter may be provided to the developer for setting. The third direction parameter is associated with the first direction parameter and is operable to determine a parameter value of the first direction parameter. In an alternative embodiment, determining a parameter value of a third direction parameter of the root node; and taking the parameter value of the third direction parameter as the parameter value of the first direction parameter of the root node. The developer may set the parameter value of the third direction parameter of the root node in the page, so that, for the root node, the parameter value of the third direction parameter is used as the parameter value of the first direction parameter of the root node. And then, the next-stage node of the root node can take the parameter value of the first direction parameter of the root node as the parameter value of the own first direction parameter, so that the succession of the parameter value of the first direction parameter is realized, and a developer does not need to set each node respectively, thereby improving the setting efficiency.
In this embodiment of the present application, the parameter values of the first direction parameter include a left-to-right LTR and/or a right-to-left RTL; the parameter values of the third direction parameters include left to right LTR and/or right to left RTL.
In one embodiment, the first direction parameter may be determined according to the third direction parameter (direction), so as to obtain a parameter value of the first direction parameter (resultDirection), as in an example shown in fig. 3:
step 302, determining a third direction parameter of a node in the page.
Step 304, determining whether the parameter value of the third direction parameter is inherited. If yes, go to step 308; if not, go to step 306. Whether inheritance is needed or not can be determined according to whether the parameter value of the third direction is set or not, inheritance is not needed if the parameter value is set, and inheritance is needed if the parameter value is not set.
And 306, taking the parameter value of the third direction parameter of the node as the parameter value of the first direction parameter of the node. For example, the parameter value of the third direction parameter of the root node is taken as the parameter value of the first direction parameter of the root node.
Step 308, determining whether the node has a previous level node. If yes, the node has the previous node, step 310 is executed, and if not, step 312 is executed if the node does not have the previous node.
Step 310, determining the parameter value of the first direction parameter of the node at the previous stage of the node as the parameter value of the first direction parameter of the node.
In step 312, the parameter value of the first direction parameter of the node is determined as a default value, such as the left-to-right LTR direction. If the parameter value of the third direction parameter of the root node is not set, the default value may be used as the parameter value of the first direction parameter.
In this embodiment of the present application, the parameter values of the first direction parameters of the nodes may be inherited, so that the parameter values of different first direction parameters may be determined by using CSS setting and Layout (Layout) depending on the reference of the node to the direction parameter of the previous node.
Step 206, determining the direction information of the node according to the parameter value of the first direction parameter.
After obtaining the parameter value of the first direction parameter of the node, the direction information of the node can be calculated according to the parameter value of the first direction parameter.
In this embodiment of the present application, the direction information of the node is further related to a second direction parameter, where the second direction parameter is used to determine a direction of the node corresponding to the flow layout. The stream layout refers to the sequential arrangement of views of nodes in a page in a certain direction, and when a certain set boundary or set number is reached, a row is started again, and the original starting point is returned to resume sequential arrangement in that direction. For example, the default direction is arranged from left to right, according to the layout mode of the stream layout, the node corresponding views in the page are sequentially arranged from left to right according to the adding sequence, and when the rest width of the layout view accommodates the width of the new sub-view to be inserted, one row is started again, and the layout is rearranged from left to right.
In the page development process, the layout engine determines the direction information of the nodes according to the second direction parameters, and on the basis, the embodiment of the application provides the first direction parameters, and the parameter values of the first direction parameters can be inherited from the previous level nodes, so that each node is not required to be set respectively, and the development efficiency and reusability can be improved.
In an optional embodiment, the determining the direction information of the node according to the parameter value of the first direction parameter includes: determining a parameter value of a second direction parameter of the node, wherein the second direction parameter is used for determining a direction of the node corresponding to the stream layout; and determining the direction information of the node according to the parameter value of the second direction parameter and the parameter value of the first direction parameter. The parameter value of the node corresponding to the second direction parameter can be obtained, the parameter value can be determined according to the direction of the stream layout, such as horizontal layout from right to left corresponding to the row direction, and then the direction information of the node is determined according to the parameter value of the second direction parameter and the parameter value of the first direction parameter.
In one example, the parameter values of the second direction parameter (FlexDirection) include: a row forward parameter value (row), a row reverse parameter value (row-reverse), a column forward parameter value (column-reverse), and a column reverse parameter value (column-reverse), wherein the row forward parameter value row is a default value, meaning that a flexible item (such as node content) is to be horizontally displayed, just like a row; the row direction parameter value row-reverse is the same as row, but in reverse order; column forward parameter value column refers to the flexible item (e.g., node content) to be displayed vertically, just as a column; column reverse parameter values column-reverse are the same as column, but in reverse order. The direction information of the node includes at least one of: a horizontal layout from right to left corresponding to the row direction, a horizontal layout from left to right corresponding to the row direction, a vertical layout from right to left corresponding to the column direction, and a vertical layout from left to right corresponding to the column direction.
In one example, in the direction information determination example shown in fig. 4, taking by default left-to-right as an example:
step 402, judging whether the parameter value of the second direction parameter of the node is a line forward parameter value; if yes, go to step 404; if not, go to step 410.
Step 404, determining whether the parameter value of the first direction parameter of the node is from right to left; if yes, go to step 406; if not, go to step 408.
In step 406, the direction information of the node is determined to be a horizontal layout horizonLayout (RTL) from right to left.
In step 408, the direction information of the node is determined to be a horizontal layout horizonLayout (LTR) from left to right.
Step 410, determining whether the parameter value of the second direction parameter is a line inversion parameter value; if yes, go to step 412, if no, go to step 414.
Step 412, determining whether the parameter value of the first direction parameter is from right to left; if yes, go to step 408; if not, go to step 406.
Step 414, determining whether the parameter value of the second direction parameter is a column parameter value; if yes, go to step 416, if no, go to step 422.
Step 416, determining whether the parameter value of the first direction parameter is from right to left; if yes, go to step 418; if not, go to step 420.
At step 418, the direction information for the node is determined to be a right-to-left vertical layout verticalLayout (RTL).
In step 420, the direction information of the node is determined to be a left-to-right vertical layout verticalLayout (LTR).
Step 422, determining whether the parameter value of the second direction parameter is a column inversion parameter value, if so, executing step 424, and if not, ending the process.
Step 424, determining whether the parameter value of the first direction parameter is from right to left; if yes, go to step 420; if not, go to step 418.
So that for each node a third direction parameter direction of the page cascading style sheet (Cascading Style Sheets, CSS) and a first direction parameter resultDirection can be determined and the layout engine determines direction information for the second direction parameter FlexDirection of the streaming layout.
And step 208, if the direction information is opposite to the default display direction of the node corresponding view, adjusting the display direction of the node corresponding view.
After the direction information of the node is determined, the view corresponding to the node can be set according to the direction information. And if the direction information set by the node is opposite to the default display direction of the view corresponding to the node, the display direction of the view corresponding to the node can be adjusted to be consistent with the direction information.
In an alternative embodiment, the default display direction of the page is a left-to-right layout display, if the determined direction information is from left to right, the node corresponding view can be set according to the direction information, and if the determined direction is from right to left, that is, the determined direction information is opposite to the default display direction of the view corresponding to the node, the node corresponding view can be adjusted. The display direction of the view corresponding to the node is adjusted in an affine transformation mode, a view attribute adjustment mode and the like, so that the layout from right to left is realized, and the ABCD displayed in the layout from left to right is adjusted to the ABCD displayed in the layout from right to left in the page part area shown in fig. 1. Optionally, the adjusting the display direction of the node corresponding view includes: setting the attribute of the view corresponding to the node according to the direction information; and/or adjusting the view corresponding to the node through affine transformation.
In an alternative example, the direction-dependent attribute of the node's corresponding view may be adjusted to enable a right-to-left layout display. Taking an Android (Android) system as an example, the left attribute may be assigned as margin start, the top may be assigned as margin top, and the layout direction attribute layoutDirection of the View may be set as RTL (from right to left), so that the adjustment of the layout is implemented as shown in fig. 1.
In another alternative example, if the direction information is opposite to the default display direction of the view corresponding to the node, the view corresponding to the node is adjusted through affine transformation. Affine transformation of the embodiments of the present application includes a mirroring process, which adjusts the direction of a view by mirroring the view. Wherein the radiation transformation process may include two affine transformations: affine transformation is carried out on the container view corresponding to the node, and affine transformation is carried out on each sub view corresponding to the container view, so that the direction of the view corresponding to the node is adjusted from right to left.
In the two affine transformation process of the embodiment of the application, taking the iOS system as an example, the node corresponding view includes a view of the container and a sub-view in the container view. Firstly, affine transformation such as mirror image processing can be carried out on the View of the container corresponding to the node, wherein the View of the container is responsible for scrolling interaction, the sub View corresponding to the container is the content being displayed, so that the mirror image processing of the container does not affect the content being displayed, but the interaction and the sub View are reversed, and therefore affine transformation such as mirror image processing can be carried out on the sub View again, after the content in the sub View undergoes mirror image twice, the sub View can be restored to be forward, namely, the content displayed in the page is forward, and the interaction and the layout are opposite, so that the direction is adjusted from left to right to left.
In the partial page example shown in fig. 5, the initial page is the first page example, where the solid line frame is a horizontal scroll container visible window, and the dotted line frame is the size (content size) of the node corresponding content, where the content outside the visible window, i.e., the solid line frame, can be displayed by scrolling. The first mirroring process is performed on the view of the container, each content related to the container can be mirrored to obtain a second page example, at this time, interaction, layout and content are all reversed, and then the second mirroring process is performed on each sub-view, namely, the content corresponding to the node, so that the mirrored content is displayed in the forward direction, the content in the page is displayed as the mirrored content through the two mirroring processes, and the interaction and layout images are reversed, so that the left-to-right adjustment is realized.
In the embodiment of the application, the first direction parameter for development setting and the third direction parameter which is the same as the third direction parameter are introduced on the basis of the existing third direction parameter FlexDirect of the layout engine, so that the change of the existing system is reduced, the reusability is improved, and the development efficiency is improved.
On the basis of the above embodiment, the embodiment of the present application further provides a data processing method, taking a default direction as an example from left to right:
Referring to fig. 6, a flowchart of steps of another data processing method embodiment of the present application is shown.
Step 602, determining a third direction parameter of a node in a page.
Step 604, determining whether the parameter value of the third direction parameter is inherited. If yes, go to step 608, if no, go to step 606. Whether inheritance is required may be determined based on whether the parameter value of the third direction parameter has been set, and inheritance is not required if the parameter value has been set, and inheritance is possible if the parameter value has not been set.
Step 606, taking the parameter value of the third direction parameter of the node as the parameter value of the first direction parameter.
Step 608 determines whether the node has a previous level node. If yes, go to step 610, if no, go to step 612.
Step 610, determining a parameter value of a first direction parameter of a node higher than the node as a parameter value of the first direction parameter of the node.
Step 612, setting the parameter value of the first direction parameter of the node as a default value. For the root node, if the parameter value of the third direction parameter is not set, the parameter value of the first direction parameter of the root node may be set as a default value.
Step 614 determines a parameter value for a second direction parameter for the node.
Step 616, determining the direction information of the node according to the parameter value of the second direction parameter and the parameter value of the first direction parameter.
The procedure for determining the direction information is similar to the example corresponding to fig. 4 described above, and thus will not be described again.
Step 618, determining whether the direction information is the same as a default display direction of the node corresponding view. If so, the process is ended, and if not, step 620 is performed.
And step 620, setting the attribute of the view corresponding to the node according to the direction information.
According to the direction information, the view corresponding to the node can be set, if the direction information is the same as the default direction of the view, no change is needed, and if the direction information is opposite to the default direction of the view, the direction related attribute of the view corresponding to the node can be adjusted, so that the layout display from right to left is realized. Taking an Android (Android) system as an example, the left attribute may be assigned as margin start, the top may be assigned as margin top, and the layout direction attribute layoutDirection of the View may be set as RTL (from right to left), so that the adjustment of the layout is implemented as shown in fig. 1.
Therefore, the method can adjust the layout of the weex page display from left to right to left according to the page of the application program in each android system through the process.
On the basis of the embodiment, the embodiment of the application also provides a data processing method, and the adjustment of the corresponding content direction of the node can be realized through twice affine transformation. Taking the default direction as left to right as an example:
referring to fig. 7, a flowchart of steps of yet another data processing method embodiment of the present application is shown.
Step 702, determining a third direction parameter of a node in a page.
Step 704, determining whether the parameter value of the third direction parameter is inherited. If yes, go to step 708, if no, go to step 706. Whether inheritance is required may be determined based on whether the parameter value of the third direction parameter has been set, and inheritance is not required if the parameter value has been set, and inheritance is possible if the parameter value has not been set.
And step 706, taking the parameter value of the third direction parameter of the node as the parameter value of the first direction parameter.
Step 708, determining whether the node has a previous level node. If yes, go to step 710, if no, go to step 712.
Step 710, determining the parameter value of the first direction parameter of the node at the previous stage of the node as the parameter value of the first direction parameter of the node.
Step 712, setting a parameter value of the first direction parameter of the node to a default value. For the root node, if the parameter value of the third direction parameter is not set, the parameter value of the first direction parameter of the root node may be set as a default value.
Step 714, determining a parameter value of a second direction parameter of the node.
Step 716, determining the direction information of the node according to the parameter value of the first direction parameter and the parameter value of the second direction parameter.
The procedure for determining the direction information is similar to the example corresponding to fig. 4 described above, and thus will not be described again.
Step 618, determining whether the direction information is the same as a default display direction of the node corresponding view. If so, the process is ended, and if not, step 720 is performed.
If the direction information is opposite to the default direction of the view corresponding to the node, and if the default direction is from left to right, the determined direction information is from right to left, the following steps may be executed:
step 720, carrying out affine transformation on the container view corresponding to the node, and carrying out affine transformation on each sub view corresponding to the container view.
Thus, for the pages of the application programs in each iOS system, the layout of the page display from left to right to left can be adjusted through the above-mentioned process.
In this embodiment of the present application, the JS (JavaScript) end may determine a third direction parameter of an Application (APP), and then determine whether a parameter value of the third direction parameter is set to determine whether inheritance is needed, for example, whether to follow a system direction by itself, default LTR when no setting is made, and so on. When the front end sets the direction of RTL 'for the root node, each Element of the base class is represented by RTL layout, so that the direction of RTL' is not required to be set for each Element, and the transformation cost of page adaptation is reduced. In the embodiment of the application, the experience of the scrolling container which can be adjusted by the node view in the page accords with RTL, and in the RTL condition, the first element of the scrolling container is at the rightmost side and aligned right, and the scrolling direction is from right to left.
According to the embodiment of the application, RTL layout patterns can be uniformly solved on the software development kit (Software Development Kit, SDK) level, the method can be applied to all business scenes, the page intrusion program is small, and after the parameter value of the third-direction parameter of the root node (namely the root node) is specified, the RTL layout setting of the whole page can be completed in an inheritance mode.
In the embodiment of the present application, the default is left to right, and if the default is right to left in the actual processing, and the layout is detected to be adjusted to be left to right, the method similar to the above embodiment may be used to execute the adjustment of the direction according to the requirement.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are all preferred embodiments and that the acts referred to are not necessarily required by the embodiments of the present application.
On the basis of the above embodiment, the present embodiment further provides a data processing apparatus, which is applied to electronic devices such as a server (cluster) and a terminal device.
With reference to fig. 8, a block diagram of an embodiment of a data processing apparatus of the present application is shown, which may specifically include the following modules:
the node determining module 802 is configured to determine a node in a page, and a node at a level higher than the node.
The parameter value determining module 804 is configured to determine a parameter value of the first direction parameter of the previous node as a parameter value of the first direction parameter of the node.
The direction determining module 806 is configured to determine direction information of the node according to the parameter value of the first direction parameter.
And a direction adjustment module 808, configured to adjust the display direction of the node corresponding view if the direction information is opposite to the default display direction of the node corresponding view.
In summary, the nodes in the page and the node at the upper level of the node are determined, then the parameter value of the first direction parameter of the node at the upper level is determined as the parameter value of the first direction parameter of the node, the first direction parameter of the node can inherit the first direction parameter of the node at the upper level, and then the direction information of the node is determined according to the parameter value of the first direction parameter, so that each node can automatically detect and adjust the direction, the method is suitable for development of various pages, has better reusability, and can improve the development efficiency of the page.
With reference to fig. 9, a block diagram illustrating another embodiment of a data processing apparatus of the present application may specifically include the following modules:
the node determining module 802 is configured to determine a node in a page, and a node at a level higher than the node.
The parameter value determining module 804 is configured to determine a parameter value of the first direction parameter of the previous node as a parameter value of the first direction parameter of the node.
The direction determining module 806 is configured to determine direction information of the node according to the parameter value of the first direction parameter.
And a direction adjustment module 808, configured to adjust the display direction of the node corresponding view if the direction information is opposite to the default display direction of the node corresponding view.
Wherein the direction adjustment module 808 comprises: attribute adjustment submodule 8082 and transform submodule 8084:
the attribute adjustment submodule 8082 is configured to set an attribute of the view corresponding to the node according to the direction information.
The transformation submodule 8084 is used for adjusting the view corresponding to the node through affine transformation.
Further, the transformation submodule 8084 is configured to perform affine transformation on the container view corresponding to the node, and perform affine transformation on each sub-view corresponding to the container view.
The direction determining module 806 is configured to determine a parameter value of a second direction parameter of the node, where the second direction parameter is used to determine a direction of the node corresponding to the flow layout; and determining the direction information of the node according to the parameter value of the second direction parameter and the parameter value of the first direction parameter.
In this embodiment of the present application, the parameter values of the first direction parameter include left to right and/or right to left; the direction information of the node includes: a horizontal layout from right to left corresponding to a row direction, a horizontal layout from left to right corresponding to a row direction, a vertical layout from right to left corresponding to a column direction, and/or a vertical layout from left to right corresponding to a column direction. The parameter values of the second direction parameter include: a row forward parameter value, a row reverse parameter value, a column forward parameter value, and/or a column reverse parameter value.
The parameter value determining module 804 is further configured to determine a parameter value of a third direction parameter of the root node; and taking the parameter value of the third direction parameter as the parameter value of the first direction parameter of the root node.
In this embodiment of the present application, the JS (JavaScript) end may determine a third direction parameter of an Application (APP), and then determine whether a parameter value of the third direction parameter is set to determine whether inheritance is needed, for example, whether to follow a system direction by itself, default LTR when no setting is made, and so on. When the front end sets the direction of RTL 'for the root node, each Element of the base class is represented by RTL layout, so that the direction of RTL' is not required to be set for each Element, and the transformation cost of page adaptation is reduced. In the embodiment of the application, the experience of the scrolling container which can be adjusted by the node view in the page accords with RTL, and in the RTL condition, the first element of the scrolling container is at the rightmost side and aligned right, and the scrolling direction is from right to left.
According to the embodiment of the application, RTL layout patterns can be uniformly solved on the software development kit (Software Development Kit, SDK) level, the method can be applied to all business scenes, the page intrusion program is small, and after the parameter value of the third-direction parameter of the root node (namely the root node) is specified, the RTL layout setting of the whole page can be completed in an inheritance mode.
In the embodiment of the present application, the default is left to right, and if the default is right to left in the actual processing, and the layout is detected to be adjusted to be left to right, the method similar to the above embodiment may be used to execute the adjustment of the direction according to the requirement.
The embodiment of the application also provides a non-volatile readable storage medium, where one or more modules (programs) are stored, where the one or more modules are applied to a device, and the device may be caused to execute instructions (instractions) of each method step in the embodiment of the application.
Embodiments of the present application provide one or more machine-readable media having instructions stored thereon that, when executed by one or more processors, cause an electronic device to perform a method as described in one or more of the above embodiments. In this embodiment of the present application, the electronic device includes a server (cluster), a mobile device, a terminal device, and the like.
Embodiments of the present disclosure may be implemented as an apparatus for performing a desired configuration using any suitable hardware, firmware, software, or any combination thereof, which may include a server (cluster), mobile device, terminal device, etc., electronic device. Fig. 10 schematically illustrates an example apparatus 1000 that may be used to implement various embodiments described herein.
For one embodiment, fig. 10 illustrates an example apparatus 1000 having one or more processors 1002, a control module (chipset) 1004 coupled to at least one of the processor(s) 1002, a memory 1006 coupled to the control module 1004, a non-volatile memory (NVM)/storage 1008 coupled to the control module 1004, one or more input/output devices 1010 coupled to the control module 1004, and a network interface 1012 coupled to the control module 1004.
The processor 1002 may include one or more single-core or multi-core processors, and the processor 1002 may include any combination of general-purpose or special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In some embodiments, the apparatus 1000 can be used as a server (cluster), a mobile device, a terminal device, or the like in the embodiments of the present application.
In some embodiments, the apparatus 1000 can include one or more computer-readable media (e.g., memory 1006 or NVM/storage 1008) having instructions 1014 and one or more processors 1002 in combination with the one or more computer-readable media configured to execute the instructions 1014 to implement the modules to perform the actions described in this disclosure.
For one embodiment, the control module 1004 may include any suitable interface controller to provide any suitable interface to at least one of the processor(s) 1002 and/or any suitable device or component in communication with the control module 1004.
The control module 1004 may include a memory controller module to provide an interface to the memory 1006. The memory controller modules may be hardware modules, software modules, and/or firmware modules.
Memory 1006 may be used to load and store data and/or instructions 1014 for device 1000, for example. For one embodiment, the memory 1006 may include any suitable volatile memory, such as a suitable DRAM. In some embodiments, the memory 1006 may comprise a double data rate type four synchronous dynamic random access memory (DDR 4 SDRAM).
For one embodiment, the control module 1004 may include one or more input/output controllers to provide an interface to the NVM/storage 1008 and the input/output device(s) 1010.
For example, NVM/storage 1008 may be used to store data and/or instructions 1014. NVM/storage 1008 may include any suitable nonvolatile memory (e.g., flash memory) and/or may include any suitable nonvolatile storage device(s) (e.g., one or more Hard Disk Drives (HDDs), one or more Compact Disc (CD) drives, and/or one or more Digital Versatile Disc (DVD) drives).
NVM/storage 1008 may include storage resources that are physically part of the device on which apparatus 1000 is installed, or may be accessible by the device without necessarily being part of the device. For example, NVM/storage 1008 may be accessed over a network via input/output device(s) 1010.
Input/output device(s) 1010 may provide an interface for apparatus 1000 to communicate with any other suitable device, input/output device 1010 may include communication components, audio components, sensor components, and the like. Network interface 1012 may provide an interface for device 1000 to communicate over one or more networks, and device 1000 may communicate wirelessly with one or more components of a wireless network according to any of one or more wireless network standards and/or protocols, such as accessing a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, etc., or a combination thereof.
For one embodiment, at least one of the processor(s) 1002 may be packaged together with logic of one or more controllers (e.g., memory controller modules) of the control module 1004. For one embodiment, at least one of the processor(s) 1002 may be packaged together with logic of one or more controllers of the control module 1004 to form a System In Package (SiP). For one embodiment, at least one of the processor(s) 1002 may be integrated on the same mold as logic of one or more controllers of the control module 1004. For one embodiment, at least one of the processor(s) 1002 may be integrated on the same die with logic of one or more controllers of the control module 1004 to form a system on chip (SoC).
In various embodiments, the apparatus 1000 may be, but is not limited to being: a server, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet, a netbook, etc.), among other terminal devices. In various embodiments, device 1000 may have more or fewer components and/or different architectures. For example, in some embodiments, the apparatus 1000 includes one or more cameras, a keyboard, a Liquid Crystal Display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an Application Specific Integrated Circuit (ASIC), and a speaker.
The embodiment of the application provides electronic equipment, which comprises: one or more processors; and one or more machine readable media having instructions stored thereon, which when executed by the one or more processors, cause the server to perform the data processing method as described in one or more of the embodiments of the present application.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present embodiments have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the present application.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The foregoing has described in detail a data processing method and apparatus, an electronic device and a storage medium provided in the present application, and specific examples have been applied herein to illustrate the principles and embodiments of the present application, the above examples being provided only to assist in understanding the method and core idea of the present application; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A method of data processing, the method comprising:
determining nodes in a page and a node of a higher level of the nodes;
determining the parameter value of the first direction parameter of the previous node as the parameter value of the first direction parameter of the node;
determining the direction information of the node according to the parameter value of the first direction parameter;
and if the direction information is opposite to the default display direction of the node corresponding view, adjusting the display direction of the node corresponding view.
2. The method of claim 1, wherein adjusting the display direction of the node corresponding view comprises:
setting the attribute of the view corresponding to the node according to the direction information; and/or
And adjusting the view corresponding to the node through affine transformation.
3. The method according to claim 2, wherein said adjusting the view corresponding to the node by affine transformation comprises:
carrying out affine transformation on the container view corresponding to the node, and carrying out affine transformation on each sub view corresponding to the container view.
4. The method according to claim 1, wherein determining the direction information of the node according to the parameter value of the first direction parameter comprises:
Determining a parameter value of a second direction parameter of the node, wherein the second direction parameter is used for determining a direction of the node corresponding to the stream layout;
and determining the direction information of the node according to the parameter value of the second direction parameter and the parameter value of the first direction parameter.
5. The method according to any of claims 1-4, wherein the parameter values of the first direction parameter comprise left to right and/or right to left; the direction information of the node includes: a horizontal layout from right to left corresponding to a row direction, a horizontal layout from left to right corresponding to a row direction, a vertical layout from right to left corresponding to a column direction, and/or a vertical layout from left to right corresponding to a column direction.
6. The method of claim 4, wherein the parameter values of the second direction parameter comprise: a row forward parameter value, a row reverse parameter value, a column forward parameter value, and/or a column reverse parameter value.
7. The method as recited in claim 6, further comprising:
determining a parameter value of a third direction parameter of the root node;
and taking the parameter value of the third direction parameter as the parameter value of the first direction parameter of the root node.
8. A data processing apparatus, the apparatus comprising:
the node determining module is used for determining nodes in the page and a node at the upper level of the nodes;
the parameter value determining module is used for determining the parameter value of the first direction parameter of the previous node as the parameter value of the first direction parameter of the node;
the direction determining module is used for determining the direction information of the node according to the parameter value of the first direction parameter;
and the direction adjustment module is used for adjusting the display direction of the node corresponding view if the direction information is opposite to the default display direction of the node corresponding view.
9. An electronic device, comprising:
a processor; and
a memory having executable code stored thereon which, when executed, causes the processor to perform the data processing method of any of claims 1-8.
10. One or more machine readable media having executable code stored thereon that, when executed, causes a processor to perform the data processing method of any of claims 1-8.
CN201910108105.1A 2019-02-02 2019-02-02 Data processing method, device, electronic equipment and storage medium Active CN111539183B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910108105.1A CN111539183B (en) 2019-02-02 2019-02-02 Data processing method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910108105.1A CN111539183B (en) 2019-02-02 2019-02-02 Data processing method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111539183A CN111539183A (en) 2020-08-14
CN111539183B true CN111539183B (en) 2023-05-23

Family

ID=71974782

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910108105.1A Active CN111539183B (en) 2019-02-02 2019-02-02 Data processing method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111539183B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105867897A (en) * 2015-12-07 2016-08-17 乐视网信息技术(北京)股份有限公司 Page redirection analysis method and apparatus
CN107659430A (en) * 2017-08-14 2018-02-02 北京三快在线科技有限公司 A kind of Node Processing Method, device, electronic equipment and computer-readable storage medium
CN108595573A (en) * 2018-04-16 2018-09-28 Oppo广东移动通信有限公司 page display method, device, storage medium and electronic equipment
CN108958612A (en) * 2018-06-14 2018-12-07 北京字节跳动网络技术有限公司 Control method, control page method, system, equipment and the computer readable storage medium of page sliding

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7073137B2 (en) * 2000-10-30 2006-07-04 Microsoft Corporation System and method for user interface mirroring utilizing a layout manager
US20100067113A1 (en) * 2008-09-18 2010-03-18 Matthew John Harrison Apparatus and Method for Displaying Hierarchical Data
US8108766B2 (en) * 2009-03-20 2012-01-31 Xerox Corporation XPath-based display of a paginated XML document
US8161384B2 (en) * 2009-04-23 2012-04-17 Hewlett-Packard Development Company, L.P. Arranging graphic objects on a page with text

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105867897A (en) * 2015-12-07 2016-08-17 乐视网信息技术(北京)股份有限公司 Page redirection analysis method and apparatus
CN107659430A (en) * 2017-08-14 2018-02-02 北京三快在线科技有限公司 A kind of Node Processing Method, device, electronic equipment and computer-readable storage medium
CN108595573A (en) * 2018-04-16 2018-09-28 Oppo广东移动通信有限公司 page display method, device, storage medium and electronic equipment
CN108958612A (en) * 2018-06-14 2018-12-07 北京字节跳动网络技术有限公司 Control method, control page method, system, equipment and the computer readable storage medium of page sliding

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于PyQt的全文搜索引擎平台开发";张文超等;《软件导刊》;第17卷(第9期);第132-135页 *

Also Published As

Publication number Publication date
CN111539183A (en) 2020-08-14

Similar Documents

Publication Publication Date Title
US9710944B2 (en) Electronic document thinning
WO2017177931A1 (en) Text information display method and apparatus, and mobile device
WO2017162061A1 (en) Mixed view display method and device
JP2019510309A (en) Method and apparatus for reusing ListCell in hybrid applications
WO2015196822A1 (en) Method and device for adapting webpage to screen layout
US20130036196A1 (en) Method and system for publishing template-based content
US20210067825A1 (en) Display device and content providing method thereof
CN106649369A (en) Adjustment method and device for window display
WO2019011141A1 (en) Startup and configuration method, apparatus and device, medium, and operating system
KR20180019158A (en) METHOD AND DEVICE FOR PREVIEWING A DYNAMIC IMAGE, AND METHOD AND DEVICE FOR DISPLAYING A DISPLAY PACKAGE
US10572572B2 (en) Dynamic layout generation for an electronic document
CN112835499A (en) Carousel graph display method, device, equipment and medium
CN111931093A (en) Display method of table in page and mobile terminal
US20140019849A1 (en) Extensible Content Focus Mode
CN111859865A (en) Method, device, terminal and medium for converting PDF document
CN110443772A (en) Image processing method, device, computer equipment and storage medium
CN109284101B (en) Method and device for changing association of object attributes
CN105868201B (en) Page generation method and device
CN107621951B (en) View level optimization method and device
CN111539183B (en) Data processing method, device, electronic equipment and storage medium
CN112528614A (en) Table editing method and device and electronic equipment
CN106843819B (en) Object serialization method and device
CN112527424A (en) Control method and device for popup window
CN107977923B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN110968811A (en) Display control 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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20240223

Address after: 51 Belarusian Road, Singapore

Patentee after: Alibaba Singapore Holdings Ltd.

Country or region after: Singapore

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: ALIBABA GROUP HOLDING Ltd.

Country or region before: Cayman Islands

TR01 Transfer of patent right