Electronic device and solar curve drawing method thereof, and computer readable storage medium
By obtaining sunset time and sunrise time and using techniques such as Bezier curve to draw the sun curve, the problem that the sunrise and sunset curve cannot intuitively and accurately represent the sun position in the existing technology is solved, and dynamic adjustment of curve characteristics and scene adaptability are achieved. .
Patent Information
- Application Number
- CN202111266691.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-28
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2041-10-28
AI Technical Summary
In the prior art, the drawing method of sunrise and sunset curves is fixed, and it is impossible to intuitively and accurately represent the position of the sun in different scenarios.
By obtaining sunset time and sunrise time, determining curve control parameters, drawing the sun curve using Bezier curve, etc., characterizing the changing characteristics of the sun's position relative to the horizon with time.
The curve characteristics of the sunrise and sunset curve are realized to improve the intuitiveness and accuracy of the representation of the sun position in different scenarios, and are suitable for dynamic adjustment of the sun position in different scenarios.
Smart Images

Figure CN113947645B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic equipment, and in particular to a method for drawing a solar curve, an electronic device and a computer-readable storage medium. Background Art
[0002] At present, more and more electronic devices can be installed with weather applications, such as watches. In addition to displaying basic weather data, weather applications may also need to display sunrise and sunset related data. Among them, sunrise and sunset curves are common data that need to be displayed in weather applications, so that users can intuitively know the position of the sun relative to the horizon at different times through the curve.
[0003] However, the current sunrise and sunset curves are drawn in a fixed way. Regardless of the actual sunrise and sunset conditions of the sun, the sunrise and sunset curves drawn are all fixed in style, resulting in the curve characteristics of the sunrise and sunset curves being unable to intuitively and accurately represent the position of the sun in different scenarios. Summary of the invention
[0004] The main purpose of the present invention is to provide a method for drawing a solar curve, an electronic device and a computer-readable storage medium, aiming to improve the intuitiveness and accuracy of the curve characteristics of the sunrise and sunset curve in representing the sun's position in different scenes.
[0005] To achieve the above object, the present invention provides a method for drawing a solar curve, which comprises the following steps:
[0006] Get sunset and sunrise times;
[0007] Determine a curve control parameter according to the sunset time and the sunrise time;
[0008] A sun curve is drawn according to the curve control parameters, wherein the sun curve represents the change characteristics of the position of the sun relative to the horizon over time.
[0009] Optionally, the step of drawing a solar curve according to the curve control parameters comprises:
[0010] A Bezier curve is drawn according to the curve control parameters to obtain the solar curve.
[0011] Optionally, the solar curve includes a first curve, the first curve characterizing the change characteristics of the position of the sun relative to the horizon over time when the sun is above the horizon, and the step of determining the curve control parameter according to the sunset time and the sunrise time includes:
[0012] Determining a first target time, the sunrise time, and the sunset time as first curve parameters corresponding to the first curve, wherein the curve control parameters include the first curve parameters;
[0013] The first target time is the time when the sun is at the highest position relative to the horizon or a first average of the sunrise time and the sunset time.
[0014] Optionally, the step of drawing a Bezier curve according to the curve control parameter includes:
[0015] Drawing a reference line representing the horizon and marking the sunrise time and the sunset time on the reference line;
[0016] A second-order Bezier curve is drawn on a first side of the baseline as the first curve, with the sunrise time as the first starting point, the sunset time as the first ending point, and the first target time as the first control point; the first side represents the area above the horizon.
[0017] Optionally, the solar curve includes a second curve, the second curve characterizing the change characteristics of the position of the sun relative to the horizon over time when the sun is below the horizon, and the step of determining the curve control parameter according to the sunset time and the sunrise time includes:
[0018] Determine a second target time, the sunrise time, and the first time as second curve parameters corresponding to the second curve; the first time is earlier than the sunrise time, and the second target time is a second average of the sunrise time and the first time;
[0019] Determine a third target time, the sunset time, and the second time as a third curve parameter corresponding to the second curve; the second time is later than the sunset time, and the third target time is a third mean of the sunset time and the second time;
[0020] The curve control parameters include the second curve parameters and the third curve parameters.
[0021] Optionally, the second curve includes a first sub-curve and a second sub-curve, the first sub-curve represents a change in the position of the sun relative to the horizon over time before sunrise, and the second sub-curve represents a change in the position of the sun relative to the horizon over time after sunset, and the step of drawing a Bezier curve according to the curve control parameters includes:
[0022] Draw a reference line representing the horizon and mark the first time, the sunrise time, the sunset time, and the second time on the reference line;
[0023] Taking the first time as a second starting point, the sunrise time as a second ending point, and the second target time as a second control point, a second-order Bezier curve is drawn on a second side of the baseline as the first sub-curve;
[0024] Taking the sunset time as a third starting point, the second time as a third ending point, and the third target time as a third control point, a second-order Bezier curve is drawn on a second side of the baseline as the second sub-curve;
[0025] The second side is below the horizon.
[0026] Optionally, after the step of drawing a solar curve according to the curve control parameters, the method further comprises:
[0027] Get the target time;
[0028] Determine the point on the solar curve corresponding to the target time as the reference point;
[0029] A target sun image is drawn on the reference point.
[0030] Optionally, the sun curve includes a first curve and a reference line representing the horizon, the first curve is located on a first side of the reference line, the first curve represents the change characteristics of the position of the sun relative to the horizon over time when the sun is above the horizon, the reference point is a point on the first curve, and after the step of determining the point corresponding to the target time on the sun curve as the reference point, the step further includes:
[0031] Determine a first interval duration between the target time and the sunrise time, and determine a second interval duration between the target time and the sunset time;
[0032] When the first interval duration or the second interval duration is less than a preset duration, a first sun image is drawn on the reference point, where the first sun image is a part of the target sun image;
[0033] When the first interval duration and the second interval duration are both greater than or equal to the preset duration, the step of drawing the target sun image on the reference point is performed.
[0034] In addition, in order to achieve the above-mentioned purpose, the present application also proposes an electronic device, which includes: a memory, a processor, and a solar curve drawing program stored in the memory and runnable on the processor, and when the solar curve drawing program is executed by the processor, the steps of the solar curve drawing method described in any one of the above items are implemented.
[0035] In addition, in order to achieve the above-mentioned purpose, the present application also proposes a computer-readable storage medium, on which a solar curve drawing program is stored. When the solar curve drawing program is executed by a processor, the steps of the solar curve drawing method described in any of the above items are implemented.
[0036] The present invention proposes a method for drawing a solar curve. The method uses the sunset time and the sunrise time as curve control parameters to draw a solar curve that characterizes the changing characteristics of the position of the sun relative to the horizon, so that the drawn solar curve is no longer a fixed style. The curve characteristics of the solar curve can be dynamically adjusted with the actual sunset time and sunrise time, thereby achieving effective improvement in the intuitiveness and accuracy of the curve characteristics of the sunrise and sunset curves in characterizing the sun's position in different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of the hardware structure involved in the operation of an electronic device according to an embodiment of the present invention;
[0038] Figure 2 It is a schematic diagram of a flow chart of an embodiment of a method for drawing a solar curve of the present invention;
[0039] Figure 3 It is a schematic diagram of the flow chart of another embodiment of the method for drawing a solar curve of the present invention;
[0040] Figure 4 A schematic diagram of a solar curve drawn by an embodiment of a method for drawing a solar curve of the present invention;
[0041] Figure 5 A schematic diagram of a process of drawing a first curve representing the position of the sun relative to the horizon when the sun is above the horizon, according to an embodiment of a method for drawing a sun curve of the present invention;
[0042] Figure 6 A schematic diagram of a process of drawing a second curve representing the position of the sun relative to the horizon when the sun is below the horizon, according to an embodiment of the method for drawing a sun curve of the present invention;
[0043] Figure 7 The figure is a flow chart of another embodiment of the method for drawing a solar curve of the present invention.
[0044] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0045] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0046] The main solution of the embodiment of the present invention is: obtaining the sunset time and the sunrise time; determining the curve control parameters according to the sunset time and the sunrise time; drawing the solar curve according to the curve control parameters, and the solar curve represents the change characteristics of the position of the sun relative to the horizon over time.
[0047] In the prior art, the sunrise and sunset curves are currently drawn in a fixed manner. Regardless of the actual sunrise and sunset conditions of the sun, the sunrise and sunset curves drawn are all fixed in style, resulting in that the curve characteristics of the sunrise and sunset curves cannot intuitively and accurately represent the position of the sun in different scenarios.
[0048] The present invention provides the above-mentioned solution, aiming to effectively improve the intuitiveness and accuracy of the curve characteristics of the sunrise and sunset curve in representing the sun's position in different scenes.
[0049] An embodiment of the present invention provides an electronic device. In this embodiment, the electronic device is a smart watch. In other embodiments, the electronic device may also be other types of devices that need to display sunrise and sunset conditions according to actual conditions. Specifically, the electronic device includes but is not limited to a mobile phone, a head-mounted display device, a tablet computer, a television, an air conditioner, etc.
[0050] The electronic device may plot a sun curve characterizing the changing characteristics of the position of the sun relative to the horizon over time.
[0051] In the embodiment of the present invention, refer to Figure 1 , the electronic device includes: a processor 1001 (such as a CPU), a memory 1002, a data interface 1003, etc. The above components can be connected via a communication bus. The memory 1002 can be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1002 can also be a storage device independent of the aforementioned processor 1001.
[0052] The data interface 1003 may be used to obtain time data related to drawing a sun curve, for example, the time data may include sunset time and sunrise time, and the time data may also include the time of the highest point of the sun, etc. The data interface 1003 may be a hardware data interface (such as a USB interface, etc.) or a network data interface.
[0053] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0054] like Figure 1As shown, the memory 1002 as a computer-readable storage medium may include a sun curve drawing program. Figure 1 In the device shown, the processor 1001 can be used to call the solar curve drawing program stored in the memory 1002, and execute the relevant step operations of the solar curve drawing method in the following embodiment.
[0055] The embodiment of the present invention further provides a method for drawing a solar curve, which is applied to the above-mentioned device and electronic device for drawing a solar curve.
[0056] Reference Figure 2 , an embodiment of a method for drawing a solar curve of the present application is proposed. In this embodiment, the method for drawing a solar curve includes:
[0057] Step S10, obtaining sunset time and sunrise time;
[0058] In this embodiment, the sunset time and sunrise time here belong to the same day; in other embodiments, the sunset time and sunrise time may also belong to two adjacent days respectively. For example, if two adjacent days are defined as the first day and the second day, and the first day is earlier than the second day, then the sunset time may be the time of sunset on the first day and the sunrise time may be the time of sunrise on the second day.
[0059] The sunset time and sunrise time can be obtained by accessing the Internet and obtaining the solar time data on the Internet. In addition, the sunset time and sunrise time can also be obtained by obtaining data input by the user.
[0060] Specifically, you can get the current date, and get the sunset time and sunrise time here based on the current date; you can also get the current date and the date one day after the current date, and get the sunset time based on the current date, and get the sunrise time based on the day after the current date; you can also get the sunset time and sunrise time here based on a date specified by the user.
[0061] Step S20, determining a curve control parameter according to the sunset time and the sunrise time;
[0062] The curve control parameter is specifically a parameter that limits the curve characteristics of the sun curve during its drawing process. In this embodiment, the curve control parameter is the position point that the sun curve needs to pass through in the drawing area; in other embodiments, the curve control parameter can also be a numerical range that the points on the sun curve are restricted from exceeding, such as the maximum or minimum value allowed for the points on the curve.
[0063] Different sunset times and different sunrise times correspond to different curve control parameters. Specifically, the sunset time and sunrise time can be used as curve control parameters; the corresponding characteristic time can be calculated according to the sunset time and sunrise time as the curve control parameter; the sunset time, sunrise time and the characteristic time calculated by the sunset time and sunrise time can be used as curve control parameters.
[0064] The time periods represented by the solar curve to be drawn are different, and the corresponding relationships between the sunset time, sunrise time and the curve control parameters may be different. Based on this, the time period represented by the solar curve can be determined, and the corresponding corresponding relationship can be obtained according to the time period represented by the solar curve to determine the curve control parameters corresponding to the current sunset time and sunrise time.
[0065] Step S30: drawing a solar curve according to the curve control parameters, wherein the solar curve represents the change characteristics of the position of the sun relative to the horizon over time.
[0066] Specifically, a curve function corresponding to the solar curve may be pre-set, and the curve control parameter may be used as a known value or a numerical limit range of the curve function, and a curve corresponding to the curve function satisfying the curve control parameter may be drawn as the solar curve.
[0067] The solar curve may include a first curve, a second curve and / or a third curve, the first curve representing the changing characteristics of the position of the sun relative to the horizon when the sun is above the horizon, the second curve representing the changing characteristics of the position of the sun relative to the horizon when the sun is below the horizon, and the third curve representing the changing characteristics of the position of the sun relative to the horizon within a target time period (which can be set by the user or can be a system default parameter).
[0068] In this embodiment, the abscissa of each position point on the sun curve represents time, and the ordinate of each position point represents the position of the sun relative to the horizon (ie, the altitude of the sun).
[0069] A method for drawing a solar curve is proposed in an embodiment of the present invention. The method uses sunset time and sunrise time as curve control parameters to draw a solar curve that characterizes the changing characteristics of the position of the sun relative to the horizon, so that the drawn solar curve is no longer a fixed style, and the curve characteristics of the solar curve can be dynamically adjusted with the actual sunset time and sunrise time, so as to achieve effective improvement in the intuitiveness and accuracy of the curve characteristics of the sunrise and sunset curve in characterizing the position of the sun in different scenes. For example, in the polar day scene and the polar night scene, since the sunset time and the sunrise time are significantly different, the curve characteristics of the drawn sunrise and sunset curves are significantly different, and the user can accurately and intuitively obtain the changes in the position of the sun in different scenes based on the curve characteristics of the sunrise and sunset curves.
[0070] Further, based on the above embodiment, another embodiment of the method for drawing the solar curve of the present application is proposed. Figure 3 , the step S30 comprises:
[0071] Step S30a, drawing a Bezier curve according to the curve control parameters to obtain the solar curve.
[0072] In this embodiment, the curve control parameters include a plurality of known position points of the Bezier curve function, and a Bezier curve passing through the plurality of known position points at the same time is drawn as the sun curve.
[0073] In this embodiment, the Bezier curve obtained by drawing the curve control parameters suitable for the sunrise time and the sunset time is used as the solar curve, which is conducive to ensuring that the applicability of the solar curve drawing algorithm is effectively improved, and is convenient for application platforms using different computer languages to draw accurate and intuitive solar curves based on the sunset time and the sunrise time, thereby improving the convenience of transplanting the solar curve drawing method to different platforms.
[0074] In other embodiments, the sun curve may also be other types of curves, such as a sine curve, an elliptical curve, etc.
[0075] Further, in this embodiment, the solar curve includes a first curve (such as Figure 4 The curve CDE in the figure represents the change of the position of the sun relative to the horizon over time when the sun is above the horizon. Figure 5 The step of determining the curve control parameter according to the sunset time and the sunrise time comprises:
[0076] Step S21, determining a first target time, the sunrise time and the sunset time as first curve parameters corresponding to the first curve, wherein the curve control parameters include the first curve parameters; the first target time is the time when the sun is at the highest position relative to the horizon or a first average of the sunrise time and the sunset time.
[0077] In this embodiment, if the time when the sun is at its highest position relative to the horizon is obtained (such as the time when the sun is at its highest position relative to the horizon is included in the memory of the electronic device, the data currently input by the user, or the solar data obtained based on the Internet), the first target time is the time when the sun is at its highest position relative to the horizon; otherwise, the first target time is the first mean value. In other embodiments, the user may also set parameters, and one of the first mean value and the time when the sun is at its highest position relative to the horizon is determined as the first target time according to the user-set parameters.
[0078] Here, using the first target time, sunrise time and sunset time as curve control parameters of the first curve is conducive to ensuring that the drawn first curve can accurately and intuitively reflect the relevant conditions when the sun rises above the horizon and when the sun is at its highest point.
[0079] It should be noted that, in other embodiments, when the first curve is a curve of other types other than the Bezier curve, the curve control parameters may also include the first curve parameters here.
[0080] Further, based on the above step S21, refer to Figure 5 , step S30a comprises:
[0081] Step S31, drawing a reference line representing the horizon and marking the sunrise time and the sunset time on the reference line;
[0082] The baseline is specifically a straight line extending horizontally. Different points on the baseline can represent different times. The position of sunrise time and sunset time on the baseline varies with the time interval between sunrise time and sunset time. Define the point of sunrise time on the baseline as the first position point (e.g. Figure 4 The point on the baseline at sunset time is defined as the second position point (such as point C in Figure 4 The distance between the first position point and the second position point increases as the time interval increases; the distance between the first position point and the second position point decreases as the time interval decreases. Specifically, the unit distance corresponding to the unit time on the baseline can be preset, the product of the time interval and the unit distance can be determined as the target distance, and the two position points on the baseline separated by the target distance can be used as the sunrise time and the sunset time respectively.
[0083] Step S32, drawing a second-order Bezier curve as the first curve on the first side of the baseline with the sunrise time as the first starting point, the sunset time as the first ending point and the first target time as the first control point; the first side represents the area above the horizon.
[0084] In this embodiment, the first side is specifically the upper side of the reference line. In other embodiments, the first side can also be the lower side of the reference line or the user's designated side of the two sides of the reference line.
[0085] Specifically, positions corresponding to the first starting point, the first ending point, and the first control point are determined in the area where the baseline is located, and the coordinates corresponding to the positions are obtained as known values of the second-order Bezier curve function. Based on the second-order Bezier curve function with the above coordinates, a second-order Bezier curve (i.e., the first curve, such as Figure 4The convex part of the first curve is protruding toward the top of the baseline, the starting point of the first curve is the mark point corresponding to the sunrise time on the baseline, the ending point of the first curve is the mark point corresponding to the sunset time on the baseline, the position corresponding to the first control point is above the baseline, and the convex part of the first curve passes through the position corresponding to the first control point.
[0086] In this embodiment, drawing the first curve in the above manner can ensure that the drawn first curve can accurately reflect the relevant conditions when the sun rises above the horizon and when the sun is at its highest point.
[0087] Further, in this embodiment, the solar curve includes a second curve (such as Figure 4 The curve ABC and / or EFG in the figure), wherein the second curve represents the change characteristics of the position of the sun relative to the horizon over time when the sun is below the horizon, referring to Figure 6 , step S20 comprises:
[0088] Step S22, determining a second target time, the sunrise time and the first time as second curve parameters corresponding to the second curve; the first time is earlier than the sunrise time, and the second target time is a second average of the sunrise time and the first time;
[0089] The baseline is specifically a straight line extending horizontally. Different points on the baseline can represent different times. The position of sunrise time and sunset time on the baseline varies with the time interval between sunrise time and sunset time. Define the point of sunrise time on the baseline as the first position point (e.g. Figure 4 The point on the baseline at sunset time is defined as the second position point (such as point C in Figure 4 The distance between the first position point and the second position point increases as the time interval increases; the distance between the first position point and the second position point decreases as the time interval decreases. Specifically, the unit distance corresponding to the unit time on the baseline can be preset, and the product of the time interval and the unit distance can be determined as the target distance. The two position points on the baseline separated by the target distance are respectively used as the sunrise time and the sunset time. In addition, the point on the baseline at the first time is defined as the third position point (such as Figure 4 A in the figure), define the point on the baseline at the second time as the fourth position point (such as Figure 4 The third position point and the fourth position point may be fixed points pre-set on the baseline, the unit distance here may be determined based on the third position point and the fourth position point, and the unit time corresponding to the unit distance may be determined based on the interval between the first time and the second time.
[0090] Step S23, determining a third target time, the sunset time and the second time as the third curve parameters corresponding to the second curve; the second time is later than the sunset time, and the third target time is a third mean of the sunset time and the second time; the curve control parameters include the second curve parameters and the third curve parameters.
[0091] The first time and the second time may be pre-set fixed times, or may be times determined according to setting parameters input by the user. In this embodiment, the sunrise time and the sunset time belong to the same day, and the first time may be less than the second time, such as the first time may be 0 o'clock and the second time may be 24 o'clock. In other embodiments, the sunrise time and the sunset time belong to two adjacent days respectively, and the first time and the second time may be the same time, such as both may be 0 o'clock between the two adjacent days.
[0092] In this embodiment, determining the curve control parameters according to the above steps S22 and S23 can ensure that the drawn second curve can further accurately and intuitively reflect the position of the sun relative to the horizon at different times before and / or after sunrise.
[0093] It should be noted that, in other embodiments, when the second curve is a curve of other types other than the Bezier curve, the curve control parameters may also include the second curve parameters and / or the third curve parameters herein.
[0094] Further, based on the above steps S22 and S23, step S30a includes:
[0095] Step S33, drawing a reference line representing the horizon and marking the first time, the sunrise time, the sunset time and the second time on the reference line;
[0096] Step S34, drawing a second-order Bezier curve as the first sub-curve on the second side of the baseline with the first time as the second starting point, the sunrise time as the second ending point, and the second target time as the second control point;
[0097] In this embodiment, the second side is specifically the lower side of the reference line. In other embodiments, the first side may also be the upper side of the reference line or a user-specified side of the two sides of the reference line.
[0098] Specifically, the positions corresponding to the second starting point, the second ending point, and the second control point are determined in the area where the baseline is located, and the coordinates corresponding to the respective positions are obtained as known values of the second-order Bezier curve function. Based on the second-order Bezier curve function with the above-mentioned coordinates, a second-order Bezier curve (i.e., the first sub-curve, such as Figure 4The convex part of the first sub-curve is protruded toward the bottom of the baseline, the starting point of the first sub-curve is the marking point corresponding to the first time on the baseline, the ending point of the first sub-curve is the marking point corresponding to the sunset time on the baseline, the position corresponding to the second control point is below the baseline, and the convex part of the first sub-curve passes through the position corresponding to the second control point.
[0099] Step S35, drawing a second-order Bezier curve as the second sub-curve on the second side of the baseline with the sunset time as the third starting point, the second time as the third ending point and the third target time as the third control point; wherein the second side represents below the horizon.
[0100] In this embodiment, the second side is specifically the lower side of the reference line. In other embodiments, the first side may also be the upper side of the reference line or a user-specified side of the two sides of the reference line.
[0101] Specifically, the positions corresponding to the third starting point, the third ending point, and the third control point are determined in the area where the baseline is located, and the coordinates corresponding to the respective positions are obtained as known values of the second-order Bezier curve function. Based on the second-order Bezier curve function with the above-mentioned coordinates, a second-order Bezier curve (i.e., the second sub-curve, such as Figure 4 The convex part of the second sub-curve protrudes toward the bottom of the baseline, the starting point of the second sub-curve is the mark point corresponding to the sunset time on the baseline, the ending point of the second sub-curve is the mark point corresponding to the second time on the baseline, the position corresponding to the third control point is below the baseline, and the convex part of the second sub-curve passes through the position corresponding to the third control point.
[0102] In this embodiment, drawing the second curve in the above manner can ensure that the drawn second curve can further accurately and intuitively reflect the position of the sun relative to the horizon at different times before and after sunrise.
[0103] Further, in this embodiment, the sun curve includes the first curve and the second curve, then step S31 and step S33 in step S30 can be executed simultaneously, and step S32, step S34 and step S35 can be executed after step S33, wherein the execution order of step S32, step S34 and step S35 may not be specifically limited. Based on this, the sun curve can represent the situation that the sun gradually rises from below the horizon to above the horizon at different times from 0 o'clock to 24 o'clock in a day, and the situation that the sun gradually rises from above the horizon to below the horizon at different times.
[0104] In other embodiments, the solar curve may also include one of the above-mentioned first curve and the second curve; or, the solar curve may also include the above-mentioned first curve and the above-mentioned first sub-curve, then step S31 and step S33 in step S30 may be executed simultaneously, and step S30a may include step S33, step S32, and step S34; or, the solar curve may also include the above-mentioned first curve and the above-mentioned second sub-curve, then step S31 and step S33 in step S30 may be executed simultaneously, and step S30a may include step S33, step S32, and step S35; or, the solar curve may also include a part of the above-mentioned first curve or a part of the second curve.
[0105] In other embodiments, the first curve and the second curve may also be Bezier curves of order greater than second, such as third-order Bezier curves or fourth-order Bezier curves, and the curve control parameters may adaptively include more parameters as control parameters corresponding to the curves.
[0106] In other embodiments, when the sunrise time and the sunset time belong to two different days, step S20 may also include: determining a fourth target time, the sunrise time and the sunset time as fourth curve parameters corresponding to the second curve, the fourth target time being a fourth mean of the sunrise time and the sunset time. Step S30a may include: drawing a second-order Bezier curve on the second side of the reference line as the second curve with the sunset time as the first starting point, the sunrise time as the first ending point and the fourth target time as the fourth control point; the second side represents below the horizon.
[0107] Further, based on any of the above embodiments, another embodiment of the method for drawing a solar curve of the present application is proposed. Figure 7 , after step S30, further comprising:
[0108] Step S40, obtaining the target time;
[0109] The target time can be the current time or a time specified by the user.
[0110] Step S50, determining the point corresponding to the target time on the solar curve as the reference point;
[0111] Different time points correspond to different position points on the baseline. The position point on the baseline corresponding to the target time is the target position point, and the point on the sun curve corresponding to the target position point is the reference point.
[0112] Step S60, drawing a target sun image on the reference point.
[0113] The target sun image can be a sun image configured by default in the system, or an image set by the user.
[0114] Specifically, a point on the target sun image may be selected as a positioning point (such as an internal point, an edge point, or a point spaced from the outside and the edge), the positioning point may be set at the reference point, and the target sun image may be drawn.
[0115] In this embodiment, a sun image is drawn at a corresponding position on the sun curve at the target moment, so that the user can intuitively and accurately obtain the position of the sun relative to the horizon through the sun and its position on the sun curve.
[0116] Furthermore, in this embodiment, the solar curve includes a first curve, and the first curve represents the change characteristics of the position of the sun relative to the horizon over time when the sun is above the horizon. After the step of obtaining the target time, it also includes: if the target time is greater than or equal to the sunrise time, and the target time is less than or equal to the sunset time, then the step of determining the point corresponding to the target time on the solar curve as the reference point is executed, wherein the step of determining the point corresponding to the target time on the solar curve as the reference point includes determining the point corresponding to the target time on the first curve as the reference point. Based on this, it can be ensured that the solar image is drawn only when the sun is above the horizon, and the solar image is not drawn when the sun is below the horizon, thereby ensuring the accuracy of the position of the sun and the sun represented by the solar curve that the user can see relative to the horizon.
[0117] Furthermore, in this embodiment, in addition to the first curve, the solar curve also includes a reference line representing the horizon, the first curve is located on a first side of the reference line, the reference point is a point on the first curve, and after the step of determining the point corresponding to the target time on the solar curve as the reference point, it also includes: determining a first interval duration between the target time and the sunrise time, and determining a second interval duration between the target time and the sunset time; when the first interval duration or the second interval duration is less than a preset duration, drawing a first solar image (such as Figure 4 The first solar image is a part of the target solar image; when the first interval duration and the second interval duration are both greater than or equal to the preset duration, the target solar image is drawn on the reference point (such as Figure 4 The steps for the circle between points D and E in the figure are as follows.
[0118] The preset duration here is specifically the minimum interval duration between the target time and the sunrise time or sunset time allowed when the sun is completely above the horizon. The preset duration can be specifically determined according to the curve characteristics of the sun curve and the size of the target sun image. If the first interval duration or the second interval duration is less than the preset duration, it indicates that at least part of the sun is below the horizon; if the first interval duration and the second interval duration are both greater than or equal to the preset duration, it indicates that the sun is completely above the horizon.
[0119] Here, the first sun image may be obtained by clipping the target sun image in advance according to a fixed ratio, or by clipping the target sun image according to a corresponding ratio determined according to a target time.
[0120] Furthermore, in this embodiment, when the first interval duration or the second interval duration is less than a preset duration, the corresponding target ratio is determined according to the first interval duration or the second interval duration; the smaller the first interval duration or the second interval duration, the smaller the target ratio; the target solar image is reduced according to the target ratio to obtain a first solar image, and after the first solar image is obtained, the first solar image is drawn on the reference point.
[0121] In this embodiment, when the time interval between the target time and the sunrise time or sunset time is short, only a part of the target sun image is drawn; the entire target sun image is drawn only when the time intervals between the sunrise time and the sunset time and the target time are long, thereby ensuring that the sun drawn on the sun curve more intuitively and accurately reflects the position of the sun relative to the horizon as seen by the user in reality, thereby improving the accuracy and intuitiveness of the drawn sun and its sun curve.
[0122] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, on which a solar curve drawing program is stored. When the solar curve drawing program is executed by a processor, the relevant steps of any embodiment of the solar curve drawing method as described above are implemented.
[0123] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0124] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0125] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, electronic device, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0126] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for drawing a solar curve, characterized in that: The method for drawing the sun curve comprises the following steps: Get sunset and sunrise times; Determine a curve control parameter according to the sunset time and the sunrise time, wherein the step of determining the curve control parameter according to the sunset time and the sunrise time comprises: taking the sunset time, the sunrise time and a characteristic time calculated by the sunset time and the sunrise time as the curve control parameter; A solar curve is drawn according to the curve control parameter, wherein the solar curve represents the change characteristics of the position of the sun relative to the horizon over time, and the step of drawing the solar curve according to the curve control parameter comprises: taking the curve control parameter as a known value or a value limit range of a curve function corresponding to the preset solar curve, and drawing a curve corresponding to the curve function satisfying the curve control parameter as the solar curve; The solar curve includes a first curve and a second curve, the first curve represents the change characteristics of the position of the sun relative to the horizon when the sun is above the horizon, and the second curve represents the change characteristics of the position of the sun relative to the horizon when the sun is below the horizon. The second curve includes a first sub-curve and a second sub-curve, the first sub-curve represents the change characteristics of the position of the sun relative to the horizon before sunrise, and the second sub-curve represents the change characteristics of the position of the sun relative to the horizon after sunset.
2. The method for drawing a solar curve according to claim 1, characterized in that: The step of drawing a solar curve according to the curve control parameters comprises: A Bezier curve is drawn according to the curve control parameters to obtain the solar curve.
3. The method for drawing a solar curve according to claim 2, characterized in that: The step of determining the curve control parameter according to the sunset time and the sunrise time comprises: Determine a first target time, the sunrise time, and the sunset time as first curve parameters corresponding to the first curve, wherein the curve control parameters include the first curve parameters; The first target time is the time when the sun is at the highest position relative to the horizon or a first average of the sunrise time and the sunset time.
4. The method for drawing a solar curve according to claim 3, characterized in that: The step of drawing a Bezier curve according to the curve control parameters comprises: drawing a reference line representing the horizon and marking the sunrise time and the sunset time on the reference line; A second-order Bezier curve is drawn on a first side of the baseline as the first curve, with the sunrise time as the first starting point, the sunset time as the first ending point, and the first target time as the first control point; the first side represents the area above the horizon.
5. The method for drawing a solar curve according to claim 2, characterized in that: The step of determining the curve control parameter according to the sunset time and the sunrise time comprises: Determine a second target time, the sunrise time, and the first time as second curve parameters corresponding to the second curve; the first time is earlier than the sunrise time, and the second target time is a second average of the sunrise time and the first time; Determine a third target time, the sunset time, and the second time as a third curve parameter corresponding to the second curve; the second time is later than the sunset time, and the third target time is a third mean of the sunset time and the second time; The curve control parameters include the second curve parameters and the third curve parameters.
6. The method for drawing a solar curve according to claim 5, characterized in that: The step of drawing a Bezier curve according to the curve control parameters comprises: Draw a reference line representing the horizon and mark the first time, the sunrise time, the sunset time, and the second time on the reference line; Taking the first time as a second starting point, the sunrise time as a second ending point, and the second target time as a second control point, a second-order Bezier curve is drawn on a second side of the baseline as the first sub-curve; Taking the sunset time as a third starting point, the second time as a third ending point, and the third target time as a third control point, a second-order Bezier curve is drawn on a second side of the baseline as the second sub-curve; The second side is below the horizon.
7. The method for drawing a solar curve according to any one of claims 1 to 6, characterized in that: After the step of drawing the solar curve according to the curve control parameters, the method further includes: Get the target time; Determine the point on the solar curve corresponding to the target time as the reference point; A target sun image is drawn on the reference point.
8. The method for drawing a solar curve according to claim 7, characterized in that: The sun curve also includes a reference line representing the horizon, the reference point is a point on the first curve, and after the step of determining the point corresponding to the target time on the sun curve as the reference point, the step further includes: Determine a first interval duration between the target time and the sunrise time, and determine a second interval duration between the target time and the sunset time; When the first interval duration or the second interval duration is less than a preset duration, a first sun image is drawn on the reference point, where the first sun image is a part of the target sun image; When the first interval duration and the second interval duration are both greater than or equal to the preset duration, the step of drawing the target sun image on the reference point is performed.
9. An electronic device, characterized in that: The electronic device comprises: a memory, a processor and a solar curve drawing program stored in the memory and executable on the processor. When the solar curve drawing program is executed by the processor, the steps of the solar curve drawing method as described in any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a solar curve drawing program, and when the solar curve drawing program is executed by a processor, the steps of the solar curve drawing method according to any one of claims 1 to 8 are implemented.
