[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN113947645B - Electronic device, method for drawing solar curve of electronic device, and computer-readable storage medium - Google Patents

Electronic device, method for drawing solar curve of electronic device, and computer-readable storage medium Download PDF

Info

Publication number
CN113947645B
CN113947645B CN202111266691.6A CN202111266691A CN113947645B CN 113947645 B CN113947645 B CN 113947645B CN 202111266691 A CN202111266691 A CN 202111266691A CN 113947645 B CN113947645 B CN 113947645B
Authority
CN
China
Prior art keywords
curve
time
solar
point
sunrise
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111266691.6A
Other languages
Chinese (zh)
Other versions
CN113947645A (en
Inventor
张勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Techology Co Ltd
Original Assignee
Goertek Techology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Goertek Techology Co Ltd filed Critical Goertek Techology Co Ltd
Priority to CN202111266691.6A priority Critical patent/CN113947645B/en
Publication of CN113947645A publication Critical patent/CN113947645A/en
Application granted granted Critical
Publication of CN113947645B publication Critical patent/CN113947645B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

The invention discloses a drawing method of a solar curve, which comprises the following steps: acquiring sunset time and sunrise time; determining curve control parameters according to the sunset time and the sunrise time; and drawing a solar curve according to the curve control parameters, wherein the solar curve represents the change characteristic of the position of the sun relative to the horizon with time. The invention also discloses an electronic device and a computer readable storage medium. The invention aims to effectively improve the intuitiveness and accuracy of the characteristic of the sunrise and sunset curve on the representation of the sun position under different scenes.

Description

Electronic device, method for drawing solar curve of electronic device, and computer-readable storage medium
Technical Field
The present invention relates to the technical field of electronic devices, and in particular, to a method for drawing a solar curve, an electronic device, and a computer-readable storage medium.
Background
Currently, more and more electronic devices may install weather applications, such as watches, that may require the presentation of sunrise and sunset related data in addition to the underlying weather data. The sunrise and sunset curve is common data which needs to be displayed in weather application, so that a user can intuitively know the position of the sun relative to the horizon at different moments through the curve.
However, at present, the sunrise and sunset curves are drawn in a fixed mode, and the drawn sunrise and sunset curves are of fixed patterns no matter what the actual sunrise and sunset conditions of the sun are, so that the curve characteristics of the sunrise and sunset curves cannot intuitively realize accurate representation of the sun positions in different scenes.
Disclosure of Invention
The invention mainly aims to provide a drawing method of a solar curve, electronic equipment and a computer readable storage medium, and aims to improve intuitiveness and accuracy of curve characteristics of a sunrise and sunset curve on solar position representation in different scenes.
In order to achieve the above object, the present invention provides a method for drawing a solar curve, the method for drawing a solar curve comprising the steps of:
acquiring sunset time and sunrise time;
determining curve control parameters according to the sunset time and the sunrise time;
and drawing a solar curve according to the curve control parameters, wherein the solar curve represents the change characteristic of the position of the sun relative to the horizon with time.
Optionally, the step of drawing the solar curve according to the curve control parameter includes:
And drawing a Bezier curve according to the curve control parameters to obtain the solar curve.
Optionally, the solar curve includes a first curve, the first curve characterizes a change feature of a position of the sun relative to the horizon when the sun is above the horizon, and the step of determining a curve control parameter according to the sunset time and the sunrise time includes:
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 comprise the first curve parameters;
The first target time is a time when the sun is at a highest position relative to the horizon or a first average of the sunrise time and the sunset time.
Optionally, the step of drawing a bezier curve according to the curve control parameter includes:
drawing a datum line representing a horizon and marking the sunrise time and the sunset time on the datum line;
Drawing a second-order Bezier curve on a first side of the datum line as the first curve by taking the sunrise time as a first starting point, the sunset time as a first ending point and the first target time as a first control point; the first side is above the horizon.
Optionally, the solar curve includes a second curve, the second curve characterizes a change of a position of the sun relative to the horizon when the sun is below the horizon, and the step of determining a curve control parameter according to the sunset time and the sunrise time includes:
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 value of the sunrise time and the first time;
determining a third target time, the sunset time and a 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 average value of the sunset time and the second time;
The curve control parameters include the second curve parameter and the third curve parameter.
Optionally, the second curve includes a first sub-curve and a second sub-curve, the first sub-curve characterizing a time-dependent characteristic of a position of the sun relative to the horizon before sunrise, the second sub-curve characterizing a time-dependent characteristic of a position of the sun relative to the horizon after sunset, and the step of drawing the bezier curve according to the curve control parameter includes:
drawing a reference line representing a horizon and marking the first time, the sunrise time, the sunset time and the second time on the reference line;
drawing a second-order Bezier curve on a second side of a datum line as the first sub-curve by 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;
drawing a second-order Bezier curve on a second side of a datum line as the second sub-curve by 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;
Wherein the second side characterizes below the horizon.
Optionally, after the step of drawing the solar curve according to the curve control parameter, the method further includes:
Acquiring a target moment;
determining a point corresponding to the target moment on the solar curve as a datum point;
And drawing a target sun image on the datum point.
Optionally, the solar curve includes a first curve and a reference line representing a horizon, the first curve is located on a first side of the reference line, the first curve represents a time-varying feature of a position of the sun relative to the horizon when the sun is located above the horizon, the reference point is a point on the first curve, and the step of determining that a corresponding point on the solar curve at the target time is the reference point further includes:
determining a first interval duration of the target time and the sunrise time, and determining a second interval duration of the target time and the sunset time;
when the first interval duration or the second interval duration is smaller than a preset duration, drawing a first solar image on the datum point, wherein the first solar image is a part of the target solar image;
And when the first interval duration and the second interval duration are both greater than or equal to the preset duration, executing the step of drawing the target solar image on the datum point.
In addition, in order to achieve the above object, the present application also proposes an electronic device including: the solar curve drawing device comprises a memory, a processor and a solar curve drawing program which is stored in the memory and can run on the processor, wherein the solar curve drawing program realizes the steps of the solar curve drawing method according to any one of the above when being executed by the processor.
In addition, in order to achieve the above object, the present application also proposes a computer-readable storage medium having stored thereon a drawing program of a solar curve, which when executed by a processor, implements the steps of the drawing method of a solar curve as set forth in any one of the above.
According to the method for drawing the sun curve, the sunset time and the sunrise time are used as curve control parameters to draw the sun curve representing the change characteristic of the position of the sun relative to the horizon, so that the drawn sun curve is not in a fixed mode, the curve characteristic of the sun curve can be dynamically adjusted along with the actual sunset time and sunrise time, and the intuitiveness and the accuracy of the curve characteristic of the sunrise sunset curve on the representation of the sun position in different scenes are effectively improved.
Drawings
FIG. 1 is a schematic diagram of a hardware architecture involved in the operation of an embodiment of an electronic device according to the present invention;
FIG. 2 is a schematic flow chart of an embodiment of a method for drawing a solar curve according to the present invention;
FIG. 3 is a schematic flow chart of another embodiment of a method for drawing a solar curve according to the present invention;
FIG. 4 is a schematic diagram of a solar curve drawn according to an embodiment of the method for drawing a solar curve of the present invention;
FIG. 5 is a schematic flow chart of a first curve representing the position of the sun above the horizon line when the first curve represents the position of the sun above the horizon line according to the embodiment of the method for drawing a solar curve of the present invention;
FIG. 6 is a schematic flow chart of 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 solar curve of the present invention;
Fig. 7 is a flowchart of a method for drawing a solar curve according to another embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The main solutions of the embodiments of the present invention are: acquiring sunset time and sunrise time; determining curve control parameters according to the sunset time and the sunrise time; and drawing a solar curve according to the curve control parameters, wherein the solar curve represents the change characteristic of the position of the sun relative to the horizon with time.
In the prior art, the current sunrise and sunset curve is drawn in a fixed mode, and the drawn sunrise and sunset curve is of a fixed mode no matter what the actual sunrise and sunset condition of the sun is, so that the curve characteristics of the sunrise and sunset curve cannot intuitively realize accurate representation of the sun position in different scenes.
The invention provides the solution, and aims to effectively improve the intuitiveness and accuracy of the curve characteristics of the sunrise and sunset curve on the representation of the sun position under different scenes.
The embodiment of the invention provides electronic equipment. 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 according to actual situations, and 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, and the like.
The electronic device may plot a solar curve characterizing a change in position of the sun relative to the horizon over time.
In an embodiment of the present invention, referring to fig. 1, an electronic device includes: a processor 1001 (e.g., a CPU), a memory 1002, a data interface 1003, and the like. The above components may be connected by a communication bus. The memory 1002 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1002 may alternatively be a storage device separate from the processor 1001 described above.
The data interface 1003 may be configured to obtain time data related to drawing a solar curve, for example, the time data may include sunset time and sunrise time, and the time data may further include peak time 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.
It will be appreciated by those skilled in the art that the device structure shown in fig. 1 is not limiting of the device and may include more or fewer components than shown, or may be combined with certain components, or a different arrangement of components.
As shown in fig. 1, a drawing program of a solar curve may be included in a memory 1002 as a computer-readable storage medium. In the apparatus shown in fig. 1, a processor 1001 may be used to call a drawing program of a solar curve stored in a memory 1002 and perform the relevant step operations of the drawing method of a solar curve in the following embodiments.
The embodiment of the invention also provides a drawing method of the solar curve, which is applied to the drawing device of the solar curve and the electronic equipment.
Referring to fig. 2, an embodiment of a method for drawing a solar curve according to the present application is provided. In this embodiment, the method for drawing a solar curve includes:
step S10, acquiring sunset time and sunrise time;
In the present embodiment, the sunset time and sunrise time here belong to the same day; in other embodiments, the sunset time and the sunrise time may also belong to two adjacent days, for example, two adjacent days are the first day and the second day, respectively, and the first day is earlier than the second day, and the sunset time may be the sunset time of the first day and the sunrise time may be the sunrise time of the second day.
The sunset time and sunrise time can be obtained by accessing the Internet and obtaining solar time data on the Internet. In addition, the sunset time and sunrise time can also be obtained by acquiring data input by a user.
Specifically, the current date can be obtained, and the sunset time and sunrise time are obtained according to the current date; the current date and the date of the day after the current date can also be obtained, the sunset time is obtained according to the current date, and the sunrise time is obtained according to the day after the current date; the sunset time and sunrise time herein may also be acquired according to a date specified by the user.
Step S20, determining curve control parameters according to the sunset time and the sunrise time;
The curve control parameter is specifically a parameter for limiting the curve characteristics of the solar curve in the drawing process of the solar curve. In this embodiment, the curve control parameter is a position point where the solar curve needs to pass through in the drawing area; in other embodiments, the curve control parameter may be a range of values that cannot be exceeded by the point on the solar curve, such as a maximum or minimum allowed by the point on the curve.
Different sunset times and different curve control parameters corresponding to different sunrise times are different. Specifically, 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 the sunrise time and used as a curve control parameter; and taking the sunset time, the sunrise time and the characteristic time obtained by calculating the sunset time and the sunrise time as curve control parameters.
The solar curve to be drawn has different time periods, and the sunset time, sunrise time and curve control parameters have different corresponding relations. Based on the method, the time period represented by the solar curve can be determined, and corresponding relations are acquired according to the time period represented by the solar curve to determine curve control parameters corresponding to the current sunset time and sunrise time.
And step S30, drawing a solar curve according to the curve control parameters, wherein the solar curve represents the change characteristic of the position of the sun relative to the horizon with time.
Specifically, a curve function corresponding to a solar curve may be preset, the curve control parameter is used as a known value or a numerical limitation range of the curve function, and a curve corresponding to the curve function meeting the curve control parameter is drawn as the solar curve.
The sun profile may include a first profile that characterizes the change in position of the sun with respect to the horizon over time when the sun is above the horizon, a second profile that characterizes the change in position of the sun with respect to the horizon over time when the sun is below the horizon, and/or a third profile that characterizes the change in position of the sun with respect to the horizon over time over a target time period (which may be user-set or may be a system default parameter).
In this embodiment, the abscissa of each location point on the solar curve characterizes time and the ordinate of each location point characterizes the position of the sun relative to the horizon (i.e. the solar altitude).
According to the method for drawing the solar curve, the sunset time and the sunrise time are used as curve control parameters to draw the solar curve representing the change characteristic of the position of the sun relative to the horizon, so that the drawn solar curve is not in a fixed mode, the curve characteristic of the solar curve can be dynamically adjusted along with the actual sunset time and sunrise time, and the intuitiveness and the accuracy of the curve characteristic of the sunrise curve on the representation of the position of the sun in different scenes are effectively improved. For example, under the extreme day scene and polar night scenes, due to the obvious difference between the sunset time and the sunrise time, the curve characteristics of the drawn sunrise and sunset curves have obvious differences, and a user can accurately and intuitively acquire the change condition of the sun position under different scenes based on the curve characteristics of the sunrise and sunset curves.
Further, based on the above embodiment, another embodiment of the method for drawing a solar curve according to the present application is provided. In this embodiment, referring to fig. 3, the step S30 includes:
and step S30a, drawing a Bezier curve according to the curve control parameters to obtain the solar curve.
In this embodiment, the curve control parameter includes a plurality of known position points of the bezier curve function, and then a bezier curve passing through the plurality of known position points at the same time is plotted as a sun curve.
In this embodiment, the bezier curve drawn by the curve control parameters adapted to the sunset time and the sunset time is used as the sun curve, which is favorable for ensuring that the applicability of the drawing algorithm of the sun curve is effectively improved, and is convenient for an application platform adopting different computer languages to draw an accurate and visual sun curve based on the sunset time and the sunset time, thereby improving the convenience of transplanting the drawing mode of the sun curve to different platforms.
In other embodiments, the sun curve may also be other types of curves, such as sinusoidal, elliptical, etc.
Further, in this embodiment, the solar curve includes a first curve (such as a curve CDE in fig. 4), where the first curve characterizes a change of a position of the sun with respect to the horizon when the sun is above the horizon, and referring to fig. 5, the step of determining a curve control parameter according to the sunset time and the sunrise time includes:
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 comprise the first curve parameters; the first target time is a time when the sun is at a highest position relative to the horizon or a first average of the sunrise time and the sunset time.
In this embodiment, if the time when the sun is at the highest position relative to the horizon is obtained (for example, the time when the sun is at the highest position relative to the horizon is included in the memory of the electronic device, the data input by the current user, or the sun data obtained based on the internet), the first target time is the time when the sun is at the highest position relative to the horizon; otherwise, the first target time is the first average value. In other embodiments, the parameter may also be set by a user, and one of the first average value and the time when the sun is at the highest position relative to the horizon is determined as the first target time according to the user set parameter.
The first target time, sunrise time and sunset time are used as curve control parameters of the first curve, so that the drawn first curve can accurately and intuitively reflect the related conditions of the sun rising above the horizon and the time when the sun is at the highest point.
It should be noted that, in other embodiments, when the first curve is another type of curve other than the bezier curve, the curve control parameters may also include the first curve parameters herein.
Further, based on the above step S21, referring to fig. 5, step S30a includes:
Step S31, drawing a datum line representing a horizon and marking the sunrise time and the sunset time on the datum line;
The reference line is in particular a straight line extending in the transverse direction. Different points on the reference line may characterize different times. The positions of the sunrise time and the sunset time on the reference line differ depending on the time interval between the sunrise time and the sunset time. Defining a point of the sunrise time on the reference line as a first position point (e.g. a point C in fig. 4), and defining a point of the sunset time on the reference line as a second position point (e.g. a point D in fig. 4), wherein the distance between the first position point and the second position point is in an increasing trend along with the increase of the time interval; the distance between the first location point and the second location point decreases with time interval as a decreasing trend. Specifically, a preset unit distance corresponding to a unit time on a reference line can be used for determining a product of a time interval and the unit distance as a target distance, and two position points with the interval of the reference line as the target distance are respectively used as sunrise time and sunset time.
Step S32, drawing a second-order bezier curve as the first curve on the first side of the reference line with the sunrise time as a first starting point, the sunset time as a first ending point, and the first target time as a first control point; the first side is above the horizon.
In this embodiment, the first side is specifically an upper side of the reference line. In other embodiments, the first side may also be the underside of the reference line or a user-specified side of the two sides of the reference line.
Specifically, positions corresponding to a first starting point, a first ending point and a first control point are determined in an area where the datum line is located, coordinates corresponding to the positions are obtained to serve as known values of a second-order Bezier curve function, a second-order Bezier curve (namely a first curve, such as a curve CDE in fig. 4) is drawn in an area above the datum line based on the second-order Bezier curve function with the known coordinates, a convex portion of the drawn first curve protrudes towards the upper side of the datum line, the starting point of the first curve is a mark point corresponding to the sunrise time on the datum line, the ending point of the first curve is a mark point corresponding to the sunset time on the datum line, the position corresponding to the first control point is located above the datum line, and a convex portion of the first curve passes through the position corresponding to the first control point.
In this embodiment, the first curve is drawn according to the above manner, so that the drawn first curve can be ensured to accurately reflect the related situation of the time when the sun rises above the horizon and the time when the sun is at the highest point.
Further, in this embodiment, the solar curve includes a second curve (such as the curve ABC and/or EFG in fig. 4), where the second curve characterizes a change of the position of the sun with respect to the horizon when the sun is below the horizon, and referring to fig. 6, step S20 includes:
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 value of the sunrise time and the first time;
the reference line is in particular a straight line extending in the transverse direction. Different points on the reference line may characterize different times. The positions of the sunrise time and the sunset time on the reference line differ depending on the time interval between the sunrise time and the sunset time. Defining a point of the sunrise time on the reference line as a first position point (e.g. a point C in fig. 4), and defining a point of the sunset time on the reference line as a second position point (e.g. a point D in fig. 4), wherein the distance between the first position point and the second position point is in an increasing trend along with the increase of the time interval; the distance between the first location point and the second location point decreases with time interval as a decreasing trend. Specifically, a preset unit distance corresponding to a unit time on a reference line can be used for determining a product of a time interval and the unit distance as a target distance, and two position points with the interval of the reference line as the target distance are respectively used as sunrise time and sunset time. In addition, a point of the first time on the reference line is defined as a third position point (e.g., point a in fig. 4), a point of the second time on the reference line is defined as a fourth position point (e.g., point G in fig. 4), the third position point and the fourth position point may be fixed points set in advance on the reference line, the unit distance 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 length between the first time and the second time.
Step S23, determining a third target time, the sunset time and a second time as 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 average value of the sunset time and the second time; the curve control parameters include the second curve parameter and the third curve parameter.
The first time and the second time may be fixed times set in advance, or may be times determined according to setting parameters input by a 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, for example, the first time may be 0 point and the second time may be 24 points. In other embodiments, the sunrise time and the sunset time respectively belong to two adjacent days, and the first time and the second time may be the same time, for example, may each be 0 point between two adjacent days.
In this embodiment, the curve control parameters are determined according to the above steps S22 and S23, so that it is ensured that the drawn second curve can further accurately and intuitively reflect the position of the sun before and/or after sunrise with respect to the horizon at different times.
It should be noted that, in other embodiments, when the second curve is another type of curve other than the bezier curve, the curve control parameters may also include the second curve parameter and/or the third curve parameter.
Further, based on the above step S22 and step S23, step S30a includes:
Step S33, drawing a datum line representing a horizon and marking the first time, the sunrise time, the sunset time and the second time on the datum line;
Step S34, drawing a second-order bezier curve as the first sub-curve on the second side of the reference line with 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;
In this embodiment, the second side is specifically the underside 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.
Specifically, the positions corresponding to the second starting point, the second ending point and the second control point are determined in the region where the datum line is located, the coordinates corresponding to the positions are obtained to serve as the known values of the second-order Bezier curve function, a second-order Bezier curve (namely, a first sub-curve, such as curve ABC in FIG. 4) is drawn in the region below the datum line based on the second-order Bezier curve function with the known coordinates, the convex part of the drawn first sub-curve protrudes towards the lower side of the datum line, the starting point of the first sub-curve is a mark point corresponding to the first time on the datum line, the ending point of the first sub-curve is a mark point corresponding to the sunset time on the datum line, the position corresponding to the second control point is located below the datum line, and the convex part of the first sub-curve passes through the position corresponding to the second control point.
Step S35, drawing a second-order bezier curve as the second sub-curve on the second side of the reference line with 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; wherein the second side characterizes below the horizon.
In this embodiment, the second side is specifically the underside 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.
Specifically, positions corresponding to a third starting point, a third ending point and a third control point are determined in an area where the datum line is located, coordinates corresponding to the positions are obtained to serve as known values of a second-order Bezier curve function, a second-order Bezier curve (namely a second sub-curve, such as curve EFG in fig. 4) is drawn in an area below the datum line based on the second-order Bezier curve function with the known coordinates, a convex part of the drawn second sub-curve protrudes towards the lower side of the datum line, the starting point of the second sub-curve is a mark point corresponding to sunset time on the datum line, the ending point of the second sub-curve is a mark point corresponding to second time on the datum line, the position corresponding to the third control point is located below the datum line, and a convex part of the second sub-curve passes through the position corresponding to the third control point.
In this embodiment, the second curve is drawn according to the above manner, so that it is ensured that the drawn second curve can further accurately and intuitively reflect the position of the sun with respect to the horizon at different times before and after sunrise.
Further, in the present embodiment, the solar curve includes the first curve and the second curve, and the step S31 and the step S33 in the step S30 may be performed simultaneously, and the step S32, the step S34 and the step S35 may be performed after the step S33, wherein the execution sequence of the step S32, the step S34 and the step S35 may not be specifically limited. Based on this, the solar curve may characterize a case where the sun corresponding to different times from 0 to 24 in one day gradually rises from below the horizon to above the horizon and a case where the sun corresponding to different times gradually rises from above the horizon to below the horizon.
In other embodiments, the solar curve may also include one of the first and second curves described above; or the sun curve may also include the first curve and the first sub-curve, and then step S31 and step S33 in step S30 may be performed simultaneously, and step S30a may include step S33, step S32, and step S34; or the sun curve may also include the first curve and the second sub-curve, and then step S31 and step S33 in step S30 may be performed simultaneously, and step S30a may include step S33, step S32, and step S35; still alternatively, the solar curve may comprise a portion of the first curve or a portion of the second curve described above.
In other embodiments, the first curve and the second curve may also be bezier curves with orders greater than two orders, such as a third order bezier curve or a fourth order bezier curve, and the curve control parameters may adaptively include a greater number of parameters as the control parameters corresponding to the curves.
In other embodiments, when the sunrise time and the sunset time respectively belong to two different days, the step S20 may also include: and determining a fourth target time, the sunrise time and the sunset time as fourth curve parameters corresponding to the second curve, wherein the fourth target time is a fourth average value of the sunrise time and the sunset time. Step S30a may include: drawing a second-order Bezier curve on a second side of the datum line as the second curve by taking the sunset time as a first starting point, the sunrise time as a first ending point and the fourth target time as a fourth control point; the second side is below the horizon.
Further, based on any one of the above embodiments, another embodiment of the method for drawing a solar curve according to the present application is provided. In this embodiment, referring to fig. 7, after step S30, the method further includes:
Step S40, obtaining a target moment;
The target time may be the current time or a user-specified time.
Step S50, determining a point corresponding to the target moment on the solar curve as a datum point;
The different points of time correspond to different position points on the reference line, the position point corresponding to the target point of time on the reference line is taken as a target position point, and the point corresponding to the target position point on the solar curve is taken as a reference point.
Step S60, drawing a target sun image on the reference point.
The target sun image can be a sun image configured by default of the system, and can also be an image set by a user.
Specifically, a point on the target solar image may be selected as a positioning point (such as an inner point, an edge point, or a point spaced from the outer and edge points), and the positioning point is set at the reference point and the target solar image is drawn.
In the embodiment, the solar image is drawn at the corresponding position on the solar curve in a manner of being suitable for the target moment, so that a user can intuitively and accurately acquire the position of the sun relative to the horizon through the sun and the position of the sun on the solar curve.
Further, in this embodiment, the solar curve includes a first curve, where the first curve characterizes a change feature of a position of the sun relative to a horizon line with time when the sun is above the horizon line, and after the step of obtaining the target time, the method further includes: and if the target time is greater than or equal to sunrise time and the target time is less than or equal to sunset time, executing the step of determining that the point corresponding to the target time on the solar curve is the datum point, wherein the step of determining that the point corresponding to the target time on the solar curve is the datum point comprises determining that the point corresponding to the target time on the first curve is the datum point. Based on the method, the solar image can be drawn only when the sun is above the horizon, and the solar image can not be drawn when the sun is below the horizon, so that the accuracy of the sun and the sun which can be seen by a user and is represented on the sun curve relative to the horizon is ensured.
Further, in this embodiment, the solar curve includes a reference line representing a horizon line in addition to a first curve, where 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 that a point corresponding to the target time on the solar curve is the reference point, the method further includes: determining a first interval duration of the target time and the sunrise time, and determining a second interval duration of the target time and the sunset time; when the first interval duration or the second interval duration is smaller than a preset duration, drawing a first solar image (such as a semicircle at a point C in FIG. 4) on the reference point, wherein the first solar image is a part of the target solar image; and when the first interval duration and the second interval duration are both greater than or equal to a preset duration, executing the step of drawing a target solar image (such as a circle between points D and E in fig. 4) on the reference point.
The preset time period here is specifically a minimum interval time period between the target time allowed when the sun is all above the horizon and the sunrise time or the sunset time. The preset time length can be determined according to the curve characteristics of the sun curve and the size of the target sun image. The first interval duration or the second interval duration is smaller than a preset duration, which indicates that at least part of the sun is below the horizon; the first interval duration and the second interval duration are both greater than or equal to a preset duration, indicating that the sun is all above the horizon.
The first solar image may be obtained by clipping the target solar image according to a fixed proportion in advance, or may be obtained by clipping the target solar image according to a proportion corresponding to the target time.
Further, in this embodiment, when the first interval duration or the second interval duration is smaller than a preset duration, a corresponding target proportion is determined according to the first interval duration or the second interval duration; the smaller the first interval duration or the second interval duration is, the smaller the target proportion is; and reducing the target sun image according to the target proportion, obtaining a first sun image, and drawing the first sun image on the datum point after obtaining the first sun image.
In this embodiment, when the time interval between the target time and sunrise time or sunset time is shorter, only a part of the target sun image is drawn; and drawing all target solar images when the sunrise time and the sunset time are longer than the target time, so that the sun drawn on the solar curve can more intuitively and accurately reflect the position of the sun relative to the horizon line, which is seen by a user in reality, of the sun, and the accuracy and the observability of the drawn sun and the solar curve thereof are improved.
In addition, the embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium stores a drawing program of the solar curve, and the drawing program of the solar curve realizes the relevant steps of any embodiment of the drawing method of the solar curve when being executed by a processor.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above, including several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an electronic device, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

1. The method for drawing the solar curve is characterized by comprising the following steps of:
acquiring sunset time and sunrise time;
Determining 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 the following steps: taking the sunset time, the sunrise time and the characteristic time obtained by calculating the sunset time and the sunrise time as curve control parameters;
Drawing a solar curve according to the curve control parameters, wherein the solar curve represents the time-dependent change characteristic of the position of the sun relative to the horizon, and the step of drawing the solar curve according to the curve control parameters comprises the following steps: the curve control parameters are used as known values or numerical limiting ranges of curve functions corresponding to preset solar curves, and curves corresponding to the curve functions meeting the curve control parameters are drawn to serve as solar curves;
The solar curve comprises a first curve and a second curve, wherein the first curve represents the time-dependent characteristic of the position of the sun relative to the horizon when the sun is above the horizon, the second curve represents the time-dependent characteristic of the position of the sun relative to the horizon when the sun is below the horizon, the second curve comprises a first sub-curve and a second sub-curve, the first sub-curve represents the time-dependent characteristic of the position of the sun relative to the horizon before sunrise, and the second sub-curve represents the time-dependent characteristic of the position of the sun relative to the horizon after sunset.
2. The method of claim 1, wherein the step of plotting the solar curve according to the curve control parameter comprises:
And drawing a Bezier curve according to the curve control parameters to obtain the solar curve.
3. The method of drawing a solar curve according to claim 2, wherein the step of determining a curve control parameter according to the sunset time and the sunrise time includes:
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 comprise the first curve parameters;
The first target time is a time when the sun is at a highest position relative to the horizon or a first average of the sunrise time and the sunset time.
4. A method of mapping a solar curve as claimed in claim 3 wherein the step of mapping a bezier curve based on the curve control parameters comprises:
drawing a datum line representing a horizon and marking the sunrise time and the sunset time on the datum line;
Drawing a second-order Bezier curve on a first side of the datum line as the first curve by taking the sunrise time as a first starting point, the sunset time as a first ending point and the first target time as a first control point; the first side is above the horizon.
5. The method of drawing a solar curve according to claim 2, wherein the step of determining a curve control parameter according to the sunset time and the sunrise time includes:
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 value of the sunrise time and the first time;
determining a third target time, the sunset time and a 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 average value of the sunset time and the second time;
The curve control parameters include the second curve parameter and the third curve parameter.
6. The method of claim 5, wherein the step of drawing a bezier curve according to the curve control parameter comprises:
drawing a reference line representing a horizon and marking the first time, the sunrise time, the sunset time and the second time on the reference line;
drawing a second-order Bezier curve on a second side of a datum line as the first sub-curve by 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;
drawing a second-order Bezier curve on a second side of a datum line as the second sub-curve by 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;
Wherein the second side characterizes below the horizon.
7. The method for drawing a solar curve according to any one of claims 1 to 6, further comprising, after the step of drawing a solar curve according to the curve control parameter:
Acquiring a target moment;
determining a point corresponding to the target moment on the solar curve as a datum point;
And drawing a target sun image on the datum point.
8. The method of claim 7, wherein the solar curve further comprises a reference line representing a horizon, the reference point being a point on the first curve, and the step of determining that the corresponding point on the solar curve at the target time is the reference point further comprises:
determining a first interval duration of the target time and the sunrise time, and determining a second interval duration of the target time and the sunset time;
when the first interval duration or the second interval duration is smaller than a preset duration, drawing a first solar image on the datum point, wherein the first solar image is a part of the target solar image;
And when the first interval duration and the second interval duration are both greater than or equal to the preset duration, executing the step of drawing the target solar image on the datum point.
9. An electronic device, the electronic device comprising: a memory, a processor and a drawing program of a solar curve stored on the memory and executable on the processor, which when executed by the processor realizes the steps of the drawing method of a solar curve according to any one of claims 1 to 8.
10. A computer-readable storage medium, wherein a drawing program of a solar curve is stored on the computer-readable storage medium, which when executed by a processor, implements the steps of the drawing method of a solar curve according to any one of claims 1 to 8.
CN202111266691.6A 2021-10-28 2021-10-28 Electronic device, method for drawing solar curve of electronic device, and computer-readable storage medium Active CN113947645B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111266691.6A CN113947645B (en) 2021-10-28 2021-10-28 Electronic device, method for drawing solar curve of electronic device, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111266691.6A CN113947645B (en) 2021-10-28 2021-10-28 Electronic device, method for drawing solar curve of electronic device, and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN113947645A CN113947645A (en) 2022-01-18
CN113947645B true CN113947645B (en) 2024-11-05

Family

ID=79337308

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111266691.6A Active CN113947645B (en) 2021-10-28 2021-10-28 Electronic device, method for drawing solar curve of electronic device, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN113947645B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108664726A (en) * 2018-05-10 2018-10-16 我要家网络科技有限公司 A kind of house Sunlight Analysis method
CN110598898A (en) * 2019-07-30 2019-12-20 深圳供电局有限公司 Open-acquisition-based weather data photovoltaic prediction method and system and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106023279B (en) * 2016-05-09 2019-02-01 广州视睿电子科技有限公司 curve drawing method and system
CN111127590B (en) * 2019-12-26 2023-06-20 新奥数能科技有限公司 Second-order Bezier curve drawing method and device
CN112579083B (en) * 2020-12-09 2024-05-17 京东科技控股股份有限公司 Image display method, device, electronic equipment and storage medium
CN113362418A (en) * 2021-04-23 2021-09-07 江苏小牛电子科技有限公司 Curve smoothing method, system, equipment and storage medium based on Bezier curve

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108664726A (en) * 2018-05-10 2018-10-16 我要家网络科技有限公司 A kind of house Sunlight Analysis method
CN110598898A (en) * 2019-07-30 2019-12-20 深圳供电局有限公司 Open-acquisition-based weather data photovoltaic prediction method and system and storage medium

Also Published As

Publication number Publication date
CN113947645A (en) 2022-01-18

Similar Documents

Publication Publication Date Title
CN109472864B (en) Generation method and device of elevation tile map
CN110189381B (en) External parameter calibration system, method, terminal and readable storage medium
CN107273000B (en) Screen multi-resolution adaptation method of intelligent oscilloscope
CN114385769A (en) Dynamically controlling a map viewport in accordance with user signals
US20190065855A1 (en) Augmented reality geolocation using image matching
EP2104926A1 (en) Displaying elevation information from a digital map
CN111340879A (en) Image positioning system and method based on up-sampling
CN113947645B (en) Electronic device, method for drawing solar curve of electronic device, and computer-readable storage medium
CN106502507A (en) Screenshotss method and mobile terminal
CN107992607B (en) Typhoon forecast picture drawing method and device, computer equipment and storage medium
CN104932784A (en) Picture display method and terminal
CN111914046A (en) Generation method and device of target seating chart and computer equipment
CN105043377A (en) Method and device for recording running routes, and electronic equipment
CN111653250B (en) Screen display demonstration method and device and terminal equipment
CN112149020B (en) Progress bar display method and device, electronic equipment and storage medium
CN110660004B (en) Curve data reading method, electric energy meter and storage medium
CN110334163B (en) Map background optimization method, device, equipment and storage medium for big data
CN110543278A (en) Cross-device screen coordinate adaptation method and device and storage medium
CN103943026B (en) A kind of impact point automatic placement method based on pixel distance
CN111459440A (en) Control method, control device, terminal and readable storage medium
CN108416747B (en) Element position correction method, element position correction device, computer equipment and storage medium
CN102496349B (en) Graph equipment display method and device
CN116681632A (en) Image processing method, device, equipment and storage medium
CN109241213A (en) A kind of electronic map point polymerization and device
CN113434935B (en) Method, apparatus, computer device and readable storage medium for marking temporary size

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant