Method and device for reducing array, equipment and medium

By segmenting the trend curve and merging similar changing segments, the problem of array reduction in the prior art resulting in feature loss and long calculation time is solved, and effective reduction of the trend curve and data fitting are achieved.

CN119149926APending Publication Date: 2024-12-17WEICHAI POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411284679.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

When the prior art reduces the array in the trend curve, the velocity curve loses the characteristic of the velocity change, cannot effectively represent the original data, and the calculation time is long.

Method used

By segmenting the trend curve according to the change of slope, comparing the change amount of the dependent variable in each segment with the preset change amount, combining segments with similar change amounts, retaining key data points, and reducing the length of the array.

Benefits of technology

The effective reduction of the trend curve is achieved, the original features are retained, the subsequent calculation time is reduced, and a small amount of data can be used to represent a large amount of data. The curve is basically fully fitted.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149926A_ABST
    Figure CN119149926A_ABST
Patent Text Reader

Abstract

The invention discloses a method, device and equipment for reducing an array and a medium, and the method comprises the steps: segmenting a trend curve according to the change of a slope, and obtaining a plurality of first trend line segments; if the variable quantity of the dependent variable in the ith first trend line segment is smaller than or equal to the preset variable quantity, temporarily storing the first trend curve segment; if the variable quantity of the dependent variable in the (i + 1) th first trend line segment is smaller than or equal to the preset variable quantity, merging the data in the two first trend line segments; if the variable quantity of the dependent variable in the two combined first trend line segments is greater than a preset variable quantity, defining the two combined first trend line segments as second trend line segments, and emptying and temporarily storing the second trend line segments; if the first length is smaller than or equal to the second length, data of the starting point and the ending point of the second trend line segment are reserved, and data between the starting point and the ending point in the second trend line segment are abandoned. An array can be shortened to any required length, a small amount of data is used for representing a large amount of data, a curve is basically fitted, and the subsequent calculation time is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, equipment and medium for reducing an array. Background Art

[0002] The typical driving profile of a vehicle is a curve that reflects the speed-time of the vehicle. It is a representative test condition fitted based on big data of roads and user habits. The profile can reflect the actual operating conditions of the vehicle, and establishing the vehicle profile plays a significant role in vehicle and road analysis.

[0003] At present, when depicting speed curves, the amount of data involved is relatively large, and the subsequent calculation is time-consuming. Using various known interpolation methods, it is necessary to sort and then interpolate, which loses the characteristic of speed change. The newly generated speed curve is very different from the original curve and cannot represent the original data.

[0004] How to reduce the array in the trend curve while retaining the characteristics of the original array to the greatest extent, thereby reducing the subsequent calculation time, is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention

[0005] The present invention provides a method, device, equipment and medium for reducing an array, which can shorten the array in a trend curve to any required length, and can use a small amount of data to represent a large amount of data. The curve is basically completely fitted, which can reduce subsequent calculation time.

[0006] In a first aspect, an embodiment of the present invention provides a method for reducing an array, which is applicable to reducing an array in a trend curve. The method for reducing an array includes:

[0007] S110, segmenting the trend curve according to the change of slope to obtain a plurality of first trend line segments;

[0008] S120, comparing the change amount of the dependent variable in the first trend line segment of the i-th segment with a preset change amount;

[0009] S130, if the change amount of the dependent variable in the i-th segment of the first trend line segment is less than or equal to the preset change amount, temporarily storing the first trend curve segment;

[0010] S140, comparing the change amount of the dependent variable in the (i+1)th segment of the first trend line segment with a preset change amount;

[0011] S150, if the change amount of the dependent variable in the (i+1)th first trend line segment is less than or equal to the preset change amount, merging the data in the two first trend line segments;

[0012] S160, comparing the change amount of the dependent variable in the two merged first trend line segments with the preset change amount;

[0013] S170: if the change amount of the dependent variable in the two first trend line segments after merging is greater than the preset change amount, define the two first trend line segments after merging as a second trend line segment, and clear the temporary storage;

[0014] S180, looping through steps S120 to S170 until all the first trend line segments are compared, where i is a positive integer;

[0015] S190, comparing a first length of the second trend line segment with a second length of a preset line segment;

[0016] S1100: If the first length is less than or equal to the second length, retain the data of the start point and the end point of the second trend line segment, and discard the data between the start point and the end point of the second trend line segment.

[0017] Optionally, after comparing the change amount of the dependent variable in the i-th segment of the first trend line segment with a preset change amount, the method further includes:

[0018] If the change amount of the dependent variable in the i-th segment of the first trend line segment is greater than the preset change amount, the i-th segment of the first trend line segment is defined as the second trend line segment.

[0019] Optionally, after comparing the change amount of the dependent variable in the (i+1)th first trend line segment with a preset change amount, the method further includes:

[0020] If the change in the dependent variable in the i+1th first trend line segment is greater than the preset change, the i-th first trend line segment and the i+1th first trend line segment are both defined as the second trend line segment.

[0021] Optionally, after comparing the change amount of the dependent variable in the two first trend line segments after merging with the preset change amount, the method further includes:

[0022] If the change in the dependent variable in the two merged first trend line segments is less than or equal to the preset change, i+2 is replaced by i+1, and steps S140 to S160 are performed again until the change in the dependent variable in the merged first trend line segment is greater than the preset change.

[0023] Optionally, after comparing the first length of the second trend line segment with the second length of the preset line segment, the method further includes:

[0024] If the first length is greater than the second length, determining whether the first length is evenly divisible by the second length;

[0025] If the first length is an integer dividing the second length, data of every point corresponding to the second length starting from the starting point of the second trend line segment is retained.

[0026] Optionally, after determining whether the first length is evenly divisible by the second length if the first length is greater than the second length, the method further includes:

[0027] If the first length cannot divide the second length evenly, then the data of the points corresponding to the second length starting from the starting point of the second trend line segment and the data of the end point of the second trend line segment are retained; or the data of the points corresponding to the second length starting from the end point of the second trend line segment and the data of the starting point of the second trend line segment are retained.

[0028] Optionally, the second length is Wherein, m is the length of the original horizontal coordinate array in the trend curve, k is the length of the horizontal coordinate array in the trend curve after the preset reduction, Indicates rounding down.

[0029] In a second aspect, an embodiment of the present invention further provides a device for reducing an array, comprising:

[0030] A first trend line segment acquisition module, used for segmenting the trend curve according to the change of slope to obtain multiple first trend line segments;

[0031] A size comparison module, used for comparing the size of the change of the dependent variable in the first trend line segment of the i-th segment with a preset change;

[0032] A first trend curve temporary storage module, configured to temporarily store the first trend curve segment if the size comparison module determines that the change amount of the dependent variable in the i-th first trend line segment is less than or equal to the preset change amount;

[0033] The size comparison module is further used to compare the size of the change of the dependent variable in the i+1th segment of the first trend line segment with a preset change;

[0034] a data merging module, configured to merge the data in the two first trend line segments if the size comparison module determines that the change amount of the dependent variable in the i+1th segment of the first trend line segment is less than or equal to the preset change amount;

[0035] The size comparison module is further used to compare the size of the change of the dependent variable in the two first trend line segments after merging with the preset change;

[0036] A line segment definition module, configured to define the two first trend line segments after merging as a second trend line segment and clear the temporary storage if the size comparison module determines that the change amount of the dependent variable in the two first trend line segments after merging is greater than the preset change amount;

[0037] The size comparison module is further used to compare the first length of the second trend line segment with the second length of the preset line segment;

[0038] A data retention module is used to retain the data of the starting point and the end point of the second trend line segment and discard the data between the starting point and the end point of the second trend line segment if the size comparison module determines that the first length is less than or equal to the second length.

[0039] In a third aspect, an embodiment of the present invention further provides a device for reducing an array, the device for reducing an array comprising:

[0040] at least one processor; and

[0041] a memory communicatively connected to the at least one processor; wherein,

[0042] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the method for reducing an array as described in the first aspect.

[0043] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method of reducing an array as described in the first aspect when executing the computer instructions.

[0044] The embodiment of the present invention provides a method, device, equipment and medium for reducing an array, which divides a trend curve into segments according to the change of slope to obtain multiple first trend line segments; if the change amount of the dependent variable in the i-th first trend line segment is less than or equal to the preset change amount, the first trend curve segment is temporarily stored; if the change amount of the dependent variable in the i+1-th first trend line segment is less than or equal to the preset change amount, the data in the two first trend line segments are merged; if the change amount of the dependent variable in the two merged first trend line segments is greater than the preset change amount, the two merged first trend line segments are defined as the second trend line segment, and the temporary storage is cleared; if the first length is less than or equal to the second length, the data of the starting point and the end point of the second trend line segment are retained, and the data between the starting point and the end point of the second trend line segment are discarded. The embodiment of the present invention divides the trend curve into segments according to the change of slope to reduce the segments, which can achieve the maximum retention of trend changes, merge the parts where the trend changes are not obvious, and can greatly improve the reduction effect. The embodiment of the present invention can shorten the array in the trend curve to any required length, and can use a small amount of data to represent a large amount of data. The curve is basically completely fitted, which can reduce the subsequent calculation time.

[0045] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0047] Figure 1 A flowchart of a method for reducing an array provided by an embodiment of the present invention;

[0048] Figure 2 A segmented architecture diagram of a trend curve provided by an embodiment of the present invention;

[0049] Figure 3 A comparison diagram of reduction results provided by an embodiment of the present invention;

[0050] Figure 4 A speed ratio comparison diagram provided by an embodiment of the present invention;

[0051] Figure 5 A flowchart of another method for reducing an array provided by an embodiment of the present invention;

[0052] Figure 6 A point-taking diagram provided by an embodiment of the present invention;

[0053] Figure 7 Another point-taking diagram provided by an embodiment of the present invention;

[0054] Figure 8 Another point-taking diagram provided by an embodiment of the present invention;

[0055] Fig. 9 A schematic diagram of the structure of a device for reducing an array provided by an embodiment of the present invention;

[0056] Fig.10 A schematic diagram of the structure of a device for reducing an array provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0058] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0059] Figure 1 This is a flowchart of a method for reducing an array provided by an embodiment of the present invention. This embodiment can be applied to reducing an array in a trend curve. The trend curve can be a spectrum curve or other curves that can reflect trend changes. The method can be executed by a device for reducing an array. The device for reducing an array can be implemented in the form of hardware and / or software. Figure 1 As shown, the method includes:

[0060] S110 , segmenting the trend curve according to changes in slope to obtain a plurality of first trend line segments.

[0061] For example, in the road spectrum curve of the embodiment of the present invention, the horizontal axis is time, the vertical axis is speed, and the road spectrum curve is segmented according to increasing or decreasing speed, so that a plurality of first trend line segments can be obtained.

[0062] S120, comparing the change amount of the dependent variable in the i-th first trend line segment with a preset change amount.

[0063] Specifically, the preset variation can be freely set by the user.

[0064] S130: If the change amount of the dependent variable in the i-th first trend line segment is less than or equal to a preset change amount, temporarily storing the first trend curve segment.

[0065] S140, comparing the change amount of the dependent variable in the (i+1)th first trend line segment with a preset change amount.

[0066] S150: If the change amount of the dependent variable in the (i+1)th first trend line segment is less than or equal to a preset change amount, the data in the two first trend line segments are merged.

[0067] It is understood that in the embodiment of the present invention, if the change amount of the dependent variable in the first trend line segment is less than or equal to the preset change amount, it can be merged. Exemplarily, in the embodiment of the present invention, if the speed change in the trend curve is less than or equal to the preset change amount, it is considered to be traveling at a constant speed and can be merged.

[0068] S160: Compare the change amount of the dependent variable in the two merged first trend line segments with the preset change amount.

[0069] S170: If the change amount of the dependent variable in the two first trend line segments after merging is greater than the preset change amount, the two first trend line segments after merging are defined as the second trend line segments, and the temporary storage is cleared.

[0070] S180, looping through steps S120 to S170 until all first trend line segments have been compared, where i is a positive integer.

[0071] Figure 2 A segmented architecture diagram of a trend curve provided in an embodiment of the present invention is exemplarily shown in FIG. Figure 2 , the blue box is the first trend line segment that needs to be merged, and the one between two adjacent arrows is the second trend line segment.

[0072] S190: Compare a first length of the second trend line segment with a second length of the preset line segment.

[0073] Specifically, the second length of the preset line segment can be freely set by the user.

[0074] Optionally, the second length is Among them, m is the length of the original horizontal coordinate array in the trend curve, and k is the length of the horizontal coordinate array in the trend curve after the preset reduction. Indicates rounding down.

[0075] It is understandable that m is much larger than k.

[0076] S1100: If the first length is less than or equal to the second length, retain the data of the start point and the end point of the second trend line segment, and discard the data between the start point and the end point of the second trend line segment.

[0077] Figure 3 A comparison chart of reduction results provided by an embodiment of the present invention, referring to Figure 3 , the maximum value of the abscissa of the trend curve before reduction is 16000, and the maximum value of the abscissa of the trend curve after reduction is 2000. It can be understood that the trend curve after reduction is the curve fitting result of the method for reducing the array according to the embodiment of the present invention. Figure 3 , the basic trend of the trend curve after reduction has not changed much compared with the trend curve before reduction.

[0078] Figure 4 A speed ratio result comparison diagram provided by an embodiment of the present invention is specifically a result comparison diagram of the speed ratio of a road spectrum curve after being reduced by the method of reducing an array in an embodiment of the present invention and the speed ratio of a road spectrum curve before being reduced. Figure 4 The horizontal axis is the speed, and the vertical axis is the proportion of the speed. Figure 4 , the proportion of different speeds in the trend curve after reduction is basically unchanged from that before reduction.

[0079] Therefore, after the road spectrum curve is reduced by the method of reducing the array in the embodiment of the present invention, the original speed characteristics can be retained to the greatest extent, and the curve fitting can be guaranteed, and the speed proportion, average acceleration, and acceleration and deceleration time proportion are similar.

[0080] In summary, the embodiment of the present invention divides the trend curve into segments according to the change in slope, and reduces it in segments, which can achieve the maximum retention of trend changes, and merge the parts where the trend changes are not obvious, which can greatly improve the reduction effect. The embodiment of the present invention can shorten the array in the trend curve to any required length, and can use a small amount of data to represent a large amount of data. The curve is basically completely fitted, which can reduce the subsequent calculation time.

[0081] Figure 5 A flowchart of another method for reducing an array provided by an embodiment of the present invention, referring to Figure 5 , the method comprises the following steps:

[0082] S210 , segmenting the trend curve according to changes in slope to obtain a plurality of first trend line segments.

[0083] S220 , comparing the change in the dependent variable in the i-th first trend line segment with a preset change.

[0084] S230: If the change amount of the dependent variable in the i-th first trend line segment is less than or equal to the preset change amount, temporarily store the first trend curve segment.

[0085] S240, comparing the change amount of the dependent variable in the (i+1)th first trend line segment with a preset change amount.

[0086] S250: If the change amount of the dependent variable in the (i+1)th first trend line segment is less than or equal to a preset change amount, the data in the two first trend line segments are merged.

[0087] S260: Compare the change amount of the dependent variable in the two merged first trend line segments with the preset change amount.

[0088] S270: If the change amount of the dependent variable in the two first trend line segments after merging is greater than the preset change amount, the two first trend line segments after merging are defined as the second trend line segments, and the temporary storage is cleared.

[0089] S280, looping through steps S220 to S270 until all first trend line segments have been compared, where i is a positive integer.

[0090] S290: Compare the first length of the second trend line segment with the second length of the preset line segment.

[0091] S2100: If the first length is less than or equal to the second length, retain the data of the start point and the end point of the second trend line segment, and discard the data between the start point and the end point of the second trend line segment.

[0092] Optionally, based on the above embodiment, continue to refer to Figure 5 , after step S220, further comprising:

[0093] S231. If the change in the dependent variable in the i-th first trend line segment is greater than a preset change, define the i-th first trend line segment as a second trend line segment.

[0094] Optionally, based on the above embodiment, continue to refer to Figure 5 , after step S240, further comprising:

[0095] S251. If the change in the dependent variable in the i+1th first trend line segment is greater than a preset change, both the i-th first trend line segment and the i+1th first trend line segment are defined as second trend line segments.

[0096] It can be understood that if the change in the dependent variable in the first trend line segment is greater than the preset change, it means that the trend of the first trend line segment has changed significantly, then the first trend line segment will be retained and defined as the second trend line segment before executing the next step.

[0097] Optionally, based on the above embodiment, continue to refer to Figure 5 , after step S260, further comprising:

[0098] S271. If the change in the dependent variable in the two merged first trend line segments is less than or equal to the preset change, replace i+2 with i+1, and execute steps S240 to S260 again until the change in the dependent variable in the merged first trend line segment is greater than the preset change.

[0099] Optionally, based on the above embodiment, continue to refer to Figure 5 , after step S290, further comprising:

[0100] S2101. If the first length is greater than the second length, determine whether the first length is evenly divisible by the second length.

[0101] S2110. If the first length is an integer dividing the second length, retain the data of each point corresponding to the second length starting from the starting point of the second trend line segment.

[0102] Figure 6 A point-taking diagram provided by an embodiment of the present invention, specifically a point-taking diagram when the first length is an integer dividing the second length, refer to Figure 6 , the first length y divides the second length x, and the data of the points corresponding to the second length x are retained starting from the starting point of the second trend line segment. Figure 6 The point encircled by the blue circle is the point to be taken.

[0103] Optionally, based on the above embodiment, continue to refer to Figure 5 , after step S2101, further comprising:

[0104] S2111. If the first length cannot divide the second length evenly, retain the data of the points corresponding to the second length starting from the starting point of the second trend line segment and the data of the end point of the second trend line segment; or retain the data of the points corresponding to the second length starting from the end point of the second trend line segment and the data of the starting point of the second trend line segment.

[0105] Figure 7 Another point map provided by an embodiment of the present invention, Figure 8 Another point map provided by an embodiment of the present invention, Figure 7 and Figure 8 When the first length cannot divide the second length, a point diagram is obtained. Figure 7, retain the data of the points corresponding to the second length x starting from the starting point of the second trend line segment, as well as the data of the end point of the second trend line segment, refer to Figure 8 , retain the data of the points corresponding to the second length x starting from the end point of the second trend line segment, and the data of the starting point of the second trend line segment. Figure 7 and Figure 8 The point encircled by the red circle is the point to be taken.

[0106] It is understandable that in the embodiment of the present invention, if the first length cannot divide the second length, Figure 7 and Figure 8 The two sets of schemes randomly select points, which can ensure the uniformity and stability of the points.

[0107] The embodiment of the present invention divides the trend curve into segments according to the change of the slope, and reduces it in segments, which can achieve the maximum retention of the trend change, and merge the parts where the trend change is not obvious, which can greatly improve the reduction effect. If the first length cannot divide the second length, the two sets of schemes of the embodiment of the present invention are used to randomly select points, which can ensure the uniformity and stability of the points. The embodiment of the present invention can shorten the array in the trend curve to any required length, and can use a small amount of data to represent a large amount of data. The curve is basically completely fitted, which can reduce the subsequent calculation time.

[0108] Fig. 9 A schematic diagram of a device for reducing an array provided by an embodiment of the present invention, referring to Fig. 9 The device includes: a first trend line segment acquisition module 910, a size comparison module 920, a first trend curve temporary storage module 930, a data merging module 940, a line segment definition module 950 and a data retention module 960.

[0109] In an embodiment of the present invention, the first trend line segment acquisition module 910 is used to segment the trend curve according to the change in slope to obtain multiple first trend line segments. The size comparison module 920 is used to compare the change in the dependent variable in the i-th first trend line segment with the size of the preset change. The first trend curve temporary storage module 930 is used to temporarily store the first trend curve segment if the size comparison module 920 determines that the change in the dependent variable in the i-th first trend line segment is less than or equal to the preset change. The size comparison module 920 is also used to compare the change in the dependent variable in the i+1-th first trend line segment with the size of the preset change. The data merging module 940 is used to merge the data in the two first trend line segments if the size comparison module 920 determines that the change in the dependent variable in the i+1-th first trend line segment is less than or equal to the preset change. The size comparison module 920 is also used to compare the change amount of the dependent variable in the two first trend segments after merging with the preset change amount; if the size comparison module 920 determines that the change amount of the dependent variable in the two first trend segments after merging is greater than the preset change amount, the segment definition module 950 defines the two first trend segments after merging as the second trend segment and clears the temporary storage. The size comparison module 920 is also used to compare the first length of the second trend segment with the second length of the preset segment. The data retention module 960 is used to retain the data of the starting point and end point of the second trend segment if the size comparison module 920 determines that the first length is less than or equal to the second length, and discard the data between the starting point and end point of the second trend segment.

[0110] Optionally, based on the above embodiment, the line segment definition module 950 is further used to define the i-th first trend segment as the second trend segment if the size comparison module 920 determines that the change amount of the dependent variable in the i-th first trend segment is greater than the preset change amount. If the size comparison module 920 determines that the change amount of the dependent variable in the i+1-th first trend segment is greater than the preset change amount, the i-th first trend segment and the i+1-th first trend segment are both defined as the second trend segment. The size comparison module 920 is also used to determine whether the first length is divisible by the second length if the first length is determined to be greater than the second length. The data retention module 960 is also used to retain the data of the points corresponding to the second length from the starting point of the second trend segment if the size comparison module 920 determines that the first length is divisible by the second length. If the first length cannot be divided by the second length, the data of the points corresponding to the second length from the starting point of the second trend segment and the data of the end point of the second trend segment are retained; or the data of the points corresponding to the second length from the end point of the second trend segment and the data of the starting point of the second trend segment are retained.

[0111] The array reduction device provided in the embodiment of the present invention can execute the array reduction method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. For contents not described in detail in the embodiment of the present invention, reference can be made to the array reduction method provided in the above embodiment.

[0112] Fig.10 A schematic diagram of a device for reducing an array provided in an embodiment of the present invention, wherein the device for reducing an array is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The device for reducing an array may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0113] like Fig.10 As shown, the device 10 for reducing the array includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by the at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the device 10 for reducing the array can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0114] A number of components in the reduced array device 10 are connected to an I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the reduced array device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0115] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a method for reducing an array.

[0116] In some embodiments, the method of reducing an array may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 10 for reducing an array via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method of reducing an array described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the method of reducing an array in any other suitable manner (e.g., by means of firmware).

[0117] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0118] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0119] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0120] To provide interaction with a user, the systems and techniques described herein may be implemented on a reduced array of devices having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the reduced array of devices. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0121] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0122] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0123] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0124] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for reducing an array, characterized in that: Applicable to reducing the array in the trend curve, the method of reducing the array includes: S110, segmenting the trend curve according to the change of slope to obtain a plurality of first trend line segments; S120, comparing the change amount of the dependent variable in the first trend line segment of the i-th segment with a preset change amount; S130, if the change amount of the dependent variable in the i-th segment of the first trend line segment is less than or equal to the preset change amount, temporarily storing the first trend curve segment; S140, comparing the change amount of the dependent variable in the (i+1)th segment of the first trend line segment with a preset change amount; S150, if the change amount of the dependent variable in the (i+1)th first trend line segment is less than or equal to the preset change amount, merging the data in the two first trend line segments; S160, comparing the change amount of the dependent variable in the two merged first trend line segments with the preset change amount; S170: if the change amount of the dependent variable in the two first trend line segments after merging is greater than the preset change amount, define the two first trend line segments after merging as a second trend line segment, and clear the temporary storage; S180, looping through steps S120 to S170 until all the first trend line segments are compared, where i is a positive integer; S190, comparing a first length of the second trend line segment with a second length of a preset line segment; S1100: If the first length is less than or equal to the second length, retain the data of the start point and the end point of the second trend line segment, and discard the data between the start point and the end point of the second trend line segment.

2. The method for reducing an array according to claim 1, characterized in that: After comparing the change amount of the dependent variable in the first trend line segment of the i-th segment with the preset change amount, the method further includes: If the change amount of the dependent variable in the i-th segment of the first trend line segment is greater than the preset change amount, the i-th segment of the first trend line segment is defined as the second trend line segment.

3. The method for reducing an array according to claim 1, characterized in that: After comparing the change amount of the dependent variable in the first trend line segment (i+1) with the preset change amount, the method further includes: If the change in the dependent variable in the i+1th first trend line segment is greater than the preset change, the i-th first trend line segment and the i+1th first trend line segment are both defined as the second trend line segment.

4. The method for reducing an array according to claim 1, characterized in that: After comparing the change amount of the dependent variable in the two first trend line segments after merging with the preset change amount, the method further includes: If the change in the dependent variable in the two merged first trend line segments is less than or equal to the preset change, i+2 is replaced by i+1, and steps S140 to S160 are performed again until the change in the dependent variable in the merged first trend line segment is greater than the preset change.

5. The method for reducing an array according to claim 1, characterized in that: After comparing the first length of the second trend line segment with the second length of the preset line segment, the method further includes: If the first length is greater than the second length, determining whether the first length is evenly divisible by the second length; If the first length is an integer that divides the second length, data of every point corresponding to the second length starting from the starting point of the second trend line segment is retained.

6. The method for reducing an array according to claim 5, characterized in that: After determining whether the first length is evenly divisible by the second length if the first length is greater than the second length, the method further includes: If the first length cannot divide the second length evenly, then the data of the points corresponding to the second length starting from the starting point of the second trend line segment and the data of the end point of the second trend line segment are retained; or the data of the points corresponding to the second length starting from the end point of the second trend line segment and the data of the starting point of the second trend line segment are retained.

7. The method for reducing an array according to claim 1, characterized in that: The second length is Wherein, m is the length of the original horizontal coordinate array in the trend curve, k is the length of the horizontal coordinate array in the trend curve after the preset reduction, Indicates rounding down.

8. A device for reducing an array, characterized in that: include: A first trend line segment acquisition module, used for segmenting the trend curve according to the change of slope to obtain multiple first trend line segments; A size comparison module, used for comparing the size of the change of the dependent variable in the first trend line segment of the i-th segment with a preset change; A first trend curve temporary storage module, configured to temporarily store the first trend curve segment if the size comparison module determines that the change amount of the dependent variable in the i-th first trend line segment is less than or equal to the preset change amount; The size comparison module is further used to compare the size of the change of the dependent variable in the (i+1)th segment of the first trend line segment with a preset change; a data merging module, configured to merge the data in the two first trend line segments if the size comparison module determines that the change amount of the dependent variable in the i+1th segment of the first trend line segment is less than or equal to the preset change amount; The size comparison module is further used to compare the size of the change of the dependent variable in the two first trend line segments after merging with the preset change; A line segment definition module, used for defining the two first trend line segments after merging as a second trend line segment and clearing temporary storage if the size comparison module determines that the change amount of the dependent variable in the two first trend line segments after merging is greater than the preset change amount; The size comparison module is further used to compare the first length of the second trend line segment with the second length of the preset line segment; A data retention module is used to retain the data of the starting point and the end point of the second trend line segment and discard the data between the starting point and the end point of the second trend line segment if the size comparison module determines that the first length is less than or equal to the second length.

9. A device for reducing an array, characterized in that The device for reducing the array includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the method for reducing an array according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for reducing an array according to any one of claims 1 to 7 when the computer instructions are executed.