Relative layout-based control measurement method, device and equipment
By obtaining the layout attributes and dependencies of the controls in the Android operating system, optimizing the relative layout control measurement process, solving the problem of control measurement time and high calculation overhead, and achieving more efficient measurement.
Patent Information
- Application Number
- CN202310531261.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-11
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2043-05-11
AI Technical Summary
In the Android operating system, during the control measurement process based on relative layout, each control needs to be measured twice in the horizontal and vertical directions, resulting in a large time-consuming and computational overhead.
By obtaining the layout properties of the control, determining its dependencies, and generating marking results, if the control does not rely on other controls in a certain direction, the measurement of that direction is skipped and the measurement process is optimized.
Reduces the number of times the control measures, reduces the calculation overhead, and improves the measurement efficiency.
Smart Images

Figure CN118939892A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a control measurement method, device and equipment based on relative layout. Background Art
[0002] Relative Layout is a layout method for page controls in the Android operating system. The display position of each control in the page is determined based on the relative position between controls. In the process of realizing page display through relative layout, the width and height of each control must be measured first, and then the page display is realized based on the constraints of each control defined by the relative layout.
[0003] In the process of measuring controls, each control currently needs to be measured once in the horizontal direction and once in the vertical direction. The measurement process is time-consuming and has high computational overhead. Summary of the invention
[0004] In view of this, embodiments of the present application provide a method, apparatus, and device for measuring controls based on relative layout to optimize the process of measuring controls based on relative layout.
[0005] To solve the above problems, the technical solutions provided in the embodiments of the present application are as follows:
[0006] In a first aspect, an embodiment of the present application provides a control measurement method based on relative layout, the method comprising:
[0007] Get the layout properties of controls based on relative layout;
[0008] Determine, according to the layout properties of the control, a dependency relationship of a target control, wherein the dependency relationship includes a set of controls that the target control depends on, and the target control is one of the controls;
[0009] Generate a marking result of whether the target control depends on other controls in a first direction and a second direction according to the dependency relationship;
[0010] The marking result is read when measuring the target control. If the target control does not depend on other controls in the target direction, the measurement of the target control in the target direction is skipped. The target direction is the first direction or the second direction.
[0011] In a second aspect, an embodiment of the present application provides a control measurement device based on relative layout, the device comprising:
[0012] The acquisition unit is used to obtain the layout properties of the control based on the relative layout;
[0013] A determining unit, configured to determine a dependency relationship of a target control according to a layout property of the control, wherein the dependency relationship includes a set of controls that the target control depends on, and the target control is one of the controls;
[0014] A generating unit, configured to generate, according to the dependency relationship, a marking result of whether the target control depends on other controls in a first direction and a second direction;
[0015] A measuring unit is used to read the marking result when measuring the target control, and if the target control does not depend on other controls in the target direction, skip measuring the target control in the target direction, and the target direction is the first direction or the second direction.
[0016] In a third aspect, an embodiment of the present application provides a control measurement device based on relative layout, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the control measurement method based on relative layout as described above is implemented.
[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes the relative layout-based control measurement method as described above.
[0018] It can be seen that the embodiments of the present application have the following beneficial effects:
[0019] In an embodiment of the present application, the layout properties of the controls of the relative layout are first obtained, and the dependency relationship of any control can be determined by the layout properties, so as to mark whether any control depends on other controls in the first direction and the second direction, and obtain the marking result. In the process of measuring any control, the marking result of the control is read. If the control does not depend on other controls in the first direction, the measurement of the control is skipped in the first direction. Similarly, if the control does not depend on other controls in the second direction, the measurement of the control is skipped in the second direction. Since the measurement of some controls is skipped, the current two measurements for each control can be optimized to only one measurement for some controls, which reduces the time consumption of the measurement process and reduces the calculation overhead. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic diagram of an exemplary application scenario provided for an embodiment of the present application;
[0021] Figure 2 A flowchart of a control measurement method based on relative layout provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of a target control provided in an embodiment of the present application that depends on a parent view;
[0023] Figure 4 A schematic diagram of a target control provided in an embodiment of the present application that depends on controls at the same level;
[0024] Figure 5 An example flow chart of a control measurement method based on relative layout in the prior art;
[0025] Figure 6 An example flow chart of a control measurement method based on relative layout provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of a control measurement device based on relative layout provided in an embodiment of the present application;
[0027] Figure 8 A schematic diagram of a device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0029] In order to facilitate understanding and explanation of the technical solution provided by the embodiments of the present application, the background technology of the embodiments of the present application will be described below.
[0030] Relative layout is a layout method for page controls in the Android operating system. The display position of each control in the page is determined based on the relative position between controls (Views). For example, the parent view of a control or other controls at the same level can be used as a reference to determine the display position of the control. In the process of realizing page display through relative layout, the width and height of each control must be measured first, and then the page display is realized based on the constraints on each control defined by the relative layout.
[0031] In actual applications, the onMeasure method in the source code of the Android operating system can be used to measure controls. Currently, the measurement of controls requires measuring the width and height of each control in the horizontal direction and the vertical direction, which results in a long measurement process and high calculation overhead, and there is room for optimization.
[0032] Based on this, the embodiments of the present application provide a control measurement method, device and equipment based on relative layout, which optimizes the two measurements of some controls to one measurement in certain scenarios to reduce the time consumption of the measurement process and reduce the computing overhead.
[0033] In order to facilitate understanding of the control measurement method based on relative layout provided in the embodiment of the present application, Figure 1 See the example scenario shown. Figure 1 As shown, this figure is a schematic diagram of an exemplary application scenario provided in an embodiment of the present application.
[0034] The embodiments of the present application can be applied to a device that displays a page based on a relative layout, and during the process of displaying the page, the measurement process of the controls in the page is optimized.
[0035] First, the relevant information of the relative layout can be obtained, such as the layout properties of the controls contained in the relative layout. The layout properties of the controls can be understood as the relevant parameters that define how the controls are displayed on the page. According to the layout properties of the controls, the dependency relationship of a target control can be determined. The dependency relationship includes the set of controls that the target control depends on, and the dependency relationship can also include the set of controls that depend on the target control. Thus, it is possible to mark whether the target control depends on other controls in the first direction and the second direction, and obtain and save the marking results. Among them, when the first direction is the horizontal direction, the second direction is the vertical direction; when the first direction is the vertical direction, the second direction is the horizontal direction.
[0036] In the process of measuring a control, the marking result of the control is read, and whether to skip the measurement of the control can be determined according to the marking result. Specifically, if the control does not depend on other controls in the first direction, the measurement of the control is skipped in the first direction. Similarly, if the control does not depend on other controls in the second direction, the measurement of the control is skipped in the second direction. In this way, only one measurement is performed on some controls, which reduces the time consumption of the measurement process and reduces the calculation overhead.
[0037] Those skilled in the art will understand that Figure 1 The framework diagram shown is only an example in which the embodiments of the present application can be implemented. The scope of application of the embodiments of the present application is not limited by any aspect of the framework.
[0038] To facilitate understanding of the embodiments of the present application, a control measurement method based on relative layout provided in the embodiments of the present application is described below with reference to the accompanying drawings.
[0039] See also Figure 2 As shown in FIG. 1 , this figure is a flow chart of a control measurement method based on relative layout provided in an embodiment of the present application, such as Figure 2 As shown, the method may include S201-S204:
[0040] S201: Obtaining layout properties of controls based on relative layout.
[0041] In an embodiment of the present application, first obtain relevant information about the relative layout, such as the layout properties of the controls in the relative layout. The layout properties of the controls define the relevant parameters of how the controls are displayed on the page. For example, the layout properties of the controls may include horizontal properties, vertical properties, etc. The horizontal properties may include the controls that the control depends on in the horizontal direction and the relative position relationship therewith, or the relative position relationship between the control and the parent view in the horizontal direction, or the display position of the control in the horizontal direction. For example, the horizontal properties of control A include: control A depends on control B in the horizontal direction, and control A is offset 10 pixels to the right of control B. For another example, the horizontal properties of control A include: control A depends on the parent view in the horizontal direction, and is 10 pixels away from the left boundary of the parent view in the horizontal direction. Similarly, the vertical properties may include the controls that the control depends on in the vertical direction and the relative position relationship therewith, or the relative position relationship between the control and the parent view in the vertical direction, or the display position of the control in the vertical direction.
[0042] S202: Determine the dependency relationship of the target control according to the layout properties of the control, where the dependency relationship includes a set of controls that the target control depends on, and the target control is one of the controls.
[0043] Through the layout properties of the controls, the dependency of the target control can be further determined. The target control is any one of the controls, and the dependency of each control can be determined separately. The dependency of the target control includes the set of controls that the target control depends on, and the dependency of the target control can also include the set of controls that depend on the target control. Through the dependency of the target control, the controls that the target control depends on can be counted to obtain the set of controls that the target control depends on. At the same time, the controls that the target control depends on can be counted to obtain the set of controls that depend on the target control. The target control's dependence on other controls can be understood as the target control needs to determine its own position based on the positions of other controls, and the target control being dependent on other controls can be understood as other controls need to determine their own positions based on the position of the target control.
[0044] In a specific implementation, the dependency of the target control in the first direction and the second direction can be determined respectively. When the first direction is a horizontal direction, the second direction is a vertical direction, or, when the first direction is a vertical direction, the second direction is a horizontal direction. The set of controls that the target control depends on may include other controls that the target control depends on in the first direction and other controls that the target control depends on in the second direction, such as the same-level controls that the target control depends on in the first direction and the same-level controls that the target control depends on in the second direction. Similarly, the set of controls that depend on the target control may include other controls that depend on the target control in the first direction and other controls that depend on the target control in the second direction. For example, in the first direction, control A depends on control B, control D depends on control B, and control B depends on control C. If control B is the target control, the set of controls that control B depends on includes the control that control B depends on in the first direction as control C. The set of controls that depend on control B includes the controls that depend on control B in the first direction as control A and control D. It can be understood that each control has a control identifier, and the dependency relationship can be counted through the control identifier.
[0045] S203: Generate a marking result of whether the target control depends on other controls in the first direction and the second direction according to the dependency relationship.
[0046] After determining the dependency of the target control, it is possible to mark whether the target control depends on other controls in the first direction and the second direction, respectively, and obtain and save the marking results. For example, it is possible to mark whether it depends on other controls by 1 or 0. Whether it depends on other controls here specifically refers to whether it depends on controls at the same level.
[0047] In a possible implementation, the specific implementation of S203 generating a marking result of whether the target control depends on other controls in the first direction and the second direction according to the dependency relationship of the target control may include:
[0048] If it is determined according to the dependency relationship of the target control that the target control depends on the parent view, a marking result is generated indicating that the target control does not depend on other controls in both the first direction and the second direction.
[0049] In one possible case, the target control can depend on the parent view. In this case, the target control does not depend on the same-level control in the first direction and the second direction. Then, a markup result is generated that the target control does not depend on other controls in the first direction and the second direction. Figure 3 As shown, a schematic diagram of the target control's dependence on the parent view is shown. For example, the target control is 10 pixels away from the left border of the parent view in the horizontal direction. At this time, the target control does not depend on the same level control in the first direction and the second direction, and the marking result is generated based on this.
[0050] In a possible implementation, the specific implementation of S203 generating a marking result of whether the target control depends on other controls in the first direction and the second direction according to the dependency relationship of the target control may include:
[0051] If the control set that the target control depends on includes controls at the same level as the target control in the first direction, a marking result that the target control depends on other controls in the first direction is generated;
[0052] If the control set that the target control depends on does not include the control at the same level as the target control in the first direction, a marking result is generated indicating that the target control does not depend on other controls in the first direction;
[0053] If the control set that the target control depends on includes the same-level control as the target control in the second direction, a marking result that the target control depends on other controls in the second direction is generated;
[0054] If the control set that the target control depends on does not include the same-level control as the target control in the second direction, a marking result is generated indicating that the target control does not depend on other controls in the second direction.
[0055] In another possible situation, the target control may depend on the same-level control in the first direction and / or the second direction, and a marking result is generated according to whether it depends on the same-level control. Specifically, the set of controls that the target control depends on includes the same-level control of the target control in the first direction, which means that the target control depends on the same-level control in the first direction, and a marking result is generated that the target control depends on other controls in the first direction; the set of controls that the target control depends on does not include the same-level control of the target control in the first direction, which means that the target control does not depend on the same-level control in the first direction, and a marking result is generated that the target control does not depend on other controls in the first direction. Similarly, the set of controls that the target control depends on includes the same-level control of the target control in the second direction, which means that the target control depends on the same-level control in the second direction, and a marking result is generated that the target control depends on other controls in the second direction; the set of controls that the target control depends on does not include the same-level control of the target control in the second direction, which means that the target control does not depend on the same-level control in the second direction, and a marking result is generated that the target control does not depend on other controls in the second direction.
[0056] See also Figure 4As shown, a schematic diagram is shown in which the target control depends on controls of the same level. For example, the target control depends on control A of the same level in a first direction (such as horizontal direction), and a marking result is generated that the target control depends on other controls in the first direction. At the same time, the target control depends on control B of the same level in a second direction (such as vertical direction), and a marking result is generated that the target control depends on other controls in the second direction.
[0057] S204: reading the marking result when measuring the target control, if the target control does not depend on other controls in the target direction, skipping the measurement of the target control in the target direction, the target direction is the first direction or the second direction.
[0058] When measuring each control one by one in the target direction, you can use each control as a target control and read the corresponding tag result. If the target control does not depend on other controls in the target direction, it means that the position can be determined by itself in the target direction, and the measurement of the target control can be skipped in the target direction. If the target control depends on other controls in the target direction, the target control is measured normally in the target direction. The measurement refers to measuring the width and height of the target control.
[0059] The target direction may be the first direction or the second direction, that is, during the measurement of each control in the first direction, if the target control does not rely on other controls in the first direction, the measurement of the target control is skipped in the first direction, and if the target control relies on other controls in the first direction, the target control is measured normally in the first direction. Similarly, during the measurement of each control in the second direction, if the target control does not rely on other controls in the second direction, the measurement of the target control is skipped in the second direction, and if the target control relies on other controls in the second direction, the target control is measured normally in the second direction. When the target control relies on other controls in both the first and second directions, the target control is measured in both the first and second directions, and the second measurement may adjust the measurement result of the first measurement. In addition, the embodiment of the present application does not limit whether the measurement process of each control in the first direction or the measurement process of each control in the second direction is performed first.
[0060] In order to ensure that each control is measured at least once, in a possible implementation, the control measurement method based on relative layout provided in the embodiment of the present application may also include: if the target control does not depend on other controls in the first direction and the second direction, measuring the target control in the first direction or the second direction.
[0061] That is, if the target control does not rely on other controls in the first direction and the second direction, the target control also needs to be measured once to ensure that each control is measured. In a specific implementation, the measurement can be performed in the first direction or the second direction.
[0062] Based on the description of S201-S204, firstly, the layout properties of the controls of the relative layout are obtained. The dependency relationship of any control can be determined by the layout properties, so as to mark whether any control depends on other controls in the first direction and the second direction, and obtain the marking result. In the process of measuring any control, the marking result of the control is read. If the control does not depend on other controls in the first direction, the measurement of the control is skipped in the first direction. Similarly, if the control does not depend on other controls in the second direction, the measurement of the control is skipped in the second direction. Since the measurement of some controls is skipped, the current two measurements for each control can be optimized to only one measurement for some controls, which reduces the time consumption of the measurement process and reduces the calculation overhead.
[0063] In a possible implementation, the relative layout-based control measurement method provided in the embodiment of the present application may further include:
[0064] The measurement order of the controls in the first direction and the second direction is sorted according to the layout properties of the controls.
[0065] When performing dependency analysis on controls, the measurement order of each control can also be sorted in the first direction and the second direction respectively, and the controls with the highest order will be measured first during the measurement process. The sorting can be determined according to the dependency order. For example, in the first direction, control A depends on control B, control B depends on control C, and control C depends on control D. Then the measurement order in the first direction is control D, control C, control B, and control A.
[0066] In a possible implementation, S204 reads the marking result when measuring the target control. If the target control does not depend on other controls in the target direction, the specific implementation of skipping the measurement of the target control in the target direction may include:
[0067] According to the measurement order of the controls in the first direction, the controls are taken as target controls one by one, and the marking results of the target controls are read. If the target control does not depend on other controls in the first direction, the measurement of the target control in the first direction is skipped;
[0068] According to the measurement order of the controls in the second direction, the controls are taken as target controls one by one, and the marking results of the target controls are read. If the target control does not depend on other controls in the second direction, the measurement of the target control in the second direction is skipped.
[0069] In an embodiment of the present application, the controls may be measured one by one in the first direction according to the measurement order, and then the controls may be measured one by one in the second direction. During the measurement process, if the measurement of the control needs to be skipped according to the marking result, it is skipped, thereby reducing the number of measurements of some controls. If the measurement of the control does not need to be skipped according to the marking result, the measurement is performed normally, that is, if the target control depends on other controls in the first direction, the target control is measured in the first direction, and if the target control depends on other controls in the second direction, the target control is measured in the second direction.
[0070] See also Figure 5 As shown, an exemplary flow chart of a control measurement method based on relative layout in the prior art is shown. In the original process, the measurement process is started using the onMeasure method in the relative layout. First, the measurement order of the controls (views) is sorted. The sorting method is named sortChildren. The width and height of each control are measured in a horizontal direction in a loop according to the horizontal measurement order. The width and height of each control are measured in a vertical direction in a loop according to the vertical measurement order until the onMeasure execution is completed.
[0071] See also Figure 6As shown, an exemplary flow chart of a control measurement method based on relative layout provided by an embodiment of the present application is shown. In practical applications, the embodiment of the present application uses a new onMeasure method to start the measurement process. In order to implement the method provided by the embodiment of the present application, a subclass that inherits RelativeLayout can be customized and the original RelativeLayout.onMeasure method can be skipped. First, the measurement order of the controls (views) is sorted. In order to implement dependency analysis during the sorting process, that is, to generate the marking results of whether the target control depends on other controls in the first direction and the second direction, the sortChildren method needs to be modified. The modification method is to copy it in the subclass, and copy the DependencyGraph class that generates the marking results, and pass the marking object in the getSortedViews method to record the marking results. Then, according to the measurement order in the horizontal direction, the width and height of each control are measured in a loop in the horizontal direction, and the control that is not dependent on the horizontal direction is skipped during the measurement process. According to the measurement order in the vertical direction, the width and height of each control are measured in a loop in the vertical direction, and the control that is not dependent on the vertical direction is skipped during the measurement process until the onMeasure execution ends. In order to skip the measurement process of some controls, the previously saved marking results are obtained in the loop measurement to skip unnecessary measurements in time. After the measurement of each control is completed, other functions in the original onMeasure method complete the execution of the original functions through Hook. In actual applications, the number of control measurements is reduced and the measurement speed is improved.
[0072] Based on the relative layout-based control measurement method provided in the above method embodiment, the embodiment of the present application also provides a relative layout-based control measurement device, which will be described below in conjunction with the accompanying drawings.
[0073] See also Figure 7 As shown in FIG. 1 , this figure is a schematic diagram of a control measurement device based on relative layout provided in an embodiment of the present application. Figure 7 As shown, the device comprises:
[0074] An acquisition unit 701 is used to acquire layout properties of controls based on relative layout;
[0075] A determining unit 702, configured to determine a dependency relationship of a target control according to a layout property of the control, wherein the dependency relationship includes a set of controls that the target control depends on, and the target control is one of the controls;
[0076] A generating unit 703 is used to generate a marking result of whether the target control depends on other controls in a first direction and a second direction according to the dependency relationship;
[0077] The measuring unit 704 is used to read the marking result when measuring the target control. If the target control does not depend on other controls in the target direction, the measurement of the target control in the target direction is skipped. The target direction is the first direction or the second direction.
[0078] In a possible implementation manner, the measuring unit is further configured to:
[0079] If the target control does not depend on other controls in the first direction or the second direction, the target control is measured in the first direction or the second direction.
[0080] In a possible implementation manner, the generating unit is specifically configured to:
[0081] If it is determined according to the dependency relationship of the target control that the target control depends on the parent view, a marking result is generated indicating that the target control does not depend on other controls in both the first direction and the second direction.
[0082] In a possible implementation, the generating unit is specifically configured to:
[0083] If the control set that the target control depends on includes controls at the same level as the target control in the first direction, generating a marking result that the target control depends on other controls in the first direction;
[0084] If the control set that the target control depends on does not include a control at the same level as the target control in the first direction, generating a marking result indicating that the target control does not depend on other controls in the first direction;
[0085] If the control set that the target control depends on includes controls at the same level as the target control in the second direction, generating a marking result that the target control depends on other controls in the second direction;
[0086] If the control set that the target control depends on does not include controls at the same level as the target control in the second direction, a marking result is generated indicating that the target control does not depend on other controls in the second direction.
[0087] In a possible implementation manner, the device further includes:
[0088] A sorting unit is used to sort the measurement order of the controls in a first direction and a second direction according to the layout attributes of the controls.
[0089] In a possible implementation, the measuring unit includes:
[0090] A first measurement subunit is used to take the controls as target controls one by one according to the measurement order of the controls in the first direction, read the marking results of the target controls, and skip measuring the target controls in the first direction if the target controls do not depend on other controls in the first direction;
[0091] The second measurement subunit is used to take the controls as target controls one by one in the measurement order of the controls in the second direction, read the marking results of the target controls, and skip the measurement of the target control in the second direction if the target control does not depend on other controls in the second direction.
[0092] In a possible implementation manner, the first direction is a horizontal direction, and the second direction is a vertical direction, or the first direction is a vertical direction, and the second direction is a horizontal direction.
[0093] Based on the relative layout-based control measurement method provided in the above method embodiment, the present application also provides an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, when the one or more programs are executed by the one or more processors, the one or more processors implement the relative layout-based control measurement method described in any of the above embodiments.
[0094] Reference below Figure 8 , which shows a schematic diagram of the structure of an electronic device 1300 suitable for implementing the embodiment of the present application. The terminal device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (portable android devices), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs (televisions), desktop computers, etc. Figure 8 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0095] like Figure 8As shown, the electronic device 1300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1302 or a program loaded from a storage device 1306 into a random access memory (RAM) 1303. In the RAM 1303, various programs and data required for the operation of the electronic device 1300 are also stored. The processing device 1301, the ROM 1302, and the RAM 1303 are connected to each other via a bus 1304. An input / output (I / O) interface 1305 is also connected to the bus 1304.
[0096] Typically, the following devices may be connected to the I / O interface 1305: an input device 1306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1306 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1309. The communication device 1309 may allow the electronic device 1300 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device 1300 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0097] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1309, or installed from the storage device 1306, or installed from the ROM 1302. When the computer program is executed by the processing device 1301, the above-mentioned functions defined in the method of the embodiment of the present application are executed.
[0098] The electronic device provided in the embodiment of the present application and the control measurement method based on relative layout provided in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0099] Based on the relative layout-based control measurement method provided in the above method embodiment, an embodiment of the present application provides a computer-readable medium on which a computer program is stored, wherein when the program is executed by a processor, the relative layout-based control measurement method as described in any of the above embodiments is implemented.
[0100] It should be noted that the computer-readable medium in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In an embodiment of the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In an embodiment of the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0101] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0102] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0103] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the relative layout-based control measurement method.
[0104] The computer program code for performing the operation of the embodiment of the present application can be written in one or more programming languages or a combination thereof, and the above-mentioned programming languages include but are not limited to object-oriented programming languages-such as Java, Smalltalk, C++, and also include conventional procedural programming languages-such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network-including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0105] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0106] The units involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the unit / module does not, in some cases, constitute a limitation on the unit itself.
[0107] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0108] In the context of the present application embodiment, machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable medium can include but is not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the above. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0109] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0110] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0111] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0112] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0113] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A control measurement method based on relative layout, characterized in that: The method comprises: Get the layout properties of controls based on relative layout; Determine, according to the layout properties of the control, a dependency relationship of a target control, wherein the dependency relationship includes a set of controls that the target control depends on, and the target control is one of the controls; Generate a marking result of whether the target control depends on other controls in a first direction and a second direction according to the dependency relationship; The marking result is read when measuring the target control. If the target control does not depend on other controls in the target direction, the measurement of the target control in the target direction is skipped. The target direction is the first direction or the second direction.
2. The method according to claim 1, characterized in that The method further comprises: If the target control does not depend on other controls in the first direction or the second direction, the target control is measured in the first direction or the second direction.
3. The method according to claim 1, characterized in that The generating, according to the dependency relationship of the target control, a marking result of whether the target control depends on other controls in the first direction and the second direction includes: If it is determined according to the dependency relationship of the target control that the target control depends on the parent view, a marking result is generated indicating that the target control does not depend on other controls in both the first direction and the second direction.
4. The method according to claim 1, characterized in that: The generating, according to the dependency relationship of the target control, a marking result of whether the target control depends on other controls in the first direction and the second direction includes: If the control set that the target control depends on includes controls at the same level as the target control in the first direction, generating a marking result that the target control depends on other controls in the first direction; If the control set that the target control depends on does not include a control at the same level as the target control in the first direction, generating a marking result indicating that the target control does not depend on other controls in the first direction; If the control set that the target control depends on includes controls at the same level as the target control in the second direction, generating a marking result that the target control depends on other controls in the second direction; If the control set that the target control depends on does not include controls at the same level as the target control in the second direction, a marking result is generated indicating that the target control does not depend on other controls in the second direction.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: The measurement order of the controls is sorted in a first direction and a second direction according to the layout attributes of the controls.
6. The method according to claim 5, characterized in that The step of reading the marking result when measuring the target control, and skipping the measurement of the target control in the target direction if the target control does not depend on other controls in the target direction, includes: According to the measurement order of the controls in the first direction, the controls are taken as target controls one by one, and the marking results of the target controls are read. If the target control does not depend on other controls in the first direction, the measurement of the target control in the first direction is skipped; According to the measurement order of the controls in the second direction, the controls are taken as target controls one by one, and the marking results of the target controls are read. If the target control does not depend on other controls in the second direction, the measurement of the target control in the second direction is skipped.
7. The method according to any one of claims 1 to 6, characterized in that: The first direction is a horizontal direction and the second direction is a vertical direction, or the first direction is a vertical direction and the second direction is a horizontal direction.
8. A control measurement device based on relative layout, characterized in that: The device comprises: The acquisition unit is used to obtain the layout properties of the control based on the relative layout; A determining unit, configured to determine a dependency relationship of a target control according to a layout property of the control, wherein the dependency relationship includes a set of controls that the target control depends on, and the target control is one of the controls; A generating unit, configured to generate, according to the dependency relationship, a marking result of whether the target control depends on other controls in a first direction and a second direction; A measuring unit is used to read the marking result when measuring the target control, and if the target control does not depend on other controls in the target direction, skip measuring the target control in the target direction, and the target direction is the first direction or the second direction.
9. A control measurement device based on relative layout, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the relative layout-based control measurement method as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the relative layout-based control measurement method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Optical system, in particular in a microlithographic projection exposure apparatus
CN102648402A
Control layout method and system based on intelligent filtering
CN108363571A
Page loading method and apparatus
CN110489682A
Display interface layout method, and electronic equipment
CN114077429A
Methods and systems for the industrial internet of things
WO2019094729A1
