Sampled data mean value calculation method and system, storage medium and computer
By acquiring and processing vehicle sample data in real time, dividing time units to calculate sub-means and accumulating, the problem of misjudgment of sampling data processing in the prior art is solved, and the accuracy and user experience of software control are improved.
Patent Information
- Application Number
- CN202410628789.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-11-15
AI Technical Summary
The prior art is prone to misjudgment during the sampling data processing process, which affects the accuracy of software control and reduces user experience.
By obtaining the sample data of the target vehicle in real time, dividing the time units, calculating the sub-means in each time unit, and performing accumulating processing to calculate the target mean, combining filtering and noise reduction processing to generate an accurate mean.
Improve work efficiency, reduce misjudgment, and improve the accuracy and user experience of software control.
Smart Images

Figure CN118968653A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automobile technology, and in particular to a sampling data mean value calculation method, system, storage medium and computer. Background Art
[0002] With the advancement of science and technology and the rapid development of productivity, cars have become popular in people's daily lives and have become one of the indispensable means of transportation for people's daily travel, greatly facilitating people's lives.
[0003] Among them, in the existing vehicle control logic, if the vehicle's driving information is collected in real time, the information will fluctuate greatly, which is not conducive to logical judgment and may lead to misjudgment, thus affecting the accuracy of software control.
[0004] Furthermore, in the process of real-time collection of vehicle sample data, most of the existing technologies will sum the sampled data for several consecutive cycles and then perform corresponding mean processing. However, this data processing method is prone to misjudgment, which affects the accuracy of software control and reduces the user experience. Summary of the invention
[0005] Based on this, the purpose of the present invention is to provide a method, system, storage medium and computer for calculating the mean of sampled data, so as to solve the problem that misjudgment is prone to occur in the process of processing sampled data in the prior art, resulting in affecting the accuracy of software control.
[0006] A first aspect of the present invention is to provide a method for calculating a mean value of sampled data, wherein the method comprises:
[0007] When a target vehicle is acquired in real time, sample data corresponding to the target vehicle is collected in real time;
[0008] Detecting the target collection time corresponding to the sample data in real time, and dividing the target collection time into a number of corresponding time units;
[0009] The sub-means generated by the sample data in each of the time units are calculated in real time based on preset rules, and each of the sub-means is accumulated to calculate the target mean corresponding to the sample data in real time.
[0010] According to one aspect of the above technical solution, the step of calculating the sub-means of the sample data generated in each time unit in real time based on a preset rule includes:
[0011] When a plurality of the time units are acquired in real time, a corresponding target identifier is added to each of the time units in turn;
[0012] Scanning and processing each of the time units based on the target identifier to detect in real time the time interval corresponding to each of the time units;
[0013] The sub-mean values of each sample data generated in each time unit are calculated in real time according to each time interval.
[0014] According to one aspect of the above technical solution, the step of calculating in real time according to each time interval the sub-mean value generated by each sample data in each time unit comprises:
[0015] When the time intervals corresponding to each of the time units are acquired in real time, the sample data is fully scanned according to each of the time intervals to detect in real time the original sub-data generated by the sample data in each of the time intervals;
[0016] The original sub-data are pre-processed to generate corresponding target sub-data, and sub-means corresponding to each of the time units are calculated according to the target sub-data and the time interval, and the sub-means are specific values.
[0017] According to one aspect of the above technical solution, the step of preprocessing the original sub-data to generate corresponding target sub-data includes:
[0018] When the original sub-data are acquired in real time, the original sub-data are filtered and denoised in sequence to generate the target sub-data accordingly.
[0019] According to one aspect of the above technical solution, the step of accumulating each of the sub-means to calculate the target mean corresponding to the sample data in real time includes:
[0020] When each of the sub-means is obtained in real time, a target algorithm adapted to each of the sub-means is correspondingly called out in a preset algorithm database;
[0021] Each of the sub-means is input into the target algorithm one by one, and the target algorithm performs a corresponding accumulation process on each of the sub-means to generate the target mean accordingly.
[0022] According to one aspect of the above technical solution, the expression of the target algorithm is:
[0023] x=(x1+x2+...+xn) / (n*t)
[0024] Wherein, n represents the number of the sub-means, x represents the sub-mean, and t represents the time unit.
[0025] According to one aspect of the above technical solution, the method further includes:
[0026] When the target mean is obtained in real time, corresponding prompt information is sent to the staff, and the prompt information includes text prompts and sound prompts.
[0027] A second aspect of the present invention is to provide a sampling data mean calculation system, wherein the system comprises:
[0028] A collection module, used for collecting sample data corresponding to the target vehicle in real time when the target vehicle is acquired in real time;
[0029] A division module, used for detecting the target collection time corresponding to the sample data in real time, and dividing the target collection time into a number of corresponding time units;
[0030] The calculation module is used to calculate the sub-means generated by the sample data in each time unit in real time based on preset rules, and to accumulate each sub-mean to calculate the target mean corresponding to the sample data in real time.
[0031] According to one aspect of the above technical solution, the calculation module is specifically used for:
[0032] When a plurality of the time units are acquired in real time, a corresponding target identifier is added to each of the time units in turn;
[0033] Scanning and processing each of the time units based on the target identifier to detect in real time the time interval corresponding to each of the time units;
[0034] The sub-mean values of each sample data generated in each time unit are calculated in real time according to each time interval.
[0035] According to one aspect of the above technical solution, the calculation module is further specifically used for:
[0036] When the time intervals corresponding to each of the time units are acquired in real time, the sample data is fully scanned according to each of the time intervals to detect in real time the original sub-data generated by the sample data in each of the time intervals;
[0037] The original sub-data are pre-processed to generate corresponding target sub-data, and sub-means corresponding to each of the time units are calculated according to the target sub-data and the time interval, and the sub-means are specific values.
[0038] According to one aspect of the above technical solution, the calculation module is further specifically used for:
[0039] When the original sub-data are acquired in real time, the original sub-data are filtered and denoised in sequence to generate the target sub-data accordingly.
[0040] According to one aspect of the above technical solution, the calculation module is further specifically used for:
[0041] When each of the sub-means is obtained in real time, a target algorithm adapted to each of the sub-means is correspondingly called out in a preset algorithm database;
[0042] Each of the sub-means is input into the target algorithm one by one, and the target algorithm performs a corresponding accumulation process on each of the sub-means to generate the target mean accordingly.
[0043] According to one aspect of the above technical solution, the expression of the target algorithm is:
[0044] x=(x1+x2+...+xn) / (n*t)
[0045] Wherein, n represents the number of the sub-means, x represents the sub-mean, and t represents the time unit.
[0046] According to one aspect of the above technical solution, the sampling data mean value calculation system further includes a prompt module, and the prompt module is specifically used to:
[0047] When the target mean is obtained in real time, corresponding prompt information is sent to the staff, and the prompt information includes text prompts and sound prompts.
[0048] The third aspect of the present invention is to provide a computer, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the sampling data mean calculation method as described above when executing the computer program.
[0049] A fourth aspect of the present invention is to provide a readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for calculating the mean value of sampling data as described above is implemented.
[0050] Compared with the prior art, the method, system, storage medium and device for calculating the mean value of sampled data shown in the present invention have the following beneficial effects:
[0051] By collecting sample data of the target vehicle in real time and further determining the target collection time corresponding to the current sample data, and based on this, synchronously dividing the corresponding time units, it is possible to further calculate the sub-means generated by the current sample data in each current time unit, and finally accumulate them into the required target mean. This process can objectively and effectively complete the calculation of the mean, thereby improving work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 This is a flow chart of a method for calculating the mean value of sampled data according to a first embodiment of the present invention;
[0053] Figure 2 This is a structural block diagram of a sampling data mean value calculation system provided in the third embodiment of the present invention.
[0054] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0055] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0056] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0058] See also Figure 1 , which is a sampling data mean calculation method provided in the first embodiment of the present invention. The sampling data mean calculation method provided in this embodiment can objectively and effectively complete the mean calculation, thereby improving work efficiency.
[0059] Specifically, this embodiment provides:
[0060] A method for calculating the mean of sampled data comprises the following steps:
[0061] Step S10, when a target vehicle is acquired in real time, sample data corresponding to the target vehicle is collected in real time;
[0062] Step S20, detecting the target collection time corresponding to the sample data in real time, and dividing the target collection time into a number of corresponding time units;
[0063] Step S30, calculating in real time the sub-means generated by the sample data in each of the time units based on a preset rule, and performing accumulation processing on each of the sub-means to calculate in real time the target mean corresponding to the sample data.
[0064] Specifically, in this embodiment, it should be noted that in order to objectively and accurately calculate the average value corresponding to the sampled data, it is necessary to first accurately and completely collect the corresponding data. At the same time, it is also necessary to accurately calculate the time spent on collecting the current data. Based on this, the required average value can be accurately calculated.
[0065] Furthermore, before officially starting sampling, it is necessary to first determine a corresponding target, that is, to determine a target vehicle. Furthermore, during the actual operation of the current target vehicle, sample data corresponding to the current target vehicle is collected in real time. At the same time, in order to facilitate subsequent calculations, it is also necessary to synchronously detect the target collection time corresponding to the collection of the current sample data. Based on this, the current target collection time is further divided into several corresponding time units, that is, several small time thresholds. On this basis, the sub-means generated by the current sample data in each current time unit are immediately calculated in real time according to pre-set rules. Finally, it is only necessary to immediately accumulate the several sub-means currently calculated in real time to finally calculate the required target mean, thereby being able to objectively and quickly calculate the required target mean, thereby improving work efficiency.
[0066] Second embodiment
[0067] Furthermore, the step of calculating the sub-means of the sample data generated in each time unit in real time based on a preset rule includes:
[0068] When a plurality of the time units are acquired in real time, a corresponding target identifier is added to each of the time units in turn;
[0069] Scanning and processing each of the time units based on the target identifier to detect in real time the time interval corresponding to each of the time units;
[0070] The sub-mean values of each sample data generated in each time unit are calculated in real time according to each time interval.
[0071] Furthermore, the step of calculating in real time according to each time interval the sub-mean values of each sample data generated in each time unit includes:
[0072] When the time intervals corresponding to each of the time units are acquired in real time, the sample data is fully scanned according to each of the time intervals to detect in real time the original sub-data generated by the sample data in each of the time intervals;
[0073] The original sub-data are pre-processed to generate corresponding target sub-data, and sub-means corresponding to each of the time units are calculated according to the target sub-data and the time interval, and the sub-means are specific values.
[0074] Furthermore, the step of preprocessing the original sub-data to generate corresponding target sub-data includes:
[0075] When the original sub-data are acquired in real time, the original sub-data are filtered and denoised in sequence to generate the target sub-data accordingly.
[0076] Furthermore, the step of accumulating each of the sub-means to calculate the target mean corresponding to the sample data in real time includes:
[0077] When each of the sub-means is obtained in real time, a target algorithm adapted to each of the sub-means is correspondingly called out in a preset algorithm database;
[0078] Each of the sub-means is input into the target algorithm one by one, and the target algorithm performs a corresponding accumulation process on each of the sub-means to generate the target mean accordingly.
[0079] Furthermore, the expression of the target algorithm is:
[0080] x=(x1+X2+...+xn) / (n*t)
[0081] Wherein, n represents the number of the sub-means, x represents the sub-mean, and t represents the time unit.
[0082] Furthermore, the method further comprises:
[0083] When the target mean is obtained in real time, corresponding prompt information is sent to the staff, and the prompt information includes text prompts and sound prompts.
[0084] In addition, in this embodiment, it is also necessary to explain that after a number of time units are divided in real time through the above steps, in order to be able to objectively and accurately calculate the sub-mean corresponding to each current time unit, it is possible to further detect the time interval corresponding to each current time unit, and further calculate each sub-mean according to the current time interval, so as to finally obtain the required target mean, thereby improving work efficiency.
[0085] Furthermore, the mean x of each time unit is stored, and then the timer is reset and re-accumulated. If the mean within a time period of n*T needs to be calculated, the mean of each corresponding time unit is x[1], x[2], x[3], x[4]...x[n];
[0086] When the accumulated sampling time exceeds the first time unit, the calculated mean Ex=(x[1]+0+0+0+…+0) / 1. Before the sampling time reaches the next time unit, the calculated mean Ex is not updated.
[0087] When the accumulated sampling time exceeds the second time unit, the calculated mean Ex=(x[2]+x[1]+0+0+…+0) / 2;
[0088] When the accumulated sampling time exceeds the nth time unit, the final calculated mean Ex = (x[n]+…+x[4]+x[3]+x[2]+x[1]) / n,
[0089] When the accumulated sampling time exceeds the nth time unit, the calculated mean Ex = (x[n]+…+x[4]+x[3]+x[2]+x[1]) / n;
[0090] When the accumulated sampling time exceeds the n+1th time unit, the calculated mean Ex = (x[n+1]+x[n]++x[4]+x[3]+x[2]) / n;
[0091] And so on, the rolling accumulation and averaging are realized in the minimum time unit.
[0092] See also Figure 2 , the third embodiment of the present invention provides:
[0093] A sampling data mean calculation system, wherein the system comprises:
[0094] A collection module, used for collecting sample data corresponding to the target vehicle in real time when the target vehicle is acquired in real time;
[0095] A division module, used for detecting the target collection time corresponding to the sample data in real time, and dividing the target collection time into a number of corresponding time units;
[0096] The calculation module is used to calculate the sub-means generated by the sample data in each time unit in real time based on preset rules, and to accumulate each sub-mean to calculate the target mean corresponding to the sample data in real time.
[0097] Furthermore, the calculation module is specifically used for:
[0098] When a plurality of the time units are acquired in real time, a corresponding target identifier is added to each of the time units in turn;
[0099] Scanning and processing each of the time units based on the target identifier to detect in real time the time interval corresponding to each of the time units;
[0100] The sub-mean values of each sample data generated in each time unit are calculated in real time according to each time interval.
[0101] Furthermore, the calculation module is also specifically used for:
[0102] When the time intervals corresponding to each of the time units are acquired in real time, the sample data is fully scanned according to each of the time intervals to detect in real time the original sub-data generated by the sample data in each of the time intervals;
[0103] The original sub-data are pre-processed to generate corresponding target sub-data, and sub-means corresponding to each of the time units are calculated according to the target sub-data and the time interval, and the sub-means are specific values.
[0104] Furthermore, the calculation module is also specifically used for:
[0105] When the original sub-data are acquired in real time, the original sub-data are filtered and denoised in sequence to generate the target sub-data accordingly.
[0106] Furthermore, the calculation module is also specifically used for:
[0107] When each of the sub-means is obtained in real time, a target algorithm adapted to each of the sub-means is correspondingly called out in a preset algorithm database;
[0108] Each of the sub-means is input into the target algorithm one by one, and the target algorithm performs a corresponding accumulation process on each of the sub-means to generate the target mean accordingly.
[0109] Furthermore, the expression of the target algorithm is:
[0110] x=(x1+X2+...+xn) / (n*t)
[0111] Wherein, n represents the number of the sub-means, x represents the sub-mean, and t represents the time unit.
[0112] Furthermore, the sampling data mean value calculation system further includes a prompt module, and the prompt module is specifically used for:
[0113] When the target mean is obtained in real time, corresponding prompt information is sent to the staff, and the prompt information includes text prompts and sound prompts.
[0114] A fourth embodiment of the present invention provides a computer, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the sampling data mean value calculation method as described above when executing the computer program.
[0115] A fifth embodiment of the present invention provides a readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for calculating the mean value of sampled data as described above is implemented.
[0116] In summary, the sampling data mean calculation method and system provided by the above embodiments of the present invention can objectively and effectively complete the mean calculation, thereby improving work efficiency.
[0117] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0118] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0119] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0120] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0121] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0122] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A method for calculating the mean of sampled data, characterized in that: The method comprises: When a target vehicle is acquired in real time, sample data corresponding to the target vehicle is collected in real time; Detecting the target collection time corresponding to the sample data in real time, and dividing the target collection time into a number of corresponding time units; The sub-means generated by the sample data in each of the time units are calculated in real time based on preset rules, and each of the sub-means is accumulated to calculate the target mean corresponding to the sample data in real time.
2. The method for calculating the mean of sampled data according to claim 1, characterized in that: The step of calculating the sub-means of the sample data generated in each time unit in real time based on the preset rules comprises: When a plurality of the time units are acquired in real time, a corresponding target identifier is added to each of the time units in turn; Scanning and processing each of the time units based on the target identifier to detect in real time the time interval corresponding to each of the time units; The sub-mean values of each sample data generated in each time unit are calculated in real time according to each time interval.
3. The method for calculating the mean of sampled data according to claim 2, characterized in that: The step of calculating the sub-means of each sample data generated in each time unit in real time according to each time interval includes: When the time intervals corresponding to each of the time units are acquired in real time, the sample data is fully scanned according to each of the time intervals to detect in real time the original sub-data generated by the sample data in each of the time intervals; The original sub-data are pre-processed to generate corresponding target sub-data, and sub-means corresponding to each of the time units are calculated according to the target sub-data and the time interval, and the sub-means are specific values.
4. The method for calculating the mean of sampled data according to claim 3, characterized in that: The step of preprocessing the original sub-data to generate corresponding target sub-data includes: When the original sub-data are acquired in real time, the original sub-data are filtered and denoised in sequence to generate the target sub-data accordingly.
5. The method for calculating the mean of sampled data according to claim 1, characterized in that: The step of accumulating each of the sub-means to calculate the target mean corresponding to the sample data in real time comprises: When each of the sub-means is obtained in real time, a target algorithm adapted to each of the sub-means is correspondingly called out in a preset algorithm database; Each of the sub-means is input into the target algorithm one by one, and the target algorithm performs a corresponding accumulation process on each of the sub-means to generate the target mean accordingly.
6. The method for calculating the mean of sampled data according to claim 5, characterized in that: The expression of the target algorithm is: x=(x1+x2+...+xn) / (n*t) Wherein, n represents the number of the sub-means, x represents the sub-mean, and t represents the time unit.
7. The method for calculating the mean of sampled data according to claim 6, characterized in that: The method further comprises: When the target mean is obtained in real time, corresponding prompt information is sent to the staff, and the prompt information includes text prompts and sound prompts.
8. A sampling data mean calculation system, characterized in that: The system comprises: A collection module, used for collecting sample data corresponding to the target vehicle in real time when the target vehicle is acquired in real time; A division module, used for detecting the target collection time corresponding to the sample data in real time, and dividing the target collection time into a number of corresponding time units; The calculation module is used to calculate the sub-means generated by the sample data in each time unit in real time based on preset rules, and to accumulate each sub-mean to calculate the target mean corresponding to the sample data in real time.
9. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the sampling data mean value calculation method according to any one of claims 1 to 7 is implemented.
10. A readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the sampling data mean value calculation method as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Automatic traffic event detection method
CN106781452A
Remote monitoring system for one-hundred-kilometer power consumption of electric vehicle
CN107632270A
Method and device for acquiring high-instantaneity periodic mean value
CN110362788A
Method and device for determining driver habits for assisting driving
CN113147769A
Analog quantity hour mean value calculation method and device and electronic equipment
CN113778316A
