CN-121996823-A - Intelligent controller data processing method
Abstract
The invention relates to the technical field of development of single-chip computers and intelligent controllers, in particular to an intelligent controller data processing method, which is characterized in that for the inside of the single-chip computer, all keywords are calculated into specific N-system data with a fixed bit number, and the specific N-system data are stored in the inside of the single-chip computer according to the sequence of the sizes; and searching the N-system data corresponding to the key words in the JSON information in the singlechip by a binary search method, and finding a storage position to be the corresponding variable data position. The invention calculates all keywords in a certain mode, changes the character strings into numerical data and stores the numerical data according to the size sequence. The character strings are compared one by the singlechip, and after the character strings are changed into data, the comparison becomes very simple. The method is suitable for occasions in which the singlechip is used as a core controller.
Inventors
- LI YANXIA
- JIANG DEZHI
- ZHANG YOUWEN
- Tan Peisen
- WANG XINYU
- XIAO LV
- Song Xinni
- TAN CHAOBIN
Assignees
- 浙江大元泵业股份有限公司
- 北华航天工业学院
Dates
- Publication Date
- 20260508
- Application Date
- 20260119
Claims (5)
- 1. An intelligent controller data processing method is characterized by comprising the following steps: firstly, calculating all keywords into specific N-system data with fixed digits for the inside of a singlechip, and storing the specific N-system data in the inside of the singlechip according to the size sequence; Step two, after receiving the JSON information, taking out the key word, and calculating the key word as specific N-system data; And thirdly, searching N-system data corresponding to the keywords in the JSON information in the singlechip through a binary search method, and finding a storage position to obtain a corresponding variable data position.
- 2. The intelligent controller data processing method according to claim 1, wherein the N-ary data is binary or hexadecimal data.
- 3. The method for processing intelligent controller data according to claim 1, wherein in step four, parameters behind the key words in the information are taken out and put in positions corresponding to the array of variable data.
- 4. The intelligent controller data processing method according to claim 1, wherein the parameter amount in the JSON information is judged, if the parameter amount is less than or equal to a set value, 16-bit binary data calculation is adopted, and a simple CRC algorithm is adopted; The parameter is larger than the set value, and 24-bit or 32-bit data or more bits are calculated, and the hash algorithm is adopted for conversion.
- 5. The method for processing intelligent controller data according to claim 1, wherein the ASCII code values of all the information keywords are obtained, the ASCII code values are calculated into numerical data according to a fixed algorithm, and the numerical data are placed in an array according to the sequence after being ordered.
Description
Intelligent controller data processing method Technical Field The invention relates to the technical field of development of single-chip computers and intelligent controllers, in particular to a data processing method of an intelligent controller. Background More and more intelligent products (such as intelligent water pumps) applying the internet of things function can operate the intelligent controller remotely, and under the condition of a plurality of operation parameters, information is usually transmitted by adopting a JSON or similar data format, so that the received information needs to be retrieved. Because some singlechips have limited processing capacity, a large amount of data retrieval processes can occupy the resources of the singlechips greatly, and the instantaneity of the singlechips for processing the functional events of the products is seriously affected. It is therefore necessary to find a suitable solution to reduce the consumption of resources by information retrieval. Aiming at the JSON data format being the format of 'key words plus data', the key words are required to be searched first, the matched variable names are found, then the corresponding data are put into the variable names, the complexity of the searching process is O (n), and the n is the number of characters of all the key words instead of the number of the key words because the single chip microcomputer comparison process is a character-by-character comparison process, so that the searching complexity is greatly increased, and the computing capability of the single chip microcomputer is greatly consumed. After the singlechip receives the parameters sent by the upper computer, the received data needs to be determined to which variable according to the keywords. Thus, a comparison of keywords is required. Illustrating: The string is { "current_volt", "380.0"; "motor_speed", "3180"; current_power ","92000"; current_power If the key word is the data behind MOTOR_SPEED, if ASCII character mode is adopted for direct comparison, the singlechip must compare whether the 1 st character is M, then whether the 2 nd character is O, then whether the 2 nd character is T, and so on, and the whole key word is compared, and 11 times of comparison are needed. After the key is found, the following data is fetched 3180. 3180 this data is to be stored in the corresponding location in the variable array. The location of the deposit is typically a list of deposit keys followed by a deposit address. For example: { current_ VOLT,0;MOTOR_SPEED,1;CURRENT_POWER,2..the use of the single chip microcomputer is also required to find the motor_speed in this array, read the number 1 following it, which is the newly stored address offset. And storing the data into the corresponding positions of the array according to the offset. For example, parameter [1] =3180 is stored in the Parameter [ ] array according to the corresponding position. Therefore, the comparison is required to be carried out with great workload, and the limited resources of the singlechip are greatly occupied. Disclosure of Invention In order to solve the technical problems and defects in the prior art, the invention provides the intelligent controller data processing method, which can greatly reduce the computational overhead of the intelligent controller, and can continuously reduce the operation complexity and save the computational overhead on the premise of finite overhead on the basis of data storage, calling and searching matching. In order to achieve the above and other related objects, the present invention adopts the following technical scheme: an intelligent controller data processing method, comprising: firstly, calculating all keywords into specific N-system data with fixed digits for the inside of a singlechip, and storing the specific N-system data in the inside of the singlechip according to the size sequence; Step two, after receiving the JSON information, taking out the key word, and calculating the key word as specific N-system data; And thirdly, searching N-system data corresponding to the keywords in the JSON information in the singlechip through a binary search method, and finding a storage position to obtain a corresponding variable data position. Preferably, the N-ary data is binary or hexadecimal data. Preferably, in the fourth step, parameters behind the keywords in the information are taken out, and the parameters are put into positions corresponding to the array of the variable data. Preferably, the parameter quantity in the JSON information is judged, if the parameter quantity is less than or equal to a set value, 16-bit binary data calculation is adopted, and a simple CRC algorithm is adopted; The parameter is larger than the set value, and 24-bit or 32-bit data or more bits are calculated, and the hash algorithm is adopted for conversion. Preferably, the ASCII code value of all the keywords of the information is taken, the ASCII code value is calculated in