Coordinate conversion method, device, chip and storage medium

The coordinate conversion method solves the problem that electronic devices cannot respond to user operations in parallel horizon window mode, achieves efficient response to parallel horizon mode, and improves user experience.

CN117931043BActive Publication Date: 2024-10-25HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311772308.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-20
Publication Date
2024-10-25
Estimated Expiration
2043-12-20

AI Technical Summary

Technical Problem

In the parallel horizon window mode, the electronic device may not respond to user operations, resulting in a degraded user experience.

Method used

Through the coordinate conversion method, the screen coordinates are obtained and converted into actual coordinates corresponding to the window, so that the application can respond to user operations and perform corresponding processing actions. This method involves performing coordinate conversion with two windows displayed, and stretching the windows using a preset scaling factor when necessary to ensure that the windows can cover the screen area.

Benefits of technology

It improves the user's operating experience in parallel view mode, ensures that the application can respond to user touch operations in a timely manner, and improves usage efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117931043B_ABST
    Figure CN117931043B_ABST
Patent Text Reader

Abstract

The present application provides a coordinate conversion method, device, chip and storage medium, and relates to the field of terminal technology. In the scheme of the present application, when an application of an electronic device in a horizontal screen state enters a parallel horizon mode, the electronic device can display a first window and a second window of the application in the left area and the right area of ​​the screen respectively. When the user performs a touch operation on a certain position in the first window or the second window, the electronic device obtains the screen coordinates of this position and converts the screen coordinates into actual coordinates corresponding to this window. Through the coordinate conversion process, the electronic device maps the screen coordinates to the real position of the window, so that the application can respond to the user's touch operation and perform corresponding processing actions, thereby improving the user's operating experience when using the parallel horizon mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a coordinate conversion method, device, chip and storage medium. Background Art

[0002] With the rapid development of terminal technology, electronic devices such as tablet computers are becoming more and more popular.

[0003] In order to facilitate users to browse content, the relevant technology provides a window mode called parallel horizons. In the window mode of parallel horizons, the electronic device can display two windows of an application on the screen at the same time, for example, one window is the application homepage and the other window is the content page, so that users can compare the contents of the two pages. However, when an application is set to the window mode of parallel horizons, the screen may not respond to user operations, thereby reducing the user experience. Summary of the invention

[0004] The present application provides a coordinate conversion method, device, chip and storage medium, which solve the technical problem that the screen may not be able to respond to user operations.

[0005] In order to achieve the above objectives, this application adopts the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides a coordinate conversion method. The method can be applied to an electronic device, such as a PAD. The method may include: starting a first application. Displaying a first interface of the first application, the first interface may include two windows of the first application. In response to a first touch operation of a user, obtaining a first coordinate of a touch point of the first touch operation. Converting the first coordinate to a second coordinate. Based on the second coordinate, performing a first processing action. Displaying a second interface of the first application, the second interface may include a window of the first application. In response to a second touch operation of the user, obtaining a third coordinate of a touch point of the second touch operation, and not converting the third coordinate. Based on the third coordinate, performing a second processing action.

[0007] Through the above scheme, when two windows of an application are displayed, the electronic device can perform coordinate conversion on the coordinates of the touch point, such as converting the screen coordinates into the actual coordinates corresponding to the window, so that the application can respond to the user's operation and perform the corresponding processing action. When a window of an application is displayed, the screen coordinates are consistent with the actual coordinates corresponding to the window, and the electronic device does not perform coordinate conversion on the coordinates of the touch point, but can also perform the corresponding processing action. In this way, the electronic device can flexibly adjust the coordinate strategy according to the number of windows, respond to the user's touch operation in real time, and improve the user experience.

[0008] In a possible implementation, the first application may be any application that supports the parallel horizon mode, such as a shopping application, a video application, and a social application. The parallel horizon may include two display modes: a first display mode, in which a window of the first application is displayed in the central area of ​​the screen, and no windows are displayed in other areas on both sides of the central area, such as the first window being the homepage or home page of the first application; a second display mode, in which a window of the first application is displayed in the left area of ​​the screen, and another window of the first application is displayed in the right area of ​​the screen, the two windows do not overlap each other, and the two windows occupy the entire display area of ​​the screen, such as one window is the homepage or home page of the first application, and the other window is the content page of the first application. It can be understood that after the first application is started, the window mode of the first application enters the parallel horizon mode. The electronic device can be set by the system or the first application to display a window of the first application on the screen, or two windows of the first application on the screen. In addition, the user can also adjust the number of windows of the first application as needed, such as triggering the first application to switch from a single window to a double window, or from a double window to a single window.

[0009] In a possible implementation, converting the first coordinate to the second coordinate may include: based on the fact that the first interface may include two windows of the first application, converting the first coordinate to the second coordinate. It can be understood that after the window mode of the first application enters the parallel horizon mode, the first interface includes two windows of the first application. Since the actual sizes of the two windows are larger than the display sizes on the screen, the screen coordinates need to be converted to obtain the actual coordinates corresponding to the windows.

[0010] In a possible implementation, not converting the third coordinate may include: based on the fact that the first interface may include a window of the first application, not converting the third coordinate. It is understandable that after the window mode of the first application enters the parallel horizon mode, the first interface includes a window of the first application, and since the actual size of a window is equal to the display size on the screen, the screen coordinates do not need to be converted.

[0011] In one possible implementation, converting the first coordinate to the second coordinate may include: multiplying the first coordinate by a preset zoom factor to obtain the second coordinate. The preset zoom factor may be a value greater than 1 that is preset by the electronic device. It can be understood that when the preset zoom factor is equal to 1, the actual size of the window is equal to the display size on the screen, which is equivalent to not stretching the window, and the dual windows in the parallel vision mode may not be able to fill the screen due to no stretching, so it is necessary to set the preset zoom factor to be greater than 1. For example, the preset zoom factor is equal to the ratio of the first side length to the second side length of the screen, and the first side length is greater than the second side length. In this way, the dual windows in the parallel vision mode can fill the screen.

[0012] In a possible implementation, before multiplying the first coordinate by the preset zoom factor to obtain the second coordinate, the method may further include: obtaining a preset zoom factor based on the fact that the size of each of the two windows displayed on the screen is smaller than the size of the screen. It can be understood that after the window mode of the first application enters the parallel horizon mode, the electronic device can display one window of the first application on the screen, or two windows of the first application on the screen. If there is no problem of incomplete display of one window, there is no need to perform a stretching operation. Only in the case of two windows, it is necessary to obtain a preset zoom factor to stretch the two windows. Therefore, the electronic device can first determine whether it is a double window, and if it is a double window, then obtain the preset zoom factor.

[0013] In a possible implementation, the two windows of the first application may include a first window and a second window. The first window is displayed in a first area of ​​the screen, and the second window is displayed in a second area of ​​the screen. Accordingly, before displaying the first interface of the first application, the method may further include: creating a first window and a second window. The size of the created first window is larger than the size of the first area, and the size of the created second window is larger than the size of the second area. For example, the size of the created first window is equal to the size of the first area multiplied by a preset zoom factor; the size of the created second window is equal to the size of the second area multiplied by a preset zoom factor.

[0014] Take the screen size of 2880*1840 pixels as an example. Take the vertex in the upper left corner of the screen as the origin o, the horizontal right direction along the edge of the screen as the x-axis, and the vertical downward direction along the edge of the screen as the y-axis to establish a coordinate system. If the electronic device does not set the window aspect ratio for an application in advance, then when the application enters the parallel horizon mode, the sizes of the first window and the second window are both less than 1440*1840 pixels, and cannot cover the first area and the second area of ​​the screen respectively. Therefore, the first window and the second window can be stretched. For example, the boundary parameters of the first window are (0, 0, 2254, 2880), and the boundary parameters of the second window are (626, 0, 2254, 2880). Since the size of the first window is larger than the size of the first area, and the size of the second window is larger than the size of the second area, when the first window and the second window are displayed to the first area and the second area respectively, the first window can cover the first area, and the second window can cover the second area.

[0015] In a possible implementation, the upper left vertex of the first window coincides with the first vertex of the screen, the upper right vertex of the second window coincides with the second vertex of the screen, and the distance between the first vertex and the second vertex is equal to the first side length, that is, the first vertex and the second vertex are located on a long side of the screen. It can be understood that aligning the first window and the second window with two vertices of the long side of the screen can allow the first window and the second window to cover the first area and the second area, making it convenient to display the page content of the first application.

[0016] In one possible implementation, displaying the first interface of the first application may include: based on the screen being in landscape mode and the first application supporting parallel horizon mode, displaying the first window in the first area and displaying the second window in the second area. The length of the dividing line between the first window and the second window is equal to the second side length of the screen, and the second side length of the screen is less than the first side length of the screen. It can be understood that when the electronic device is in landscape mode, partitioning the screen to left and right can make the first window and the second window be displayed in the left area and the right area respectively, which is more in line with the user's usage habits.

[0017] In one possible implementation, displaying the second interface of the first application may include: based on the screen being in landscape mode and the first application supporting parallel view mode, displaying the second interface in a third area of ​​the screen, the height of the third area being equal to the second side length of the screen, the width of the third area being less than the first side length of the screen, and the first side length being greater than the second side length. Take the screen size of 2880*1840 pixels as an example. The boundary information of a window displayed in the third area may be (852, 0, 1176, 1840), where (852, 0) is the coordinate of the upper left corner vertex of the window, 1176 is the width of the window, and 1840 is the height of the window.

[0018] In a possible implementation, before displaying the second interface of the first application, the method may further include: creating a window, the size of the created window being equal to the size of the third area, and the window being used to display the home page of the first application. It is understandable that after the first application enters the parallel vision mode, if the home page is displayed and the content page is not displayed, the home page is displayed in a centered single window on the screen, which is more in line with the user's usage habits.

[0019] In a second aspect, the present application provides a device, the device comprising a unit for executing the method in the first aspect. The device may correspond to executing the coordinate conversion method described in the first aspect. For the relevant description of the unit in the device, please refer to the description of the first aspect, and for the sake of brevity, it will not be repeated here.

[0020] In a third aspect, the present application provides an electronic device, the electronic device comprising a memory and one or more processors. The memory is used to store computer program code, and the computer program code comprises computer instructions. When the computer instructions are called by the processor, the electronic device executes the coordinate conversion method provided in any one of the first aspects.

[0021] In a fourth aspect, the present application provides a computer-readable storage medium. The computer-readable storage medium includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the coordinate conversion method provided in the first aspect and any possible implementation thereof.

[0022] In a fifth aspect, the present application provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the coordinate conversion method provided in the first aspect and any possible implementation thereof.

[0023] In a sixth aspect, the present application provides a chip, which is coupled to a memory and configured to read and execute a computer program stored in the memory to implement the coordinate conversion method provided in the first aspect and any possible implementation thereof.

[0024] It can be understood that the beneficial effects that can be achieved by the above-mentioned device of the second aspect, the electronic device of the third aspect, the computer-readable storage medium of the fourth aspect, the computer program product of the fifth aspect and the chip of the sixth aspect can be referred to as the beneficial effects in the first aspect and any possible implementation method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 A schematic diagram of the vertical screen state and the horizontal screen state provided in an embodiment of the present application;

[0026] Figure 2 A schematic diagram of a PAD and a window provided in an embodiment of the present application;

[0027] Figure 3 A schematic diagram of four window modes provided in an embodiment of the present application;

[0028] Figure 4 A schematic diagram of an application scenario of a parallel horizon mode provided in an embodiment of the present application;

[0029] Figure 5 A schematic diagram of another application scenario of the parallel horizon mode provided in an embodiment of the present application;

[0030] Figure 6 A schematic diagram of another application scenario of the parallel horizon mode provided in an embodiment of the present application;

[0031] Figure 7A schematic diagram of activity 1 and activity 2 before and after stretching provided in an embodiment of the present application;

[0032] Figure 8 Another schematic diagram of activity1 and activity2 before and after stretching provided in an embodiment of the present application;

[0033] Fig. 9 A software architecture diagram of an electronic device provided in an embodiment of the present application;

[0034] Fig.10 A schematic diagram of a flow chart of a method for converting coordinates in a parallel horizon mode provided in an embodiment of the present application;

[0035] Fig.11 Another schematic diagram of activity1 and activity2 before and after stretching provided in an embodiment of the present application;

[0036] Fig.12 A schematic diagram of another application scenario of the parallel horizon mode provided in an embodiment of the present application;

[0037] Fig.13 A schematic diagram of another application scenario of the parallel horizon mode provided in an embodiment of the present application;

[0038] Fig.14 A schematic flow chart of another method for converting coordinates in a parallel horizon mode provided in an embodiment of the present application;

[0039] Fig.15 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.

[0041] In the description of this application, unless otherwise specified, " / " means or, for example, A / B can mean A or B. In the description of this application, "and / or" is only a way to describe the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0042] The terms "first" and "second" in the specification and claims of this application are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects. For example, a first operation and a second operation are used to distinguish different operations, rather than to describe a specific order of operations. In the embodiments of this application, "plurality" refers to two or more.

[0043] References to "some embodiments" and the like described in the specification of this application mean that one or more embodiments of the present application include a particular feature, structure or characteristic described in conjunction with the embodiment. The terms "include", "comprises", "has" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0044] To facilitate understanding, relevant terms and concepts that may be involved in the embodiments of the present application are introduced below.

[0045] 1. Portrait screen state and landscape screen state.

[0046] In some embodiments, the screen of the electronic device can be divided into two states: Figure 1 As shown in (a) of FIG. 1 , the screen is in a portrait state. At this moment, the angle between the long border of the screen (e.g., the length of the long border is 2880 pixels) and the ground plane is greater than or equal to the angle between the short border of the screen (e.g., the length of the short border is 1840 pixels) and the ground plane. At this moment, the screen is displayed in the first direction; Figure 1 As shown in (b), the screen is in landscape mode. At this moment, the angle between the long frame of the screen (e.g., the length of the long frame is 2880 pixels) and the ground plane is smaller than the angle between the short frame of the screen (e.g., the length of the short frame is 1840 pixels) and the ground plane. At this moment, the screen is displayed in the second direction. The first direction and the second direction differ by 90°.

[0047] It can be understood that no matter the screen of the electronic device is in a portrait state or a landscape state, from the user's perspective, the screen always maintains a positive display relative to the user and basically does not change.

[0048] 2. Windows and window modes.

[0049] In some embodiments, a window refers to a user interface area corresponding to an application displayed on the screen of an electronic device. A window can serve as a visual interface for interaction between a user and an application. When a user starts an application in an electronic device, the application creates and displays a window. When a user operates a control in the window, the application performs a corresponding action. An application can display one or more windows on the screen.

[0050] The above window has a bounds parameter, which can be used to record the position of the boundary line of the window.

[0051] Take the electronic device as a tablet computer (PAD) as an example. Figure 2 As shown, the resolution of the PAD screen is 2880*1840 pixels. Take the vertex in the upper left corner of the PAD screen as the origin o, the horizontal right direction along the edge of the screen as the x-axis, and the vertical downward direction along the edge of the screen as the y-axis to establish a coordinate system. Each pixel in the screen can be represented by the universal coordinates (x, y), where x is used to represent the column where the pixel is located, and y is used to represent the row where the pixel is located. Among them, the coordinates (x, y) are called absolute coordinates. The boundary line of the window can be represented by the coordinates in this coordinate system. For example, the boundary parameters of the window are (x1, y1, x2, y2), (x1, y1) are the coordinates of the upper left corner vertex of the window, x2 is the width of the window, and y2 is the height of the window. It can be understood that if (x1, y1) = (0, 0), then the upper left corner vertex of the window coincides with the upper left corner vertex of the screen. When the user's finger touches a touch point on the screen, the absolute coordinates of the touch point can be obtained through the getRowX() and getRowY() functions, and the relative coordinates of the touch point can be obtained through the getX() and getY() functions. Among them, the absolute coordinates are the coordinates of the touch point relative to the screen, and the relative coordinates are the coordinates of the touch point relative to the window.

[0052] In some embodiments, the electronic device may support multiple window modes, such as full screen mode, floating window mode, split screen mode, and parallel view mode.

[0053] (1) Full screen mode: Figure 3 As shown in (a) in FIG. 1 , only one full-screen window is displayed on the screen. Taking a screen size of 2880*1840 pixels as an example, the boundary parameters of the full-screen window are (0, 0, 2880, 1840), that is, the full-screen window just covers the entire screen.

[0054] (2) Floating window mode: The window size is smaller than the screen size, and the window level is located at the top of multiple layers. Figure 3 As shown in (b), there is a floating window above a full-screen window. Of course, the electronic device can also display multiple floating windows above a full-screen window. The floating window can be used in the scenario where another task is temporarily processed based on the existing task of the electronic device, or in the scenario where multiple tasks are used in parallel in a short period of time.

[0055] (3) Split-screen mode: Multiple application windows are displayed on the screen. The windows of multiple applications do not overlap with each other and occupy the entire display area of ​​the screen. Figure 3As shown in (c) in the figure, the screen includes a window of a shopping application and a window of a travel application, wherein the window of the shopping application is located in the left area of ​​the screen, and the window of the travel application is located in the right area of ​​the screen, and the two windows do not overlap with each other.

[0056] (4) Parallel view mode: multiple windows of the same application are displayed on the screen. The multiple windows of the same application do not overlap with each other and occupy the entire display area of ​​the screen. Figure 3 As shown in (d) in the figure, the screen includes the home window and content page window of the shopping application. The home window is also called the window of activity 1, and the content page window is also called the window of activity 2. In the parallel horizon mode, activity 1 and activity 2 are in the same task and are displayed through windows located in different areas. It can be understood that a task is a collection of a series of activities, and the user completes a task by operating multiple activities.

[0057] The following uses a PAD in landscape mode as an example to illustrate the application scenario of the parallel vision mode.

[0058] For example, Figure 4 A schematic diagram of the interface for a user to enable parallel vision mode is shown.

[0059] like Figure 4 As shown in (a) of FIG. 1 , the PAD displays icons of multiple applications on the desktop. When the user wants to set the parallel horizon mode, the user can click the setting icon 101. In response to the user's click operation on the setting icon 101, the PAD displays the following Figure 4 The setting interface shown in (b) in FIG. 1 includes a search box 102 and multiple setting options. As an example, the user can click the search box 102 to trigger the editable state, and then the user can enter the keyword "parallel horizon" in the search box 102. The PAD displays as follows: Figure 4 As another example, the user can also search for the parallel horizon setting option in the multiple setting options in the setting interface. PAD can display multiple applications that support the parallel horizon function in the parallel horizon setting interface, such as shopping, browser, video, and travel. These applications can be third-party applications or system applications. Users can choose to turn on or off the parallel horizon function of each application according to actual usage needs. For example, Figure 4 As shown in (c) in FIG. 1 , the user can press the circular button of the control 103 with his finger and slide it to the right. When the control 103 is updated as shown in FIG. Figure 4After the user moves his finger off the screen, the PAD activates the parallel vision function of the shopping application. Figure 4 As shown in (e) of FIG. 1 , after the PAD responds to the user's operation and returns to the desktop, the user can click the shopping application icon 105. In response to the user's click operation on the shopping application icon 105, the PAD displays the following in a single window in the parallel view mode: Figure 4 The homepage 106 of the shopping application shown in (f) of FIG. 1 is located in the center area of ​​the screen, and the interface of the shopping application is not displayed in other areas on both sides of the center area.

[0060] It should be noted that after starting the shopping application, the PAD usually displays the homepage of the shopping application first. If the user clicks on the lower-level page control of the homepage of the shopping application, the PAD will respond to the user operation and display the content page of the shopping application, that is, the lower-level page of the homepage of the shopping application. Before the user clicks on the lower-level page control of the homepage, the PAD will display the homepage 106 of the shopping application in the form of a centered single window, so that the user can select the lower-level page control from the homepage and then switch to a double window. Regardless of whether the screen displays a single window or a double window, after the PAD receives the user's click operation on the icon 105 of the shopping application, the PAD has entered the parallel horizon mode. That is, the parallel horizon in the embodiment of the present application includes two display modes: the first display mode, a window of the application is displayed in the central area of ​​the screen, and no windows are displayed in other areas on both sides of the central area; the second display mode, a window of an application is displayed in the left area of ​​the screen, and another window of the application is displayed in the right area of ​​the screen.

[0061] This application divides the interface of an application into multiple levels: the first level interface is the homepage or home page of the application, which belongs to the highest level interface; the second level interface is the next level interface of the first level; the third level interface is the next level interface of the second level... and so on. This application does not specifically limit the number of levels. The above-mentioned first display mode specifically refers to displaying the first level interface of the application in the central area of ​​the screen. The above-mentioned second display mode may refer to displaying two pages of different levels in the left and right areas of the screen, or two pages of the same level. For example, these two pages may be: the first level interface and the second level interface, or the first level interface and the third level interface, or the second level interface and the third level interface, or the second level interface and the third level interface, etc. It should be understood that in the parallel horizon mode, two windows are used to display the pages of the same application, which is convenient for users to perform their respective corresponding operations in the two windows.

[0062] In some embodiments, the home page of an application may include two types of operation controls:

[0063] The first type of control is used to trigger content updates to the home page. The updated page is still the home page.

[0064] As an example, Figure 5 As shown in (a) of FIG. 1 , the bottom of the homepage 107 of the shopping application includes a "Home" option, a "Browse" option, a "Shopping Cart" option, and a "My" option. The user can click the "Shopping Cart" option. In response to the click operation, the PAD updates the homepage content from the homepage corresponding to "Recommendations" to the page corresponding to the "Shopping Cart" option. If the page corresponding to the "Shopping Cart" option is still the homepage of the shopping application according to the settings of the shopping application, then when the user operates the "Shopping Cart" option, Figure 5 As shown in (b), the PAD still displays the home page belonging to the first level, that is, the shopping cart page 108 corresponding to the "shopping cart" option is displayed in the central area of ​​the screen, and no windows are displayed in other areas on both sides of the central area.

[0065] The second type of control is used to trigger the display of subordinate pages of the home page, such as the second-level page.

[0066] As an example, Figure 6 As shown in (a) of FIG. 1 , the homepage of the shopping application also includes subordinate page controls such as "supermarket", "second sale" and "electrical appliances", and these subordinate page controls can trigger the display of subordinate pages of the homepage. For example, the user can click "supermarket". In response to the click operation on "supermarket", Figure 6 As shown in (b) of FIG. 1 , the PAD displays the homepage of the shopping application in the left area of ​​the screen, and displays the page 109 corresponding to the "supermarket" in the right area of ​​the screen. The page 109 corresponding to the "supermarket" belongs to the next level page of the homepage of the shopping application. When the two windows of the shopping application are displayed, the user can perform independent operations on the two windows.

[0067] When the PAD is in parallel view mode, if the screen displays two windows of an application, the user can perform independent operations on the two windows to trigger the application to perform different processing actions. For example, the user can click the "Video" control at the top of the left window, and in response to the operation, Figure 6 As shown in (c) in FIG. 1 , the PAD switches the left window to the page 110 corresponding to “video” and keeps displaying the page 109 corresponding to “supermarket” in the right window.

[0068] It should be noted that the above Figures 4 to 6The example of the PAD responding to the user's operation on the application icon in the parallel view mode by first displaying a single window and then displaying two windows is used for explanation, which does not limit the present application. The present application also provides another implementation method: the PAD responds to the user's operation on the application icon in the parallel view mode by directly displaying two windows. For example, the user can click Figure 4 In response to the user clicking the shopping application icon 105, the PAD displays the following Figure 6 The two windows shown in (b).

[0069] However, if Figure 6 (b) and Figure 6 As shown in (c) in FIG. 1 , in some cases, when a user clicks certain areas in the left window or certain areas in the right window, the application may fail to respond to the user's touch operation. That is, when a user clicks a control of the application, the application does not respond.

[0070] Combine the following Figure 7 and Figure 8 , an example is given to illustrate the reason for this phenomenon.

[0071] For a PAD in landscape mode, this application provides the following window processing strategies:

[0072] Interface processing strategy 1. If PAD has set the window aspect ratio for an application in advance, PAD can fill the screen with the interface according to the window aspect ratio set for this application in advance. For example, in full-screen mode, the border parameters of the full-screen window are (0, 0, 2880, 1840), and the full-screen window is filled with the screen according to the window aspect ratio of 2880:1840. For another example, in split-screen mode, PAD sets the border parameters of one application's window to (0, 0, 1440, 1840) and the border parameters of another application's window to (1440, 0, 1440, 1840), and then fills the left and right areas of the screen with the two application windows respectively according to the window aspect ratio of 1440:1840. It can be understood that for the above interface processing strategy 1, since the PAD has pre-set the window aspect ratio for the application, the PAD can directly display the window on the screen according to the window aspect ratio pre-set for the application, so that the problem of the window failing to fill the screen will not occur.

[0073] Interface processing strategy 2: If the PAD does not pre-set the window aspect ratio, for example, in parallel view mode, the windows of the two activities do not pre-set the aspect ratio, resulting in the two activity windows may not be able to cover the entire screen. In this case, the PAD can set a scaling factor to stretch the windows of activity1 and activity2 so that the window of activity1 covers the entire left area of ​​the screen and the window of activity2 covers the entire right area of ​​the screen.

[0074] For example, Figure 7 The diagram shows the windows of activity1 and activity2 before and after they are stretched.

[0075] Take the screen size of 2880*1840 pixels as an example. Figure 7 As shown, a coordinate system is established with the vertex of the upper left corner of the PAD screen as the origin o, the horizontal right direction along the edge of the screen as the x-axis, and the vertical downward direction along the edge of the screen as the y-axis. If the PAD does not set the window aspect ratio for an application in advance, then when the application enters the parallel horizon mode, the window size of activity1 and the window size of activity2 are both smaller than 1440*1840 pixels, and cannot fill the left and right areas of the screen respectively. The system side of the PAD can stretch the windows of activity1 and activity2 by setting a scaling factor, so that the window of activity1 fills the left area of ​​the screen and the window of activity2 fills the right area of ​​the screen. For example, the boundary parameters of the window of activity1 after stretching are (0, 0, 2254, 2880), and the boundary parameters of the window of activity2 after stretching are (626, 0, 2254, 2880). Since the window size of activity1 after stretching is larger than the size of the left area, and the window size of activity2 after stretching is larger than the size of the right area, when PAD displays the stretched window of activity1 and the window of activity2 to the left and right areas of the screen respectively, the stretched window of activity1 can fill the left area of ​​the screen, and the stretched window of activity2 can fill the right area of ​​the screen.

[0076] Although the window of activity1 overlaps with the upper left corner of the screen, the actual display size of the window of activity1 (2254*2880 pixels) is larger than the screen display size of the window of activity1 (1440*1840 pixels). Therefore, the window of activity1 exceeds the left area of ​​the screen, so that the coordinates (x1, y1) of the user's touch position P1 on the screen are different from the coordinates (x2, y2) of the position P2 in the actual display area of ​​activity1. If the touch driver of the electronic device directly passes the coordinates (x1, y1) to the application, the application may not be able to perform any processing actions based on the coordinates (x1, y1). Among them, the touch position is also called the touch position or touch point, which can refer to the position of a pixel point on the screen.

[0077] It should be noted that Figure 7 The screen coordinate system shown is only an example and does not limit the present application. In actual implementation, other methods can also be used to establish the screen coordinate system. For example, Figure 8 As shown in the figure, the coordinate system is established with the vertex of the upper right corner of the PAD screen as the origin o, the horizontal left direction along the edge of the screen as the x-axis, and the vertical downward direction along the edge of the screen as the y-axis. Figure 8 In the coordinate system shown, by stretching the windows of activity1 and activity2, the window of activity1 can fill the left area of ​​the screen, and the window of activity2 can fill the right area of ​​the screen. Figure 8 As shown in activity1 and activity2, the application may also fail to respond to user operations.

[0078] In view of the above problems, an embodiment of the present application provides a coordinate conversion method, which can be applied to an electronic device in a horizontal screen state. When an application of an electronic device enters the parallel vision mode, the electronic device displays the first window and the second window of the application in the left area and the right area of ​​the screen respectively. When the user touches a certain position in the first window or the second window, the electronic device obtains the screen coordinates of this position and converts the screen coordinates into actual coordinates corresponding to this window. Since the electronic device maps the screen coordinates to the real position of the window through the coordinate conversion process, the application can respond to the user's operation and perform corresponding processing actions, thereby improving the user's operating experience when using the parallel vision mode.

[0079] In some embodiments, the electronic device is also referred to as a terminal or user equipment (UE). For example, the electronic device may be a personal computer (PC), a mobile phone, a smart screen, a smart TV, a tablet computer (Pad), a wearable device, a computer with wireless transceiver function, a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, or a wireless terminal in smart home, etc., or may be other devices or apparatuses.

[0080] It should be noted that the embodiment of the present application is illustrated by taking the electronic device being a PAD as an example, which does not limit the present application and may also be other devices.

[0081] In the embodiment of the present application, the software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, or a micro-service architecture. Taking the Android system with a layered architecture as an example, the software system architecture of the electronic device is exemplified.

[0082] For example, Fig. 9 A software architecture diagram of an electronic device provided for this application.

[0083] like Fig. 9 As shown, electronic devices can adopt a layered architecture to divide the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the software layers of the software structure are divided from top to bottom into: application (APP) layer, application framework (FWK) layer, system library and kernel layer. The above software architecture is in the hardware layer ( Fig. 9 The hardware layer may include displays, sensors, etc.

[0084] The application layer may include a series of application packages, such as shopping applications, browsers, video applications, and travel applications. Some applications may support the parallel horizon function, while others may not. When an application supports the parallel horizon function, when the application is run, the application enters the parallel horizon mode, and displays a single window or dual windows in the parallel horizon mode. When an application does not support the parallel horizon function, when the application is run, the application enters the full screen mode.

[0085] When these application packages are running, they can access various service modules provided by the application framework layer through the application programming interface (API) and execute corresponding intelligent services.

[0086] The application framework layer provides APIs and programming frameworks for applications. The application framework layer includes some predefined functions. For example, the application framework layer may include the window manager service (WMS), activity manager service (AMS), SurfaceFlinger, and input system.

[0087] Among them, AMS is mainly responsible for managing the switching and scheduling of system components, as well as the management and scheduling of the entire life cycle of application processes. AMS is also a Binder implementation class, which allows application processes to interact with system services through the Binder mechanism. WMS is responsible for starting, adding and deleting windows, as well as managing window size, hierarchy and window animation. SurfaceFlinger is an independent service that is responsible for receiving input from all windows, calculating the position of each surface in the final composite image based on parameters such as transparency, size and position, and then generating the final image by the hardware synthesizer and sending it to the screen for display. The input system can include an input subsystem and an input manager service (IMS). When a user operates an input device, touch coordinates are generated, and the touch coordinates are collected by the input subsystem in the Linux kernel. IMS processes the data collected by the input subsystem and encapsulates it into various touch events.

[0088] In the system library, Android Runtime includes the core library and the virtual machine. Android Runtime is responsible for the scheduling and management of the Android system. The core library consists of two parts: one is the function that the Java language needs to call, and the other is the core library of Android. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection and other functions.

[0089] The system library can include multiple functional modules, such as surface manager, media libraries, 2D graphics engine (e.g. SGL), 3D graphics processing library (e.g. OpenGLES), etc. In the system library, Android Runtime includes core library and virtual machine. Android Runtime is responsible for scheduling and management of Android system. The core library contains two parts: one part is the function function that needs to be called by Java language, and the other part is the core library of Android. The application layer and application framework layer run in the virtual machine.

[0090] The kernel layer is the layer between hardware and software and belongs to the bottom layer of the Android system. The kernel layer can contain various driver interfaces, such as display driver, touch driver, etc. Among them, the electronic device can be connected to the touch screen, etc. When the user operates the touch screen, the touch driver reports the touch coordinates to the input system, and the input system is responsible for encapsulating the touch coordinates into touch events.

[0091] It should be noted that although the embodiments of the present application are described using the Android system as an example, its basic principles are also applicable to electronic devices based on operating systems such as iOS or Windows.

[0092] It is understandable that, in order to implement the coordinate conversion method in the embodiment of the present application, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments.

[0093] Based on Fig. 9 Some functional modules in the provided software architecture, Fig.10A schematic flow chart of a method for converting coordinates in a parallel view mode is provided. The method can be applied to an electronic device in a horizontal screen state.

[0094] like Fig.10 As shown, the method may include the following S01 to S15.

[0095] S01 : The touch control driver samples the user's touch operation according to a period T.

[0096] The above cycle, also called the control cycle and the reporting cycle, is the cycle in which the touch driver collects touch operations.

[0097] Take the touch driver collecting data 240 times per second as an example. The period T = 1 / 240 = 4.16ms (milliseconds), that is, the touch driver collects touch data every 4.16ms. If the user presses the touch screen with a single finger in a certain period, the touch driver can determine the touch coordinates of the single finger, also called screen coordinates, based on the voltage change of the sensor set on the display screen.

[0098] For example, Figure 7 or Figure 8 As shown, the electronic device can establish a coordinate system with a vertex of the screen as the origin and two adjacent sides as coordinate axes. Touch coordinates refer to the actual coordinates of the touch position in the screen coordinate system. Taking the screen size of 2880*1840 pixels as an example, the touch coordinates of a touch position are (1440,920), which means that the touch position is located at the center of the screen.

[0099] S02 , in response to a user clicking operation on an icon of application 1 , the touch driver transmits the collected touch coordinates to the input system, and the input system notifies application 1 of a touch event, where the touch event includes a touch type and touch coordinates.

[0100] In some embodiments, the touch type of the touch event may include any of the following:

[0101] ACTION_DOWN, which means it is triggered when the first finger touches the screen for the first time;

[0102] ACTION_MOVE, which means it is triggered when a finger slides on the screen and it will be triggered multiple times;

[0103] ACTION_UP, which is triggered when the last finger leaves the screen;

[0104] ACTION_POINTER_DOWN, indicating that a non-primary finger is pressed (that is, a finger was already on the screen before pressing);

[0105] ACTION_POINTER_UP indicates that a non-primary finger is lifted (that is, there is still a finger on the screen after it is lifted).

[0106] For example, when a user wants to use a shopping application, the user can click with one finger. Figure 4 The icon 105 of the shopping application shown in (e) in FIG. 1 . The touch driver can collect the touch coordinates of a single finger in a certain reporting period and report them to the input system. The input system encapsulates the received reporting data into a touch event and notifies the application 1 of the touch event. Among them, the touch event includes ACTION_DOWN and touch coordinates. In response to the touch event, application 1 starts to run. As an example, if application 1 has turned on the parallel vision mode, the following S03 is executed. As another example, if application 1 has not turned on the parallel vision mode, application 1 enters the full-screen mode, notifies the AMS to create an activity, and adds a window corresponding to this activity. The size of the window corresponding to this activity is equal to the size of the screen, so that the electronic device can display the homepage of application 1 in full screen on the screen, which will not be repeated here.

[0107] S03, application 1 calls AMS to create activity 1 and activity 2.

[0108] In parallel view mode, activity1 and activity2 can be in the same task of application1.

[0109] In some embodiments, before application 1 calls AMS to create activity 1 and activity 2, application 1 may also obtain the screen state of the electronic device. If the electronic device is in landscape mode, it means that the parallel view mode can be turned on, so that application 1 can call AMS to create activity 1 and activity 2.

[0110] S04, AMS calls WMS to add a window.

[0111] In the process of WMS adding a window, WMS may execute the following S05.

[0112] S05, WMS determines whether application 1 supports the parallel view mode.

[0113] In some embodiments, the electronic device may use different identifiers to mark the window modes supported by the application.

[0114] Table 1 below shows the window mode identifiers corresponding to the full screen mode and the parallel horizon mode, respectively. The WMS can call the getWindowModeType() function to obtain the identifier corresponding to the window mode of application 1. If the identifier corresponding to the window mode of application 1 obtained is 102, then the WMS can determine that application 1 supports the parallel horizon mode, and thus execute the following S06. If the obtained identifier is not 102, then the WMS can determine that application 1 does not support the parallel horizon mode, and thus does not execute the following S06.

[0115] Table 1

[0116] Windowed Mode Logo Full Screen Mode 101 Parallel Horizon Mode 102

[0117] S06, WMS sets the window mode of application 1 to the parallel horizon mode, adds window 1 corresponding to activity 1 and window 2 corresponding to activity 2, and sets boundaries for window 1 and window 2 respectively.

[0118] Window 1 is used to display the page of activity 1, and window 2 is used to display the page of activity 2. The page of activity 1 and the page of activity 2 can be the same page of application 1, or different pages of application 1.

[0119] As an example, the page of activity1 and the page of activity2 can be the same page of application 1, for example, the page of activity1 and the page of activity2 are both the homepage of application 1. As another example, the page of activity1 and the page of activity2 can also be different pages of application 1, for example, the page of activity1 is the homepage of application 1, and activity2 is the content page of application 1.

[0120] The above-mentioned borders of window 1 and window 2 refer to the borders after stretching.

[0121] With the above Figure 7 Take an example to illustrate. The width of the left area of ​​the screen is 1440, the width of the right area of ​​the screen is 1440, and the height of the screen is 1840, that is, the size of the left area is equal to the size of the right area. The coordinates of the upper left corner vertex of window 1 are (0, 0), the width of window 1 is 2254, and the height of window 1 is 2880, that is, window 1 is equivalent to multiplying the left area by a scaling factor with the upper left corner vertex of the screen as the starting point. The coordinates of the upper right corner vertex of window 2 are (2880, 0), the width of window 2 is 2254, and the height of window 2 is 2880, that is, window 2 is equivalent to multiplying the right area by a scaling factor with the upper right corner vertex of the screen as the starting point and stretching it.

[0122] As an example, the scaling factor k=a / b, where a is the length of the long side of the screen and b is the length of the short side of the screen. For example, if the screen size is 2880*1840 pixels, k=2880 / 1840=1.57.

[0123] It should be noted that Figure 7 and Figure 8 The window stretching method provided is only an example and does not limit the present application. In actual implementation, other methods can also be used to stretch the window. It can be understood that no matter which method is used to stretch the window, if the actual boundary range of the stretched window is larger than the screen display range of the window, then after the stretched window is sent to the screen for display, it can cover the left area or the right area of ​​the screen.

[0124] After completing the boundary setting of window 1 and window 2, WMS can also execute the following S07 and S08. It should be noted that the present application does not specifically limit the execution order of S07 and S08, for example, both can be executed at the same time; or, S07 can be executed first and then S08; or, S08 can be executed first and then S07.

[0125] S07, WMS notifies the input system of all window information.

[0126] Every time the focus window changes, WMS can notify the input system through the onfocusChanged() function. The onfocusChanged() function can contain information about all current windows, such as the ID of each window, the border information of each window, whether it is the focus window, and the window mode. In this way, the input system can obtain and record all window information.

[0127] S08, WMS returns a message to application 1 that the window has been created. Application 1 can notify SurfaceFlinger to render the layers of window 1 and window 2. SurfaceFlinger can render the layers of window 1 and window 2, and send them to the screen after synthesizing the layers. For example, when the screen displays Figure 6 The double window shown in (b).

[0128] S09 , the touch driver receives a touch operation of the user on the window 1 or the window 2 , and notifies the input system of the touch coordinates (which may be referred to as first coordinates) of the touch operation.

[0129] For example, when a user performs a touch operation such as clicking, long pressing, or sliding on the screen, the bottom layer driver reports the first coordinate to the kernel layer, such as the first coordinate is (x1, y1). The kernel layer notifies the input system in the form of an interrupt.

[0130] S10, the input system determines whether the current window mode is a parallel view based on the recorded window information.

[0131] If the window information obtained through S07 includes that the current window mode is parallel view, then the input system executes the following S11.

[0132] S11, the input system determines whether it is a double window based on the window size.

[0133] If the current window mode is parallel horizons, and the actual display size of window 1 and the actual display size of window 2 are both smaller than the size of the screen, it can be determined that the current window mode is dual-window, and the following S12 is executed.

[0134] The implementation method of determining whether it is a double window based on the window size may include: obtaining the screen display width of window 1 and window 2, such as Figure 7 As shown, the screen widths of window 1 and window 2 are both 1440, which is smaller than the screen width of 2880, so it can be determined that the current window is a double window.

[0135] S12, the input system obtains a preset zoom factor.

[0136] S13, the input system multiplies the first coordinate by the scaling factor to obtain a converted coordinate (which may be referred to as a second coordinate).

[0137] The scaling factors of S12 and S13 are related to the scaling factor of S06.

[0138] For example, the scaling factor k=a / b, where a is the length of the long side of the screen and b is the length of the short side of the screen.

[0139] According to the description of the above embodiment S06, the WMS can set the boundaries of window 1 and window 2 according to the scaling factor k, so that the boundaries of window 1 and window 2 exceed the left area and the right area of ​​the screen. When the actual size of a window is larger than the display size of the window on the screen, it is equivalent to reducing the content of the window according to a first ratio and sending it to the screen for display, or expanding the content displayed on the screen according to a second ratio to the actual size of the window. The first ratio and the second ratio are reciprocal of each other, for example, the first ratio is b / a, and the second ratio is a / b.

[0140] Based on this, Fig.11 As shown, the input system can transform the first coordinate as follows:

[0141] If the first coordinate belongs to the left area of ​​the screen, the input system can multiply the first coordinate (x1, y1) by the scaling factor k to obtain the converted second coordinate (k*x1, k*y1), so that the screen coordinate (x1, y1) and the actual coordinate of the application (k*x1, k*y1) are mapped one to one. Among them, k = a / b, a is the length of the long side of the screen, and b is the length of the short side of the screen.

[0142] If the second coordinate belongs to the right area of ​​the screen, the input system can multiply the first coordinate (x3, y3) by the scaling factor k and translate it along the x-axis to obtain the converted second coordinate (ak*a+k*x3, k*y3), so that the screen coordinate (x3, y3) and the actual coordinate of the application (ak*a+k*x3, k*y3) are mapped one to one. Among them, k = a / b, a is the length of the long side of the screen, and b is the length of the short side of the screen.

[0143] It should be noted that the first coordinate and the second coordinate may be absolute coordinates or relative coordinates.

[0144] S14, the input system notifies application 1 of a touch event, where the touch event includes a touch type and touch coordinates, and the touch coordinates are the converted second coordinates obtained in S13.

[0145] S15, application 1 responds to the touch event and executes a processing action corresponding to the second coordinate.

[0146] For example, Figure 6 As shown in (c) in FIG. 1 , before the coordinate conversion is performed according to S01-S14, application 1 can only obtain the screen coordinates from the input sub-port. Since the screen coordinates are inconsistent with the actual coordinates, after the user clicks the sharing control 112 in the left area of ​​the screen, application 1 will not respond to the operation. Fig.12 As shown, after the coordinate conversion is performed according to S01-S14, application 1 obtains the actual coordinates of the converted window 1 from the input sub-sub, rather than the screen coordinates of window 1. Therefore, after the user clicks the sharing control 112 in the left area, application 1 can respond to the operation and display the sharing page 113 in the left area, so that the user can share related products with friends.

[0147] For example, for example, Figure 6 As shown in (b) in FIG. 1 , before the coordinate conversion is performed according to S01-S14, application 1 can only obtain the screen coordinates from the input child. Since the screen coordinates are inconsistent with the actual coordinates, after the user clicks the "My" option 111 in the middle right area of ​​the screen, application 1 will not respond to the operation. Fig.13As shown, after the coordinate conversion is performed according to S01-S14, application 1 obtains the actual coordinates of the converted window 2 from the input sub-sub, rather than the screen coordinates of window 2. Therefore, after the user clicks the "My" option 111, application 1 can respond to the operation and display the interface 114 corresponding to the "My" option in the right area.

[0148] In the above embodiment, when the electronic device is in landscape mode and a certain application of the electronic device enters the parallel horizon mode, the electronic device displays the first window and the second window of the application in the left and right areas of the screen respectively, and when the user touches a certain position in the first window or the second window, the electronic device obtains the screen coordinates of the position and converts the screen coordinates into the actual coordinates corresponding to the window. Since the electronic device maps the screen coordinates to the real position of the window through the coordinate conversion process, the application can respond to the user's operation and perform the corresponding processing action, thereby improving the user's operating experience when using the parallel horizon mode.

[0149] Above Fig.10 The example of application 1 calling AMS to notify WMS to create a dual window after the touch driver receives a user click operation on the icon of application 1 is used for explanation, which does not limit the present application. The present application also provides another implementation method: after the touch driver receives a user click operation on the icon of application 1, application 1 calls AMS to notify WMS to create a single window, and only after receiving the user's operation on the single window, the dual window is created.

[0150] Based on Fig. 9 Some functional modules in the provided software architecture, Fig.14 A flow chart of another method for converting coordinates in a parallel view mode is provided. The method can be applied to an electronic device in a horizontal screen state.

[0151] like Fig.14 As shown, the method may include the following S21 to S42.

[0152] S21: The touch control driver samples the user's touch operation according to a period T.

[0153] S22, the touch driver receives a click operation of the user on the icon of application 2, and transmits the collected touch coordinates to the input system. The input system notifies application 2 of the touch event, and the touch event includes the touch type and the touch coordinates.

[0154] In response to the touch event, the application 2 starts to run and executes the following S23.

[0155] For the specific implementation of S21 and S22, reference may be made to the description of S01 and S02 above, which will not be repeated here.

[0156] S23, application 2 calls AMS to create activity 0.

[0157] In some embodiments, before application 2 calls AMS to create activity0, application 2 may also obtain the screen state of the electronic device. If the electronic device is in a horizontal screen state, it means that the parallel view mode can be turned on, so that application 2 can call AMS to create activity0.

[0158] S24, AMS calls WMS to add a window corresponding to activity0.

[0159] In the process of the WMS adding a window, the WMS may execute the following S25.

[0160] S25, WMS determines whether application 2 supports the parallel view mode.

[0161] If application 2 supports the parallel view mode, the WMS may execute S26 described below.

[0162] If application 2 does not support the parallel view mode, the WMS may not execute the following S26.

[0163] S26, WMS sets the window mode of application 2 to the parallel horizon mode, adds window 0 corresponding to activity 0, and sets a boundary for window 0.

[0164] Among them, window 0 is used to display the page of activity 0, such as the home page of application 2.

[0165] like Figure 4 As shown in (f) in FIG. 1 , the border of window 0 in the above S26 can be located at the center of the screen.

[0166] For example, if the screen size is 2880*1840 pixels, the boundary information of window 0 may be (852, 0, 1176, 1840), where (852, 0) is the coordinate of the top left corner of window 0, 1176 is the width of window 0, and 1840 is the height of window 0.

[0167] After completing the boundary setting of window 0, WMS may also execute the following S27 and S28.

[0168] S27, WMS notifies the input system of all window information.

[0169] S28, WMS returns a message to application 2 that window 0 has been created. Application 2 can notify SurfaceFlinger to render the layer of window 0. SurfaceFlinger can render the layer of window 0 and send it to the screen after compositing the layers. For example, when the screen displays Figure 6 The single window shown in (a).

[0170] S29, the touch driver receives the user's click operation on the lower-level page control in window 0, and transmits the collected touch coordinates to the input system. The input system notifies application 2 of the touch event, which includes the touch type and touch coordinates.

[0171] S30, application 2 calls AMS to create activity1 and activity2 based on the touch coordinates of S29.

[0172] In parallel view mode, activity1 and activity2 are in the same task of application 2.

[0173] S31, AMS calls WMS to add a window.

[0174] In the process of WMS adding a window, WMS may execute the following S32.

[0175] S32, WMS determines whether application 2 supports the parallel view mode.

[0176] As an example, the WMS may execute S32 every time a new window is created or a window changes.

[0177] If application 2 supports the parallel view mode, the WMS may execute the following S33.

[0178] If application 2 does not support the parallel horizon mode, the WMS may not execute the following S33.

[0179] S33, WMS sets the window mode of application 2 to the parallel view mode, adds window 1 corresponding to activity 1 and window 2 corresponding to activity 2, and sets boundaries for window 1 and window 2 respectively.

[0180] Among them, window 1 is used to display the page of activity1, and window 2 is used to display the page of activity2.

[0181] S34, WMS notifies the input system of all window information.

[0182] S35, WMS returns a message to application 2 that the window has been created. Application 2 can notify SurfaceFlinger to render the layers of window 1 and window 2. SurfaceFlinger can render the layers of window 1 and window 2, and send them to the screen after synthesizing the layers. For example, when the screen displays Figure 6 The double window shown in (b).

[0183] S36, the touch driver receives a touch operation of the user on window 1 or window 2, and notifies the input system of the touch coordinates (which may be referred to as first coordinates) of the touch operation.

[0184] S37, the input system determines whether the current window mode is a parallel view based on the recorded window information.

[0185] If the recorded window information includes that the current window mode is parallel view, then the input system executes the following S38.

[0186] S38, the input system determines whether it is a double window based on the window size.

[0187] If the current window mode is parallel horizon, and the actual display size of window 1 and the actual display size of window 2 are both smaller than the size of the screen, it can be determined that the current window is a double window, and the following S39 is executed.

[0188] S39, the input system obtains a preset zoom factor.

[0189] S40, the input system multiplies the first coordinate by the scaling factor to obtain a converted coordinate (which may be referred to as a second coordinate).

[0190] For example, the scaling factor k=a / b, where a is the length of the long side of the screen and b is the length of the short side of the screen.

[0191] S41, the input system notifies application 2 of a touch event, where the touch event includes a touch type and touch coordinates, and the touch coordinates are the converted second coordinates obtained in S40.

[0192] S42, application 2 responds to the touch event and executes a processing action corresponding to the second coordinate.

[0193] For the specific implementation of S29 to S42, reference may be made to the description of S03 to S15 above, which will not be repeated here.

[0194] In the above embodiment, when the electronic device is in landscape mode and an application of the electronic device enters the parallel vision mode, the electronic device first creates a single window (such as the home page), and then creates a double window (such as the home page and the content page) after receiving the user's operation on the single window, which may be more in line with user habits. In addition, after creating the double window, when the user touches a certain position in the double window, the electronic device obtains the screen coordinates of this position and converts the screen coordinates into actual coordinates corresponding to this window. Since the electronic device maps the screen coordinates to the real position of the window through the coordinate conversion process, the application can respond to the user's operation and perform corresponding processing actions, thereby improving the user's operating experience when using the parallel vision mode.

[0195] For example, Fig.15 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.

[0196] like Fig.15 As shown, the electronic device 200 may include a processor 210, an internal memory 220, a button 230, a sensor module 240, a display screen 250, an audio module 260, a speaker 260A, a receiver 260B, a microphone 260C, an earphone interface 260D, etc. Among them, the sensor module may include a touch sensor.

[0197] The processor 210 may be used to execute the coordinate transformation method in the above embodiment. The processor 210 may include one or more processing units, for example, the processor 210 may include a central processing unit (CPU), a graphics processing unit (GPU), an application processor (AP), an image signal processor (ISP), etc.

[0198] The internal memory 220 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 210 executes various functional applications and data processing of the electronic device 200 by running the instructions stored in the internal memory 220. The internal memory 220 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application (application, APP) required for at least one function, such as a gallery application, etc. The data storage area can store configuration files of each APP, as well as data created during the use of the electronic device 200.

[0199] The display screen 250 includes a display panel for displaying various images in the gallery application.

[0200] The touch sensor is also called a "touch panel". The touch sensor can be arranged on the display screen 250, and the touch sensor and the display screen 250 form a touch screen, also called a "touch screen". The touch sensor can be used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event, and provide visual output related to the touch operation through the display screen 250. In other embodiments, the touch sensor can also be arranged on the surface of the electronic device 200, which is different from the position of the display screen 250.

[0201] The electronic device 200 can implement audio functions such as music playing and recording through the audio module 260, the speaker 260A, the receiver 260B, the microphone 260C, the headphone jack 260D, and the application processor.

[0202] The audio module 260 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 260 can also be used to encode and decode audio signals.

[0203] The speaker 260A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 200 can listen to music or listen to a hands-free call through the speaker 260A.

[0204] The receiver 260B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 200 receives a call or voice message, the voice can be received by placing the receiver 260B close to the human ear.

[0205] Microphone 260C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 260C to input the sound signal into the microphone 260C. The electronic device 200 can be provided with at least one microphone 260C. In other embodiments, the electronic device 200 can be provided with two microphones 260C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 200 can also be provided with three, four or more microphones 260C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0206] The embodiment of the present application also provides a computer-readable storage medium, in which computer instructions are stored; when the computer-readable storage medium is run on a computer, the computer is caused to execute the method shown above. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that can be integrated with one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium or a semiconductor medium (e.g., a solid state drive (SSD)), etc.

[0207] An embodiment of the present application further provides a computer program product, which includes a computer program code. When the computer program code runs on a computer, the computer executes the methods in the above embodiments.

[0208] The embodiment of the present application also provides a chip, which is coupled to a memory, and the chip is used to read and execute a computer program or instruction stored in the memory to perform the methods in the above embodiments. The chip can be a general-purpose processor or a dedicated processor. It should be noted that the chip can be implemented using the following circuits or devices: one or more field programmable gate arrays (field programmable gate array, FPGA), programmable logic devices (programmable logic device, PLD), controllers, state machines, gate logic, discrete hardware components, any other suitable circuits, or any combination of circuits capable of performing the various functions described throughout this application.

[0209] The electronic device, computer-readable storage medium, computer program product and chip provided in the embodiments of the present application are all used to execute the methods provided in the above embodiments. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects corresponding to the methods provided above, and will not be repeated here.

[0210] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0211] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0212] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0213] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0214] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0215] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A coordinate conversion method, characterized in that: The method comprises: Launch the first application; In the dual-window mode of parallel horizons, a first window and a second window are created for the first application, the size of the created first window is equal to the size of the first area of ​​the screen multiplied by a preset zoom factor, the size of the created second window is equal to the size of the second area of ​​the screen multiplied by a preset zoom factor, the preset zoom factor is equal to the ratio of the first side length to the second side length of the screen, and the first side length is greater than the second side length; Display a first interface of the first application, the first interface including the first window and the second window, the first window is displayed in the first area, and the second window is displayed in the second area; In response to a first touch operation of a user, obtaining a first coordinate of a touch point of the first touch operation; Multiplying the first coordinate by the preset scaling factor to obtain a second coordinate; Based on the second coordinate, performing a first processing action; In the single-window mode of parallel horizons, create a third window for the first application, where the size of the third window is equal to the size of a third area of ​​the screen, where the third area is a partial display area of ​​the screen; Displaying a second interface of the first application in the third area, where the second interface includes the third window; In response to a second touch operation of the user, obtaining a third coordinate of a touch point of the second touch operation without converting the third coordinate; Based on the third coordinates, a second processing action is performed.

2. The method according to claim 1, characterized in that The step of multiplying the first coordinate by the preset scaling factor to obtain a second coordinate includes: Based on the fact that the first interface includes the first window and the second window, and the actual display sizes of the first window and the second window are both smaller than the size of the screen, the first coordinate is multiplied by the preset scaling factor to obtain the second coordinate.

3. The method according to claim 1, characterized in that The step of not converting the third coordinate comprises: Based on the fact that the first interface includes the third window and the actual display size of the third window is smaller than the size of the screen, the third coordinates are not converted.

4. The method according to claim 1, characterized in that: Before multiplying the first coordinate by the preset scaling factor to obtain the second coordinate, the method further includes: The preset zoom factor is acquired based on that the actual display sizes of the first window and the second window are smaller than the size of the screen.

5. The method according to claim 1, characterized in that The upper left corner vertex of the first window coincides with the first vertex of the screen, the upper right corner vertex of the second window coincides with the second vertex of the screen, the distance between the first vertex and the second vertex is equal to the first side length, and the first side length is greater than the second side length of the screen.

6. The method according to claim 1, characterized in that The displaying the first interface of the first application includes: Based on the screen being in landscape mode and the first application supporting parallel view mode, the first window is displayed in the first area, and the second window is displayed in the second area, and the length of the dividing line between the first window and the second window is equal to the second side length of the screen, and the second side length of the screen is less than the first side length of the screen.

7. The method according to any one of claims 1 to 6, characterized in that The displaying the second interface of the first application in the third area includes: Based on the screen being in landscape mode and the first application supporting parallel view mode, the third window is displayed in the third area, the height of the third area is equal to the second side length of the screen, the width of the third area is smaller than the first side length of the screen, and the second side length is smaller than the first side length.

8. The method according to claim 7, characterized in that The third window is used to display the home page of the first application.

9. An electronic device, characterized in that: comprising a processor, and a memory coupled to the processor; The memory stores instructions, and the processor calls the instructions so that the electronic device executes the coordinate conversion method as described in any one of claims 1 to 8.

10. A chip, characterized in that: The chip is coupled to a memory, and the chip is used to read and execute a computer program stored in the memory to implement the coordinate conversion method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed on an electronic device, the electronic device executes the coordinate conversion method according to any one of claims 1 to 8.