WO2022160727A1 - Docking operation method for component, and terminal - Google Patents

Docking operation method for component, and terminal Download PDF

Info

Publication number
WO2022160727A1
WO2022160727A1 PCT/CN2021/117525 CN2021117525W WO2022160727A1 WO 2022160727 A1 WO2022160727 A1 WO 2022160727A1 CN 2021117525 W CN2021117525 W CN 2021117525W WO 2022160727 A1 WO2022160727 A1 WO 2022160727A1
Authority
WO
WIPO (PCT)
Prior art keywords
component
drag operation
editing interface
moving speed
terminal
Prior art date
Application number
PCT/CN2021/117525
Other languages
French (fr)
Chinese (zh)
Inventor
王少星
Original Assignee
北京达佳互联信息技术有限公司
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 北京达佳互联信息技术有限公司 filed Critical 北京达佳互联信息技术有限公司
Publication of WO2022160727A1 publication Critical patent/WO2022160727A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0486Drag-and-drop
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance

Definitions

  • the present disclosure relates to the field of network technologies, and in particular, to an adsorption operation method and a terminal of a component.
  • the web page supports the component editing function, and the user usually completes the editing operation on the component by means of the mouse.
  • the web page often provides auxiliary functions for the component. For example, when the distance between the component and the target component in the current interface is relatively short, the component is provided with an adsorption function, that is, the component is adsorbed to the target component.
  • the terminal calculates the distance between the component and the target component in the current interface in real time, and in response to the distance between the component and the target component being less than the preset distance, then Snap the component to the target component.
  • the present disclosure provides an adsorption operation method and terminal of a component.
  • the technical solutions of the present disclosure are as follows:
  • an adsorption operation method for a component which is performed by a terminal, including:
  • the terminal when the user wants to adsorb two components together, by dragging one of the components, the terminal can automatically determine a The target component is automatically adsorbed to the target component, which reduces the adsorption time and improves the operation efficiency of component editing.
  • an adsorption operation device for components including:
  • a display unit configured to display a component editing interface, where the component editing interface includes a plurality of editable components
  • a determining unit configured to determine at least one second component in response to a drag operation of the first component in the component editing interface
  • the determining unit is configured to determine a target component from the at least one second component based on the distance between the first component and each second component and the moving speed of the dragging operation;
  • the adsorption unit is configured to adsorb the first component to the target component.
  • a terminal including:
  • memory for storing instructions executable by the processor
  • the processor is configured to execute the instruction, so as to realize the above-mentioned component adsorption operation method.
  • a non-volatile storage medium is provided.
  • the terminal can perform the adsorption operation method of the above-mentioned components. .
  • a computer program product including computer programs/instructions, when the computer program/instructions are executed by a processor, the above-mentioned component adsorption operation method is implemented.
  • FIG. 1 is an implementation environment diagram of an adsorption operation method of a component according to an exemplary embodiment
  • FIG. 2 is a flow chart of a method for adsorbing a component according to an exemplary embodiment
  • FIG. 3 is a flow chart of a method for adsorbing a component according to an exemplary embodiment
  • Fig. 4 is a schematic diagram showing an adsorption operation method of a component according to an exemplary embodiment
  • Fig. 5 is a schematic diagram showing an adsorption operation method of a component according to an exemplary embodiment
  • FIG. 6 is a schematic diagram illustrating an adsorption operation method of a component according to an exemplary embodiment
  • Fig. 7 is a schematic diagram showing an adsorption operation method of a component according to an exemplary embodiment
  • Fig. 8 is a schematic diagram showing an adsorption operation method of a component according to an exemplary embodiment
  • FIG. 9 is a flow chart of a method for adsorbing a component according to an exemplary embodiment
  • Fig. 10 is a block diagram of an adsorption operation device of a component according to an exemplary embodiment
  • Fig. 11 is a block diagram of a terminal according to an exemplary embodiment.
  • the user information involved in this disclosure is the information authorized by the user or fully authorized by all parties.
  • FIG. 1 is an implementation environment diagram of a component adsorption operation method according to an exemplary embodiment.
  • the implementation environment includes: a terminal 10 and a server 20 .
  • the terminal 10 and the server 20 communicate through a network.
  • a target application program associated with the server 20 is installed in the terminal 10 , and data interaction with the server 20 is realized through the target application program.
  • the terminal 10 obtains multiple editable components from the server 20 based on the target application, and then displays a component editing interface including multiple editable components, and the user edits the multiple editable components, for example, the user drags Move a component, change the shape of the component, edit the content displayed within the component.
  • the terminal 10 provides an auxiliary operation for the component, and the auxiliary operation includes a suction operation or adding an auxiliary line, etc.
  • the suction operation of a component is taken as an example Be explained.
  • the target application is any application that can realize the component editing function; for example, the target application is a browser, PPT (electronic slideshow), visio (a kind of drawing software) and other applications.
  • the terminal 10 is a mobile phone, a tablet computer, a PC (Personal Computer) device, a watch, a wearable device, an MP3 player (Moving Picture Experts Group Audio Layer III, moving image expert compression standard audio layer 3), MP4 (Moving Picture Experts Group Audio Layer III) IV, at least one of the moving image expert compression standard audio layer 4) player and other devices.
  • the server 20 is at least one of a server, multiple servers, a cloud server, a cloud computing platform and a virtualization center.
  • Fig. 2 is a flow chart of an adsorption operation method of a component according to an exemplary embodiment. As shown in Fig. 2 , the adsorption operation method of the component is performed by a terminal, and includes the following steps.
  • step S21 a component editing interface is displayed, and the component editing interface includes a plurality of editable components
  • step S22 in response to the drag operation of the first component in the component editing interface, at least one second component is determined
  • a target component is determined from the at least one second component based on the distance between the first component and each second component and the moving speed of the dragging operation;
  • step S24 the first component is adsorbed to the target component.
  • the terminal when the user wants to adsorb two components together, by dragging one of the components, the terminal can automatically determine a The target component is automatically adsorbed to the target component, which reduces the adsorption time and improves the operation efficiency of component editing.
  • determining at least one second component in response to a drag operation on the first component in the component editing interface includes:
  • At least one second component is determined from the component editing interface based on the moving direction of the drag operation.
  • determining at least one second component from the component editing interface based on a moving direction of the drag operation in response to a drag operation on the first component in the component editing interface includes:
  • the terminal determines, based on the moving direction of the drag operation, the component located in the moving direction in the component editing interface as the second component.
  • the determining the target component from the at least one second component based on the distance between the first component and each second component and the movement speed of the drag operation includes:
  • the target component is determined from the at least one second component based on the distance between the first component and each second component, the first component The distance between the component and this target component is not greater than the distance threshold.
  • the method further includes:
  • the moving speed of the dragging operation is not greater than the first speed threshold and greater than the second speed threshold
  • the first component in response to the slowing down of the moving speed of the dragging operation, the first component is detached from the target component, and reducing the moving speed of the drag operation by a first preset multiple to obtain a first moving speed, and move the first component based on the first moving speed, wherein the second speed threshold is smaller than the first speed threshold.
  • the method further includes:
  • the moving speed of the drag operation is not greater than the second speed threshold, reduce the moving speed of the drag operation by a second preset multiple to obtain a second moving speed, and move the first component based on the second moving speed , wherein the second speed threshold is less than the first speed threshold;
  • the first component In response to the moving direction of the drag operation changing, and the distance between the first component and the target component is greater than the distance threshold, the first component is moved based on the moving speed of the drag operation.
  • the method further includes:
  • the first component is moved based on the moving speed of the drag operation.
  • the method further includes:
  • a prompt area is determined in the component editing interface, and the distance between the first component and the target component is displayed in the prompt area.
  • the method further includes:
  • the method further includes:
  • the calculation thread is run, and through the calculation thread, the base terminal determines the component located in the movement direction in the component editing interface based on the movement direction of the drag operation as the second component.
  • the method further includes:
  • the computing thread is created by running the script file of the multi-threaded tool
  • the running the computing thread includes running the computing thread by means of the server through a communication connection between the terminal and the server.
  • FIG. 3 is a flow chart of a method for adsorbing a component according to an exemplary embodiment. As shown in FIG. 3 , the method for adsorbing a component is performed by a terminal, and includes the following steps.
  • step 301 the terminal displays a component editing interface, and the component editing interface includes a plurality of editable components.
  • the target application program is installed on the terminal, and the user triggers the target application program to trigger the terminal to display the home page interface corresponding to the target application program; in response to the user's trigger operation, the terminal displays the home page interface corresponding to the target application program, and the user can Add multiple components to the home page interface, and then trigger the terminal to display the component editing interface.
  • the home page interface includes a component area and an editing area, and the component area includes multiple components. The user drags and drops components in the component area to the editing area, thereby triggering the terminal to display the component editing interface.
  • the target application is any application such as browser, PPT or visio.
  • the component editing interface is a web page editing interface, and the web page editing interface includes multiple editable components downloaded from the server corresponding to the browser; for example, the target application is PPT or visio, etc. application, the component editing interface is a non-web page editing interface, and the non-web page editing interface includes multiple editable components stored locally in PPT or visio.
  • multiple editable components are the same type of components.
  • the plurality of editable components are different types of components.
  • the plurality of editable components are flowchart type components, electrical diagram type components, organization chart type components, and the like.
  • each component is the same shape.
  • each component has a different shape.
  • the shape of the component is heart, pentagram, circle, square, etc.
  • the multiple editable components are the same type of components as an example for description.
  • the component editing interface includes multiple editable components, namely A component, B component, C component, D component, E component, F component and G component.
  • the user edits the component by dragging, and in response to receiving the user's dragging operation, the terminal edits the component.
  • the terminal determines that the drag operation is received by: in response to the first component in the component editing interface being selected, the terminal changes the state of the first component from an inactive state to an active state, and in the first component When a component is in an activated state, in response to the first moving component being dragged, the terminal determines that the drag operation is received.
  • the components that are not selected in the component editing interface are still in an inactive state.
  • the first component is a B component
  • the mouse pointer stays on the B component
  • the mouse pointer is pressed, it is determined that the B component is selected, and the state of the B component is set to an active state. Since the A component is not selected, the A component is in an inactive state.
  • step 302 the terminal determines at least one second component in response to a drag operation of the first component in the component editing interface.
  • the first component is the component selected by the user, and the second component is any component other than the first component in the component editing interface.
  • the user can make the terminal adsorb the first component to the second component by dragging the first component.
  • snapping refers to automatically combining a component with other components without the need for continuous drag and drop operations on the component.
  • adsorption refers to the automatic combination (or automatic connection) of two or more components together.
  • adsorption refers to fitting the right side of component A with the left side of component B, or adsorption refers to completely overlapping the right side of component A with the left side of component B, Alternatively, the adsorption refers to overlapping the right side of the A component with the left part of the B component, which is not limited in the present disclosure.
  • this way of automatically combining two or more components together through adsorption is called an adsorption operation, which is not limited in the present disclosure.
  • the terminal before determining the at least one second component, the terminal needs to determine the moving direction of the drag operation. In some embodiments, this step is implemented by: the terminal determines the moving direction of the drag operation based on the current position of the first component before the drag and the current position after the drag.
  • the current position of the component is expressed as the coordinates of the component in the component editing interface, and the coordinates include the abscissa x and the ordinate y.
  • the representation of the moving direction can be set and changed according to requirements, which is not limited in the present disclosure.
  • the moving direction is decomposed into a horizontal direction and a vertical direction, for example, if the moving direction is upper left, the horizontal direction is left, and the vertical direction is up; in some embodiments, the moving direction is relative to the first Any direction of the component's upper left, lower left, upper right, lower right, right left, right right, upper right, and lower right.
  • the first component is component A
  • x1 is greater than x2
  • the horizontal direction is left
  • y1 is less than y2
  • the vertical direction is up
  • the horizontal direction and the vertical direction are combined into a moving direction to obtain the moving direction of the drag operation of dragging the A component. for the upper left.
  • the terminal determines the at least one second component by: determining at least one second component from the component editing interface based on the moving direction of the drag operation .
  • the terminal determines, based on the moving direction of the drag operation, a component located in the moving direction in the component editing interface as the second component. For example, the moving direction is divided into an upper left direction, and the terminal determines a component located in the upper left direction of the first component in the component editing interface as the second component.
  • the first component is the B component
  • the coordinates of the B component are (5, 4)
  • the moving direction is the upper left direction
  • the other components in the component editing interface are the A component, the C component, and the D component respectively.
  • E component, F component, G component and H component the coordinates of these components are (6, 3), (7, 3), (8, 2.5), (7, 1.5), (6.5, 2) and ( 6.5, 1), in the case that the abscissa of the A component is less than the abscissa of the B component, and the ordinate of the A component is greater than the ordinate of the A component, the terminal determines that the current position of the A component is located at the left and the top of the B component, This A component is determined as the second component.
  • the terminal after determining the at least one second component, the terminal composes the at least one second component into a component set.
  • the terminal can periodically determine the target component to be adsorbed by the first component, for example, the terminal determines the target component every 200 ms. Therefore, by forming at least one second component into a component set, it is convenient for the terminal to directly determine the target component from the component set when the target component is subsequently determined periodically, without the need to determine from the entire component editing interface, thereby reducing the need for The number of components to be compared when the terminal determines the target component, which improves the operation efficiency of component editing.
  • the terminal combines the at least one second component into a component set a.
  • the terminal when the terminal periodically determines the target component, the terminal can directly determine the target component from the component set a.
  • the terminal determines at least one second component based on the moving direction of the dragging operation, and further, in the subsequent editing operation process, it is only necessary to determine, from the at least one second component, the one that needs to be adsorbed by the first component.
  • the target component is sufficient, and there is no need to perform operations on all components in the component editing interface, thereby reducing the amount of computation in the component editing process and improving the operational efficiency of component editing.
  • step 303 for each second component, the terminal determines the distance between the first component and the second component based on the current location of the first component and the current location of the second component.
  • the terminal needs to start from the at least one first component.
  • a second component that is gradually approached by the first component is determined, that is, the distance between the second component and the first component decreases as the position of the first component changes.
  • the terminal determines the distance between the first component and the second component based on the current position and size information of the first component and the current position and size information of the second component.
  • the size information of the component indicates the width (width) and height (height) of the component.
  • the first component is component B
  • the current position of component B is (x1, y1)
  • the size information is width1, height1
  • the second component is component A
  • the current position of component A is (x2, y2)
  • the size information is width2, height2.
  • the difference between x1 and x2 is determined as the first difference
  • the difference between the first difference and width2 is determined as the second difference
  • the first difference is determined as the second difference.
  • the two difference values are used as the distance between the A component and the B component.
  • the distance between the two components is determined by the current positions of the two components, which provides data support for the subsequent determination of the target component.
  • the terminal before executing step 304, the terminal needs to determine the moving speed of the dragging operation, and execute step 304 based on the moving speed.
  • the terminal determines the moving speed of the drag operation by: the terminal determines the preset time closest to the current time. The displacement of the mouse pointer within the duration is set, and the ratio of the displacement to the preset duration is used as the moving speed of the dragging operation.
  • the preset duration can be set and changed according to requirements.
  • the embodiment of the present disclosure does not specifically limit the preset duration, for example, the preset duration is 200ms, 300ms, and the like.
  • the mouse pointer in determining the displacement of the mouse pointer, the mouse pointer always selects the first component.
  • the displacement of the mouse pointer is sampled every preset duration, and the real-time moving speed of the drag operation is determined by the displacement and the preset duration, thereby ensuring the accuracy of the moving speed.
  • step 304 the terminal determines a target component from the at least one second component based on the distance between the first component and each second component and the moving speed of the dragging operation.
  • the moving speed of the dragging operation is not fixed; for example, when the first component needs to be moved a large distance, the first component needs to be dragged quickly; When the first component moves a small distance, the first component needs to be dragged at a slow speed to prevent the moving speed from being too fast, causing the moving distance of the first component to exceed the required distance. Therefore, the terminal can determine to which second component the user wants to adsorb the first component based on the distance between the first component and each second component and the moving speed of the dragging operation.
  • the terminal determines whether the first component needs to be adsorbed to other components based on the moving speed of the drag operation. Illustratively, the following two cases are included.
  • the terminal when the moving speed of the drag operation is relatively large, in order to save computing resources, the terminal does not determine the target component. In some embodiments, when the moving speed of the drag operation is greater than the first speed threshold, the terminal moves the first component based on the movement speed of the drag operation.
  • the first speed threshold can be set and changed according to requirements, which is not limited in this embodiment of the present disclosure; for example, the first speed threshold is 1 pixel/20ms.
  • the terminal does not determine the target component, that is, does not adsorb the first component to other components , thereby reducing the waste of terminal performance.
  • the terminal determines from the at least one second component based on the distance between the first component and each second component under the condition that the moving speed of the drag operation is not greater than the first speed threshold A target component, the distance between the first component and the target component is not greater than a distance threshold.
  • the distance threshold can be set and changed according to requirements, which is not limited in this embodiment of the present disclosure; for example, the distance threshold is 8 pixels, 10 pixels, and the like.
  • the moving speed of the drag operation is not large and the distance between the first component and the second component is relatively short, it indicates that the user wants to adsorb the first component to the second component, and the terminal will set the first component to the second component.
  • the second component is determined as the target component.
  • the first component is the B component
  • the second component is the A component
  • the distance threshold is 10 pixels
  • the moving speed is not greater than the first speed threshold
  • the distance between the B component and the A component is 5 pixels number, that is, the distance between the B component and the A component is less than the distance threshold
  • the second component when the moving speed of the drag operation is not large and the distance between components is smaller than the distance threshold, the second component is used as the object to be adsorbed by the first component, so that the user does not need to continue dragging the component.
  • the first component saves operation time and improves the operation efficiency of component editing.
  • the terminal when the terminal has adsorbed the first component to the determined target component and the dragging operation on the first component has not stopped, the terminal detaches the first component from the target component, and the terminal removes the first component from the target component by zooming out
  • the method of the moving speed of the drag operation amplifies the ratio between the moving speed of the drag operation and the moving speed of the first component, wherein the moving speed of the first component refers to the speed of the first component approaching the target component. speed.
  • the terminal under the condition that the moving speed of the drag operation is not greater than the first speed threshold and greater than the second speed threshold, in response to the decrease of the moving speed of the drag operation, the terminal removes the first component from the first speed threshold.
  • the target component is disengaged, and the moving speed of the dragging operation is reduced by a first preset multiple to obtain a first moving speed, and the first component is moved based on the first moving speed.
  • the second speed threshold is smaller than the first speed threshold.
  • the second speed threshold can be set and changed according to requirements, which is not limited in this embodiment of the present disclosure.
  • the first preset multiple can be set and changed according to requirements, for example, the first preset multiple is 5, 4, or the like, which is not limited in this embodiment of the present disclosure.
  • the moving speed of the drag operation is not greater than the first speed threshold, and greater than the second speed threshold indicates that the drag operation is in a medium-speed state.
  • the first component has been adsorbed to the target component
  • the user is still using the terminal
  • the first component indicates that the user's intention is not to attach the first component to the target component. Therefore, the first component should be detached from the target component, so as to avoid the failure to make small adjustments to the first component due to mis-adsorption.
  • the phenomenon of distance movement is not greater than the first speed threshold, and greater than the second speed threshold indicates that the drag operation is in a medium-speed state.
  • the terminal detaches the first component from the target component and reduces the moving speed of the dragging operation. , to drag the first component, so as to realize the refined operation of the first component, avoid the phenomenon that the first component cannot be moved at a small distance due to false adsorption, and improve the accuracy of component editing operations.
  • the terminal when the moving speed of the drag operation is relatively low, amplifies the difference between the movement speed of the drag operation and the movement speed of the first component by amplifying the movement speed of the drag operation.
  • the moving speed of the first component refers to the speed at which the first component approaches the target component.
  • the terminal when the moving speed of the dragging operation is not greater than the second speed threshold, the terminal reduces the moving speed of the dragging operation by a second preset multiple to obtain a second moving speed, based on the second speed The movement speed moves the first component.
  • the moving speed of the drag operation is not greater than the second speed threshold, indicating that the drag operation is in a slow speed state, indicating that the user wants to perform a refined operation on the first component. Therefore, the terminal uses the second preset multiple The movement speed is reduced to obtain a second movement speed, and the first component is moved based on the second movement speed.
  • the second preset multiple can be set and changed according to requirements, for example, the second preset multiple is 5, 4 or others.
  • the second preset multiple is the same as the first preset multiple, and in other embodiments, the second preset multiple is different from the first preset multiple, which is not made in the embodiments of the present disclosure. limited.
  • the ratio between the moving speed of the dragging operation and the moving speed of the first component is 1:1, that is, the moving speed of the dragging operation and the moving speed of the first component are 1:1.
  • the moving speed of a component is equal, that is, under the dragging operation, if the mouse moves n pixels in the same time, the corresponding first component will also move n pixels; and after reducing the moving speed of the drag operation, If the second preset multiple is reduced, the second movement speed is obtained.
  • the ratio between the second movement speed and the movement speed of the first component is 4:1, that is, the mouse moves 4 pixels in the same time, and the corresponding The first component is moved by 1 pixel.
  • the terminal restores the control of the first component. movement speed.
  • the terminal moves the first component based on the moving speed of the drag operation in response to a change in the moving direction of the drag operation and the distance between the first component and the target component is greater than a distance threshold.
  • the moving direction of the drag operation changes, it means that the user's intention may not be to adsorb the first component to the target component. Therefore, when the distance between the first component and the target component is large, The first component is moved based on the moving speed of the dragging operation, that is, the moving speed is no longer reduced by a preset multiple.
  • the moving speed of the drag operation when the moving speed of the drag operation is slow, it indicates that the user may want to perform a refined operation on the first component, so by reducing the moving speed of the drag operation and the first component to drag the first component, so as to realize the refined operation of the first component; on the other hand, when the distance between the first component and the target component is greater than the distance threshold, the terminal does not need to The ratio between the moving speed of the dragging operation and the moving speed of the first component is further reduced, so the normal dragging operation can be restored, thereby facilitating the user to perform other editing operations on the first component and improving the operation efficiency of component editing.
  • the terminal determines a prompt area in the component editing interface, and displays the distance between the first component and the target component in the prompt area.
  • the embodiment of the present disclosure does not limit the setting position of the prompt area.
  • the terminal sets the prompt area above the first component and the target component; or sets the prompt area around the component editing interface.
  • the first component is component B
  • the target component is component A
  • the distance threshold is 10 pixels
  • the distance between component B and component A is 4 pixels
  • the terminal determines in the component editing interface Prompt area in which the distance between the B component and the A component is displayed.
  • the terminal sets a prompt area in a magnifying glass-like manner to prompt the user the distance between the first component and the target component, so that the user can drag the first component to a desired position based on the distance, and further In this way, the prompt area can be prevented from obscuring other components and affecting editing operations. Moreover, by displaying the prompt area, the user can perform a refined drag operation on the first component only by using a mouse, without using a keyboard or other devices, thereby effectively improving the operation efficiency of component editing.
  • step 305 the terminal adsorbs the first component to the target component.
  • the terminal adsorbs the first component to the target component.
  • the terminal adsorbs the first component to the target component when the dragging operation is stopped, for example, the terminal adsorbs the first component when the mouse no longer drags the first component to the target component.
  • the terminal re-determines the target component based on the moving speed of the dragging operation and the current position of the first component.
  • the process of the terminal re-determining the target component is the same as the above steps 302-304, and details are not repeated here.
  • the terminal when the user wants to adsorb two components together, by dragging one of the components, the terminal can automatically determine the distance between the component and the other components and the dragging speed. A target component, so that the component is automatically adsorbed to the target component, which reduces the adsorption time and improves the operation efficiency of component editing.
  • the user only needs to change the moving speed of the drag operation to realize the adsorption of the component to the target component, so that there is no need to continuously use the mouse to operate the component, and there is no need to use devices other than the mouse (such as a keyboard, etc.) to operate. components, thereby effectively improving the operational efficiency of component editing.
  • FIG. 9 is a flow chart of a method for adsorbing a component according to an exemplary embodiment. As shown in FIG. 9 , the method for adsorbing a component is performed by a terminal, and includes the following steps.
  • step 901 the terminal runs a rendering thread, and through the rendering thread, a component editing interface is displayed, and the component editing interface includes a plurality of editable components.
  • the terminal runs the rendering thread through the rendering engine, displays the plurality of editable components on the display interface of the terminal, and obtains the component editing interface.
  • step 902 the terminal runs a calculation thread in response to the drag operation of the first component in the component editing interface, and determines at least one second component through the calculation thread.
  • the terminal abstracts the component in the component editing interface into an object with only the current position and size information, that is, the component is input into the calculation engine in the form of pure data,
  • the compute thread is run by the compute engine.
  • the computing thread is used to determine at least one second component based on the current position and size information of the component.
  • the implementation of the terminal running the computing thread includes:
  • the terminal in response to the current terminal supporting a multi-threaded tool, creates the computing thread by running a script file of the multi-threaded tool, and runs the computing thread.
  • the terminal in response to the browser in the current terminal supporting Web Workers (multi-threaded tool), the terminal creates a calculation thread by running the script file of the Web Workers, and through the calculation thread, the first component and the component editing interface are Calculate the current position and size information of other components, determine at least one second component, and obtain the operation result.
  • the terminal in response to the current terminal not supporting the multi-threading tool, runs the computing thread by means of the server through a communication connection between the current terminal and the server.
  • the terminal sends a computing thread creation request to the server through the communication connection with the server.
  • the communication protocol of the communication connection is WebSocket (a communication protocol for full-duplex communication between a terminal and a server).
  • the server receives the calculation thread creation request, creates the calculation thread, and calculates the current position and size information of the first component and other components in the component editing interface through the calculation thread, determines at least one second component, and obtains the calculation result , the server sends the operation result to the terminal, and the terminal receives the operation result.
  • the computing operation is performed by an independent computing thread in the terminal or the server, and then the computing operation is separated from the rendering thread, so that the terminal can make full use of multi-core CPU (processor) resources, and improve the The computational efficiency of the adsorption operation for components is improved.
  • processor processor
  • step 903 for each second component, the terminal determines the distance between the first component and the second component based on the current position of the first component and the current position of the second component through the calculation thread.
  • step 303 The implementation manner of this step is the same as the implementation manner of step 303, and details are not repeated here.
  • step 904 the terminal determines, through the calculation thread, a target component from the at least one second component based on the distance between the first component and each second component and the moving speed of the drag operation.
  • step 304 The implementation of this step is the same as the implementation of step 304, and details are not repeated here.
  • step 905 the terminal attaches the first component to the target component through the rendering thread.
  • the rendering thread adsorbs the first component to the target component in the component editing interface, and displays the adsorption state in the component editing interface.
  • the components in the component editing interface are abstracted into the form of pure data, the target component to be adsorbed with the first component is determined by the computing thread, the interface rendering is performed by the rendering thread, and the The target component performs the adsorption operation on the first component and the target component, so that the determination of the adsorption operation is independent from the rendering thread and completed by the computing thread, that is, the rendering operation and the determination operation are completed through two threads, thereby improving the performance of the target component.
  • Computational efficiency of snapping components are performed by the computing thread.
  • FIG. 10 is a block diagram of an auxiliary operation device 100 showing a component according to an exemplary embodiment.
  • the apparatus 100 includes: a display unit 1001 , a determination unit 1002 and an adsorption unit 1003 .
  • the presentation unit 1001 is configured to present a component editing interface, where the component editing interface includes a plurality of editable components;
  • a determining unit 1002 configured to determine at least one second component in response to a drag operation of the first component in the component editing interface
  • the determining unit 1002 is configured to determine a target component from the at least one second component based on the distance between the first component and each second component and the moving speed of the dragging operation;
  • the adsorption unit 1003 is configured to adsorb the first component to the target component.
  • the determining unit 1002 is configured to, in response to a drag operation of the first component in the component editing interface, determine at least one first component from the component editing interface based on the moving direction of the drag operation Two components.
  • the determining unit 1002 is configured to, in response to a drag operation of the first component in the component editing interface, based on the moving direction of the drag operation, locate the component editing interface in the moving direction The component above is determined as the second component.
  • the determining unit 1002 is configured to, based on the distance between the first component and each second component, from the A target component is determined in at least one second component, and the distance between the first component and the target component is not greater than a distance threshold.
  • the apparatus further includes:
  • the moving unit is configured to reduce the moving speed of the drag operation in response to the slowing down of the moving speed of the drag operation, and remove the first component from the first speed threshold when the moving speed of the drag operation is not greater than the first speed threshold and greater than the second speed threshold
  • the target component is disengaged, and the moving speed of the drag operation is reduced by a first preset multiple to obtain a first moving speed, and the first component is moved based on the first moving speed, wherein the second speed threshold is smaller than the first speed threshold. a speed threshold.
  • the moving unit is configured to reduce the moving speed of the dragging operation by a second preset multiple to obtain the second movement when the moving speed of the dragging operation is not greater than a second speed threshold. a speed to move the first component based on the second movement speed, wherein the second speed threshold is less than the first speed threshold;
  • the moving unit is configured to move the first component based on the moving speed of the drag operation in response to a change in the moving direction of the drag operation and the distance between the first component and the target component is greater than a distance threshold.
  • the moving unit is configured to move the first component based on the moving speed of the dragging operation if the moving speed of the dragging operation is greater than the first speed threshold.
  • the apparatus further includes:
  • the prompt unit is configured to determine a prompt area in the component editing interface, and display the distance between the first component and the target component in the prompt area.
  • the apparatus further includes:
  • the running unit is configured to run the rendering thread, and the component editing interface is displayed through the rendering thread;
  • the running unit is configured to run a calculation thread, through which at least one second component is determined; based on the distance between the first component and each of the second components and the moving speed of the drag operation, from the The target component is determined in at least one second component.
  • the running unit is configured to run the calculation thread, and through the calculation thread, based on the moving direction of the dragging operation, the component in the component editing interface that is located in the moving direction is determined as the second components.
  • the apparatus further includes:
  • the creation unit is configured to create the computing thread by running the script file of the multi-threaded tool in response to the current terminal supporting the multi-threaded tool;
  • the running unit is configured to, in response to the current terminal not supporting the multi-threading tool, run the computing thread by means of the server through the communication connection between the current terminal and the server.
  • FIG. 11 is a block diagram of a terminal 10 according to an exemplary embodiment.
  • the terminal 10 is a smart phone, a tablet computer, a notebook computer or a desktop computer, and the like.
  • terminal 10 is referred to as user equipment, portable terminal, laptop terminal, desktop terminal, and the like by other names.
  • the terminal 10 includes: a processor 101 and a memory 102 .
  • the processor 101 includes one or more processing cores, such as a 4-core processor, an 8-core processor, and the like.
  • the processor 101 adopts at least one of DSP (Digital Signal Processing, digital signal processing), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, programmable logic array).
  • DSP Digital Signal Processing, digital signal processing
  • FPGA Field-Programmable Gate Array, field programmable gate array
  • PLA Programmable Logic Array, programmable logic array
  • the processor 101 also includes a main processor and a co-processor.
  • the main processor is a processor for processing data in a wake-up state, also referred to as a CPU (Central Processing Unit, central processing unit).
  • a coprocessor is a low-power processor for processing data in a standby state.
  • the processor 101 is integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used for rendering and drawing the content that needs to be displayed on the display screen.
  • the processor 101 further includes an AI (Artificial Intelligence, artificial intelligence) processor, where the AI processor is used to process computing operations related to machine learning.
  • AI Artificial Intelligence, artificial intelligence
  • memory 102 includes one or more non-volatile storage media that are non-transitory. In some embodiments, memory 102 also includes high-speed random access memory, and non-volatile memory, such as one or more disk storage devices, flash storage devices. In some embodiments, the non-volatile storage medium in the memory 102 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 101 to implement the adsorption operation method of the component provided by the method embodiment of the present disclosure .
  • the terminal 10 may optionally further include: a peripheral device interface 103 and at least one peripheral device.
  • the processor 101, the memory 102 and the peripheral device interface 103 are connected through a bus or a signal line.
  • each peripheral device is connected to the peripheral device interface 103 through a bus, signal line or circuit board.
  • the peripheral device includes: at least one of a radio frequency circuit 104 , a display screen 105 , a camera assembly 106 , an audio circuit 107 , a positioning assembly 108 and a power supply 109 .
  • the peripheral device interface 103 may be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 101 and the memory 102 .
  • processor 101, memory 102, and peripherals interface 103 are integrated on the same chip or circuit board; in some other embodiments, any one of processor 101, memory 102, and peripherals interface 103 or The two are implemented on a separate chip or circuit board, which is not limited in this embodiment.
  • the radio frequency circuit 104 is used for receiving and transmitting RF (Radio Frequency, radio frequency) signals, also called electromagnetic signals.
  • the radio frequency circuit 104 communicates with the communication network and other communication devices via electromagnetic signals.
  • the radio frequency circuit 104 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals.
  • radio frequency circuitry 104 includes an antenna system, an RF transceiver, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and the like.
  • radio frequency circuitry 104 communicates with other terminals via at least one wireless communication protocol.
  • the wireless communication protocol includes but is not limited to: World Wide Web, Metropolitan Area Network, Intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), wireless local area network and/or WiFi (Wireless Fidelity, Wireless Fidelity) network.
  • the radio frequency circuit 104 further includes a circuit related to NFC (Near Field Communication, short-range wireless communication), which is not limited in the present disclosure.
  • the display screen 105 is used for displaying UI (User Interface, user interface).
  • the UI includes graphics, text, icons, video, and any combination thereof.
  • the display screen 105 also has the ability to acquire touch signals on or above the surface of the display screen 105 .
  • the touch signal is input to the processor 101 as a control signal for processing.
  • the display screen 105 is also used to provide virtual buttons and/or virtual keyboards, also called soft buttons and/or soft keyboards.
  • the display screen 105 there is one display screen 105, which is arranged on the front panel of the terminal 10; in other embodiments, there are at least two display screens 105, which are respectively arranged on different surfaces of the terminal 10 or in a folded design; In some embodiments, the display screen 105 is a flexible display screen disposed on a curved or folded surface of the terminal 10 . Even, the display screen 105 is also set as a non-rectangular irregular figure, that is, a special-shaped screen. In some embodiments, the display screen 105 is made of materials such as LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, organic light emitting diode).
  • LCD Liquid Crystal Display, liquid crystal display
  • OLED Organic Light-Emitting Diode, organic light emitting diode
  • the camera assembly 106 is used to capture images or video.
  • the camera assembly 106 includes a front-facing camera and a rear-facing camera.
  • the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal.
  • there are at least two rear cameras which are any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth-of-field camera to realize the background blur function
  • the main camera It is integrated with the wide-angle camera to achieve panoramic shooting and VR (Virtual Reality, virtual reality) shooting functions or other integrated shooting functions.
  • VR Virtual Reality, virtual reality
  • the camera assembly 106 also includes a flash.
  • the flash is a single color temperature flash, and in some embodiments, the flash is a dual color temperature flash. Dual color temperature flash refers to the combination of warm light flash and cold light flash, which is used for light compensation under different color temperatures.
  • the audio circuit 107 includes a microphone and a speaker.
  • the microphone is used to collect the sound waves of the user and the environment, convert the sound waves into electrical signals, and input them to the processor 101 for processing, or input them to the radio frequency circuit 104 to realize voice communication.
  • there are multiple microphones which are respectively disposed at different parts of the terminal 10 .
  • the microphones are array microphones or omnidirectional collection microphones.
  • the speaker is used to convert the electrical signal from the processor 101 or the radio frequency circuit 104 into sound waves.
  • the loudspeaker is a conventional thin-film loudspeaker, and in some embodiments, the loudspeaker is a piezoelectric ceramic loudspeaker.
  • the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for distance measurement and other purposes.
  • the audio circuit 107 also includes a headphone jack.
  • the positioning component 108 is used to locate the current geographic location of the terminal 10 to implement navigation or LBS (Location Based Service).
  • the positioning component 107 is a positioning component based on the GPS (Global Positioning System, Global Positioning System) of the United States, the Beidou system of China or the Galileo system of Russia.
  • the power supply 109 is used to power various components in the terminal 10 .
  • the power source 109 is alternating current, direct current, a disposable battery, or a rechargeable battery.
  • the rechargeable battery is a wired rechargeable battery or a wireless rechargeable battery. Wired rechargeable batteries are batteries that are charged through wired lines, and wireless rechargeable batteries are batteries that are charged through wireless coils.
  • the rechargeable battery is also used to support fast charging technology.
  • the terminal 10 further includes one or more sensors 110 .
  • the one or more sensors 110 include, but are not limited to, an acceleration sensor 111 , a gyro sensor 112 , a pressure sensor 113 , a fingerprint sensor 114 , an optical sensor 115 and a proximity sensor 116 .
  • the acceleration sensor 111 detects the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 10 .
  • the acceleration sensor 111 is used to detect the components of the gravitational acceleration on the three coordinate axes.
  • the processor 101 controls the display screen 105 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 111.
  • the acceleration sensor 111 is also used for game or user movement data collection.
  • the gyro sensor 112 detects the body direction and rotation angle of the terminal 10 , and the gyro sensor 112 cooperates with the acceleration sensor 111 to collect 3D actions of the user on the terminal 10 .
  • the processor 101 can implement the following functions according to the data collected by the gyro sensor 112 : motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
  • the pressure sensor 113 is disposed on the side frame of the terminal 10 and/or the lower layer of the display screen 105 .
  • the pressure sensor 113 can detect the user's holding signal of the terminal 10 , and the processor 101 performs left and right hand identification or shortcut operations according to the holding signal collected by the pressure sensor 113 .
  • the processor 101 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 105 .
  • the operability controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
  • the fingerprint sensor 114 is used to collect the user's fingerprint, and the processor 101 identifies the user's identity according to the fingerprint collected by the fingerprint sensor 114 , or the fingerprint sensor 114 identifies the user's identity according to the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 101 authorizes the user to perform relevant sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings.
  • the fingerprint sensor 114 is disposed on the front, back, or sides of the terminal 10 . When the terminal 10 is provided with a physical button or a manufacturer's logo, the fingerprint sensor 114 is integrated with the physical button or the manufacturer's logo.
  • the optical sensor 115 is used to collect ambient light intensity.
  • the processor 101 controls the display brightness of the display screen 105 according to the ambient light intensity collected by the optical sensor 115 . Specifically, when the ambient light intensity is high, the display brightness of the display screen 105 is increased; when the ambient light intensity is low, the display brightness of the display screen 105 is decreased.
  • the processor 101 also dynamically adjusts the shooting parameters of the camera assembly 106 according to the ambient light intensity collected by the optical sensor 115 .
  • the proximity sensor 116 also referred to as a distance sensor, is usually provided on the front panel of the terminal 10 .
  • the proximity sensor 116 is used to collect the distance between the user and the front of the terminal 10 .
  • the processor 101 controls the display screen 105 to switch from the bright screen state to the off screen state; 116
  • the processor 101 controls the display screen 105 to switch from the screen-off state to the screen-on state.
  • FIG. 11 does not constitute a limitation on the terminal 10, and can include more or less components than the one shown, or combine some components, or adopt different component arrangements.
  • a non-volatile storage medium is also provided, when the instructions in the non-volatile storage medium are executed by the processor of the terminal, the terminal can execute the components in the above-mentioned embodiments. adsorption method.
  • a computer program product including a computer program/instruction, when the computer program/instruction is executed by a processor, the method for adsorbing the components in the above-mentioned embodiment is implemented.
  • the present disclosure provides an adsorption operation method of a component, the method comprising:
  • the first component and the target component are adsorbed.
  • the determining of at least one second component to be adsorbed by the first component includes:
  • At least one second component to be adsorbed by the first component is determined from the component editing interface.
  • the determining the target component from the at least one second component based on the moving speed of the drag operation and the distance between the first component and each second component includes:
  • the moving speed of the drag operation is not greater than the first speed threshold, based on the distance between the first component and each of the second components, from the at least one second component, determine that the distance is not greater than the distance threshold target component.
  • the method further includes:
  • the moving speed of the drag operation in response to the decrease in the moving speed of the drag operation, the first component and the target component are released from the adsorption state, and reduce the moving speed of the drag operation by a preset multiple, and move the first component based on the reduced moving speed.
  • the method further includes:
  • the movement speed of the drag operation is not greater than the second speed threshold, reduce the movement speed of the drag operation by a preset multiple, and move the first component based on the reduced movement speed;
  • the first component In response to the movement direction of the drag operation changing and the distance between the first component and the target component increases to be greater than a distance threshold, the first component is moved based on the movement speed of the drag operation.
  • the method further includes:
  • the first component is moved based on the moving speed of the drag operation.
  • the method further includes:
  • a prompt area is determined in the component editing interface, and the distance between the first component and the target component is displayed in the prompt area.
  • the method further includes:
  • Running a calculation thread through the calculation thread, executing the determining of at least one second component to be adsorbed by the first component; for each second component, based on the current position of the first component and the current position of the second component, determine the distance between the first component and the second component; determining the target component from the at least one second component based on the moving speed of the drag operation and the distance between the first component and each second component A step of.
  • the running computational thread includes:
  • the computing thread In response to the current terminal supporting a multi-threaded tool, the computing thread is created by running the script file of the multi-threaded tool, and the computing thread is run;
  • the computing thread is run by means of the server through a communication connection between the current terminal and the server.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The present disclosure relates to the technical field of networks. Disclosed are a docking operation method for a component, and a terminal. The method comprises: displaying a component editing interface, wherein the component editing interface comprises a plurality of editable components; determining at least one second component in response to a drag operation for a first component in the component editing interface; determining a target component from among the at least one second component on the basis of the distance between the first component and each second component, and the moving speed of the drag operation; and docking the first component to the target component.

Description

组件的吸附操作方法及终端Component adsorption operation method and terminal
本公开基于申请日为2021年01月29日、申请号为202110124740.6的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本公开作为参考。The present disclosure is based on a Chinese patent application with an application date of January 29, 2021 and an application number of 202110124740.6, and claims the priority of the Chinese patent application, the entire contents of which are incorporated herein by reference.
技术领域technical field
本公开涉及网络技术领域,尤其涉及组件的吸附操作方法及终端。The present disclosure relates to the field of network technologies, and in particular, to an adsorption operation method and a terminal of a component.
背景技术Background technique
目前,web网页支持组件编辑功能,用户通常借助鼠标来完成对组件的编辑操作。在这一过程中,在用户通过鼠标拖拽某个组件的情况下,web网页往往会为该组件提供辅助功能。例如,在该组件与当前界面中的目标组件之间的距离较近的情况下,为该组件提供吸附功能,也即将该组件吸附至该目标组件。At present, the web page supports the component editing function, and the user usually completes the editing operation on the component by means of the mouse. In this process, when the user drags a component with the mouse, the web page often provides auxiliary functions for the component. For example, when the distance between the component and the target component in the current interface is relatively short, the component is provided with an adsorption function, that is, the component is adsorbed to the target component.
相关技术中,在用户通过鼠标拖拽组件的过程中,终端实时计算该组件与当前界面中的目标组件之间的距离,响应于该组件与该目标组件之间的距离小于预设距离,则将该组件吸附至该目标组件。In the related art, in the process of the user dragging the component through the mouse, the terminal calculates the distance between the component and the target component in the current interface in real time, and in response to the distance between the component and the target component being less than the preset distance, then Snap the component to the target component.
发明内容SUMMARY OF THE INVENTION
本公开提供一种组件的吸附操作方法及终端。本公开的技术方案如下:The present disclosure provides an adsorption operation method and terminal of a component. The technical solutions of the present disclosure are as follows:
根据本公开实施例的第一方面,提供一种组件的吸附操作方法,由终端执行,包括:According to a first aspect of the embodiments of the present disclosure, there is provided an adsorption operation method for a component, which is performed by a terminal, including:
展示组件编辑界面,该组件编辑界面包括多个可编辑的组件;Display the component editing interface, which includes multiple editable components;
响应于对该组件编辑界面中的第一组件的拖拽操作,确定至少一个第二组件;In response to a drag operation of the first component in the component editing interface, determining at least one second component;
基于该第一组件与每个第二组件之间的距离和该拖拽操作的移动速度,从该至少一个第二组件中确定目标组件;determining a target component from the at least one second component based on the distance between the first component and each second component and the moving speed of the drag operation;
将该第一组件吸附至该目标组件。Snap the first component to the target component.
本公开提供的方案,在用户想要将两个组件吸附在一起的情况下,通过对其中一个组件进行拖拽,使得终端根据该组件与其他组件之间的距离和拖拽速度,自动确定一个目标组件,从而将该组件自动吸附至该目标组件,减少了吸附时间,提高了组件编辑的操作效率。In the solution provided by the present disclosure, when the user wants to adsorb two components together, by dragging one of the components, the terminal can automatically determine a The target component is automatically adsorbed to the target component, which reduces the adsorption time and improves the operation efficiency of component editing.
根据本公开实施例的第二方面,提供一种组件的吸附操作装置,包括:According to a second aspect of the embodiments of the present disclosure, there is provided an adsorption operation device for components, including:
展示单元,被配置为展示组件编辑界面,该组件编辑界面包括多个可编辑的组件;a display unit, configured to display a component editing interface, where the component editing interface includes a plurality of editable components;
确定单元,被配置为响应于对该组件编辑界面中的第一组件的拖拽操作,确定至少一个第二组件;a determining unit, configured to determine at least one second component in response to a drag operation of the first component in the component editing interface;
该确定单元,被配置为基于该第一组件与每个第二组件之间的距离和该拖拽操作的移动速度,从该至少一个第二组件中确定目标组件;The determining unit is configured to determine a target component from the at least one second component based on the distance between the first component and each second component and the moving speed of the dragging operation;
吸附单元,被配置为将该第一组件吸附至该目标组件。The adsorption unit is configured to adsorb the first component to the target component.
根据本公开实施例的第三方面,提供一种终端,包括:According to a third aspect of the embodiments of the present disclosure, a terminal is provided, including:
处理器;processor;
用于存储该处理器可执行指令的存储器;memory for storing instructions executable by the processor;
其中,该处理器被配置为执行该指令,以实现如上述组件的吸附操作方法。Wherein, the processor is configured to execute the instruction, so as to realize the above-mentioned component adsorption operation method.
根据本公开实施例的第四方面,提供一种非易失性存储介质,当该非易失性存储介质中的指令由终端的处理器执行时,使得终端能够执行如上述组件的吸附操作方法。According to a fourth aspect of the embodiments of the present disclosure, a non-volatile storage medium is provided. When an instruction in the non-volatile storage medium is executed by a processor of a terminal, the terminal can perform the adsorption operation method of the above-mentioned components. .
根据本公开实施例的第五方面,提供一种计算机程序产品,包括计算机程序/指令,该计算机程序/指令被处理器执行时实现上述组件的吸附操作方法。According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product, including computer programs/instructions, when the computer program/instructions are executed by a processor, the above-mentioned component adsorption operation method is implemented.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理,并不构成对本公开的不当限定。The accompanying drawings, which are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure and do not unduly limit the present disclosure.
图1是根据一示例性实施例示出的一种组件的吸附操作方法的实施环境图;FIG. 1 is an implementation environment diagram of an adsorption operation method of a component according to an exemplary embodiment;
图2是根据一示例性实施例示出的一种组件的吸附操作方法的流程图;FIG. 2 is a flow chart of a method for adsorbing a component according to an exemplary embodiment;
图3是根据一示例性实施例示出的一种组件的吸附操作方法的流程图;FIG. 3 is a flow chart of a method for adsorbing a component according to an exemplary embodiment;
图4是根据一示例性实施例示出的一种组件的吸附操作方法的示意图;Fig. 4 is a schematic diagram showing an adsorption operation method of a component according to an exemplary embodiment;
图5是根据一示例性实施例示出的一种组件的吸附操作方法的示意图;Fig. 5 is a schematic diagram showing an adsorption operation method of a component according to an exemplary embodiment;
图6是根据一示例性实施例示出的一种组件的吸附操作方法的示意图;FIG. 6 is a schematic diagram illustrating an adsorption operation method of a component according to an exemplary embodiment;
图7是根据一示例性实施例示出的一种组件的吸附操作方法的示意图;Fig. 7 is a schematic diagram showing an adsorption operation method of a component according to an exemplary embodiment;
图8是根据一示例性实施例示出的一种组件的吸附操作方法的示意图;Fig. 8 is a schematic diagram showing an adsorption operation method of a component according to an exemplary embodiment;
图9是根据一示例性实施例示出的一种组件的吸附操作方法的流程图;FIG. 9 is a flow chart of a method for adsorbing a component according to an exemplary embodiment;
图10是根据一示例性实施例示出的一种组件的吸附操作装置的框图;Fig. 10 is a block diagram of an adsorption operation device of a component according to an exemplary embodiment;
图11是根据一示例性实施例示出的一种终端的框图。Fig. 11 is a block diagram of a terminal according to an exemplary embodiment.
具体实施方式Detailed ways
本公开所涉及的用户信息为经用户授权或者经过各方充分授权的信息。The user information involved in this disclosure is the information authorized by the user or fully authorized by all parties.
图1是根据一示例性实施例示出的一种组件的吸附操作方法的实施环境图,参见图1, 该实施环境包括:终端10和服务器20。终端10与服务器20通过网络实现通信。FIG. 1 is an implementation environment diagram of a component adsorption operation method according to an exemplary embodiment. Referring to FIG. 1 , the implementation environment includes: a terminal 10 and a server 20 . The terminal 10 and the server 20 communicate through a network.
终端10中安装有与服务器20关联的目标应用程序,通过该目标应用程序与服务器20实现数据交互。例如,终端10基于该目标应用程序,从服务器20中获取多个可编辑的组件,进而展示包括多个可编辑组件的组件编辑界面,由用户编辑该多个可编辑的组件,例如,用户拖动某个组件、改变组件的形状、编辑组件内显示的内容。另外,在一些实施例中,在用户编辑组件的过程中,终端10为组件提供辅助操作,该辅助操作包括吸附操作或者添加辅助线等,在本公开实施例中,以组件的吸附操作为例进行说明。A target application program associated with the server 20 is installed in the terminal 10 , and data interaction with the server 20 is realized through the target application program. For example, the terminal 10 obtains multiple editable components from the server 20 based on the target application, and then displays a component editing interface including multiple editable components, and the user edits the multiple editable components, for example, the user drags Move a component, change the shape of the component, edit the content displayed within the component. In addition, in some embodiments, in the process of editing a component by the user, the terminal 10 provides an auxiliary operation for the component, and the auxiliary operation includes a suction operation or adding an auxiliary line, etc. In the embodiments of the present disclosure, the suction operation of a component is taken as an example Be explained.
该目标应用程序为任一能够实现组件编辑功能的应用程序;例如,该目标应用程序为浏览器、PPT(电子幻灯片)、visio(一种绘图软件)等应用程序。终端10为手机、平板电脑、PC(Personal Computer)设备、手表、穿戴设备、MP3播放器(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器等设备中的至少一种。服务器20为一台服务器、多台服务器、云服务器、云计算平台和虚拟化中心中的至少一种。The target application is any application that can realize the component editing function; for example, the target application is a browser, PPT (electronic slideshow), visio (a kind of drawing software) and other applications. The terminal 10 is a mobile phone, a tablet computer, a PC (Personal Computer) device, a watch, a wearable device, an MP3 player (Moving Picture Experts Group Audio Layer III, moving image expert compression standard audio layer 3), MP4 (Moving Picture Experts Group Audio Layer III) IV, at least one of the moving image expert compression standard audio layer 4) player and other devices. The server 20 is at least one of a server, multiple servers, a cloud server, a cloud computing platform and a virtualization center.
图2是根据一示例性实施例示出的一种组件的吸附操作方法的流程图,如图2所示,该组件的吸附操作方法由终端执行,包括以下步骤。Fig. 2 is a flow chart of an adsorption operation method of a component according to an exemplary embodiment. As shown in Fig. 2 , the adsorption operation method of the component is performed by a terminal, and includes the following steps.
在步骤S21中,展示组件编辑界面,该组件编辑界面包括多个可编辑的组件;In step S21, a component editing interface is displayed, and the component editing interface includes a plurality of editable components;
在步骤S22中,响应于对该组件编辑界面中的第一组件的拖拽操作,确定至少一个第二组件;In step S22, in response to the drag operation of the first component in the component editing interface, at least one second component is determined;
在步骤S23中,基于该第一组件与每个第二组件之间的距离和该拖拽操作的移动速度,从该至少一个第二组件中确定目标组件;In step S23, a target component is determined from the at least one second component based on the distance between the first component and each second component and the moving speed of the dragging operation;
在步骤S24中,将该第一组件吸附至该目标组件。In step S24, the first component is adsorbed to the target component.
本公开提供的方案,在用户想要将两个组件吸附在一起的情况下,通过对其中一个组件进行拖拽,使得终端根据该组件与其他组件之间的距离和拖拽速度,自动确定一个目标组件,从而将该组件自动吸附至该目标组件,减少了吸附时间,提高了组件编辑的操作效率。In the solution provided by the present disclosure, when the user wants to adsorb two components together, by dragging one of the components, the terminal can automatically determine a The target component is automatically adsorbed to the target component, which reduces the adsorption time and improves the operation efficiency of component editing.
在一些实施例中,该响应于对该组件编辑界面中的第一组件的拖拽操作,确定至少一个第二组件包括:In some embodiments, determining at least one second component in response to a drag operation on the first component in the component editing interface includes:
响应于对该组件编辑界面中的第一组件的拖拽操作,基于该拖拽操作的移动方向,从该组件编辑界面中确定至少一个第二组件。In response to a drag operation of the first component in the component editing interface, at least one second component is determined from the component editing interface based on the moving direction of the drag operation.
在一些实施例中,该响应于对该组件编辑界面中的第一组件的拖拽操作,基于该拖拽操作的移动方向,从该组件编辑界面中确定至少一个第二组件包括:In some embodiments, determining at least one second component from the component editing interface based on a moving direction of the drag operation in response to a drag operation on the first component in the component editing interface includes:
响应于对该组件编辑界面中的第一组件的拖拽操作,终端基于该拖拽操作的移动方向, 将该组件编辑界面中位于该移动方向上的组件确定为该第二组件。In response to the drag operation of the first component in the component editing interface, the terminal determines, based on the moving direction of the drag operation, the component located in the moving direction in the component editing interface as the second component.
在一些实施例中,该基于该第一组件与每个第二组件之间的距离和该拖拽操作的移动速度,从该至少一个第二组件中确定该目标组件包括:In some embodiments, the determining the target component from the at least one second component based on the distance between the first component and each second component and the movement speed of the drag operation includes:
在该拖拽操作的移动速度不大于第一速度阈值的情况下,基于该第一组件与每个第二组件之间的距离,从该至少一个第二组件中确定该目标组件,该第一组件与该目标组件之间的距离不大于距离阈值。In the case where the moving speed of the drag operation is not greater than the first speed threshold, the target component is determined from the at least one second component based on the distance between the first component and each second component, the first component The distance between the component and this target component is not greater than the distance threshold.
在一些实施例中,该方法还包括:In some embodiments, the method further includes:
在该拖拽操作的移动速度不大于该第一速度阈值,且大于第二速度阈值的情况下,响应于该拖拽操作的移动速度减慢,将该第一组件从该目标组件上脱离,以及将该拖拽操作的移动速度缩小第一预设倍数,得到第一移动速度,基于该第一移动速度移动该第一组件,其中,该第二速度阈值小于该第一速度阈值。In the case where the moving speed of the dragging operation is not greater than the first speed threshold and greater than the second speed threshold, in response to the slowing down of the moving speed of the dragging operation, the first component is detached from the target component, and reducing the moving speed of the drag operation by a first preset multiple to obtain a first moving speed, and move the first component based on the first moving speed, wherein the second speed threshold is smaller than the first speed threshold.
在一些实施例中,该方法还包括:In some embodiments, the method further includes:
在该拖拽操作的移动速度不大于第二速度阈值的情况下,将该拖拽操作的移动速度缩小第二预设倍数,得到第二移动速度,基于该第二移动速度移动该第一组件,其中,该第二速度阈值小于该第一速度阈值;In the case that the moving speed of the drag operation is not greater than the second speed threshold, reduce the moving speed of the drag operation by a second preset multiple to obtain a second moving speed, and move the first component based on the second moving speed , wherein the second speed threshold is less than the first speed threshold;
响应于该拖拽操作的移动方向改变,且该第一组件与该目标组件之间的距离大于该距离阈值,基于该拖拽操作的移动速度,移动该第一组件。In response to the moving direction of the drag operation changing, and the distance between the first component and the target component is greater than the distance threshold, the first component is moved based on the moving speed of the drag operation.
在一些实施例中,该方法还包括:In some embodiments, the method further includes:
在该拖拽操作的移动速度大于该第一速度阈值的情况下,基于该拖拽操作的移动速度,移动该第一组件。In the case where the moving speed of the drag operation is greater than the first speed threshold, the first component is moved based on the moving speed of the drag operation.
在一些实施例中,该方法还包括:In some embodiments, the method further includes:
在该组件编辑界面中确定提示区域,在该提示区域内显示该第一组件与该目标组件之间的距离。A prompt area is determined in the component editing interface, and the distance between the first component and the target component is displayed in the prompt area.
在一些实施例中,该方法还包括:In some embodiments, the method further includes:
运行渲染线程,通过该渲染线程,执行该展示该组件编辑界面的步骤;Run the rendering thread, and execute the step of displaying the editing interface of the component through the rendering thread;
运行计算线程,通过该计算线程,执行该确定至少一个第二组件;基于该第一组件与每个第二组件之间的距离和该拖拽操作的移动速度,从该至少一个第二组件中确定该目标组件的步骤。Running a computing thread, through which the determining at least one second component is performed; based on the distance between the first component and each second component and the moving speed of the drag operation, from the at least one second component Steps to determine this target component.
在一些实施例中,该方法还包括:In some embodiments, the method further includes:
运行该计算线程,通过该计算线程,执行基终端基于该拖拽操作的移动方向,将该组件编辑界面中位于该移动方向上的组件确定为该第二组件的步骤。The calculation thread is run, and through the calculation thread, the base terminal determines the component located in the movement direction in the component editing interface based on the movement direction of the drag operation as the second component.
在一些实施例中,该方法还包括:In some embodiments, the method further includes:
响应于该终端支持多线程工具,通过运行该多线程工具的脚本文件,创建该计算线程;In response to the terminal supporting a multi-threaded tool, the computing thread is created by running the script file of the multi-threaded tool;
响应于该终端不支持该多线程工具,该运行计算线程包括:通过该终端与服务器之间的通信连接,借助于该服务器运行该计算线程。In response to the terminal not supporting the multi-threading tool, the running the computing thread includes running the computing thread by means of the server through a communication connection between the terminal and the server.
图3是根据一示例性实施例示出的一种组件的吸附操作方法的流程图,如图3所示,该组件的吸附操作方法由终端执行,包括以下步骤。FIG. 3 is a flow chart of a method for adsorbing a component according to an exemplary embodiment. As shown in FIG. 3 , the method for adsorbing a component is performed by a terminal, and includes the following steps.
在步骤301中,终端展示组件编辑界面,该组件编辑界面包括多个可编辑的组件。In step 301, the terminal displays a component editing interface, and the component editing interface includes a plurality of editable components.
其中,终端上安装有目标应用程序,用户通过触发该目标应用程序以触发终端展示该目标应用程序对应的首页界面;响应于用户的触发操作,终端展示该目标应用程序对应的首页界面,用户能够在首页界面中添加多个组件,进而触发终端展示组件编辑界面。例如,首页界面中包括组件区域和编辑区域,组件区域中包括多个组件,用户通过拖拽的方式将组件区域的组件拖拽到编辑区域,进而触发终端展示组件编辑界面。The target application program is installed on the terminal, and the user triggers the target application program to trigger the terminal to display the home page interface corresponding to the target application program; in response to the user's trigger operation, the terminal displays the home page interface corresponding to the target application program, and the user can Add multiple components to the home page interface, and then trigger the terminal to display the component editing interface. For example, the home page interface includes a component area and an editing area, and the component area includes multiple components. The user drags and drops components in the component area to the editing area, thereby triggering the terminal to display the component editing interface.
目标应用程序为浏览器、PPT或者visio等任一应用程序。例如,目标应用程序为浏览器,则组件编辑界面为网页编辑界面,该网页编辑界面中包括从浏览器对应的服务器中下载的多个可编辑的组件;例如,目标应用程序为PPT或者visio等应用程序,则组件编辑界面为非网页编辑界面,非网页编辑界面中包括PPT或者visio本地存储的多个可编辑的组件。The target application is any application such as browser, PPT or visio. For example, if the target application is a browser, the component editing interface is a web page editing interface, and the web page editing interface includes multiple editable components downloaded from the server corresponding to the browser; for example, the target application is PPT or visio, etc. application, the component editing interface is a non-web page editing interface, and the non-web page editing interface includes multiple editable components stored locally in PPT or visio.
在一些实施例中,多个可编辑的组件为同一类型的组件。在另一些实施例中,多个可编辑的组件为不同类型的组件。例如,多个可编辑的组件为流程图类型的组件、电气图类型的组件和组织结构图类型的组件等。并且,在一些实施例中,每个组件的形状相同。在另一些实施例中,每个组件的形状不同。例如,组件的形状为心形、五角星形、圆形、正方形等。In some embodiments, multiple editable components are the same type of components. In other embodiments, the plurality of editable components are different types of components. For example, the plurality of editable components are flowchart type components, electrical diagram type components, organization chart type components, and the like. Also, in some embodiments, each component is the same shape. In other embodiments, each component has a different shape. For example, the shape of the component is heart, pentagram, circle, square, etc.
例如,在本公开实施例中,以多个可编辑的组件为同一类型的组件为例进行说明。参见图4,该组件编辑界面中包括多个可编辑的组件,分别为A组件、B组件、C组件、D组件、E组件、F组件和G组件。For example, in the embodiment of the present disclosure, the multiple editable components are the same type of components as an example for description. Referring to FIG. 4 , the component editing interface includes multiple editable components, namely A component, B component, C component, D component, E component, F component and G component.
在一些实施例中,用户通过拖拽的方式对组件进行编辑,响应于接收到用户的拖拽操作,终端对该组件进行编辑。在一些实施例中,终端确定接收到拖拽操作的实现方式为:响应于该组件编辑界面中的第一组件被选中,终端将第一组件的状态由非激活状态变更为激活状态,在第一组件处于激活状态下,响应于第一移动组件被拖动,终端确定接收到该拖拽操作。In some embodiments, the user edits the component by dragging, and in response to receiving the user's dragging operation, the terminal edits the component. In some embodiments, the terminal determines that the drag operation is received by: in response to the first component in the component editing interface being selected, the terminal changes the state of the first component from an inactive state to an active state, and in the first component When a component is in an activated state, in response to the first moving component being dragged, the terminal determines that the drag operation is received.
其中,该组件编辑界面中未被选择中的组件仍然处于非激活状态。例如,参见图5,该第一组件为B组件,鼠标指针停留在B组件上,且鼠标指针被按下,则确定B组件被选中,则将B组件的状态设置为激活状态。而由于A组件未被选中,则A组件的状态为非激活状态。The components that are not selected in the component editing interface are still in an inactive state. For example, referring to FIG. 5 , the first component is a B component, the mouse pointer stays on the B component, and the mouse pointer is pressed, it is determined that the B component is selected, and the state of the B component is set to an active state. Since the A component is not selected, the A component is in an inactive state.
在步骤302中,终端响应于对该组件编辑界面中的第一组件的拖拽操作,确定至少一个 第二组件。In step 302, the terminal determines at least one second component in response to a drag operation of the first component in the component editing interface.
其中,第一组件为用户选中的组件,第二组件为组件编辑界面中第一组件以外的任一组件。用户能够通过拖拽该第一组件,使得终端将该第一组件吸附至该第二组件。在一些实施例中,吸附是指在不需要对组件进行持续拖拽操作的情况下,将组件自动与其他组件组合在一起。换言之,吸附是指将两个或更多个组件自动组合(或自动连接)在一起。例如,以A组件和B组件的形状均为正方形为例,吸附是指将A组件的右边与B组件的左边贴合,或者,吸附是指将A组件的右边与B组件的左边完全重合,又或者,吸附是指将A组件的右边与B组件的左边部分重合,本公开对此不作限定。在一些实施例中,将这种通过吸附实现两个或更多个组件自动组合在一起的方式称为吸附操作,本公开对此不作限定。在一些实施例中,在确定至少一个第二组件之前,终端需要先确定该拖拽操作的移动方向。在一些实施例中,本步骤的实现方式为:终端基于第一组件在拖拽前的当前位置和在拖拽后的当前位置,确定该拖拽操作的移动方向。The first component is the component selected by the user, and the second component is any component other than the first component in the component editing interface. The user can make the terminal adsorb the first component to the second component by dragging the first component. In some embodiments, snapping refers to automatically combining a component with other components without the need for continuous drag and drop operations on the component. In other words, adsorption refers to the automatic combination (or automatic connection) of two or more components together. For example, taking the shape of component A and component B as square as an example, adsorption refers to fitting the right side of component A with the left side of component B, or adsorption refers to completely overlapping the right side of component A with the left side of component B, Alternatively, the adsorption refers to overlapping the right side of the A component with the left part of the B component, which is not limited in the present disclosure. In some embodiments, this way of automatically combining two or more components together through adsorption is called an adsorption operation, which is not limited in the present disclosure. In some embodiments, before determining the at least one second component, the terminal needs to determine the moving direction of the drag operation. In some embodiments, this step is implemented by: the terminal determines the moving direction of the drag operation based on the current position of the first component before the drag and the current position after the drag.
在一些实施例中,组件的当前位置表示为该组件在组件编辑界面中的坐标,该坐标包括横坐标x和纵坐标y。移动方向的表示方式能够根据需求进行设置和更改,本公开对此不作限定。在一些实施例中,该移动方向分解为水平方向和垂直方向,例如,该移动方向为左上,则水平方向为左,垂直方向为上;在一些实施例中,该移动方向为相对于第一组件的左上、左下、右上、右下、正左、正右、正上、正下中的任意一个方向。In some embodiments, the current position of the component is expressed as the coordinates of the component in the component editing interface, and the coordinates include the abscissa x and the ordinate y. The representation of the moving direction can be set and changed according to requirements, which is not limited in the present disclosure. In some embodiments, the moving direction is decomposed into a horizontal direction and a vertical direction, for example, if the moving direction is upper left, the horizontal direction is left, and the vertical direction is up; in some embodiments, the moving direction is relative to the first Any direction of the component's upper left, lower left, upper right, lower right, right left, right right, upper right, and lower right.
例如,第一组件为A组件,A组件在拖拽前的位置为(x1,y1),x1=2,y1=4;A组件在拖拽后的位置为(x2,y2),x2=1,y2=6;可见,x1大于x2,则水平方向为左,y1小于y2,则垂直方向为上,将水平方向与垂直方向组合成移动方向,得到拖拽A组件的拖拽操作的移动方向为左上。For example, the first component is component A, the position of component A before dragging is (x1, y1), x1=2, y1=4; the position of component A after dragging is (x2, y2), x2=1 , y2=6; it can be seen that if x1 is greater than x2, the horizontal direction is left, and y1 is less than y2, then the vertical direction is up, and the horizontal direction and the vertical direction are combined into a moving direction to obtain the moving direction of the drag operation of dragging the A component. for the upper left.
在一些实施例中,在确定该拖拽操作的移动方向之后,终端确定至少一个第二组件的实现方式为:基于该拖拽操作的移动方向,从该组件编辑界面中确定至少一个第二组件。In some embodiments, after determining the moving direction of the drag operation, the terminal determines the at least one second component by: determining at least one second component from the component editing interface based on the moving direction of the drag operation .
其中,由于在拖拽第一组件的过程中,在需要将第一组件吸附至第二组件的情况下,需要将第一组件拖拽至第二组件的附近,因此,该至少一个第二组件为该第一组件按照该移动方向移动后能够靠近的组件。在一些实施例中,终端基于该拖拽操作的移动方向,将该组件编辑界面中位于该移动方向上的组件确定为该第二组件。例如,该移动方向分为左上方向,终端将该组件编辑界面中位于第一组件的左上方向上的组件确定为该第二组件。Wherein, in the process of dragging the first component, when the first component needs to be adsorbed to the second component, the first component needs to be dragged to the vicinity of the second component, therefore, the at least one second component It is a component that can be approached after the first component moves according to the moving direction. In some embodiments, the terminal determines, based on the moving direction of the drag operation, a component located in the moving direction in the component editing interface as the second component. For example, the moving direction is divided into an upper left direction, and the terminal determines a component located in the upper left direction of the first component in the component editing interface as the second component.
例如,参见图6,该第一组件为B组件,B组件的坐标为(5,4),该移动方向为左上方向,该组件编辑界面中的其他组件分别为A组件、C组件、D组件、E组件、F组件、G组件和H组件,这些组件的坐标分别为(6,3)、(7,3)、(8,2.5)、(7,1.5)、(6.5,2)和(6.5, 1),在A组件的横坐标小于B组件的横坐标,且A组件的纵坐标大于A组件的纵坐标的情况下,终端确定A组件的当前位置位于B组件的左方和上方,将该A组件确定为第二组件。For example, referring to FIG. 6 , the first component is the B component, the coordinates of the B component are (5, 4), the moving direction is the upper left direction, and the other components in the component editing interface are the A component, the C component, and the D component respectively. , E component, F component, G component and H component, the coordinates of these components are (6, 3), (7, 3), (8, 2.5), (7, 1.5), (6.5, 2) and ( 6.5, 1), in the case that the abscissa of the A component is less than the abscissa of the B component, and the ordinate of the A component is greater than the ordinate of the A component, the terminal determines that the current position of the A component is located at the left and the top of the B component, This A component is determined as the second component.
在一些实施例中,终端确定至少一个第二组件后,将该至少一个第二组件组成组件集合。由于在拖拽过程中,终端能够周期性地确定第一组件需要吸附的目标组件,例如,终端每隔200ms确定一次目标组件。因此,通过将至少一个第二组件组成组件集合,便于终端在后续周期性确定目标组件的情况下,直接从该组件集合中确定目标组件,而不需要从整个组件编辑界面中确定,从而减少了终端确定目标组件时所需比对的组件数量,提高了组件编辑的操作效率。例如,终端将该至少一个第二组件组合成组件集合a,在拖拽过程中,在终端周期性确定目标组件的情况下,终端能够直接从组件集合a中确定目标组件。In some embodiments, after determining the at least one second component, the terminal composes the at least one second component into a component set. During the dragging process, the terminal can periodically determine the target component to be adsorbed by the first component, for example, the terminal determines the target component every 200 ms. Therefore, by forming at least one second component into a component set, it is convenient for the terminal to directly determine the target component from the component set when the target component is subsequently determined periodically, without the need to determine from the entire component editing interface, thereby reducing the need for The number of components to be compared when the terminal determines the target component, which improves the operation efficiency of component editing. For example, the terminal combines the at least one second component into a component set a. During the dragging process, when the terminal periodically determines the target component, the terminal can directly determine the target component from the component set a.
在本公开实施例中,终端基于该拖拽操作的移动方向来确定至少一个第二组件,进而在后续的编辑操作过程中,仅需从该至少一个第二组件中确定第一组件需要吸附的目标组件即可,无需对组件编辑界面中的所有组件进行运算,进而减少了组件编辑过程中的运算量,提高了组件编辑的操作效率。In this embodiment of the present disclosure, the terminal determines at least one second component based on the moving direction of the dragging operation, and further, in the subsequent editing operation process, it is only necessary to determine, from the at least one second component, the one that needs to be adsorbed by the first component. The target component is sufficient, and there is no need to perform operations on all components in the component editing interface, thereby reducing the amount of computation in the component editing process and improving the operational efficiency of component editing.
在步骤303中,对于每个第二组件,终端基于该第一组件的当前位置和该第二组件的当前位置,确定该第一组件与该第二组件之间的距离。In step 303, for each second component, the terminal determines the distance between the first component and the second component based on the current location of the first component and the current location of the second component.
其中,在基于该拖拽操作拖拽该第一组件的情况下,该第一组件的当前位置会发生变化,因此,在该第一组件的位置变化的过程中,终端需要从该至少一个第二组件中,确定该第一组件逐渐靠近的第二组件,即该第二组件与该第一组件之间的距离会随着第一组件的位置变化而减小。Wherein, in the case of dragging the first component based on the dragging operation, the current position of the first component will change. Therefore, in the process of changing the position of the first component, the terminal needs to start from the at least one first component. Among the two components, a second component that is gradually approached by the first component is determined, that is, the distance between the second component and the first component decreases as the position of the first component changes.
在本步骤中,终端基于第一组件的当前位置和尺寸信息、第二组件的当前位置和尺寸信息,确定该第一组件与该第二组件之间的距离。In this step, the terminal determines the distance between the first component and the second component based on the current position and size information of the first component and the current position and size information of the second component.
其中,对于任意一个组件,该组件的尺寸信息指示该组件的宽度(width)和高度(height)。例如,第一组件为B组件,B组件的当前位置为(x1,y1),尺寸信息为width1、height1,第二组件为A组件,A组件的当前位置为(x2,y2),尺寸信息为width2、height2。在A组件位于B组件的左上方向的情况下,确定x1与x2之间的差值为第一差值,确定该第一差值与width2之间的差值为第二差值,将该第二差值作为该A组件与该B组件之间的距离。Wherein, for any component, the size information of the component indicates the width (width) and height (height) of the component. For example, the first component is component B, the current position of component B is (x1, y1), the size information is width1, height1, the second component is component A, the current position of component A is (x2, y2), and the size information is width2, height2. When the A component is located in the upper left direction of the B component, the difference between x1 and x2 is determined as the first difference, the difference between the first difference and width2 is determined as the second difference, and the first difference is determined as the second difference. The two difference values are used as the distance between the A component and the B component.
在本公开实施例中,通过两个组件的当前位置来确定组件之间的距离,为后续确定目标组件提供了数据支持。In the embodiment of the present disclosure, the distance between the two components is determined by the current positions of the two components, which provides data support for the subsequent determination of the target component.
在一些实施例中,终端在执行步骤304之前,需要确定该拖拽操作的移动速度,基于该移动速度执行步骤304。在一些实施例中,由于该拖拽操作由鼠标指针拖拽该第一组件触发,在一些实施例中,终端确定该拖拽操作的移动速度的实现方式为:终端确定距离当前时间最 近的预设时长内的鼠标指针的位移,将该位移与该预设时长的比值作为该拖拽操作的移动速度。In some embodiments, before executing step 304, the terminal needs to determine the moving speed of the dragging operation, and execute step 304 based on the moving speed. In some embodiments, since the drag operation is triggered by dragging the first component with the mouse pointer, in some embodiments, the terminal determines the moving speed of the drag operation by: the terminal determines the preset time closest to the current time. The displacement of the mouse pointer within the duration is set, and the ratio of the displacement to the preset duration is used as the moving speed of the dragging operation.
其中,该预设时长能够根据需求进行设置并更改。本公开实施例对预设时长不作具体限定,例如,预设时长为200ms、300ms等。在一些实施例中,在确定该鼠标指针的位移的过程中,该鼠标指针始终选中该第一组件。The preset duration can be set and changed according to requirements. The embodiment of the present disclosure does not specifically limit the preset duration, for example, the preset duration is 200ms, 300ms, and the like. In some embodiments, in determining the displacement of the mouse pointer, the mouse pointer always selects the first component.
在本公开实施例中,每间隔预设时长对鼠标指针的位移进行采样,通过该位移与该预设时长,来确定该拖拽操作的实时移动速度,进而保证了移动速度的准确性。In the embodiment of the present disclosure, the displacement of the mouse pointer is sampled every preset duration, and the real-time moving speed of the drag operation is determined by the displacement and the preset duration, thereby ensuring the accuracy of the moving speed.
在步骤304中,终端基于该第一组件与每个第二组件之间的距离和该拖拽操作的移动速度,从该至少一个第二组件中确定目标组件。In step 304, the terminal determines a target component from the at least one second component based on the distance between the first component and each second component and the moving speed of the dragging operation.
其中,在对组件编辑操作的过程中,拖拽操作的移动速度不是固定不变的;例如,在需要将第一组件移动较大距离的情况下,需要快速拖动第一组件;在需要将第一组件移动较小距离的情况下,需要慢速拖动第一组件,以防移动速度过快,导致第一组件的移动距离超过所需的距离。因此,终端能够基于该第一组件与每个第二组件之间的距离和该拖拽操作的移动速度,来确定用户想要将第一组件吸附至哪个第二组件。Among them, in the process of editing the component, the moving speed of the dragging operation is not fixed; for example, when the first component needs to be moved a large distance, the first component needs to be dragged quickly; When the first component moves a small distance, the first component needs to be dragged at a slow speed to prevent the moving speed from being too fast, causing the moving distance of the first component to exceed the required distance. Therefore, the terminal can determine to which second component the user wants to adsorb the first component based on the distance between the first component and each second component and the moving speed of the dragging operation.
在一些实施例中,终端基于该拖拽操作的移动速度确定第一组件是否需要吸附至其他组件。示意性地,包括下述两种情况。In some embodiments, the terminal determines whether the first component needs to be adsorbed to other components based on the moving speed of the drag operation. Illustratively, the following two cases are included.
第一种情况,在拖拽操作的移动速度较大的情况下,为了节省计算资源,终端不确定目标组件。在一些实施例中,终端在该拖拽操作的移动速度大于第一速度阈值的情况下,基于该拖拽操作的移动速度,移动该第一组件。In the first case, when the moving speed of the drag operation is relatively large, in order to save computing resources, the terminal does not determine the target component. In some embodiments, when the moving speed of the drag operation is greater than the first speed threshold, the terminal moves the first component based on the movement speed of the drag operation.
其中,该第一速度阈值能够根据需求进行设置和更改,本公开实施例对此不作限定;例如,第一速度阈值为1像素数/20ms。The first speed threshold can be set and changed according to requirements, which is not limited in this embodiment of the present disclosure; for example, the first speed threshold is 1 pixel/20ms.
在本公开实施例中,该移动速度大于第一速度阈值表示该拖拽操作处于较快的速度状态,在这种情况下终端不确定目标组件,也即是不将第一组件吸附至其他组件,从而减少了终端性能的浪费。In this embodiment of the present disclosure, if the moving speed is greater than the first speed threshold, it indicates that the dragging operation is in a fast speed state. In this case, the terminal does not determine the target component, that is, does not adsorb the first component to other components , thereby reducing the waste of terminal performance.
第二种情况,在拖拽操作的移动速度不大的情况下,第一组件和第二组件之间的距离根据该拖拽操作的拖拽而变化。在一些实施例中,终端在该拖拽操作的移动速度不大于第一速度阈值的情况下,基于该第一组件与每个第二组件之间的距离,从该至少一个第二组件中确定目标组件,该第一组件与该目标组件之间的距离不大于距离阈值。In the second case, when the moving speed of the drag operation is not large, the distance between the first component and the second component changes according to the drag of the drag operation. In some embodiments, the terminal determines from the at least one second component based on the distance between the first component and each second component under the condition that the moving speed of the drag operation is not greater than the first speed threshold A target component, the distance between the first component and the target component is not greater than a distance threshold.
其中,该距离阈值能够根据需求进行设置和更改,本公开实施例对此不作限定;例如,距离阈值为8像素数、10像素数等。在该拖拽操作的移动速度不大,且第一组件和第二组件之间的距离较近的情况下,表明用户想要将该第一组件吸附至该第二组件,则终端将该第二 组件确定为目标组件。The distance threshold can be set and changed according to requirements, which is not limited in this embodiment of the present disclosure; for example, the distance threshold is 8 pixels, 10 pixels, and the like. In the case that the moving speed of the drag operation is not large and the distance between the first component and the second component is relatively short, it indicates that the user wants to adsorb the first component to the second component, and the terminal will set the first component to the second component. The second component is determined as the target component.
例如,参见图7,第一组件为B组件,第二组件为A组件,距离阈值为10像素数,移动速度不大于第一速度阈值,且B组件与A组件的之间的距离为5像素数,即B组件与A组件的之间的距离小于该距离阈值,终端将A组件确定为目标组件,将B组件吸附至A组件。For example, referring to FIG. 7 , the first component is the B component, the second component is the A component, the distance threshold is 10 pixels, the moving speed is not greater than the first speed threshold, and the distance between the B component and the A component is 5 pixels number, that is, the distance between the B component and the A component is less than the distance threshold, the terminal determines the A component as the target component, and adsorbs the B component to the A component.
在本公开实施例中,在拖拽操作的移动速度不大,且组件之间的距离小于距离阈值的情况下,将第二组件作为第一组件需要吸附的对象,从而无需用户继续拖拽该第一组件,节省了操作时间,提高了组件编辑的操作效率。In this embodiment of the present disclosure, when the moving speed of the drag operation is not large and the distance between components is smaller than the distance threshold, the second component is used as the object to be adsorbed by the first component, so that the user does not need to continue dragging the component. The first component saves operation time and improves the operation efficiency of component editing.
在一些实施例中,在终端已经将第一组件吸附至确定好的目标组件,且对第一组件的拖拽操作未停止的情况下,终端将第一组件从目标组件上脱离,并且通过缩小该拖拽操作的移动速度的方式,放大该拖拽操作的移动速度与该第一组件的移动速度之间的比例,其中,该第一组件的移动速度是指第一组件向目标组件靠近的速度。在一些实施例中,在该拖拽操作的移动速度不大于该第一速度阈值,且大于第二速度阈值的情况下,终端响应于该拖拽操作的移动速度降低,将该第一组件从该目标组件上脱离,以及将该拖拽操作的移动速度缩小第一预设倍数,得到第一移动速度,基于该第一移动速度移动该第一组件。In some embodiments, when the terminal has adsorbed the first component to the determined target component and the dragging operation on the first component has not stopped, the terminal detaches the first component from the target component, and the terminal removes the first component from the target component by zooming out The method of the moving speed of the drag operation amplifies the ratio between the moving speed of the drag operation and the moving speed of the first component, wherein the moving speed of the first component refers to the speed of the first component approaching the target component. speed. In some embodiments, under the condition that the moving speed of the drag operation is not greater than the first speed threshold and greater than the second speed threshold, in response to the decrease of the moving speed of the drag operation, the terminal removes the first component from the first speed threshold. The target component is disengaged, and the moving speed of the dragging operation is reduced by a first preset multiple to obtain a first moving speed, and the first component is moved based on the first moving speed.
其中,该第二速度阈值小于该第一速度阈值。例如,在第一速度阈值为1像素数/20ms的情况下,第二速度阈值为1像素数/30ms。在一些实施例中,该第二速度阈值能够根据需求进行设置和更改,本公开实施例对此不作限定。在一些实施例中,该第一预设倍数能够根据需求进行设置和更改,例如,第一预设倍数为5、4或其他等,本公开实施例对此不作限定。Wherein, the second speed threshold is smaller than the first speed threshold. For example, when the first speed threshold is 1 pixel/20ms, the second speed threshold is 1 pixel/30ms. In some embodiments, the second speed threshold can be set and changed according to requirements, which is not limited in this embodiment of the present disclosure. In some embodiments, the first preset multiple can be set and changed according to requirements, for example, the first preset multiple is 5, 4, or the like, which is not limited in this embodiment of the present disclosure.
其中,拖拽操作的移动速度不大于该第一速度阈值,且大于第二速度阈值表示该拖拽操作处于中速状态,在第一组件已经吸附至目标组件的情况下,用户仍在通过终端拖拽第一组件,那么表明用户的意图并非是将第一组件吸附至该目标组件,因此,将第一组件从目标组件上脱离,以避免出现因误吸附导致的无法对第一组件进行小距离移动的现象。Wherein, the moving speed of the drag operation is not greater than the first speed threshold, and greater than the second speed threshold indicates that the drag operation is in a medium-speed state. In the case that the first component has been adsorbed to the target component, the user is still using the terminal By dragging the first component, it indicates that the user's intention is not to attach the first component to the target component. Therefore, the first component should be detached from the target component, so as to avoid the failure to make small adjustments to the first component due to mis-adsorption. The phenomenon of distance movement.
在本公开实施例中,在第一组件已经吸附至目标组件,且拖拽操作并未停止的情况下,终端将第一组件从目标组件上脱离,并通过缩小拖拽操作的移动速度的方式,来拖拽第一组件,从而实现对第一组件的精细化操作,避免出现因误吸附导致的无法对第一组件进行小距离移动的现象,提高了组件编辑操作的精准度。In this embodiment of the present disclosure, when the first component has been adsorbed to the target component and the dragging operation has not stopped, the terminal detaches the first component from the target component and reduces the moving speed of the dragging operation. , to drag the first component, so as to realize the refined operation of the first component, avoid the phenomenon that the first component cannot be moved at a small distance due to false adsorption, and improve the accuracy of component editing operations.
在另一些实施例中,在该拖拽操作的移动速度较小的情况下,终端通过放大拖拽操作的移动速度的方式,放大该拖拽操作的移动速度与该第一组件的移动速度之间的比例,其中,该第一组件的移动速度是指第一组件向目标组件靠近的速度。在一些实施例中,在该拖拽操作的移动速度不大于第二速度阈值的情况下,终端将该拖拽操作的移动速度缩小第二预设倍数,得到第二移动速度,基于该第二移动速度移动该第一组件。In other embodiments, when the moving speed of the drag operation is relatively low, the terminal amplifies the difference between the movement speed of the drag operation and the movement speed of the first component by amplifying the movement speed of the drag operation. The moving speed of the first component refers to the speed at which the first component approaches the target component. In some embodiments, when the moving speed of the dragging operation is not greater than the second speed threshold, the terminal reduces the moving speed of the dragging operation by a second preset multiple to obtain a second moving speed, based on the second speed The movement speed moves the first component.
其中,拖拽操作的移动速度不大于该第二速度阈值表示该拖拽操作处于较慢的速度状态,表示用户想要对该第一组件进行精细化操作,因此,终端按照第二预设倍数缩小移动速度,得到第二移动速度,基于该第二移动速度来移动第一组件。在一些实施例中,该第二预设倍数能够根据需求进行设置和更改,例如,第二预设倍数为5、4或其他等。在一些实施例中,该第二预设倍数与上述第一预设倍数相同,在另一些实施例中,该第二预设倍数与上述第一预设倍数不同,本公开实施例对此不作限定。Wherein, the moving speed of the drag operation is not greater than the second speed threshold, indicating that the drag operation is in a slow speed state, indicating that the user wants to perform a refined operation on the first component. Therefore, the terminal uses the second preset multiple The movement speed is reduced to obtain a second movement speed, and the first component is moved based on the second movement speed. In some embodiments, the second preset multiple can be set and changed according to requirements, for example, the second preset multiple is 5, 4 or others. In some embodiments, the second preset multiple is the same as the first preset multiple, and in other embodiments, the second preset multiple is different from the first preset multiple, which is not made in the embodiments of the present disclosure. limited.
例如,在拖拽操作的移动速度处于较快的速度状态的情况下,拖拽操作的移动速度和第一组件的移动速度之间的比例为1:1,即拖拽操作的移动速度和第一组件的移动速度相等,即在拖拽操作的拖拽下,相同时间内,鼠标移动n像素数,对应的第一组件也会移动n像素数;而将拖拽操作的移动速度缩小后,如缩小第二预设倍数,得到第二移动速度,此时该第二移动速度和第一组件的移动速度之间的比例为4:1,即相同时间内,鼠标移动4像素数,对应的第一组件移动1像素数。For example, when the moving speed of the dragging operation is in a fast speed state, the ratio between the moving speed of the dragging operation and the moving speed of the first component is 1:1, that is, the moving speed of the dragging operation and the moving speed of the first component are 1:1. The moving speed of a component is equal, that is, under the dragging operation, if the mouse moves n pixels in the same time, the corresponding first component will also move n pixels; and after reducing the moving speed of the drag operation, If the second preset multiple is reduced, the second movement speed is obtained. At this time, the ratio between the second movement speed and the movement speed of the first component is 4:1, that is, the mouse moves 4 pixels in the same time, and the corresponding The first component is moved by 1 pixel.
在一些实施例中,在拖拽操作的移动方向发生改变的情况下,目标组件有时会发生变化,因此,在将拖拽操作的移动速度缩小预设倍数的情况下,终端恢复对第一组件的移动速度。在一些实施例中,终端响应于该拖拽操作的移动方向改变,且该第一组件与该目标组件之间的距离大于距离阈值,基于该拖拽操作的移动速度,移动该第一组件。In some embodiments, when the moving direction of the drag operation changes, the target component sometimes changes. Therefore, when the moving speed of the drag operation is reduced by a preset multiple, the terminal restores the control of the first component. movement speed. In some embodiments, the terminal moves the first component based on the moving speed of the drag operation in response to a change in the moving direction of the drag operation and the distance between the first component and the target component is greater than a distance threshold.
其中,在拖拽操作的移动方向发生改变的情况下,表示用户的意图可能并非将该第一组件吸附至目标组件,因此,在第一组件与目标组件之间的距离较大的情况下,基于拖拽操作的移动速度移动第一组件,即不再将移动速度缩小预设倍数。Wherein, when the moving direction of the drag operation changes, it means that the user's intention may not be to adsorb the first component to the target component. Therefore, when the distance between the first component and the target component is large, The first component is moved based on the moving speed of the dragging operation, that is, the moving speed is no longer reduced by a preset multiple.
在本公开实施例中,一方面,在拖拽操作的移动速度较慢的情况下,表示用户可能想要对第一组件进行精细化操作,因此通过缩小拖拽操作的移动速度和第一组件的移动速度之间的比例,来拖拽第一组件,从而实现对第一组件的精细化操作;另一方面,在第一组件和目标组件之间的距离大于距离阈值的情况下,终端无需再缩小拖拽操作的移动速度和第一组件的移动速度之间的比例,因此可恢复正常的拖拽操作,从而便于用户对第一组件进行其他编辑操作,提高组件编辑的操作效率。In the embodiments of the present disclosure, on the one hand, when the moving speed of the drag operation is slow, it indicates that the user may want to perform a refined operation on the first component, so by reducing the moving speed of the drag operation and the first component to drag the first component, so as to realize the refined operation of the first component; on the other hand, when the distance between the first component and the target component is greater than the distance threshold, the terminal does not need to The ratio between the moving speed of the dragging operation and the moving speed of the first component is further reduced, so the normal dragging operation can be restored, thereby facilitating the user to perform other editing operations on the first component and improving the operation efficiency of component editing.
在一些实施例中,在该第一组件与目标组件之间的距离不大于该距离阈值的情况下,即在组件编辑界面中,第一组件与目标组件之间的距离较近,终端在该组件编辑界面中设置一个提示区域。在一些实施例中,终端在该组件编辑界面中确定提示区域,在该提示区域内显示该第一组件与该目标组件之间的距离。In some embodiments, when the distance between the first component and the target component is not greater than the distance threshold, that is, in the component editing interface, the distance between the first component and the target component is relatively short, and the terminal is in this Set a prompt area in the component editing interface. In some embodiments, the terminal determines a prompt area in the component editing interface, and displays the distance between the first component and the target component in the prompt area.
其中,本公开实施例对提示区域的设置位置不作限定,例如,终端在该第一组件和该目标组件的上方设置该提示区域;或者,在该组件编辑界面的四周设置该提示区域。例如,参 见图8,第一组件为B组件,目标组件为A组件,距离阈值为10像素数,B组件与A组件的之间的距离为4像素数,则终端在该组件编辑界面中确定提示区域,在该提示区域中显示B组件与A组件之间的距离。The embodiment of the present disclosure does not limit the setting position of the prompt area. For example, the terminal sets the prompt area above the first component and the target component; or sets the prompt area around the component editing interface. For example, referring to Fig. 8, the first component is component B, the target component is component A, the distance threshold is 10 pixels, and the distance between component B and component A is 4 pixels, then the terminal determines in the component editing interface Prompt area in which the distance between the B component and the A component is displayed.
在本公开实施例中,终端以类放大镜的方式来设置一个提示区域,用于提示用户第一组件与目标组件之间的距离,便于用户基于该距离拖动第一组件至需要的位置,进一步地,这种方式能够避免该提示区域对其他组件造成遮挡,影响编辑操作。而且,通过显示提示区域,使得用户能够仅借助鼠标来对第一组件进行精细化的拖拽操作,无需借助键盘等设备,从而有效提高了组件编辑的操作效率。In this embodiment of the present disclosure, the terminal sets a prompt area in a magnifying glass-like manner to prompt the user the distance between the first component and the target component, so that the user can drag the first component to a desired position based on the distance, and further In this way, the prompt area can be prevented from obscuring other components and affecting editing operations. Moreover, by displaying the prompt area, the user can perform a refined drag operation on the first component only by using a mouse, without using a keyboard or other devices, thereby effectively improving the operation efficiency of component editing.
在步骤305中,终端将该第一组件吸附至该目标组件。In step 305, the terminal adsorbs the first component to the target component.
其中,在确定好目标组件之后,终端将第一组件吸附至该目标组件。在一些实施例中,终端在该拖拽操作停止的情况下,将该第一组件吸附至该目标组件,例如,终端在鼠标不再拖拽第一组件的情况下,将该第一组件吸附至该目标组件。Wherein, after the target component is determined, the terminal adsorbs the first component to the target component. In some embodiments, the terminal adsorbs the first component to the target component when the dragging operation is stopped, for example, the terminal adsorbs the first component when the mouse no longer drags the first component to the target component.
在一些实施例中,在基于该拖拽操作拖拽该第一组件的过程中,由于该拖拽操作在拖动第一组件,因此,第一组件的当前位置是变化的,该拖拽操作的移动速度也可能发生变化,在这种情况下,终端基于该拖拽操作的移动速度和第一组件的当前位置,重新确定该目标组件。终端重新确定该目标组件的过程与上述步骤302-304同理,在此不再赘述。In some embodiments, during the process of dragging the first component based on the dragging operation, since the dragging operation is dragging the first component, the current position of the first component is changed, and the dragging operation The moving speed of the first component may also change. In this case, the terminal re-determines the target component based on the moving speed of the dragging operation and the current position of the first component. The process of the terminal re-determining the target component is the same as the above steps 302-304, and details are not repeated here.
在本公开实施例中,在用户想要将两个组件吸附在一起的情况下,通过对其中一个组件进行拖拽,使得终端根据该组件与其他组件之间的距离和拖拽速度,自动确定一个目标组件,从而将该组件自动吸附至该目标组件,减少了吸附时间,提高了组件编辑的操作效率。同时,用户只需要改变拖拽操作的移动速度即可实现将该组件吸附至该目标组件,这样就不需要持续借助鼠标来操作组件,更不需要借助鼠标以外的设备(如键盘等)来操作组件,从而有效提高了组件编辑的操作效率。In the embodiment of the present disclosure, when the user wants to adsorb two components together, by dragging one of the components, the terminal can automatically determine the distance between the component and the other components and the dragging speed. A target component, so that the component is automatically adsorbed to the target component, which reduces the adsorption time and improves the operation efficiency of component editing. At the same time, the user only needs to change the moving speed of the drag operation to realize the adsorption of the component to the target component, so that there is no need to continuously use the mouse to operate the component, and there is no need to use devices other than the mouse (such as a keyboard, etc.) to operate. components, thereby effectively improving the operational efficiency of component editing.
图9是根据一示例性实施例示出的一种组件的吸附操作方法的流程图,如图9所示,该组件的吸附操作方法由终端执行,包括以下步骤。FIG. 9 is a flow chart of a method for adsorbing a component according to an exemplary embodiment. As shown in FIG. 9 , the method for adsorbing a component is performed by a terminal, and includes the following steps.
在步骤901中,终端运行渲染线程,通过该渲染线程,展示组件编辑界面,该组件编辑界面包括多个可编辑的组件。In step 901, the terminal runs a rendering thread, and through the rendering thread, a component editing interface is displayed, and the component editing interface includes a plurality of editable components.
其中,终端通过渲染引擎运行渲染线程,在终端的显示界面上显示该多个可编辑的组件,得到该组件编辑界面。The terminal runs the rendering thread through the rendering engine, displays the plurality of editable components on the display interface of the terminal, and obtains the component editing interface.
在步骤902中,终端响应于对该组件编辑界面中的第一组件的拖拽操作,运行计算线程,通过该计算线程,确定至少一个第二组件。In step 902, the terminal runs a calculation thread in response to the drag operation of the first component in the component editing interface, and determines at least one second component through the calculation thread.
其中,由于吸附操作的运算过程只和组件的当前位置和尺寸信息相关,因此,终端将组 件编辑界面中的组件抽象成只有当前位置和尺寸信息的对象,即将组件以纯数据的形式输入计算引擎,由计算引擎运行该计算线程。Among them, since the operation process of the adsorption operation is only related to the current position and size information of the component, the terminal abstracts the component in the component editing interface into an object with only the current position and size information, that is, the component is input into the calculation engine in the form of pure data, The compute thread is run by the compute engine.
其中,计算线程用于基于该组件的当前位置和尺寸信息,确定至少一个第二组件。在本步骤中,终端运行计算线程的实现方式包括:The computing thread is used to determine at least one second component based on the current position and size information of the component. In this step, the implementation of the terminal running the computing thread includes:
在一些实施例中,终端响应于当前终端支持多线程工具,通过运行该多线程工具的脚本文件,创建该计算线程,运行该计算线程。In some embodiments, in response to the current terminal supporting a multi-threaded tool, the terminal creates the computing thread by running a script file of the multi-threaded tool, and runs the computing thread.
在本步骤中,响应于当前终端中的浏览器支持Web Workers(多线程工具),终端通过运行Web Workers的脚本文件,创建计算线程,通过该计算线程,对该第一组件和组件编辑界面中的其他组件的当前位置和尺寸信息进行运算,确定至少一个第二组件,得到运算结果。In this step, in response to the browser in the current terminal supporting Web Workers (multi-threaded tool), the terminal creates a calculation thread by running the script file of the Web Workers, and through the calculation thread, the first component and the component editing interface are Calculate the current position and size information of other components, determine at least one second component, and obtain the operation result.
在另一些实施例中,终端响应于当前终端不支持该多线程工具,通过该当前终端与服务器之间的通信连接,借助于该服务器运行该计算线程。In other embodiments, in response to the current terminal not supporting the multi-threading tool, the terminal runs the computing thread by means of the server through a communication connection between the current terminal and the server.
其中,在终端不支持Web Workers的情况下,终端通过与服务器之间的通信连接,向服务器发送计算线程创建请求。在一些实施例中,该通信连接的通信协议为WebSocket(一种终端与服务器间进行全双工通信的通信协议)。服务器接收该计算线程创建请求,创建该计算线程,通过该计算线程,对该第一组件和组件编辑界面中的其他组件的当前位置和尺寸信息进行运算,确定至少一个第二组件,得到运算结果,服务器向终端发送该运算结果,终端接收该运算结果。Among them, in the case that the terminal does not support Web Workers, the terminal sends a computing thread creation request to the server through the communication connection with the server. In some embodiments, the communication protocol of the communication connection is WebSocket (a communication protocol for full-duplex communication between a terminal and a server). The server receives the calculation thread creation request, creates the calculation thread, and calculates the current position and size information of the first component and other components in the component editing interface through the calculation thread, determines at least one second component, and obtains the calculation result , the server sends the operation result to the terminal, and the terminal receives the operation result.
在本公开实施例中,通过将计算操作由终端中或者服务器中的独立的计算线程来执行,进而将计算操作从渲染线程中分离开,使得终端能够充分利用多核CPU(处理器)资源,提高了对组件进行吸附操作的计算效率。In the embodiment of the present disclosure, the computing operation is performed by an independent computing thread in the terminal or the server, and then the computing operation is separated from the rendering thread, so that the terminal can make full use of multi-core CPU (processor) resources, and improve the The computational efficiency of the adsorption operation for components is improved.
本步骤的实现方式与步骤302的实现方式同理,在此不再赘述。The implementation of this step is the same as the implementation of step 302, and details are not repeated here.
在步骤903中,对于每个第二组件,终端通过该计算线程,基于该第一组件的当前位置和该第二组件的当前位置,确定该第一组件与该第二组件之间的距离。In step 903, for each second component, the terminal determines the distance between the first component and the second component based on the current position of the first component and the current position of the second component through the calculation thread.
本步骤的实现方式与步骤303的实现方式同理,在此不再赘述。The implementation manner of this step is the same as the implementation manner of step 303, and details are not repeated here.
在步骤904中,终端通过该计算线程,基于该第一组件与每个第二组件之间的距离和该拖拽操作的移动速度,从该至少一个第二组件中确定目标组件。In step 904, the terminal determines, through the calculation thread, a target component from the at least one second component based on the distance between the first component and each second component and the moving speed of the drag operation.
其中,本步骤的实现方式与步骤304的实现方式同理,在此不再赘述。The implementation of this step is the same as the implementation of step 304, and details are not repeated here.
在步骤905中,终端通过该渲染线程,将该第一组件吸附至该目标组件。In step 905, the terminal attaches the first component to the target component through the rendering thread.
例如,渲染线程在组件编辑界面中将该第一组件吸附至该目标组件,并在该组件编辑界面中显示吸附状态。For example, the rendering thread adsorbs the first component to the target component in the component editing interface, and displays the adsorption state in the component editing interface.
在本公开实施例中,将组件编辑界面中的组件抽象成纯数据的形式,由计算线程来确定 待与第一组件进行吸附的目标组件,由渲染线程进行界面渲染以及基于计算线程确定出的目标组件,对第一组件和目标组件进行吸附操作,从而实现将吸附操作的确定从渲染线程中独立出来,由计算线程来完成,也即通过两个线程完成渲染操作和确定操作,从而提高了对组件进行吸附操作的运算效率。In the embodiment of the present disclosure, the components in the component editing interface are abstracted into the form of pure data, the target component to be adsorbed with the first component is determined by the computing thread, the interface rendering is performed by the rendering thread, and the The target component performs the adsorption operation on the first component and the target component, so that the determination of the adsorption operation is independent from the rendering thread and completed by the computing thread, that is, the rendering operation and the determination operation are completed through two threads, thereby improving the performance of the target component. Computational efficiency of snapping components.
图10是根据一示例性实施例示出的一种组件的辅助操作装置100框图。参照图10,该装置100包括:展示单元1001、确定单元1002和吸附单元1003。FIG. 10 is a block diagram of an auxiliary operation device 100 showing a component according to an exemplary embodiment. Referring to FIG. 10 , the apparatus 100 includes: a display unit 1001 , a determination unit 1002 and an adsorption unit 1003 .
展示单元1001,被配置为展示组件编辑界面,该组件编辑界面包括多个可编辑的组件;The presentation unit 1001 is configured to present a component editing interface, where the component editing interface includes a plurality of editable components;
确定单元1002,被配置为响应于对该组件编辑界面中的第一组件的拖拽操作,确定至少一个第二组件;a determining unit 1002, configured to determine at least one second component in response to a drag operation of the first component in the component editing interface;
该确定单元1002,被配置为基于该第一组件与每个第二组件之间的距离和该拖拽操作的移动速度,从该至少一个第二组件中确定目标组件;The determining unit 1002 is configured to determine a target component from the at least one second component based on the distance between the first component and each second component and the moving speed of the dragging operation;
吸附单元1003,被配置为将该第一组件吸附至该目标组件。The adsorption unit 1003 is configured to adsorb the first component to the target component.
在一些实施例中,该确定单元1002,被配置为响应于对该组件编辑界面中的第一组件的拖拽操作,基于该拖拽操作的移动方向,从该组件编辑界面中确定至少一个第二组件。In some embodiments, the determining unit 1002 is configured to, in response to a drag operation of the first component in the component editing interface, determine at least one first component from the component editing interface based on the moving direction of the drag operation Two components.
在一些实施例中,该确定单元1002,被配置为响应于对该组件编辑界面中的第一组件的拖拽操作,基于该拖拽操作的移动方向,将该组件编辑界面中位于该移动方向上的组件确定为该第二组件。In some embodiments, the determining unit 1002 is configured to, in response to a drag operation of the first component in the component editing interface, based on the moving direction of the drag operation, locate the component editing interface in the moving direction The component above is determined as the second component.
在一些实施例中,该确定单元1002,被配置为在该拖拽操作的移动速度不大于第一速度阈值的情况下,基于该第一组件与每个第二组件之间的距离,从该至少一个第二组件中确定目标组件,该第一组件与该目标组件之间的距离不大于距离阈值。In some embodiments, the determining unit 1002 is configured to, based on the distance between the first component and each second component, from the A target component is determined in at least one second component, and the distance between the first component and the target component is not greater than a distance threshold.
在一些实施例中,该装置还包括:In some embodiments, the apparatus further includes:
移动单元,被配置为在该拖拽操作的移动速度不大于该第一速度阈值,且大于第二速度阈值的情况下,响应于该拖拽操作的移动速度减慢,将该第一组件从该目标组件上脱离,以及将该拖拽操作的移动速度缩小第一预设倍数,得到第一移动速度,基于该第一移动速度移动该第一组件,其中,该第二速度阈值小于该第一速度阈值。The moving unit is configured to reduce the moving speed of the drag operation in response to the slowing down of the moving speed of the drag operation, and remove the first component from the first speed threshold when the moving speed of the drag operation is not greater than the first speed threshold and greater than the second speed threshold The target component is disengaged, and the moving speed of the drag operation is reduced by a first preset multiple to obtain a first moving speed, and the first component is moved based on the first moving speed, wherein the second speed threshold is smaller than the first speed threshold. a speed threshold.
在一些实施例中,该移动单元,被配置为在该拖拽操作的移动速度不大于第二速度阈值的情况下,将该拖拽操作的移动速度缩小第二预设倍数,得到第二移动速度,基于该第二移动速度移动该第一组件,其中,该第二速度阈值小于该第一速度阈值;In some embodiments, the moving unit is configured to reduce the moving speed of the dragging operation by a second preset multiple to obtain the second movement when the moving speed of the dragging operation is not greater than a second speed threshold. a speed to move the first component based on the second movement speed, wherein the second speed threshold is less than the first speed threshold;
该移动单元,被配置为响应于该拖拽操作的移动方向改变,且该第一组件与该目标组件之间的距离大于距离阈值,基于该拖拽操作的移动速度,移动该第一组件。The moving unit is configured to move the first component based on the moving speed of the drag operation in response to a change in the moving direction of the drag operation and the distance between the first component and the target component is greater than a distance threshold.
在一些实施例中,该移动单元,被配置为在该拖拽操作的移动速度大于该第一速度阈值 的情况下,基于该拖拽操作的移动速度,移动该第一组件。In some embodiments, the moving unit is configured to move the first component based on the moving speed of the dragging operation if the moving speed of the dragging operation is greater than the first speed threshold.
在一些实施例中,该装置还包括:In some embodiments, the apparatus further includes:
提示单元,被配置为在该组件编辑界面中确定提示区域,在该提示区域内显示该第一组件与该目标组件之间的距离。The prompt unit is configured to determine a prompt area in the component editing interface, and display the distance between the first component and the target component in the prompt area.
在一些实施例中,该装置还包括:In some embodiments, the apparatus further includes:
运行单元,被配置为运行渲染线程,通过该渲染线程,展示该组件编辑界面;The running unit is configured to run the rendering thread, and the component editing interface is displayed through the rendering thread;
该运行单元,被配置为运行计算线程,通过该计算线程,确定至少一个第二组件;基于该第一组件与每个该第二组件之间的距离和该拖拽操作的移动速度,从该至少一个第二组件中确定该目标组件。The running unit is configured to run a calculation thread, through which at least one second component is determined; based on the distance between the first component and each of the second components and the moving speed of the drag operation, from the The target component is determined in at least one second component.
在一些实施例中,该运行单元,被配置为运行该计算线程,通过该计算线程,基于该拖拽操作的移动方向,将该组件编辑界面中位于该移动方向上的组件确定为该第二组件。In some embodiments, the running unit is configured to run the calculation thread, and through the calculation thread, based on the moving direction of the dragging operation, the component in the component editing interface that is located in the moving direction is determined as the second components.
在一些实施例中,该装置还包括:In some embodiments, the apparatus further includes:
创建单元,被配置为响应于当前终端支持多线程工具,通过运行该多线程工具的脚本文件,创建该计算线程;The creation unit is configured to create the computing thread by running the script file of the multi-threaded tool in response to the current terminal supporting the multi-threaded tool;
该运行单元,被配置为响应于该当前终端不支持该多线程工具,通过该当前终端与服务器之间的通信连接,借助于该服务器运行该计算线程。The running unit is configured to, in response to the current terminal not supporting the multi-threading tool, run the computing thread by means of the server through the communication connection between the current terminal and the server.
关于上述实施例中的装置,其中各个组件执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the apparatus in the above-mentioned embodiment, the specific manner in which each component performs the operation has been described in detail in the embodiment of the method, and will not be described in detail here.
图11是根据一示例性实施例示出的一种终端10的框图。在一些实施例中,该终端10为:智能手机、平板电脑、笔记本电脑或台式电脑等。在一些实施例中,终端10被称为用户设备、便携式终端、膝上型终端、台式终端等其他名称。FIG. 11 is a block diagram of a terminal 10 according to an exemplary embodiment. In some embodiments, the terminal 10 is a smart phone, a tablet computer, a notebook computer or a desktop computer, and the like. In some embodiments, terminal 10 is referred to as user equipment, portable terminal, laptop terminal, desktop terminal, and the like by other names.
通常,终端10包括有:处理器101和存储器102。Generally, the terminal 10 includes: a processor 101 and a memory 102 .
在一些实施例中,处理器101包括一个或多个处理核心,比如4核心处理器、8核心处理器等。在一些实施例中,处理器101采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。在一些实施例中,处理器101也包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central Processing Unit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器101集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器101还包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的 计算操作。In some embodiments, the processor 101 includes one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. In some embodiments, the processor 101 adopts at least one of DSP (Digital Signal Processing, digital signal processing), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, programmable logic array). A form of hardware implementation. In some embodiments, the processor 101 also includes a main processor and a co-processor. The main processor is a processor for processing data in a wake-up state, also referred to as a CPU (Central Processing Unit, central processing unit). ; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 101 is integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used for rendering and drawing the content that needs to be displayed on the display screen. In some embodiments, the processor 101 further includes an AI (Artificial Intelligence, artificial intelligence) processor, where the AI processor is used to process computing operations related to machine learning.
在一些实施例中,存储器102包括一个或多个非易失性存储介质,该非易失性存储介质是非暂态的。在一些实施例中,存储器102还包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器102中的非易失性存储介质用于存储至少一个指令,该至少一个指令用于被处理器101所执行以实现本公开中方法实施例提供的组件的吸附操作方法。In some embodiments, memory 102 includes one or more non-volatile storage media that are non-transitory. In some embodiments, memory 102 also includes high-speed random access memory, and non-volatile memory, such as one or more disk storage devices, flash storage devices. In some embodiments, the non-volatile storage medium in the memory 102 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 101 to implement the adsorption operation method of the component provided by the method embodiment of the present disclosure .
在一些实施例中,终端10还可选包括有:外围设备接口103和至少一个外围设备。在一些实施例中,处理器101、存储器102和外围设备接口103之间通过总线或信号线相连。在一些实施例中,各个外围设备通过总线、信号线或电路板与外围设备接口103相连。具体地,外围设备包括:射频电路104、显示屏105、摄像头组件106、音频电路107、定位组件108和电源109中的至少一种。In some embodiments, the terminal 10 may optionally further include: a peripheral device interface 103 and at least one peripheral device. In some embodiments, the processor 101, the memory 102 and the peripheral device interface 103 are connected through a bus or a signal line. In some embodiments, each peripheral device is connected to the peripheral device interface 103 through a bus, signal line or circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 104 , a display screen 105 , a camera assembly 106 , an audio circuit 107 , a positioning assembly 108 and a power supply 109 .
外围设备接口103可被用于将I/O(Input/Output,输入/输出)相关的至少一个外围设备连接到处理器101和存储器102。在一些实施例中,处理器101、存储器102和外围设备接口103被集成在同一芯片或电路板上;在一些其他实施例中,处理器101、存储器102和外围设备接口103中的任意一个或两个在单独的芯片或电路板上实现,本实施例对此不加以限定。The peripheral device interface 103 may be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 101 and the memory 102 . In some embodiments, processor 101, memory 102, and peripherals interface 103 are integrated on the same chip or circuit board; in some other embodiments, any one of processor 101, memory 102, and peripherals interface 103 or The two are implemented on a separate chip or circuit board, which is not limited in this embodiment.
射频电路104用于接收和发射RF(Radio Frequency,射频)信号,也称电磁信号。射频电路104通过电磁信号与通信网络以及其他通信设备进行通信。射频电路104将电信号转换为电磁信号进行发送,或者,将接收到的电磁信号转换为电信号。在一些实施例中,射频电路104包括:天线系统、RF收发器、一个或多个放大器、调谐器、振荡器、数字信号处理器、编解码芯片组、用户身份模块卡等等。在一些实施例中,射频电路104通过至少一种无线通信协议来与其他终端进行通信。该无线通信协议包括但不限于:万维网、城域网、内联网、各代移动通信网络(2G、3G、4G及5G)、无线局域网和/或WiFi(Wireless Fidelity,无线保真)网络。在一些实施例中,射频电路104还包括NFC(Near Field Communication,近距离无线通信)有关的电路,本公开对此不加以限定。The radio frequency circuit 104 is used for receiving and transmitting RF (Radio Frequency, radio frequency) signals, also called electromagnetic signals. The radio frequency circuit 104 communicates with the communication network and other communication devices via electromagnetic signals. The radio frequency circuit 104 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. In some embodiments, radio frequency circuitry 104 includes an antenna system, an RF transceiver, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and the like. In some embodiments, radio frequency circuitry 104 communicates with other terminals via at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: World Wide Web, Metropolitan Area Network, Intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), wireless local area network and/or WiFi (Wireless Fidelity, Wireless Fidelity) network. In some embodiments, the radio frequency circuit 104 further includes a circuit related to NFC (Near Field Communication, short-range wireless communication), which is not limited in the present disclosure.
显示屏105用于显示UI(User Interface,用户界面)。在一些实施例中,该UI包括图形、文本、图标、视频及其他们的任意组合。当显示屏105是触摸显示屏时,显示屏105还具有采集在显示屏105的表面或表面上方的触摸信号的能力。在一些实施例中,该触摸信号作为控制信号输入至处理器101进行处理。此时,显示屏105还用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏105为一个,设置在终端10的前面板;在另一些实施例中,显示屏105为至少两个,分别设置在终端10的不同表面或呈折叠设计;在另一些实施例中,显示屏105是柔性显示屏,设置在终端10的弯曲表面上或折叠面上。甚 至,显示屏105还设置成非矩形的不规则图形,也即异形屏。在一些实施例中,显示屏105采用LCD(Liquid Crystal Display,液晶显示屏)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。The display screen 105 is used for displaying UI (User Interface, user interface). In some embodiments, the UI includes graphics, text, icons, video, and any combination thereof. When the display screen 105 is a touch display screen, the display screen 105 also has the ability to acquire touch signals on or above the surface of the display screen 105 . In some embodiments, the touch signal is input to the processor 101 as a control signal for processing. At this time, the display screen 105 is also used to provide virtual buttons and/or virtual keyboards, also called soft buttons and/or soft keyboards. In some embodiments, there is one display screen 105, which is arranged on the front panel of the terminal 10; in other embodiments, there are at least two display screens 105, which are respectively arranged on different surfaces of the terminal 10 or in a folded design; In some embodiments, the display screen 105 is a flexible display screen disposed on a curved or folded surface of the terminal 10 . Even, the display screen 105 is also set as a non-rectangular irregular figure, that is, a special-shaped screen. In some embodiments, the display screen 105 is made of materials such as LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, organic light emitting diode).
摄像头组件106用于采集图像或视频。在一些实施例中,摄像头组件106包括前置摄像头和后置摄像头。通常,前置摄像头设置在终端的前面板,后置摄像头设置在终端的背面。在一些实施例中,后置摄像头为至少两个,分别为主摄像头、景深摄像头、广角摄像头、长焦摄像头中的任意一种,以实现主摄像头和景深摄像头融合实现背景虚化功能、主摄像头和广角摄像头融合实现全景拍摄以及VR(Virtual Reality,虚拟现实)拍摄功能或者其他融合拍摄功能。在一些实施例中,摄像头组件106还包括闪光灯。在一些实施例中,闪光灯是单色温闪光灯,在一些实施例中,闪光灯是双色温闪光灯。双色温闪光灯是指暖光闪光灯和冷光闪光灯的组合,用于不同色温下的光线补偿。The camera assembly 106 is used to capture images or video. In some embodiments, the camera assembly 106 includes a front-facing camera and a rear-facing camera. Usually, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth-of-field camera to realize the background blur function, the main camera It is integrated with the wide-angle camera to achieve panoramic shooting and VR (Virtual Reality, virtual reality) shooting functions or other integrated shooting functions. In some embodiments, the camera assembly 106 also includes a flash. In some embodiments, the flash is a single color temperature flash, and in some embodiments, the flash is a dual color temperature flash. Dual color temperature flash refers to the combination of warm light flash and cold light flash, which is used for light compensation under different color temperatures.
在一些实施例中,音频电路107包括麦克风和扬声器。麦克风用于采集用户及环境的声波,并将声波转换为电信号输入至处理器101进行处理,或者输入至射频电路104以实现语音通信。出于立体声采集或降噪的目的,在一些实施例中,麦克风为多个,分别设置在终端10的不同部位。在一些实施例中,麦克风是阵列麦克风或全向采集型麦克风。扬声器则用于将来自处理器101或射频电路104的电信号转换为声波。在一些实施例中,扬声器是传统的薄膜扬声器,在一些实施例中,扬声器以是压电陶瓷扬声器。当扬声器是压电陶瓷扬声器时,不仅能够将电信号转换为人类可听见的声波,也能够将电信号转换为人类听不见的声波以进行测距等用途。在一些实施例中,音频电路107还包括耳机插孔。In some embodiments, the audio circuit 107 includes a microphone and a speaker. The microphone is used to collect the sound waves of the user and the environment, convert the sound waves into electrical signals, and input them to the processor 101 for processing, or input them to the radio frequency circuit 104 to realize voice communication. For the purpose of stereo collection or noise reduction, in some embodiments, there are multiple microphones, which are respectively disposed at different parts of the terminal 10 . In some embodiments, the microphones are array microphones or omnidirectional collection microphones. The speaker is used to convert the electrical signal from the processor 101 or the radio frequency circuit 104 into sound waves. In some embodiments, the loudspeaker is a conventional thin-film loudspeaker, and in some embodiments, the loudspeaker is a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for distance measurement and other purposes. In some embodiments, the audio circuit 107 also includes a headphone jack.
定位组件108用于定位终端10的当前地理位置,以实现导航或LBS(Location Based Service,基于位置的服务)。在一些实施例中,定位组件107是基于美国的GPS(Global Positioning System,全球定位系统)、中国的北斗系统或俄罗斯的伽利略系统的定位组件。The positioning component 108 is used to locate the current geographic location of the terminal 10 to implement navigation or LBS (Location Based Service). In some embodiments, the positioning component 107 is a positioning component based on the GPS (Global Positioning System, Global Positioning System) of the United States, the Beidou system of China or the Galileo system of Russia.
电源109用于为终端10中的各个组件进行供电。在一些实施例中,电源109是交流电、直流电、一次性电池或可充电电池。当电源109包括可充电电池时,该可充电电池是有线充电电池或无线充电电池。有线充电电池是通过有线线路充电的电池,无线充电电池是通过无线线圈充电的电池。该可充电电池还用于支持快充技术。The power supply 109 is used to power various components in the terminal 10 . In some embodiments, the power source 109 is alternating current, direct current, a disposable battery, or a rechargeable battery. When the power source 109 includes a rechargeable battery, the rechargeable battery is a wired rechargeable battery or a wireless rechargeable battery. Wired rechargeable batteries are batteries that are charged through wired lines, and wireless rechargeable batteries are batteries that are charged through wireless coils. The rechargeable battery is also used to support fast charging technology.
在一些实施例中,终端10还包括有一个或多个传感器110。该一个或多个传感器110包括但不限于:加速度传感器111、陀螺仪传感器112、压力传感器113、指纹传感器114、光学传感器115以及接近传感器116。In some embodiments, the terminal 10 further includes one or more sensors 110 . The one or more sensors 110 include, but are not limited to, an acceleration sensor 111 , a gyro sensor 112 , a pressure sensor 113 , a fingerprint sensor 114 , an optical sensor 115 and a proximity sensor 116 .
在一些实施例中,加速度传感器111检测以终端10建立的坐标系的三个坐标轴上的加速度大小。比如,加速度传感器111用于检测重力加速度在三个坐标轴上的分量。在一些实施 例中,处理器101根据加速度传感器111采集的重力加速度信号,控制显示屏105以横向视图或纵向视图进行用户界面的显示。在一些实施例中,加速度传感器111还用于游戏或者用户的运动数据的采集。In some embodiments, the acceleration sensor 111 detects the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 10 . For example, the acceleration sensor 111 is used to detect the components of the gravitational acceleration on the three coordinate axes. In some embodiments, the processor 101 controls the display screen 105 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 111. In some embodiments, the acceleration sensor 111 is also used for game or user movement data collection.
在一些实施例中,陀螺仪传感器112检测终端10的机体方向及转动角度,陀螺仪传感器112与加速度传感器111协同采集用户对终端10的3D动作。处理器101根据陀螺仪传感器112采集的数据,能够实现如下功能:动作感应(比如根据用户的倾斜操作来改变UI)、拍摄时的图像稳定、游戏控制以及惯性导航。In some embodiments, the gyro sensor 112 detects the body direction and rotation angle of the terminal 10 , and the gyro sensor 112 cooperates with the acceleration sensor 111 to collect 3D actions of the user on the terminal 10 . The processor 101 can implement the following functions according to the data collected by the gyro sensor 112 : motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
在一些实施例中,压力传感器113设置在终端10的侧边框和/或显示屏105的下层。当压力传感器113设置在终端10的侧边框时,能够检测用户对终端10的握持信号,由处理器101根据压力传感器113采集的握持信号进行左右手识别或快捷操作。当压力传感器113设置在显示屏105的下层时,由处理器101根据用户对显示屏105的压力操作,实现对UI界面上的可操作性控件进行控制。可操作性控件包括按钮控件、滚动条控件、图标控件、菜单控件中的至少一种。In some embodiments, the pressure sensor 113 is disposed on the side frame of the terminal 10 and/or the lower layer of the display screen 105 . When the pressure sensor 113 is disposed on the side frame of the terminal 10 , it can detect the user's holding signal of the terminal 10 , and the processor 101 performs left and right hand identification or shortcut operations according to the holding signal collected by the pressure sensor 113 . When the pressure sensor 113 is disposed on the lower layer of the display screen 105 , the processor 101 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 105 . The operability controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
指纹传感器114用于采集用户的指纹,由处理器101根据指纹传感器114采集到的指纹识别用户的身份,或者,由指纹传感器114根据采集到的指纹识别用户的身份。在识别出用户的身份为可信身份时,由处理器101授权该用户执行相关的敏感操作,该敏感操作包括解锁屏幕、查看加密信息、下载软件、支付及更改设置等。在一些实施例中,指纹传感器114被设置在终端10的正面、背面或侧面。当终端10上设置有物理按键或厂商Logo时,指纹传感器114与物理按键或厂商Logo集成在一起。The fingerprint sensor 114 is used to collect the user's fingerprint, and the processor 101 identifies the user's identity according to the fingerprint collected by the fingerprint sensor 114 , or the fingerprint sensor 114 identifies the user's identity according to the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 101 authorizes the user to perform relevant sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. In some embodiments, the fingerprint sensor 114 is disposed on the front, back, or sides of the terminal 10 . When the terminal 10 is provided with a physical button or a manufacturer's logo, the fingerprint sensor 114 is integrated with the physical button or the manufacturer's logo.
光学传感器115用于采集环境光强度。在一个实施例中,处理器101根据光学传感器115采集的环境光强度,控制显示屏105的显示亮度。具体地,当环境光强度较高时,调高显示屏105的显示亮度;当环境光强度较低时,调低显示屏105的显示亮度。在另一个实施例中,处理器101还根据光学传感器115采集的环境光强度,动态调整摄像头组件106的拍摄参数。The optical sensor 115 is used to collect ambient light intensity. In one embodiment, the processor 101 controls the display brightness of the display screen 105 according to the ambient light intensity collected by the optical sensor 115 . Specifically, when the ambient light intensity is high, the display brightness of the display screen 105 is increased; when the ambient light intensity is low, the display brightness of the display screen 105 is decreased. In another embodiment, the processor 101 also dynamically adjusts the shooting parameters of the camera assembly 106 according to the ambient light intensity collected by the optical sensor 115 .
接近传感器116,也称距离传感器,通常设置在终端10的前面板。接近传感器116用于采集用户与终端10的正面之间的距离。在一个实施例中,在接近传感器116检测到用户与终端10的正面之间的距离逐渐变小的情况下,由处理器101控制显示屏105从亮屏状态切换为息屏状态;在接近传感器116检测到用户与终端10的正面之间的距离逐渐变大的情况下,由处理器101控制显示屏105从息屏状态切换为亮屏状态。The proximity sensor 116 , also referred to as a distance sensor, is usually provided on the front panel of the terminal 10 . The proximity sensor 116 is used to collect the distance between the user and the front of the terminal 10 . In one embodiment, when the proximity sensor 116 detects that the distance between the user and the front of the terminal 10 is gradually decreasing, the processor 101 controls the display screen 105 to switch from the bright screen state to the off screen state; 116 When it is detected that the distance between the user and the front of the terminal 10 gradually increases, the processor 101 controls the display screen 105 to switch from the screen-off state to the screen-on state.
本领域技术人员能够理解,图11中示出的结构并不构成对终端10的限定,能够包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。Those skilled in the art can understand that the structure shown in FIG. 11 does not constitute a limitation on the terminal 10, and can include more or less components than the one shown, or combine some components, or adopt different component arrangements.
在示例性实施例中,还提供了一种非易失性存储介质,当该非易失性存储介质中的指令 由终端的处理器执行时,使得终端能够执行如上述实施例中的组件的吸附操作方法。In an exemplary embodiment, a non-volatile storage medium is also provided, when the instructions in the non-volatile storage medium are executed by the processor of the terminal, the terminal can execute the components in the above-mentioned embodiments. adsorption method.
在示例性实施例中,还提供了一种计算机程序产品,包括计算机程序/指令,该计算机程序/指令被处理器执行时实现上述实施例中的组件的吸附操作方法。In an exemplary embodiment, a computer program product is also provided, including a computer program/instruction, when the computer program/instruction is executed by a processor, the method for adsorbing the components in the above-mentioned embodiment is implemented.
另外,本公开提供一种组件的吸附操作方法,该方法包括:In addition, the present disclosure provides an adsorption operation method of a component, the method comprising:
展示组件编辑界面,该组件编辑界面包括多个可编辑的组件;Display the component editing interface, which includes multiple editable components;
响应于对该组件编辑界面中的第一组件的拖拽操作,确定该第一组件待吸附的至少一个第二组件;In response to the drag operation of the first component in the component editing interface, determining at least one second component to be adsorbed by the first component;
对于每个第二组件,基于该第一组件的当前位置和该第二组件的当前位置,确定该第一组件与该第二组件之间的距离;for each second component, determining the distance between the first component and the second component based on the current location of the first component and the current location of the second component;
基于该拖拽操作的移动速度和该第一组件与每个第二组件之间的距离,从该至少一个第二组件中确定目标组件;determining a target component from the at least one second component based on the moving speed of the drag operation and the distance between the first component and each of the second components;
将该第一组件与该目标组件进行吸附。The first component and the target component are adsorbed.
在一些实施例中,该确定该第一组件待吸附的至少一个第二组件包括:In some embodiments, the determining of at least one second component to be adsorbed by the first component includes:
基于该拖拽操作的移动方向,从该组件编辑界面中确定该第一组件待吸附的至少一个第二组件。Based on the moving direction of the drag operation, at least one second component to be adsorbed by the first component is determined from the component editing interface.
在一些实施例中,该基于该拖拽操作的移动速度和该第一组件与每个第二组件之间的距离,从该至少一个第二组件中确定该目标组件包括:In some embodiments, the determining the target component from the at least one second component based on the moving speed of the drag operation and the distance between the first component and each second component includes:
在该拖拽操作的移动速度不大于第一速度阈值的情况下,基于该第一组件与每个第二组件之间的距离,从该至少一个第二组件中,确定距离不大于距离阈值的目标组件。In the case where the moving speed of the drag operation is not greater than the first speed threshold, based on the distance between the first component and each of the second components, from the at least one second component, determine that the distance is not greater than the distance threshold target component.
在一些实施例中,该方法还包括:In some embodiments, the method further includes:
在该拖拽操作的移动速度不大于该第一速度阈值,且大于第二速度阈值的情况下,响应于该拖拽操作的移动速度降低,将该第一组件和该目标组件脱离吸附状态,以及将该拖拽操作的移动速度缩小预设倍数,基于缩小后的移动速度移动该第一组件。In the case where the moving speed of the drag operation is not greater than the first speed threshold and greater than the second speed threshold, in response to the decrease in the moving speed of the drag operation, the first component and the target component are released from the adsorption state, and reduce the moving speed of the drag operation by a preset multiple, and move the first component based on the reduced moving speed.
在一些实施例中,该方法还包括:In some embodiments, the method further includes:
在该拖拽操作的移动速度不大于第二速度阈值的情况下,将该拖拽操作的移动速度缩小预设倍数,基于缩小后的移动速度移动该第一组件;In the case that the movement speed of the drag operation is not greater than the second speed threshold, reduce the movement speed of the drag operation by a preset multiple, and move the first component based on the reduced movement speed;
响应于该拖拽操作的移动方向改变,且该第一组件与该目标组件之间的距离增大至大于距离阈值,基于该拖拽操作的移动速度,移动该第一组件。In response to the movement direction of the drag operation changing and the distance between the first component and the target component increases to be greater than a distance threshold, the first component is moved based on the movement speed of the drag operation.
在一些实施例中,该方法还包括:In some embodiments, the method further includes:
在该拖拽操作的移动速度大于该第一速度阈值的情况下,基于该拖拽操作的移动速度,移动该第一组件。In the case where the moving speed of the drag operation is greater than the first speed threshold, the first component is moved based on the moving speed of the drag operation.
在一些实施例中,该方法还包括:In some embodiments, the method further includes:
在该组件编辑界面中确定提示区域,在该提示区域内显示该第一组件与该目标组件之间的距离。A prompt area is determined in the component editing interface, and the distance between the first component and the target component is displayed in the prompt area.
在一些实施例中,该方法还包括:In some embodiments, the method further includes:
运行渲染线程,通过该渲染线程,执行该展示该组件编辑界面的步骤;Run the rendering thread, and execute the step of displaying the editing interface of the component through the rendering thread;
运行计算线程,通过该计算线程,执行该确定该第一组件待吸附的至少一个第二组件;对于每个第二组件,基于该第一组件的当前位置和该第二组件的当前位置,确定该第一组件与该第二组件之间的距离;基于该拖拽操作的移动速度和该第一组件与每个第二组件之间的距离,从该至少一个第二组件中确定该目标组件的步骤。Running a calculation thread, through the calculation thread, executing the determining of at least one second component to be adsorbed by the first component; for each second component, based on the current position of the first component and the current position of the second component, determine the distance between the first component and the second component; determining the target component from the at least one second component based on the moving speed of the drag operation and the distance between the first component and each second component A step of.
在一些实施例中,该运行计算线程包括:In some embodiments, the running computational thread includes:
响应于当前终端支持多线程工具,通过运行该多线程工具的脚本文件,创建该计算线程,运行该计算线程;In response to the current terminal supporting a multi-threaded tool, the computing thread is created by running the script file of the multi-threaded tool, and the computing thread is run;
响应于该当前终端不支持该多线程工具,通过该当前终端与服务器之间的通信连接,借助于该服务器运行该计算线程。In response to the current terminal not supporting the multi-threading tool, the computing thread is run by means of the server through a communication connection between the current terminal and the server.
本公开所有实施例均能够单独被执行,还能够与其他实施例相结合被执行,均视为本公开要求的保护范围。All the embodiments of the present disclosure can be implemented independently or in combination with other embodiments, which are all regarded as the protection scope required by the present disclosure.

Claims (35)

  1. 一种组件的吸附操作方法,由终端执行,包括:An adsorption operation method of a component, performed by a terminal, includes:
    展示组件编辑界面,所述组件编辑界面包括多个可编辑的组件;Displaying a component editing interface, the component editing interface includes a plurality of editable components;
    响应于对所述组件编辑界面中的第一组件的拖拽操作,确定至少一个第二组件;determining at least one second component in response to a drag operation on the first component in the component editing interface;
    基于所述第一组件与每个所述第二组件之间的距离和所述拖拽操作的移动速度,从所述至少一个第二组件中确定目标组件;determining a target component from the at least one second component based on the distance between the first component and each of the second components and the speed of movement of the drag operation;
    将所述第一组件吸附至所述目标组件。Snap the first component to the target component.
  2. 根据权利要求1所述的组件的吸附操作方法,其中,所述响应于对所述组件编辑界面中的第一组件的拖拽操作,确定至少一个第二组件包括:The component adsorption operation method according to claim 1, wherein the determining at least one second component in response to a drag operation on the first component in the component editing interface comprises:
    响应于对所述组件编辑界面中的第一组件的拖拽操作,基于所述拖拽操作的移动方向,从所述组件编辑界面中确定至少一个第二组件。In response to a drag operation on a first component in the component editing interface, at least one second component is determined from the component editing interface based on a movement direction of the drag operation.
  3. 根据权利要求1所述的组件的吸附操作方法,其中,所述响应于对所述组件编辑界面中的第一组件的拖拽操作,基于所述拖拽操作的移动方向,从所述组件编辑界面中确定至少一个第二组件包括:The component adsorption operation method according to claim 1, wherein, in response to a drag operation on the first component in the component editing interface, based on the moving direction of the drag operation, the component is edited from the component. Determining at least one second component in the interface includes:
    响应于对所述组件编辑界面中的第一组件的拖拽操作,基于所述拖拽操作的移动方向,将所述组件编辑界面中位于所述移动方向上的组件确定为所述第二组件。In response to the drag operation on the first component in the component editing interface, based on the moving direction of the drag operation, determine the component located in the moving direction in the component editing interface as the second component .
  4. 根据权利要求1所述的组件的吸附操作方法,其中,所述基于所述第一组件与每个所述第二组件之间的距离和所述拖拽操作的移动速度,从所述至少一个第二组件中确定所述目标组件包括:The suction operation method for components according to claim 1, wherein said at least one component is obtained from the at least one Determining the target component in the second component includes:
    在所述拖拽操作的移动速度不大于第一速度阈值的情况下,基于所述第一组件与每个所述第二组件之间的距离,从所述至少一个第二组件中确定所述目标组件,所述第一组件与所述目标组件之间的距离不大于距离阈值。In the case where the moving speed of the drag operation is not greater than a first speed threshold, determining the at least one second component based on a distance between the first component and each of the second components A target component, the distance between the first component and the target component is not greater than a distance threshold.
  5. 根据权利要求4所述的组件的吸附操作方法,其中,所述方法还包括:The adsorption operation method of the assembly according to claim 4, wherein the method further comprises:
    在所述拖拽操作的移动速度不大于所述第一速度阈值,且大于第二速度阈值的情况下,响应于所述拖拽操作的移动速度减慢,将所述第一组件从所述目标组件上脱离,以及将所述拖拽操作的移动速度缩小第一预设倍数,得到第一移动速度,基于所述第一移动速度移动所 述第一组件,其中,所述第二速度阈值小于所述第一速度阈值。In the case where the moving speed of the drag operation is not greater than the first speed threshold and greater than the second speed threshold, in response to the slowing down of the moving speed of the drag operation, the first component is removed from the The target component is disengaged from the top, and the moving speed of the drag operation is reduced by a first preset multiple to obtain a first moving speed, and the first component is moved based on the first moving speed, wherein the second speed threshold is less than the first speed threshold.
  6. 根据权利要求4所述的组件的吸附操作方法,其中,所述方法还包括:The adsorption operation method of the assembly according to claim 4, wherein the method further comprises:
    在所述拖拽操作的移动速度不大于第二速度阈值的情况下,将所述拖拽操作的移动速度缩小第二预设倍数,得到第二移动速度,基于所述第二移动速度移动所述第一组件,其中,所述第二速度阈值小于所述第一速度阈值;In the case where the moving speed of the drag operation is not greater than the second speed threshold, the moving speed of the drag operation is reduced by a second preset multiple to obtain a second moving speed, and the moving speed is moved based on the second moving speed. the first component, wherein the second speed threshold is less than the first speed threshold;
    响应于所述拖拽操作的移动方向改变,且所述第一组件与所述目标组件之间的距离大于所述距离阈值,基于所述拖拽操作的移动速度,移动所述第一组件。In response to the movement direction of the drag operation changing and the distance between the first component and the target component is greater than the distance threshold, the first component is moved based on the movement speed of the drag operation.
  7. 根据权利要求4所述的组件的吸附操作方法,其中,所述方法还包括:The adsorption operation method of the assembly according to claim 4, wherein the method further comprises:
    在所述拖拽操作的移动速度大于所述第一速度阈值的情况下,基于所述拖拽操作的移动速度,移动所述第一组件。In the case where the moving speed of the drag operation is greater than the first speed threshold, the first component is moved based on the moving speed of the drag operation.
  8. 根据权利要求1-7任一项所述的组件的吸附操作方法,其中,所述方法还包括:The adsorption operation method of a component according to any one of claims 1-7, wherein the method further comprises:
    在所述组件编辑界面中确定提示区域,在所述提示区域内显示所述第一组件与所述目标组件之间的距离。A prompt area is determined in the component editing interface, and the distance between the first component and the target component is displayed in the prompt area.
  9. 根据权利要求1所述的组件的吸附操作方法,其中,所述方法还包括:The adsorption operation method of the assembly according to claim 1, wherein the method further comprises:
    运行渲染线程,通过所述渲染线程,执行所述展示所述组件编辑界面的步骤;Running a rendering thread, and executing the step of displaying the component editing interface through the rendering thread;
    运行计算线程,通过所述计算线程,执行所述确定至少一个第二组件;基于所述第一组件与每个所述第二组件之间的距离和所述拖拽操作的移动速度,从所述至少一个第二组件中确定所述目标组件的步骤。Running a computing thread, through which the determining at least one second component is performed; based on the distance between the first component and each of the second components and the moving speed of the dragging operation, from the the step of determining the target component in the at least one second component.
  10. 根据权利要求9所述的组件的吸附操作方法,其中,所述方法还包括:The adsorption operation method of the assembly according to claim 9, wherein the method further comprises:
    运行所述计算线程,通过所述计算线程,执行基于所述拖拽操作的移动方向,将所述组件编辑界面中位于所述移动方向上的组件确定为所述第二组件的步骤。The calculation thread is run, and the calculation thread is used to perform a step of determining a component located in the moving direction in the component editing interface based on the moving direction of the dragging operation as the second component.
  11. 根据权利要求9所述的组件的吸附操作方法,其中,所述方法还包括:The adsorption operation method of the assembly according to claim 9, wherein the method further comprises:
    响应于所述终端支持多线程工具,通过运行所述多线程工具的脚本文件,创建所述计算线程;In response to the terminal supporting a multi-threaded tool, the computing thread is created by running a script file of the multi-threaded tool;
    响应于所述终端不支持所述多线程工具,所述运行计算线程包括:通过所述终端与服务 器之间的通信连接,借助于所述服务器运行所述计算线程。In response to the terminal not supporting the multi-threading tool, the running a computing thread includes running the computing thread by means of the server through a communication connection between the terminal and a server.
  12. 一种组件的吸附操作装置,包括:An adsorption operation device of a component, comprising:
    展示单元,被配置为展示组件编辑界面,所述组件编辑界面包括多个可编辑的组件;a presentation unit configured to present a component editing interface, the component editing interface including a plurality of editable components;
    确定单元,被配置为响应于对所述组件编辑界面中的第一组件的拖拽操作,确定至少一个第二组件;a determining unit, configured to determine at least one second component in response to a drag operation on the first component in the component editing interface;
    所述确定单元,被配置为基于所述第一组件与每个所述第二组件之间的距离和所述拖拽操作的移动速度,从所述至少一个第二组件中确定目标组件;the determining unit configured to determine a target component from the at least one second component based on the distance between the first component and each of the second components and the moving speed of the dragging operation;
    吸附单元,被配置为将所述第一组件吸附至所述目标组件。The adsorption unit is configured to adsorb the first component to the target component.
  13. 根据权利要求12所述的组件的吸附操作装置,其中,所述确定单元,被配置为响应于对所述组件编辑界面中的第一组件的拖拽操作,基于所述拖拽操作的移动方向,从所述组件编辑界面中确定至少一个第二组件。The component adsorption operation device according to claim 12, wherein the determining unit is configured to, in response to a drag operation on the first component in the component editing interface, move direction based on the drag operation , and at least one second component is determined from the component editing interface.
  14. 根据权利要求12所述的组件的吸附操作装置,其中,所述确定单元,被配置为响应于对所述组件编辑界面中的第一组件的拖拽操作,基于所述拖拽操作的移动方向,将所述组件编辑界面中位于所述移动方向上的组件确定为所述第二组件。The component adsorption operation device according to claim 12, wherein the determining unit is configured to, in response to a drag operation on the first component in the component editing interface, move direction based on the drag operation , and determine the component located in the moving direction in the component editing interface as the second component.
  15. 根据权利要求12所述的组件的吸附操作装置,其中,所述确定单元,被配置为在所述拖拽操作的移动速度不大于第一速度阈值的情况下,基于所述第一组件与每个所述第二组件之间的距离,从所述至少一个第二组件中确定所述目标组件,所述第一组件与所述目标组件之间的距离不大于距离阈值。The suction operation device for a component according to claim 12, wherein the determination unit is configured to, in the case where the moving speed of the dragging operation is not greater than a first speed threshold value, based on the relationship between the first component and each The distance between each of the second components, the target component is determined from the at least one second component, and the distance between the first component and the target component is not greater than a distance threshold.
  16. 根据权利要求15所述的组件的吸附操作装置,其中,所述装置还包括:The suction operation device of the assembly according to claim 15, wherein the device further comprises:
    移动单元,被配置为在所述拖拽操作的移动速度不大于所述第一速度阈值,且大于第二速度阈值的情况下,响应于所述拖拽操作的移动速度减慢,将所述第一组件从所述目标组件上脱离,以及将所述拖拽操作的移动速度缩小第一预设倍数,得到第一移动速度,基于所述第一移动速度移动所述第一组件,其中,所述第二速度阈值小于所述第一速度阈值。a moving unit, configured to slow down the moving speed of the drag operation in response to the slowing down of the moving speed of the drag operation, and move the The first component is detached from the target component, and the moving speed of the dragging operation is reduced by a first preset multiple to obtain a first moving speed, and the first component is moved based on the first moving speed, wherein, The second speed threshold is less than the first speed threshold.
  17. 根据权利要求15所述的组件的吸附操作装置,其中,The suction operation device of the assembly according to claim 15, wherein,
    所述移动单元,被配置为在所述拖拽操作的移动速度不大于第二速度阈值的情况下,将 所述拖拽操作的移动速度缩小第二预设倍数,得到第二移动速度,基于所述第二移动速度移动所述第一组件,其中,所述第二速度阈值小于所述第一速度阈值;The moving unit is configured to reduce the moving speed of the dragging operation by a second preset multiple when the moving speed of the dragging operation is not greater than a second speed threshold to obtain a second moving speed, based on the second movement speed moves the first component, wherein the second speed threshold is less than the first speed threshold;
    所述移动单元,被配置为响应于所述拖拽操作的移动方向改变,且所述第一组件与所述目标组件之间的距离大于所述距离阈值,基于所述拖拽操作的移动速度,移动所述第一组件。The moving unit is configured to change the moving direction in response to the drag operation, and the distance between the first component and the target component is greater than the distance threshold, based on the moving speed of the drag operation , move the first component.
  18. 根据权利要求15所述的组件的吸附操作装置,其中,The suction operation device of the assembly according to claim 15, wherein,
    所述移动单元,被配置为在所述拖拽操作的移动速度大于所述第一速度阈值的情况下,基于所述拖拽操作的移动速度,移动所述第一组件。The moving unit is configured to move the first component based on the moving speed of the drag operation when the moving speed of the drag operation is greater than the first speed threshold.
  19. 根据权利要求12-18任一项所述的组件的吸附操作装置,其中,所述装置还包括:The adsorption operation device of the assembly according to any one of claims 12-18, wherein the device further comprises:
    提示单元,被配置为在所述组件编辑界面中确定提示区域,在所述提示区域内显示所述第一组件与所述目标组件之间的距离。A prompting unit, configured to determine a prompting area in the component editing interface, and displaying the distance between the first component and the target component in the prompting area.
  20. 根据权利要求12所述的组件的吸附操作装置,其中,所述装置还包括:The suction operation device of the assembly according to claim 12, wherein the device further comprises:
    运行单元,被配置为运行渲染线程,通过所述渲染线程,展示所述组件编辑界面;a running unit, configured to run a rendering thread, and display the component editing interface through the rendering thread;
    所述运行单元,被配置为运行计算线程,通过所述计算线程,确定至少一个第二组件;基于所述第一组件与每个所述第二组件之间的距离和所述拖拽操作的移动速度,从所述至少一个第二组件中确定所述目标组件。The running unit is configured to run a calculation thread, and through the calculation thread, at least one second component is determined; based on the distance between the first component and each of the second components and the drag operation a speed of movement, the target component is determined from the at least one second component.
  21. 根据权利要求20所述的组件的吸附操作装置,其中,所述运行单元,被配置为运行所述计算线程,通过所述计算线程,基于所述拖拽操作的移动方向,将所述组件编辑界面中位于所述移动方向上的组件确定为所述第二组件。The component adsorption operation device according to claim 20, wherein the running unit is configured to run the calculation thread, and the component is edited based on the moving direction of the drag operation through the calculation thread. The component located in the moving direction in the interface is determined as the second component.
  22. 根据权利要求20所述的组件的吸附操作装置,其中,所述装置还包括:The suction operation device of the assembly according to claim 20, wherein the device further comprises:
    创建单元,被配置为响应于当前终端支持多线程工具,通过运行所述多线程工具的脚本文件,创建所述计算线程;A creation unit configured to create the computing thread by running a script file of the multi-threaded tool in response to the current terminal supporting the multi-threaded tool;
    所述运行单元,被配置为响应于所述当前终端不支持所述多线程工具,通过所述当前终端与服务器之间的通信连接,借助于所述服务器运行所述计算线程。The running unit is configured to, in response to the current terminal not supporting the multi-threaded tool, run the computing thread by means of the server through a communication connection between the current terminal and the server.
  23. 一种终端,包括:A terminal that includes:
    处理器;processor;
    用于存储所述处理器可执行指令的存储器;a memory for storing the processor-executable instructions;
    其中,所述处理器被配置为执行所述指令,以实现下述步骤:wherein the processor is configured to execute the instructions to implement the following steps:
    展示组件编辑界面,所述组件编辑界面包括多个可编辑的组件;Displaying a component editing interface, the component editing interface includes a plurality of editable components;
    响应于对所述组件编辑界面中的第一组件的拖拽操作,确定至少一个第二组件;determining at least one second component in response to a drag operation on the first component in the component editing interface;
    基于所述第一组件与每个所述第二组件之间的距离和所述拖拽操作的移动速度,从所述至少一个第二组件中确定目标组件;determining a target component from the at least one second component based on the distance between the first component and each of the second components and the speed of movement of the drag operation;
    将所述第一组件吸附至所述目标组件。Snap the first component to the target component.
  24. 根据权利要求23所述的终端,其中,所述处理器还被配置为执行所述指令,以实现下述步骤:The terminal of claim 23, wherein the processor is further configured to execute the instructions to implement the steps of:
    响应于对所述组件编辑界面中的第一组件的拖拽操作,基于所述拖拽操作的移动方向,从所述组件编辑界面中确定至少一个第二组件。In response to a drag operation on a first component in the component editing interface, at least one second component is determined from the component editing interface based on a movement direction of the drag operation.
  25. 根据权利要求23所述的终端,其中,所述处理器还被配置为执行所述指令,以实现下述步骤:The terminal of claim 23, wherein the processor is further configured to execute the instructions to implement the steps of:
    响应于对所述组件编辑界面中的第一组件的拖拽操作,基于所述拖拽操作的移动方向,将所述组件编辑界面中位于所述移动方向上的组件确定为所述第二组件。In response to the drag operation on the first component in the component editing interface, based on the moving direction of the drag operation, determine the component located in the moving direction in the component editing interface as the second component .
  26. 根据权利要求23所述的终端,其中,所述处理器还被配置为执行所述指令,以实现下述步骤:The terminal of claim 23, wherein the processor is further configured to execute the instructions to implement the steps of:
    在所述拖拽操作的移动速度不大于第一速度阈值的情况下,基于所述第一组件与每个所述第二组件之间的距离,从所述至少一个第二组件中确定所述目标组件,所述第一组件与所述目标组件之间的距离不大于距离阈值。In the case where the moving speed of the drag operation is not greater than a first speed threshold, determining the at least one second component based on a distance between the first component and each of the second components A target component, the distance between the first component and the target component is not greater than a distance threshold.
  27. 根据权利要求26所述的终端,其中,所述处理器还被配置为执行所述指令,以实现下述步骤:The terminal of claim 26, wherein the processor is further configured to execute the instructions to implement the steps of:
    在所述拖拽操作的移动速度不大于所述第一速度阈值,且大于第二速度阈值的情况下,响应于所述拖拽操作的移动速度减慢,将所述第一组件从所述目标组件上脱离,以及将所述拖拽操作的移动速度缩小第一预设倍数,得到第一移动速度,基于所述第一移动速度移动所述第一组件,其中,所述第二速度阈值小于所述第一速度阈值。In the case where the moving speed of the drag operation is not greater than the first speed threshold and greater than the second speed threshold, in response to the slowing down of the moving speed of the drag operation, the first component is removed from the The target component is disengaged from the top, and the moving speed of the drag operation is reduced by a first preset multiple to obtain a first moving speed, and the first component is moved based on the first moving speed, wherein the second speed threshold is less than the first speed threshold.
  28. 根据权利要求26所述的终端,其中,所述处理器还被配置为执行所述指令,以实现下述步骤:The terminal of claim 26, wherein the processor is further configured to execute the instructions to implement the steps of:
    在所述拖拽操作的移动速度不大于第二速度阈值的情况下,将所述拖拽操作的移动速度缩小第二预设倍数,得到第二移动速度,基于所述第二移动速度移动所述第一组件,其中,所述第二速度阈值小于所述第一速度阈值;In the case where the moving speed of the drag operation is not greater than the second speed threshold, the moving speed of the drag operation is reduced by a second preset multiple to obtain a second moving speed, and the moving speed is moved based on the second moving speed. the first component, wherein the second speed threshold is less than the first speed threshold;
    响应于所述拖拽操作的移动方向改变,且所述第一组件与所述目标组件之间的距离大于所述距离阈值,基于所述拖拽操作的移动速度,移动所述第一组件。In response to the movement direction of the drag operation changing and the distance between the first component and the target component is greater than the distance threshold, the first component is moved based on the movement speed of the drag operation.
  29. 根据权利要求26所述的终端,其中,所述处理器还被配置为执行所述指令,以实现下述步骤:The terminal of claim 26, wherein the processor is further configured to execute the instructions to implement the steps of:
    在所述拖拽操作的移动速度大于所述第一速度阈值的情况下,基于所述拖拽操作的移动速度,移动所述第一组件。In the case where the moving speed of the drag operation is greater than the first speed threshold, the first component is moved based on the moving speed of the drag operation.
  30. 根据权利要求23-29任一项所述的终端,其中,所述处理器还被配置为执行所述指令,以实现下述步骤:The terminal of any one of claims 23-29, wherein the processor is further configured to execute the instructions to implement the following steps:
    在所述组件编辑界面中确定提示区域,在所述提示区域内显示所述第一组件与所述目标组件之间的距离。A prompt area is determined in the component editing interface, and the distance between the first component and the target component is displayed in the prompt area.
  31. 根据权利要求23所述的终端,其中,所述处理器还被配置为执行所述指令,以实现下述步骤:The terminal of claim 23, wherein the processor is further configured to execute the instructions to implement the steps of:
    运行渲染线程,通过所述渲染线程,执行所述展示所述组件编辑界面的步骤;Running a rendering thread, and executing the step of displaying the component editing interface through the rendering thread;
    运行计算线程,通过所述计算线程,执行所述确定至少一个第二组件;基于所述第一组件与每个所述第二组件之间的距离和所述拖拽操作的移动速度,从所述至少一个第二组件中确定所述目标组件的步骤。Running a computing thread, through which the determining at least one second component is performed; based on the distance between the first component and each of the second components and the moving speed of the dragging operation, from the the step of determining the target component in the at least one second component.
  32. 根据权利要求31所述的终端,其中,所述处理器还被配置为执行所述指令,以实现下述步骤:The terminal of claim 31, wherein the processor is further configured to execute the instructions to implement the steps of:
    运行所述计算线程,通过所述计算线程,执行基于所述拖拽操作的移动方向,将所述组件编辑界面中所述第一组件按照所述移动方向移动后,所述第一组件能够靠近的组件确定为所述第二组件的步骤。Running the computing thread, executing the moving direction based on the dragging operation through the computing thread, and after moving the first component in the component editing interface according to the moving direction, the first component can approach The component is identified as the second component step.
  33. 根据权利要求31所述的终端,其中,所述处理器还被配置为执行所述指令,以实现下述步骤:The terminal of claim 31, wherein the processor is further configured to execute the instructions to implement the steps of:
    响应于所述终端支持多线程工具,通过运行所述多线程工具的脚本文件,创建所述计算线程;In response to the terminal supporting a multi-threaded tool, the computing thread is created by running a script file of the multi-threaded tool;
    响应于所述终端不支持所述多线程工具,所述运行计算线程包括:通过所述终端与服务器之间的通信连接,借助于所述服务器运行所述计算线程。In response to the terminal not supporting the multi-threading tool, the running the computing thread includes: running the computing thread by means of the server through a communication connection between the terminal and the server.
  34. 一种非易失性存储介质,当所述非易失性存储介质中的指令由终端的处理器执行时,使得所述终端能够执行下述步骤:A non-volatile storage medium, when the instructions in the non-volatile storage medium are executed by a processor of a terminal, the terminal can perform the following steps:
    展示组件编辑界面,所述组件编辑界面包括多个可编辑的组件;Displaying a component editing interface, the component editing interface includes a plurality of editable components;
    响应于对所述组件编辑界面中的第一组件的拖拽操作,确定至少一个第二组件;determining at least one second component in response to a drag operation on the first component in the component editing interface;
    基于所述第一组件与每个所述第二组件之间的距离和所述拖拽操作的移动速度,从所述至少一个第二组件中确定目标组件;determining a target component from the at least one second component based on the distance between the first component and each of the second components and the speed of movement of the drag operation;
    将所述第一组件吸附至所述目标组件。Snap the first component to the target component.
  35. 一种计算机程序产品,包括计算机程序/指令,其中,所述计算机程序/指令被处理器执行时实现下述步骤:A computer program product, comprising a computer program/instruction, wherein the computer program/instruction, when executed by a processor, implements the following steps:
    展示组件编辑界面,所述组件编辑界面包括多个可编辑的组件;Displaying a component editing interface, the component editing interface includes a plurality of editable components;
    响应于对所述组件编辑界面中的第一组件的拖拽操作,确定至少一个第二组件;determining at least one second component in response to a drag operation on the first component in the component editing interface;
    基于所述第一组件与每个所述第二组件之间的距离和所述拖拽操作的移动速度,从所述至少一个第二组件中确定目标组件;determining a target component from the at least one second component based on the distance between the first component and each of the second components and the speed of movement of the drag operation;
    将所述第一组件吸附至所述目标组件。Snap the first component to the target component.
PCT/CN2021/117525 2021-01-29 2021-09-09 Docking operation method for component, and terminal WO2022160727A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110124740.6A CN112764654B (en) 2021-01-29 2021-01-29 Component adsorption operation method and device, terminal and storage medium
CN202110124740.6 2021-01-29

Publications (1)

Publication Number Publication Date
WO2022160727A1 true WO2022160727A1 (en) 2022-08-04

Family

ID=75707562

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/117525 WO2022160727A1 (en) 2021-01-29 2021-09-09 Docking operation method for component, and terminal

Country Status (2)

Country Link
CN (1) CN112764654B (en)
WO (1) WO2022160727A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112764654B (en) * 2021-01-29 2022-10-25 北京达佳互联信息技术有限公司 Component adsorption operation method and device, terminal and storage medium
CN114579238A (en) * 2022-02-28 2022-06-03 天翼安全科技有限公司 Primitive alignment method, device and equipment
CN114661202B (en) * 2022-03-02 2022-11-22 北京城市网邻信息技术有限公司 Online home decoration method, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100037168A1 (en) * 2008-07-10 2010-02-11 Nile Thayne Systems and methods for webpage design
CN109597563A (en) * 2019-01-24 2019-04-09 网易(杭州)网络有限公司 A kind of interface editing method, device, electronic equipment and storage medium
CN109979020A (en) * 2019-04-04 2019-07-05 广州视源电子科技股份有限公司 A kind of line segment adsorption method, device, equipment and storage medium
CN112764654A (en) * 2021-01-29 2021-05-07 北京达佳互联信息技术有限公司 Component adsorption operation method and device, terminal and storage medium

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5977973A (en) * 1997-05-14 1999-11-02 Microsoft Corporation Window linking
CN103617247B (en) * 2013-11-28 2016-08-24 中铁第四勘察设计院集团有限公司 Adsorption intelligent information mask method and device for CAD system
CN104298445B (en) * 2014-09-30 2019-01-15 百度在线网络技术(北京)有限公司 A kind of method and apparatus switching interface content
CN105573738B (en) * 2014-11-07 2018-11-16 珠海金山办公软件有限公司 A kind of object spacing adjusting method and device
CN106293314B (en) * 2015-05-30 2020-07-14 腾讯科技(深圳)有限公司 Display control method, device and terminal
CN106708477A (en) * 2015-07-20 2017-05-24 鸿合科技有限公司 Inductive control moving method and apparatus
CN106126036A (en) * 2016-06-30 2016-11-16 北京奇虎科技有限公司 The batch processing method of a kind of icon, device and mobile terminal
CN106293329B (en) * 2016-07-28 2019-11-22 北京小度信息科技有限公司 A kind of method, apparatus and terminal that interface element array being presented at the terminal
CN110147159B (en) * 2017-09-21 2022-07-29 腾讯科技(深圳)有限公司 Target positioning method and device in virtual interaction scene and electronic equipment
CN109529327B (en) * 2017-09-21 2022-03-04 腾讯科技(深圳)有限公司 Target positioning method and device in virtual interaction scene and electronic equipment
CN109191547B (en) * 2018-08-20 2023-06-02 广州视源电子科技股份有限公司 Element adsorption method, device, apparatus and storage medium
CN109847336B (en) * 2019-02-26 2021-08-06 腾讯科技(深圳)有限公司 Virtual scene display method and device, electronic equipment and storage medium
CN111352545A (en) * 2019-05-07 2020-06-30 鸿合科技股份有限公司 Automatic adsorption method of interactive service and related equipment
CN110389810B (en) * 2019-07-31 2023-03-31 创新先进技术有限公司 Method, device and equipment for quickly placing UI (user interface) control on virtual canvas
CN110935173B (en) * 2019-11-20 2021-09-10 腾讯科技(深圳)有限公司 Operation control method, operation control device, storage medium, and electronic device
CN111104036B (en) * 2019-11-21 2022-04-05 广州视源电子科技股份有限公司 Element control method, device, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100037168A1 (en) * 2008-07-10 2010-02-11 Nile Thayne Systems and methods for webpage design
CN109597563A (en) * 2019-01-24 2019-04-09 网易(杭州)网络有限公司 A kind of interface editing method, device, electronic equipment and storage medium
CN109979020A (en) * 2019-04-04 2019-07-05 广州视源电子科技股份有限公司 A kind of line segment adsorption method, device, equipment and storage medium
CN112764654A (en) * 2021-01-29 2021-05-07 北京达佳互联信息技术有限公司 Component adsorption operation method and device, terminal and storage medium

Also Published As

Publication number Publication date
CN112764654A (en) 2021-05-07
CN112764654B (en) 2022-10-25

Similar Documents

Publication Publication Date Title
US11797145B2 (en) Split-screen display method, electronic device, and computer-readable storage medium
CN110602321B (en) Application program switching method and device, electronic device and storage medium
JP7081048B2 (en) System navigation bar display method, system navigation bar control method, graphical user interface, and electronic devices
CN109712224B (en) Virtual scene rendering method and device and intelligent device
WO2022160727A1 (en) Docking operation method for component, and terminal
KR101685363B1 (en) Mobile terminal and operation method thereof
WO2020030065A1 (en) Display adaptation method and apparatus for application, device, and storage medium
WO2019101185A1 (en) Method and apparatus for playing audio data
CN110333834B (en) Frame frequency adjusting method and device, display device and computer readable storage medium
CN108762881B (en) Interface drawing method and device, terminal and storage medium
WO2019179326A1 (en) Application interface display method and apparatus, and mobile device
WO2022134632A1 (en) Work processing method and apparatus
CN109783183B (en) Request processing method and device, electronic equipment and storage medium
WO2021103841A1 (en) Control vehicle
CN111694478A (en) Content display method, device, terminal and storage medium
WO2022199102A1 (en) Image processing method and device
CN108664300B (en) Application interface display method and device in picture-in-picture mode
CN111158575B (en) Method, device and equipment for terminal to execute processing and storage medium
CN110868642B (en) Video playing method, device and storage medium
EP4125274A1 (en) Method and apparatus for playing videos
WO2022228043A1 (en) Display method, electronic device, storage medium and program product
WO2022062788A1 (en) Interactive special effect display method and terminal
WO2021218926A1 (en) Image display method and apparatus, and computer device
CN109101166B (en) Audio control method, device and storage medium
CN111464829B (en) Method, device and equipment for switching media data and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21922320

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 13.11.2023)