Sensing data processing method adaptive to multiple data types and related equipment

By using the generic mean filter function implemented by macro definition in the handling robot, the problem of high complexity in processing multiple data types of sensor data in the existing technology is solved, and more efficient sensing data processing is achieved, which has good versatility. and scalability.

CN119356790AActive Publication Date: 2025-01-24GUANGDONG LYRIC ROBOT INTELLIGENT AUTOMATION CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411228511.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2025-01-24
Estimated Expiration
2044-09-03

AI Technical Summary

Technical Problem

The prior art has high complexity and lacks good versatility and scalability when processing sensor data of various data types in a transport robot, resulting in low efficiency in sensing data processing.

Method used

The generic mean filter function implemented using macro definition can adapt to sensor data of different data types. There is no need to write specific code for each sensor. The mean calculation is performed through the generic mean filter function to obtain the mean calculation result of the target data type.

Benefits of technology

Improve the versatility and scalability of sensor data processing, reduce code repeat and memory occupation, reduce maintenance costs, and improve sensor data processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356790A_ABST
    Figure CN119356790A_ABST
Patent Text Reader

Abstract

The invention provides a sensing data processing method adaptive to multiple data types, and the method comprises the steps: obtaining a plurality of pieces of sensing numerical data of a target data type from a sensor data queue based on a preset target filtering number, generating a reading address pointer, a numerical value sum variable, a numerical value storage variable and a return value address pointer corresponding to the plurality of sensing numerical data, so as to transmit parameters to a generic mean filtering function constructed based on a preset parameter coding rule; in the generic mean filtering function, according to a read address pointer, a target filtering number, a numerical value sum variable, a numerical value storage variable, a return value address pointer and bytes occupied by the data, a code text defined by a macro is replaced, and then a mean calculation result of the target data type of the multiple pieces of sensing numerical data is obtained, according to the method and the device, the generic mean filtering function realized by adopting macro definition can adapt to sensor data of different data types, and the sensing data processing efficiency can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of handling robot technology, and in particular to a sensor data processing method, system, device and medium that are adaptable to multiple data types. Background Art

[0002] Currently, a variety of sensors are involved in the work process of an AGV, such as temperature sensors, humidity sensors, wire sensors (height sensors), obstacle detection sensors (radar sensors), etc. Different batches of robots are equipped with different types and numbers of sensors, and the data types of different sensors are also different. The existing technology usually requires setting a matching data reading function for each sensor data type, which is highly complex. In this mode, as long as there is a change in the sensor device, the code needs to be re-edited to read the data, resulting in poor sensor data processing efficiency. Summary of the invention

[0003] An embodiment of the present application provides a sensor data processing method that is adaptable to multiple data types. The method can adapt to sensor data of different data types by adopting a generic mean filter function implemented by macro definition, without the need to write specific code for each sensor. It has better versatility and scalability, and can effectively improve the efficiency of sensor data processing.

[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application provides a sensor data processing method adapted to multiple data types, which is applied to a communication terminal, wherein the communication terminal is provided with sensors of multiple data types, and the method comprises: obtaining a sensor data queue received by the communication terminal, determining a target data type corresponding to the sensor data queue, and obtaining multiple sensor value data of the target data type from the sensor data queue based on a preset target filtering number; generating a read address pointer, a value sum variable, a value storage variable, and a return value address pointer corresponding to the multiple sensor value data based on the target data type, and passing the read address pointer, the target filtering number, the value sum variable, the value storage variable, the return value address pointer, and the preset bytes occupied by the data to a generic mean filter function constructed based on a preset parameter encoding rule; replacing a macro-defined code text in the generic mean filter function according to the read address pointer, the target filtering number, the value sum variable, the value storage variable, the return value address pointer, and the bytes occupied by the data, so as to compile the generic mean filter function to perform mean calculation on the multiple sensor value data and obtain the mean calculation result of the target data type.

[0005] In some embodiments, the method of obtaining multiple sensor value data of the target data type from the sensor data queue based on a preset target filtering number includes: determining a target function from multiple function functions according to the target data type; creating an initialization array of the target data type through the target function, and reading multiple sensor value data corresponding to the target data type from the sensor data according to the preset target filtering number, storing the multiple sensor value data in the initialization array, and obtaining a local variable array.

[0006] In some embodiments, generating the read address pointers, value sum variables, value storage variables and return value address pointers corresponding to the multiple sensor value data based on the target data type includes: calling the target processing function corresponding to the target data type from multiple preset data type processing functions through the target function function; generating the read address pointer, value sum variable, value storage variable and return value address pointer corresponding to the local variable array of the target data type through the target processing function.

[0007] In some embodiments, the reading address pointer, the target filtering quantity, the numerical sum variable, the numerical storage variable, the return value address pointer and the preset bytes occupied by the data are passed to the generic mean filtering function constructed based on the preset parameter encoding rules, including: setting the initial values ​​of the numerical sum variable and the numerical storage variable to 0; calling the generic mean filtering function constructed based on the preset parameter encoding rules through the target processing function, so as to pass the reading address pointer, the target filtering quantity, the numerical sum variable, the numerical storage variable, the return value address pointer and the preset bytes occupied by the data to the generic mean filtering function according to the preset parameter order.

[0008] In some embodiments, constructing a generic mean filter function based on preset parameter encoding rules includes the following steps: naming the incoming parameters according to the parameter type of the incoming parameters to obtain the macro-defined code text corresponding to each of the incoming parameters; using a loop statement to perform mean calculation code encoding on the macro-defined code text to obtain a generic mean filter function.

[0009] In some embodiments, the macro-defined code text is replaced in the generic mean filter function according to the read address pointer, the target filter quantity, the numerical sum variable, the numerical storage variable, the return value address pointer, and the bytes occupied by the data, including: determining the parameter order corresponding to the read address pointer, the target filter quantity, the numerical sum variable, the numerical storage variable, the return value address pointer, and the bytes occupied by the data in the generic mean filter function; and replacing the macro-defined code text in the generic mean filter function according to the code text position corresponding to the parameter order.

[0010] In some embodiments, compiling the generic mean filter function to perform mean calculation on the multiple sensor value data to obtain the mean calculation result of the target data type includes: compiling the generic mean filter function to read the sensor value data to the value storage variable multiple times according to the read address pointer and the bytes occupied by the data based on the target filtering number, and accumulating the value storage variables read multiple times to the value sum variable; performing mean calculation on the value sum variable according to the target filtering number, and storing the mean calculation result in the memory pointed to by the return value address pointer.

[0011] To achieve the above-mentioned purpose, the second aspect of the embodiment of the present application provides a sensor data processing system adaptable to multiple data types, the system comprising: an application layer, used to obtain a sensor data queue received by a communication terminal, determine a target data type corresponding to the sensor data queue, and obtain multiple sensor value data of the target data type from the sensor data queue based on a preset target filtering number; a constraint layer, used to generate a read address pointer, a value sum variable, a value storage variable, and a return value address pointer corresponding to the multiple sensor value data based on the target data type, and pass the read address pointer, the target filtering number, the value sum variable, the value storage variable, the return value address pointer, and the preset data bytes to a generic mean filter function constructed based on a preset parameter encoding rule; an execution layer, used to replace the macro definition code text of the function in the generic mean filter function according to the read address pointer, the target filtering number, the value sum variable, the value storage variable, the return value address pointer, and the data bytes, so as to compile the generic mean filter function to perform mean calculation on the multiple sensor value data to obtain the mean calculation result of the target data type.

[0012] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application provides an electronic device, comprising: at least one processor; at least one memory for storing at least one program; when at least one of the programs is executed by at least one of the processors, a sensor data processing method adapted to multiple data types as described in any one of the first aspects is implemented.

[0013] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the sensor data processing method adapted to multiple data types as described in any one of the fourth aspects.

[0014] The embodiments of the present application provide a sensor data processing method, system, device and storage medium that are adaptable to multiple data types. The method can determine the target data type corresponding to the sensor data queue by acquiring the sensor data queue received by the communication terminal, and obtain multiple sensor numerical data of the target data type from the sensor data queue based on a preset target filter number; generate a read address pointer, a numerical sum variable, a numerical storage variable and a return value address pointer corresponding to the multiple sensor numerical data based on the target data type, and pass the read address pointer, the target filter number, the numerical sum variable, the numerical storage variable, the return value address pointer and the preset bytes occupied by the data to a generic mean filter function constructed based on a preset parameter encoding rule; replace the macro-defined code text in the generic mean filter function according to the read address pointer, the target filter number, the numerical sum variable, the numerical storage variable, the return value address pointer and the bytes occupied by the data, so as to compile the generic mean filter function to perform mean calculation on the multiple sensor numerical data and obtain the mean calculation result of the target data type; wherein The above-mentioned communication terminal may include a handling robot. Based on the different types of sensor data received by the communication terminal, the present application can define pointers and variables of different data types to substitute into the macro-defined generic mean filter function for macro replacement of code text, thereby realizing the output of mean calculation results of different data types; it can be understood that by defining variables and pointers before macro replacement to constrain the type of incoming parameters, the risk of runtime errors of the present application scheme can be effectively reduced, and then through the macro-defined code text replacement, the generic mean filter function can be adapted to sensor data of various data types, so there is no need to set up multiple different types of mean summation functions. Since the processing functions of all data types reuse the same macro replacement of the generic mean filter function, code duplication is avoided, memory space is saved, and the present application scheme has better versatility and scalability, and when the data type of the sensor changes, the present application scheme does not need to re-edit a large amount of code to adapt to the new data type, which can effectively reduce maintenance costs and improve sensor data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 Another method flow chart of a sensor data processing method adapted to multiple data types provided by an embodiment of the present application;

[0016] Figure 2 Another method flow chart of a sensor data processing method adapted to multiple data types provided by an embodiment of the present application;

[0017] Figure 3 Another method flow chart of a sensor data processing method adapted to multiple data types provided by an embodiment of the present application;

[0018] Figure 4 Another method flow chart of a sensor data processing method adapted to multiple data types provided by an embodiment of the present application;

[0019] Figure 5 Another method flow chart of a sensor data processing method adapted to multiple data types provided by an embodiment of the present application;

[0020] Figure 6 Another method flow chart of a sensor data processing method adapted to multiple data types provided by an embodiment of the present application;

[0021] Figure 7 Another method flow chart of a sensor data processing method adapted to multiple data types provided by an embodiment of the present application;

[0022] Figure 8 A schematic diagram of a module of a sensor data processing system adapted to multiple data types provided in an embodiment of the present application;

[0023] Fig. 9 A schematic diagram of a module when a sensor data processing system provided in an embodiment of the present application is set on an AGV mainboard;

[0024] Fig.10 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0026] In some embodiments, although the functional modules are divided in the system schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms first, second, etc. in the specification, claims and the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0027] In addition, unless otherwise clearly specified and limited, the term "connected" should be understood in a broad sense. For example, it can be a fixed connection or a movable connection, a detachable connection or a non-detachable connection, or an integral connection; it can be a mechanical connection, an electrical connection, or the two can communicate with each other; it can be a direct connection or an indirect connection through an intermediate medium.

[0028] In the description of the embodiments of the present application, the description of reference terms "one embodiment / implementation", "another embodiment / implementation" or "certain embodiments / implementations", "in the above embodiments / implementations", etc. means that the specific features, structures, materials or characteristics described in combination with the implementation or example are included in at least two embodiments or implementations disclosed in the present application. In the disclosure of this application, the schematic representation of the above terms does not necessarily refer to the same embodiment or implementation. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that in the flowchart.

[0029] Currently, a variety of sensors are involved in the work process of an AGV, such as temperature sensors, humidity sensors, wire sensors (height sensors), obstacle detection sensors (radar sensors), etc. Different batches of robots are equipped with different types and numbers of sensors, and the data types of different sensors are also different. The existing technology usually requires setting a matching data reading function for each sensor data type, which is highly complex. In this mode, as long as there is a change in the sensor device, the code needs to be re-edited to read the data, resulting in poor sensor data processing efficiency.

[0030] Therefore, in order to overcome the limitations of the prior art, an embodiment of the present application provides a sensor data processing method that is adaptable to multiple data types, the method comprising obtaining multiple sensor value data of a target data type from a sensor data queue based on a preset target filtering number, and generating a read address pointer, a value sum variable, a value storage variable, and a return value address pointer corresponding to the multiple sensor value data, so as to pass the parameters to a generic mean filter function constructed based on a preset parameter encoding rule; in the generic mean filter function, the macro-defined code text is replaced according to the read address pointer, the target filtering number, the value sum variable, the value storage variable, the return value address pointer, and the bytes occupied by the data, so as to obtain the mean calculation result of the target data type of the multiple sensor value data, wherein the generic mean filter function implemented by the macro definition in the present application can adapt to sensor data of different data types, and can effectively improve the sensor data processing efficiency.

[0031] The embodiments of the present application are further described below in conjunction with the accompanying drawings.

[0032] refer to Figure 1 , Figure 1 Another method flow chart of a method for processing sensor data adapted to multiple data types provided in an embodiment of the present application; A first aspect of an embodiment of the present application provides a method for processing sensor data adapted to multiple data types, which is applied to a communication terminal, and the communication terminal is provided with sensors of multiple data types, and the method includes but is not limited to the following steps:

[0033] Step S110, acquiring a sensor data queue received by the communication terminal, determining a target data type corresponding to the sensor data queue, and obtaining a plurality of sensor value data of the target data type from the sensor data queue based on a preset target filter quantity;

[0034] Step S120, generating a read address pointer, a value sum variable, a value storage variable, and a return value address pointer corresponding to a plurality of sensor value data based on the target data type, and passing the read address pointer, the target filtering quantity, the value sum variable, the value storage variable, the return value address pointer, and the preset bytes occupied by the data to a generic mean filter function constructed based on a preset parameter encoding rule;

[0035] Step S130, in the generic mean filter function, replace the macro-defined code text according to the read address pointer, the target filter quantity, the numerical sum variable, the numerical storage variable, the return value address pointer and the bytes occupied by the data, so as to compile the generic mean filter function to perform mean calculation on multiple sensor numerical data and obtain the mean calculation result of the target data type.

[0036] Among them, the above-mentioned communication terminal may include a handling robot. Based on the different types of sensor data received by the communication terminal, the present application can define pointers and variables of different data types to substitute into the macro-defined generic mean filter function for macro replacement of code text, thereby realizing the output of mean calculation results of different data types; it can be understood that by defining variables and pointers before macro replacement to constrain the type of incoming parameters, the risk of runtime errors of the present application scheme can be effectively reduced, and then through the macro-defined code text replacement, the generic mean filter function can be adapted to sensor data of various data types, so there is no need to set up multiple different types of mean summation functions. Since the processing functions of all data types reuse the same generic mean filter function macro replacement, code duplication is avoided, memory space is saved, and the present application scheme has better versatility and scalability, and when the data type of the sensor changes, the present application scheme does not need to re-edit a large amount of code to adapt to the new data type, which can effectively reduce maintenance costs and improve sensor data processing efficiency.

[0037] In some embodiments, the method of the present application is a sensor data processing method that can be applied to different data types, aiming to simplify the processing flow of different sensor data, and is applied to a communication terminal. A communication terminal refers to a device with data receiving capability, specifically a device equipped with multiple sensors, such as AGV; a communication terminal is provided with sensors of multiple data types, which means that multiple types of sensors are installed on the communication terminal, such as temperature sensors, humidity sensors, height sensors (wire sensors), radar sensors, etc.

[0038] In some embodiments, the sensor data queue refers to a set of sensor data arranged in order, which is collected by a communication terminal. It is necessary to determine the specific type of the data in the queue, such as an integer, a floating point number, etc., in order to perform corresponding processing, and obtain multiple sensor value data of the target data type from the sensor data queue based on a preset target filtering number, wherein the target filtering number refers to the number of data points that need to be filtered. A certain amount of data is selected from the sensor data queue for processing.

[0039] In some embodiments, a read address pointer, a value sum variable, a value storage variable, and a return value address pointer corresponding to a plurality of sensor value data are generated based on a target data type, wherein the read address pointer points to the address of the input data; the value sum variable is used to store the sum of all data; the value storage variable is used to store a copy of the original data; the return value address pointer points to the memory address where the filtering result is stored; further, the read address pointer, the target filtering quantity, the value sum variable, the value storage variable, the return value address pointer, and the preset bytes occupied by the data can be passed as parameters to a generic mean filtering function constructed based on a preset parameter encoding rule, and the bytes occupied by the data (the number of bytes occupied by each data item in the memory.

[0040] In some embodiments, a generic mean filter function is constructed based on a preset parameter encoding rule, and by replacing the macro-defined code text, a mean filter function can be dynamically constructed to process different types of sensor data, wherein "macro definition" can be understood as using a fixed string text to replace the incoming parameters during encoding; "macro replacement" can be understood as replacing the "string text" with the actual parameters passed to the function when the function is called, so that the function can implement the reading and writing process of the substituted parameters based on the original code segment. The difference from the traditional process-oriented interface function is that the type of parameter needs to be set during interface encoding, while the macro definition in this application uses a string, and there is no need to determine the parameter type during encoding. The code is replaced with text before compilation to implement the corresponding function function.

[0041] refer to Figure 2 , Figure 2 Another method flow chart of a sensor data processing method adapted to multiple data types provided by an embodiment of the present application; in some embodiments, a plurality of sensor value data of a target data type are obtained from a sensor data queue based on a preset target filtering quantity, and the method includes but is not limited to the following steps:

[0042] Step S210, determining a target function from a plurality of function functions according to the target data type;

[0043] Step S220, creating an initialization array of the target data type through the target function, and reading multiple sensor value data corresponding to the target data type from the sensor data according to the preset target filtering quantity, storing the multiple sensor value data in the initialization array, and obtaining a local variable array.

[0044] In some embodiments, step S210 and step S220 describe how to select a specific number of data points from the sensor data queue for subsequent processing, determine a target function from multiple function functions according to the target data type, multiple function functions refer to a pre-prepared set of functions, each function corresponds to a data type, and the target function selects a suitable function from this set of functions according to the determined target data type; create an initialization array of the target data type through the target function, the initialization array is a suitable data structure created according to the target data type, usually an array, used to store the data to be processed; further, read multiple sensor value data corresponding to the target data type from the sensor data according to a preset target filter number, the target filter number is the number of data points that need to be filtered mentioned above, read a specified number of data points from the sensor data queue, store the multiple sensor value data in the initialization array, obtain a local variable array, store the read data points in the initialization array, this array becomes a local variable array, and is only valid within the current function scope.

[0045] In some embodiments, specifically, the objective function GenericFilter_AverageFloat() may be as follows:

[0046]

[0047] Among them, float is the target data type, GenericQueue_Float is the generic queue for storing float values, pOut_FLOAT is the return value address pointer defined by the target function, Number is the target filter quantity defined by the target function, and temp is the initialization array. It can be understood that the above process is implemented by the application layer. The application layer is a layer that encapsulates the functions of the constraint layer. Its main function is to add corresponding function codes to the application layer when other extended functions need to be added. Corresponding to the above code, the function of the code is to read the filtered raw data from the queue and send it to the rule constraint layer for mean filtering. In the specific implementation process, the code is first responsible for reading the data in the queue and storing it in the local variable array, and then passing the first address of the array to the rule constraint layer for mean filtering to obtain the filtered result.

[0048] refer to Figure 3 , Figure 3 Another method flow chart of a sensor data processing method adapted to multiple data types provided in an embodiment of the present application; in some embodiments, a read address pointer, a value sum variable, a value storage variable, and a return value address pointer corresponding to multiple sensor value data are generated based on the target data type, and the method includes but is not limited to the following steps:

[0049] Step S310, calling a target processing function corresponding to a target data type from a plurality of preset data type processing functions through a target function function;

[0050] Step S320, generating a read address pointer, a value sum variable, a value storage variable and a return value address pointer corresponding to the local variable array of the target data type through the target processing function.

[0051] In some embodiments, steps S310 to S320 describe how to generate variables related to a specific data type, and call a target processing function corresponding to the target data type from a preset plurality of data type processing functions through a target function function. The plurality of data type processing functions are similar to a plurality of function functions, and these functions are used to process data of different data types. The target processing function selects a suitable processing function from this group of functions according to the target data type, and then the target processing function can generate a read address pointer, a numerical sum variable, a numerical storage variable, and a return value address pointer corresponding to the local variable array of the target data type.

[0052] refer to Figure 4 , Figure 4 Another method flow chart of a sensor data processing method adapted to multiple data types provided by an embodiment of the present application; in some embodiments, a read address pointer, a target filtering quantity, a value sum variable, a value storage variable, a return value address pointer, and a preset data occupancy byte are passed to a generic mean filter function constructed based on a preset parameter encoding rule, and the method includes but is not limited to the following steps:

[0053] Step S410, setting the initial values ​​of the numerical sum variable and the numerical storage variable to 0;

[0054] Step S420, calling the generic mean filter function constructed based on the preset parameter encoding rules through the target processing function, so as to pass the read address pointer, target filter quantity, numerical sum variable, numerical storage variable, return value address pointer and preset data occupied bytes to the generic mean filter function according to the preset parameter order.

[0055] In some embodiments, step S410 and step S420 illustrate how to pass the required parameters to the generic mean filter function. In step S410, the initial values ​​of the numerical sum variable and the numerical storage variable are set to 0. The numerical sum variable is used to store the sum of all read data, and the numerical storage variable is used to store the results of intermediate calculations or copies of original data. Both variables need to be cleared before calculation to avoid the results of the previous calculation affecting the current calculation. In step S420, the generic mean filter function constructed based on the preset parameter encoding rules is called by the target processing function. The preset parameter order specifies the order in which the parameters are passed to the generic mean filter function.

[0056] In some embodiments, specifically, the multiple data type processing functions may be:

[0057]

[0058]

[0059] Among them, the target data type of Filter_AverageF loat is F loat, the target data type of Filter_AverageInt32 is int, and "pData, Number, DATA_BYTE_4, sum, combine, pOut_int32" correspond to the read address pointer, the target filtering number, the bytes occupied by the data, the numerical sum variable, the numerical storage variable, and the return value address pointer respectively. This order is the preset parameter order, corresponding to the constraint layer in the corresponding system of the method of this application, wherein the constraint layer is a function encapsulation of the execution layer, the purpose of which is to avoid the problems that may be encountered when directly calling the ruleless layer by utilizing the data type check of the function. The above code shows two mean filter functions, one for single-precision floating point type (F loat) and the other for 32-bit integer (I nt); It can be understood that the common point of these two functions is that they both call the generic mean filter function AVERAGE in the same execution layer in the second to last line of their respective functions, and the difference lies in the different parameter types passed to the generic mean filter function AVERAGE in the same execution layer: the single-precision floating-point processing function has all the other parameters of 'float' or 'fl oat*' type except the constant parameter (16-bit unsigned integer 'Number'); and the 32-bit integer processing function has all the other parameters of 'int' or 'int*' type except the constant parameter (16-bit unsigned integer 'Number').

[0060] It can be imagined that if the mean filter function of other data types is needed in actual applications, it is only necessary to re-encapsulate a processing function of the corresponding data type and modify the parameters passed to the irregular layer to the corresponding data type. Since all mean filter functions call the same macro replacement, there will be no duplication of code blocks, thereby avoiding memory waste, effectively reducing maintenance costs, and improving sensor data processing efficiency.

[0061] refer to Figure 5 , Figure 5 Another method flow chart of a sensor data processing method adapted to multiple data types provided in an embodiment of the present application; in some embodiments, a method for constructing a generic mean filter function based on a preset parameter encoding rule includes but is not limited to the following steps:

[0062] Step S510, naming the incoming parameters according to their parameter types, and obtaining the code text of the macro definition corresponding to each incoming parameter;

[0063] Step S520, using a loop statement to perform mean calculation code encoding on the macro-defined code text to obtain a generic mean filter function.

[0064] In some embodiments, the incoming parameters refer to the read address pointer, the target filter quantity, the numerical sum variable, the numerical storage variable, the return value address pointer, and the bytes occupied by the preset data; the macro-defined code text is to make the function more general. Macro definitions can be used to replace specific variable names, so that code can be dynamically generated for different data types. For example, a macro PARAMETER_TYPE can be defined to represent the data type of the incoming parameter, or other similar macros can be used to represent different parameters.

[0065] In some embodiments, a loop statement is used to iterate over each data point in an array and accumulate them, such as do{...}while(0). The mean calculation code encoding is to write the code logic for calculating the mean, which usually involves accumulating all values ​​and then dividing them by the number of values. The generic mean filter function is the final generated function that can accept parameters of different data types and can dynamically adjust the calculation logic according to the type of parameters passed in.

[0066] In some embodiments, the parameter of the incoming parameter is named according to the parameter type of the incoming parameter, including naming each parameter according to the parameter type (pointer, variable, constant) according to the specified naming specification, generating a corresponding macro definition for each parameter, so as to correctly reference it in the subsequent macro replacement process, specifically, pointer parameter: starting with lowercase letter 'p', such as pI nput, indicating the address of input data; variable parameter: starting with lowercase letter 'v', such as vSum, indicating a variable; constant parameter: starting with lowercase letter 'c', such as cNumber, indicating a constant or variable. It can be understood that in this application, the read address pointer and the return value address pointer are pointers, the target filter number and the bytes occupied by the data are constants, and the numerical sum variable and the numerical storage variable are variables.

[0067] In some embodiments, the parameter encoding rules may also include using a do{...}while(0) statement to wrap the macro-replaced code block to ensure the atomicity of the macro replacement. The parameters or variables in the macro need to be protected by a separate pair of brackets. The use of compound statements in each line is minimized. While() is used instead of for() for loops to compile a generic mean filter function to perform mean calculations on multiple sensor value data to obtain the mean calculation result of the target data type, thereby achieving generic programming using macro replacement technology, so that a mean filter function can process sensor data of multiple data types. In this way, the code can be simplified, maintenance costs can be reduced, and the reusability and flexibility of the code can be improved.

[0068] In some embodiments, specifically, the generic mean filter function is as follows:

[0069]

[0070] Among them, pI nput, cNumber, cDataByte, vSum, vCombine, and pOut are the macro definition code texts corresponding to the read address pointer, the target filtering number, the bytes occupied by the data, the value sum variable, the value storage variable, and the return value address pointer, respectively. The execution layer of the corresponding application system, in the macro definition, first defines two empty type pointers pDi stine and pSource, and uses the memcpy() function in the loop to copy the original data to vCombine in sequence according to the specified basic memory unit size. At the same time, vCombine will be accumulated to vSum after each copy is completed until all data are processed. Finally, vSum is averaged for the number of data and written to the memory location pointed to by pOut to complete the filtering operation. The whole process uses the do...while (0) syntax structure to protect the macro replacement, which ensures the portability and security of the code.

[0071] refer to Figure 6 , Figure 6 Another method flow chart of a sensor data processing method adapted to multiple data types provided by an embodiment of the present application; in some embodiments, the macro-defined code text is replaced according to the read address pointer, the target filter quantity, the value sum variable, the value storage variable, the return value address pointer and the bytes occupied by the data in the generic mean filter function, and the method includes but is not limited to the following steps:

[0072] Step S610, determining the parameter order corresponding to the read address pointer, the target filtering quantity, the value sum variable, the value storage variable, the return value address pointer and the bytes occupied by the data in the generic mean filter function;

[0073] Step S620, replacing the macro-defined code text in the generic mean filter function according to the code text position corresponding to the parameter sequence.

[0074] In some embodiments, the order of parameters can be read address pointer, target filter quantity, bytes occupied by data, numerical sum variable, numerical storage variable, return value address pointer. The order of these parameters in the function can be determined to perform macro replacement in subsequent steps and actual function calls.

[0075] It can be understood that the code text of the macro definition is the macro definition related to each parameter generated in step S510, and the replacement operation can ensure that the macro definition is replaced with a correct variable name or expression in the actual function body.

[0076] refer to Figure 7 , Figure 7 Another method flow chart of a sensor data processing method adapted to multiple data types provided by an embodiment of the present application; in some embodiments, a generic mean filter function is compiled to perform mean calculation on multiple sensor value data to obtain a mean calculation result of a target data type, and the method includes but is not limited to the following steps:

[0077] Step S710, compile a generic mean filter function to read the sensor value data to the value storage variable multiple times according to the read address pointer and the bytes occupied by the data based on the target filtering quantity, and accumulate the multiple read value storage variables to the value sum variable;

[0078] Step S720, performing mean calculation on the numerical sum variable according to the target filtering quantity, and storing the mean calculation result in the memory pointed to by the return value address pointer.

[0079] In some embodiments, a loop structure is used to read a specified number of data points, one data point at a time into a numerical storage variable, and after each reading, the value of the numerical storage variable is accumulated into the numerical sum variable. Assuming the target filter number is n, this process is repeated n times to ensure that all required data is accumulated; further, the numerical sum variable is averaged according to the target filter number, and the mean calculation result is stored in the memory pointed to by the return value address pointer. The mean calculation is to calculate the mean by dividing the value of the numerical sum variable by the target filter number, and the calculated mean result will be stored in the memory location pointed to by the return value address pointer.

[0080] refer to Figure 8 , Figure 8 A module schematic diagram of a sensor data processing system adapted to multiple data types provided in an embodiment of the present application; To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a sensor data processing system adapted to multiple data types, the system comprising: an application layer, used to obtain a sensor data queue received by a communication terminal, determine a target data type corresponding to the sensor data queue, and obtain multiple sensor numerical data of the target data type from the sensor data queue based on a preset target filter number; a constraint layer, used to generate a read address pointer, a value sum variable, a value storage variable, and a return value address pointer corresponding to multiple sensor numerical data based on the target data type, and pass the read address pointer, the target filter number, the value sum variable, the value storage variable, the return value address pointer, and the preset bytes occupied by the data to a generic mean filter function constructed based on a preset parameter encoding rule; an execution layer, used to replace the macro definition code text of the function in the generic mean filter function according to the read address pointer, the target filter number, the value sum variable, the value storage variable, the return value address pointer, and the bytes occupied by the data, so as to compile the generic mean filter function to perform mean calculation on multiple sensor numerical data to obtain the mean calculation result of the target data type.

[0081] refer to Fig. 9 , Fig. 9 A module schematic diagram of a sensor data processing system provided in one embodiment of the present application when it is set on an AGV mainboard; in some embodiments, different sensor opening interface modules are connected to the AGV mainboard, the sensor interface module is connected to a generic mean filtering module of a sensor data processing system that is adaptable to multiple data types, and the sensor data processing system reads the sensor data and sends it to the central processing unit for subsequent data processing actions.

[0082] Some embodiments of the present application provide an electronic device, Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, referring to Fig.10The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the sensor data processing method adapted to multiple data types according to any one of the above embodiments is implemented. For example, the above described Figure 1 Steps S110 to S130 of the method, Figure 2 Steps S210 to S220 of the method, Figure 3 Steps S310 to S320 of the method, Figure 4 Steps S410 to S420 of the method, Figure 5 Steps S510 to S520 of the method, Figure 6 Steps S610 to S620 of the method, Figure 7 Method steps S710 to S720.

[0083] The electronic device 1000 of the embodiment of the present application includes one or more processors 1010 and a memory 1020. Fig.10 In the figure, a processor 1010 and a memory 1020 are taken as an example.

[0084] The processor 1010 and the memory 1020 may be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.

[0085] The memory 1020, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory 1020 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 1020 may optionally include a memory 1020 remotely disposed relative to the processor 1010, and these remote memories may be connected to the electronic device 1000 via a network. At the same time, examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0086] In some embodiments, when the processor executes the computer program, the sensor data processing method adapted to multiple data types of any one of the above embodiments is executed at preset intervals.

[0087] Those skilled in the art will understand that Fig.10 The device structure shown in the figure does not constitute a limitation on the electronic device 1000, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0088] exist Fig.10In the electronic device 1000 shown, the processor 1010 can be used to call the sensor data processing method adapted to multiple data types stored in the memory 1020, thereby implementing the sensor data processing method adapted to multiple data types.

[0089] Based on the hardware structure of the above-mentioned electronic device 1000, various embodiments of the sensor data processing device that is adaptable to multiple data types of the present application are proposed. At the same time, the non-transient software programs and instructions required to implement the sensor data processing method that is adaptable to multiple data types of the above-mentioned embodiments are stored in the memory. When executed by the processor, the sensor data processing method that is adaptable to multiple data types of the above-mentioned embodiments is executed.

[0090] The embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to execute the above-mentioned sensor data processing method adapted to multiple data types, which can enable the above-mentioned one or more processors to execute the sensor data processing method adapted to multiple data types of any one of the above-mentioned embodiments, for example, to execute the above-mentioned Figure 1 Steps S110 to S130 of the method, Figure 2 Steps S210 to S220 of the method, Figure 3 Steps S310 to S320 of the method, Figure 4 Steps S410 to S420 of the method, Figure 5 Steps S510 to S520 of the method, Figure 6 Steps S610 to S620 of the method, Figure 7 Method steps S710 to S720.

[0091] The embodiment of the present application also provides a computer program product, which includes a computer program, which is stored in a computer-readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the sensor data processing method adapted to multiple data types according to any one of the above embodiments, for example, executing the above described Figure 1 Steps S110 to S130 of the method, Figure 2 Steps S210 to S220 of the method, Figure 3 Steps S310 to S320 of the method, Figure 4 Steps S410 to S420 of the method, Figure 5 Steps S510 to S520 of the method, Figure 6 Steps S610 to S620 of the method, Figure 7 Method steps S710 to S720.

[0092] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network nodes. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0093] It will be appreciated by those skilled in the art that all or some of the steps and systems in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Software such as the computer readable medium may be distributed on a computer readable medium, which may include a computer readable storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer readable storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer readable instructions, data structures, program modules, or other data). Computer readable storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory, or other memory technologies, CD to ROM, digital versatile disks (DVDs) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage, or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0094] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the above implementation mode. Technical personnel familiar with the field can also make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.

Claims

1. A sensor data processing method adapted to multiple data types, characterized in that: Applied to a communication terminal, the communication terminal is provided with sensors of multiple data types, the method comprising: Acquire a sensor data queue received by the communication terminal, determine a target data type corresponding to the sensor data queue, and obtain a plurality of sensor value data of the target data type from the sensor data queue based on a preset target filter quantity; Generate a read address pointer, a value sum variable, a value storage variable, and a return value address pointer corresponding to the plurality of sensor value data based on the target data type, and pass the read address pointer, the target filtering quantity, the value sum variable, the value storage variable, the return value address pointer, and the preset bytes occupied by the data to a generic mean filter function constructed based on a preset parameter encoding rule; In the generic mean filter function, the macro-defined code text is replaced according to the read address pointer, the target filtering quantity, the numerical sum variable, the numerical storage variable, the return value address pointer and the bytes occupied by the data, so as to compile the generic mean filter function to perform mean calculation on the multiple sensor numerical data and obtain the mean calculation result of the target data type.

2. The sensor data processing method adapted to multiple data types according to claim 1, characterized in that: The method of obtaining a plurality of sensor value data of the target data type from the sensor data queue based on a preset target filtering quantity comprises: Determining a target function from a plurality of function functions according to the target data type; An initialization array of the target data type is created through the target function, and a plurality of sensor value data corresponding to the target data type is read from the sensor data according to a preset target filtering quantity, and the plurality of sensor value data are stored in the initialization array to obtain a local variable array.

3. The sensor data processing method adapted to multiple data types according to claim 2 is characterized in that: The generating, based on the target data type, a read address pointer, a value sum variable, a value storage variable, and a return value address pointer corresponding to the plurality of sensor value data includes: Calling a target processing function corresponding to the target data type from a plurality of preset data type processing functions through the target function function; The target processing function generates a read address pointer, a value sum variable, a value storage variable and a return value address pointer corresponding to the local variable array of the target data type.

4. The sensor data processing method adapted to multiple data types according to claim 3 is characterized in that: The step of passing the read address pointer, the target filtering quantity, the value sum variable, the value storage variable, the return value address pointer, and the preset bytes occupied by the data to a generic mean filter function constructed based on a preset parameter encoding rule includes: Setting the initial values ​​of the numerical sum variable and the numerical storage variable to 0; The target processing function calls a generic mean filter function constructed based on a preset parameter encoding rule, so as to pass the read address pointer, the target filter quantity, the numerical sum variable, the numerical storage variable, the return value address pointer and the preset data bytes to the generic mean filter function according to a preset parameter order.

5. The sensor data processing method adapted to multiple data types according to claim 1, characterized in that: The steps of constructing a generic mean filter function based on a preset parameter encoding rule include: Name the input parameters according to their parameter types, and obtain the code text of the macro definition corresponding to each of the input parameters; A loop statement is used to encode the mean value calculation code for the code text of the macro definition to obtain a generic mean filter function.

6. The sensor data processing method adapted to multiple data types according to claim 5, characterized in that: In the generic mean filter function, the code text of the macro definition is replaced according to the read address pointer, the target filter quantity, the numerical sum variable, the numerical storage variable, the return value address pointer and the bytes occupied by the data, including: Determine the parameter order corresponding to the read address pointer, the target filtering quantity, the value sum variable, the value storage variable, the return value address pointer and the bytes occupied by the data in the generic mean filter function; The macro-defined code text in the generic mean filter function is replaced according to the code text position corresponding to the parameter sequence.

7. The sensor data processing method adapted to multiple data types according to claim 6, characterized in that: The compiling the generic mean filter function to perform mean calculation on the plurality of sensor value data to obtain the mean calculation result of the target data type includes: Compile the generic mean filter function to read the sensor value data to the value storage variable multiple times according to the read address pointer and the bytes occupied by the data based on the target filtering quantity, and accumulate the value storage variables read multiple times to the value sum variable; The mean value of the numerical sum variable is calculated according to the target filtering quantity, and the mean value calculation result is stored in the memory pointed to by the return value address pointer.

8. A sensor data processing system adapted to multiple data types, characterized in that: The system comprises: The application layer is used to obtain the sensor data queue received by the communication terminal, determine the target data type corresponding to the sensor data queue, and obtain multiple sensor value data of the target data type from the sensor data queue based on a preset target filter quantity; A constraint layer, for generating a read address pointer, a value sum variable, a value storage variable and a return value address pointer corresponding to the plurality of sensor value data based on the target data type, and passing the read address pointer, the target filtering quantity, the value sum variable, the value storage variable, the return value address pointer and the preset bytes occupied by the data to a generic mean filter function constructed based on a preset parameter encoding rule; The execution layer is used to replace the macro definition code text of the function in the generic mean filter function according to the read address pointer, the target filtering quantity, the numerical sum variable, the numerical storage variable, the return value address pointer and the bytes occupied by the data, so as to compile the generic mean filter function to perform mean calculation on the multiple sensor numerical data to obtain the mean calculation result of the target data type.

9. An electronic device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When at least one of the programs is executed by at least one of the processors, the sensor data processing method adapted to multiple data types as described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the sensor data processing method adapted to multiple data types as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Apparatus and method for performing non-local means filtering using motion estimation circuitry of a graphics processor

    CN113409435A

  • Method and system for generating and installing multi-platform customized system package, and medium

    CN116932041A

  • Apparatus and method for performing non-local means filtering using motion estimation circuitry of a graphics processor

    US20210287417A1

  • Full-search block matching method and apparatus

    WO2019041873A1