Embedded device parameter value retrieval method and device, equipment and medium

By building a parameter mirror data structure in an embedded device, determining the target parameters using the parameter identification code and calculating the memory address, the problems of low parameter retrieval efficiency and large memory usage in the prior art are solved, and efficient parameter retrieval and read and write operations are realized.

CN119719431APending Publication Date: 2025-03-28SHENZHEN HEWANG ENERGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411781004.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

Existing embedded device parameter retrieval methods are inefficient and have a large memory usage when there are many parameters, making it difficult to quickly retrieve and read and write parameter values.

Method used

By obtaining the parameter identification code to be retrieved, its legality is determined, and the target parameters are determined from the pre-constructed parameter mirror data structure, the corresponding numerical memory address is calculated for read and write operations.

Benefits of technology

It improves the retrieval efficiency of embedded device parameter values, reduces memory usage, avoids the need to build array subscripts, and realizes direct parameter read and write operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719431A_ABST
    Figure CN119719431A_ABST
Patent Text Reader

Abstract

The invention relates to an embedded device parameter value retrieval method and device, equipment and a medium. The method comprises the steps that a to-be-retrieved parameter identification code is obtained; when it is judged that the to-be-retrieved parameter identification code meets the preset legal condition, target parameters are determined from a pre-constructed parameter mirror image data structure through the to-be-retrieved parameter identification code; and calculating a numerical memory address corresponding to the to-be-retrieved parameter identification code according to the target parameter, and performing read-write operation on the numerical memory address. According to the method, the target parameter is determined from the parameter mirror image data structure through the to-be-retrieved parameter identification code, and then the numerical memory address corresponding to the to-be-retrieved parameter identification code is calculated according to the target parameter, so that read-write operation can be directly performed on the numerical memory address, and the retrieval efficiency of the parameter numerical value of the embedded equipment can be improved; and meanwhile, an array subscript does not need to be constructed, parameter read-write operation can be directly carried out after the memory address is calculated, and memory occupation is effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of embedded device technology, and in particular to a method, apparatus, device and medium for retrieving embedded device parameter values. Background Art

[0002] Embedded devices, as core control components, play a crucial role in the new energy industry. Embedded device parameters are an indispensable part of control algorithms and monitoring applications; however, as the applications supported by embedded devices become increasingly complex, the number of parameters also increases. Depending on their function, these parameters are divided into different modules and groups for easy identification.

[0003] How to quickly retrieve the value of a corresponding parameter from a large number of parameters has become an increasingly prominent problem. Currently, commonly used retrieval methods include binary search, linked lists, and array indices, but each has its limitations. For example, binary search and linked list methods require traversal, which takes a long time when there are many parameters. Array indices can perform a single query, but consume a lot of memory when there are many parameters. Therefore, there is an urgent need for a parameter retrieval method that can improve retrieval efficiency and reduce memory consumption when retrieving a large number of parameters. Summary of the Invention

[0004] The purpose of this application is to provide a method, apparatus, device, and medium for retrieving embedded device parameter values, so as to improve the retrieval efficiency of embedded device parameter values ​​and reduce memory usage.

[0005] To address the aforementioned technical problems, embodiments of this application provide a method for retrieving embedded device parameter values, including:

[0006] Obtain the identifier code of the parameter to be searched;

[0007] When it is determined that the identifier of the parameter to be retrieved meets the preset legal conditions, the target parameter is determined from the pre-constructed parameter mirror data structure through the identifier of the parameter to be retrieved;

[0008] The numerical memory address corresponding to the identifier code of the parameter to be retrieved is calculated based on the target parameters, and read and write operations are performed on the numerical memory address.

[0009] To address the aforementioned technical problems, embodiments of this application provide an embedded device parameter value retrieval device, comprising:

[0010] The parameter identifier code acquisition unit is used to acquire the identifier code of the parameter to be retrieved.

[0011] The target parameter determination unit is used to determine the target parameter from a pre-built parameter mirror data structure by means of the target parameter identifier code when it is determined that the identifier code of the parameter to be retrieved meets the preset legal conditions.

[0012] The read / write operation unit is used to calculate the numerical memory address corresponding to the identifier code of the parameter to be retrieved based on the target parameter, and to perform read / write operations on the numerical memory address.

[0013] To solve the above-mentioned technical problems, one technical solution adopted by the present invention is to provide an embedded device, including one or more processors; and a memory for storing one or more programs, such that the one or more processors implement the embedded device parameter value retrieval method described in any one of the above-mentioned methods.

[0014] To solve the above-mentioned technical problems, one technical solution adopted by the present invention is: a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the embedded device parameter value retrieval method described in any one of the above-mentioned methods.

[0015] This invention provides a method, apparatus, device, and medium for retrieving parameter values ​​in embedded devices. The method includes: obtaining a parameter identifier code to be retrieved; when the parameter identifier code meets preset legal conditions, determining a target parameter from a pre-constructed parameter mirror data structure using the parameter identifier code; calculating the memory address corresponding to the parameter identifier code based on the target parameter, and performing read / write operations on the memory address. This invention determines the target parameter from the parameter mirror data structure using the parameter identifier code, and then calculates the memory address corresponding to the parameter identifier code based on the target parameter. This allows for direct read / write operations on the memory address, improving the efficiency of retrieving parameter values ​​in embedded devices. Furthermore, it eliminates the need to construct array indices, enabling direct parameter read / write operations after calculating the memory address, effectively reducing memory usage. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating the implementation of the embedded device parameter value retrieval method provided in this application embodiment;

[0018] Figure 2This is a flowchart of the implementation process of the method for retrieving the value of an embedded device parameter provided by another embodiment of the present application;

[0019] Figure 3 This is a schematic diagram of the implementation of step S11 provided in an embodiment of the present application;

[0020] Figure 4 This is a schematic diagram of the implementation of step S13 provided in the embodiment of the present application;

[0021] Figure 5 This is a schematic diagram of implementing step S136 provided in an embodiment of the present application;

[0022] Figure 6 This is a flowchart of a sub-process in the method for retrieving parameter values ​​of embedded devices provided in an embodiment of the present application;

[0023] Figure 7 Schematic diagram of a device for retrieving parameter values ​​of embedded devices provided in an embodiment of the present application;

[0024] Figure 8 This is a schematic diagram of an embedded device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.

[0026] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0028] The present invention will be described in detail below with reference to the accompanying drawings and embodiments.

[0029] It should be noted that the embedded device parameter value retrieval method provided in this application embodiment is generally executed by the embedded device, and correspondingly, the embedded device parameter value retrieval device is generally configured in the embedded device.

[0030] See also Figure 1 , Figure 1 This paper illustrates a specific implementation of a method for retrieving parameter values ​​of embedded devices.

[0031] It should be noted that if substantially the same result is obtained, the method of this invention is not based on... Figure 1 Limited to the order of the processes shown, this method includes the following steps:

[0032] S1: Get the identification code of the parameter to be retrieved.

[0033] Specifically, when it is necessary to retrieve parameter values ​​of an embedded device, the identifier code of the parameter to be retrieved is obtained in order to perform parameter retrieval and read / write operations.

[0034] The identifier code for the parameter to be retrieved consists of a module number, a group number, and an ID number. The module number represents the logic control module number, the group number represents the number of the same type of parameter group within the logic control module, and the ID number represents the number of a single parameter within the same type of parameter group.

[0035] A logic control module (LCM) is a system or component that integrates logical operations, control flow, and the execution of specific functions. In embedded devices, the LCM processes input signals from sensors, performs calculations and judgments according to preset logical rules or algorithms, and then outputs corresponding control signals to control the internal or external environment of the device. In the parameter retrieval system of an embedded device, the LCM can classify and identify parameters based on their attributes and functions. By assigning unique identifiers to different parameters, the system can easily manage and retrieve these parameters. The LCM is responsible for classifying and storing parameters based on their identifiers. To improve the efficiency of parameter retrieval, the LCM can also construct a parameter mirror structure. This structure includes a parameter mirror header, an index area, and a data area, which together constitute the core of the parameter retrieval system.

[0036] See also Figure 2 , Figure 2 A specific implementation method prior to step S1 is shown below in detail:

[0037] S11: Obtain initial parameters, classify and label the initial parameters, and generate parameter identification codes.

[0038] Specifically, before retrieving embedded device parameter values, this embodiment of the application needs to construct a parameter image data structure, which includes header data, index area data, and value area data of the parameter image. In this embodiment, all initial parameters need to be obtained; these initial parameters are used to construct the parameter image data structure. Then, the initial parameters are categorized and labeled to generate parameter identification codes. The parameter image data structure is shown in Table 1 below:

[0039] Table 1

[0040] Header Data Index Area Numerical area 16 bytes N*2 bytes Number of parameters * 4 bytes

[0041] See also Figure 3 , Figure 3 A specific implementation of step S11 is shown, which is described in detail as follows:

[0042] S111: Classify and label all the initial parameters according to the logic control module, and use the module number as the third byte of the parameter label code.

[0043] S112: Classify and label the initial parameters belonging to the same logic control module according to the functional information, and use the group number as the second byte of the parameter label code.

[0044] S113: Mark the initial parameters of the same type of functional information belonging to the same logic control module in sequence, and use the ID number as the first byte of the parameter identification code.

[0045] S114: The fourth byte of the parameter identification code is used as a reserved position.

[0046] Specifically, all initial parameters are categorized and labeled according to the logic control module, with the module number used as the third byte of the parameter label code. Then, initial parameters belonging to the same logic control module are categorized and labeled according to their functional information, with the group number used as the second byte of the parameter label code. Next, initial parameters belonging to the same logic control module and with the same type of functional information are labeled sequentially, with the ID number used as the first byte of the parameter identifier code. The fourth byte of the parameter identifier code is reserved.

[0047] The parameter identification codes are shown in Table 2 below:

[0048] Table 2

[0049] Reserve Module number Group number ID number 1 byte 1 byte 1 byte 1 byte

[0050] S12: Traverse the parameter identification code to identify the target initial parameters corresponding to the logic control module.

[0051] Specifically, all parameter identifiers are traversed to identify the target initial parameters corresponding to the logic control module. These target initial parameters include the logic control module number, the number of logic control modules, the maximum parameter group number, the maximum parameter ID within the parameter group, and the parameter extreme value ID. The parameter extreme value ID refers to the maximum parameter ID across all parameter groups. The maximum parameter ID within a parameter group refers to the maximum parameter ID within the same parameter group.

[0052] S13: Based on the target initial parameters, construct the header data, index area data and value area data in the parameter mirror data structure in sequence.

[0053] Specifically, the header data, index area data, and value area data in the parameter mirror data structure are constructed sequentially based on the initial target data, so that the corresponding parameters can be quickly retrieved during subsequent parameter retrieval.

[0054] See also Figure 4 , Figure 4 A specific implementation of step S13 is shown below:

[0055] S131: Assign a value to the identifier header corresponding to the header data, and assign values ​​to the number of modules and the number of parameter groups in the header data according to the number of logic control modules and the maximum parameter group number, respectively.

[0056] In one specific embodiment, the identifier header corresponding to the header data is assigned the value "IM", the number of logic control modules is assigned to the number of modules in the header data, and the maximum parameter group number is assigned to the number of parameter groups in the header data.

[0057] S132: Calculate the sum of the largest parameter ID in all parameter groups, and assign a value to the number of parameters in the header data based on the sum.

[0058] Specifically, the maximum parameter ID in all parameter groups is summed to obtain the sum, and then the number of parameters in the header data is assigned according to the sum.

[0059] S133: Assign a value to the index area offset in the header data according to the number of bytes in the parameter identifier code.

[0060] S134: Calculate the offset value based on the number of modules, the number of parameter groups, and the index area offset, and assign the offset value to the numerical area offset in the header data.

[0061] Specifically, the number of bytes in the parameter identification code is identified, and then the index offset in the header data is assigned based on this number of bytes. The offset value is obtained by multiplying the number of calculation modules by the number of parameter groups, then multiplying by 2, and adding the result to the index offset. This offset value is then assigned to the value offset in the header data.

[0062] S135: Calculate a mirror value based on the numerical area offset and the number of parameters, and assign a mirror size in the header data according to the mirror value.

[0063] Specifically, the number of parameters is multiplied by 4 and then added to the value area offset to obtain the mirror value. Then, the mirror size in the header data is assigned according to the GIA mirror value. The constructed header data structure is shown in Table 3 below:

[0064] Table 3

[0065]

[0066] S136: Constructing index area data and value area data in the parameter mirror data structure.

[0067] See also Figure 5 , Figure 5 A specific implementation of step S136 is shown, which is described in detail as follows:

[0068] S1361: Using the number of modules as the number of rows of the index area data, and using the number of parameter groups as the number of columns of the index area data.

[0069] S1362: Fill the first row of the logic control module with the information of the logic control module, and assign the first column of the index area data with the logic control module number.

[0070] S1363: Assign values ​​to each position of the index area data by gradually superimposing the largest parameter ID in the parameter group.

[0071] Specifically, when constructing the index area data, the number of modules is used as the number of rows in the index area data, and the number of parameter groups is used as the number of columns. Then, the information of the logic control modules is filled into the first row of the logic control module, and the logic control module number is assigned to the first column of the index area data. Starting from the second column and the second row, values ​​are assigned to each position in the index area data according to the principle of progressively adding the maximum parameter ID from the parameter groups. The assignment method for each position is as follows: the second column is assigned the maximum parameter ID of the first group; the third column is assigned the maximum parameter ID of the second group plus the value of the second column, and so on. The last group is assigned the number of maximum parameter IDs of the last group plus the value of the previous column. If a parameter group does not exist, the maximum parameter ID of that group is defaulted to 0. The second row is filled with information for the second logic control module. The first column is assigned the logic control module number. The second column is assigned the value of the last column of the first row plus the maximum parameter ID of the first group. The third column is assigned the maximum parameter ID of the second group plus the value of the second column. This pattern is repeated for each column. The last group is assigned the number of maximum parameter IDs of the last group plus the value of the previous column. This pattern is repeated for each row until the last logic control module.

[0072] The constructed index area data structure is shown in Table 4 below:

[0073] Table 4

[0074]

[0075] …

[0076]

[0077] S1364: Assign values ​​to the numerical data in the numerical region sequentially according to the number of parameters to construct the numerical data in the numerical region.

[0078] Specifically, the numerical data is constructed by sequentially assigning values ​​to the data in the numerical region according to the number of parameters. The constructed numerical data structure is shown in Table 5 below:

[0079] Table 5

[0080]

[0081] This application provides a specific embodiment for constructing a parameter mirror data structure. Assume there are a total of 3 logic control modules: the first logic control module has 50 parameter groups, each with 100 parameters; the second logic control module has 99 parameter groups, each with 50 parameters; and the third logic control module has 70 parameter groups, each with 80 parameters.

[0082] Each parameter is assigned an identifier code. The three logic control modules are numbered 1, 2, and 3 respectively. The parameter groups of the first logic control module are numbered 1, 2, 3…50, and the parameters in each parameter group are numbered 1, 2, 3…100. The parameter groups of the second logic control module are numbered 1, 2, 3…99, and the parameters in each parameter group are numbered 1, 2, 3…50. The parameter groups of the third logic control module are numbered 1, 2, 3…70, and the parameters in each parameter group are numbered 1, 2, 3…80.

[0083] Iterate through the identifiers of all parameters and count that there are 3 logic control modules and a maximum number of parameter groups of 100 (99+1, with group 0 used as the module number). The maximum parameter ID of each parameter group in the first logic control module is 100, the maximum parameter ID of each parameter group in the second logic control module is 50, and the maximum parameter ID of each parameter group in the third logic control module is 80.

[0084] Construct a parameter mirror structure. In the header data, assign the identifier "IM", the number of modules 3, the number of parameter groups 100, the total number of parameters 15550 (5000+4950+5600), the index offset 16, the value offset 616 (3*100*2+16), and the mirror size 62816 (616+15550*4). In the index area, assign 1 to the first column of row 1, 100 to the second column of row 1, 200 to the third column of row 1, ..., 5000 to the 51st column of row 1, 5000 to the 52nd column of row 1, ..., 5000 to the 100th column of row 1. The first column of row 2 is assigned the value 2, the second column of row 1 is assigned the value 5050 (5000+50), the third column of row 1 is assigned the value 5100, ... the first column of row 100 is assigned the value 9950. The first column of row 3 is assigned the value 3, the second column of row 1 is assigned the value 10030 (9950+80), the third column of row 10110, ... the first column of row 171 is assigned the value 15500, the first column of row 172 is assigned the value 15500, ... the first column of row 100 is assigned the value 15500. In the numerical area, the initial value 0x80000000 is assigned sequentially according to the number of parameters. The final parameter mirror data structure is shown in Table 6 below.

[0085] Table 6

[0086]

[0087]

[0088] S2: When it is determined that the identifier code of the parameter to be retrieved meets the preset legal conditions, the target parameter is determined from the pre-constructed parameter mirror data structure through the identifier code of the parameter to be retrieved.

[0089] Specifically, the above steps have constructed a parameter mirror data structure, which allows for the retrieval of parameter values, enabling the determination of the target parameter through the identifier code of the parameter to be retrieved.

[0090] Furthermore, a specific implementation of step S2 is provided: traversing the parameter mirror data structure using the parameter identifier code to be retrieved, to determine the target parameter from the parameter mirror data structure, wherein the target parameter includes the starting address of the parameter mirror data structure, the offset of the target data area, and the offset of the target index area. This target parameter allows for the calculation of the memory address in subsequent steps, thereby enabling direct parameter reading.

[0091] See also Figure 6 , Figure 6 A specific implementation method prior to step S2 is shown below in detail:

[0092] S21: Obtain the number of modules and the number of parameter groups in the parameter mirror data result to obtain the target number of modules and the target number of parameter groups.

[0093] S22: If the second byte of the parameter identifier code to be retrieved is greater than the number of target parameter groups and the third byte is the number of target modules, then it is determined that the parameter identifier code to be retrieved satisfies the preset legal conditions.

[0094] S23: If the second byte of the identifier code to be retrieved is greater than the number of target parameter groups and the third byte is not greater than the number of target modules, then it is determined that the identifier code to be retrieved does not meet the preset legal conditions.

[0095] Specifically, upon receiving a retrieval identifier, a validity check needs to be performed on that identifier. First, the number of modules and parameter groups in the currently constructed parameter mirror data result needs to be obtained to determine the number of target modules and target parameter groups. If the second byte of the retrieval identifier is greater than the number of target parameter groups and the third byte is the number of target modules, then the retrieval identifier is determined to meet the preset validity conditions, and steps S2 and S3 are continued. If the second byte of the retrieval identifier is not greater than the number of target parameter groups and the third byte is not the number of target modules, then the retrieval identifier does not meet the preset validity conditions, and a failure result is returned.

[0096] S3: Calculate the numerical memory address corresponding to the identifier code of the parameter to be retrieved based on the target parameter, and perform read and write operations on the numerical memory address.

[0097] Specifically, according to the calculation formula: Parameter mirror data structure starting address + Numerical area offset + (Index area offset * [3rd byte value - 1] * [2nd byte value - 1] + 1st byte value) * 4. Since the target parameters have been obtained in the above steps, including the parameter mirror data structure starting address, target data area offset, and target index area offset, substituting them into the above formula yields the numerical memory address, allowing direct read and write operations on the numerical memory address.

[0098] In one specific embodiment, the parameter value address is obtained based on the parameter identifier code. Assuming the parameter identifier code is 0x010249, it indicates that the logic control module number is 1, the parameter group number is 2, and the parameter ID number is 73 (0x49). According to the above calculation formula, the memory address corresponding to this parameter identifier code is the first address of the parameter mirror data structure + 616 + (100 + 73) * 4. After calculating the memory address corresponding to the parameter identifier code, read and write operations can be directly performed on this memory address. Because of the existence of the parameter mirror data structure, the memory address of the parameter value can be directly calculated based on the parameter identifier, thus enabling direct read and write operations. This ensures both high efficiency in read and write operations and low memory usage.

[0099] In this embodiment, a parameter identifier code to be retrieved is obtained; when the parameter identifier code meets a preset legal condition, a target parameter is determined from a pre-constructed parameter mirror data structure using the parameter identifier code; the numerical memory address corresponding to the parameter identifier code is calculated based on the target parameter, and read / write operations are performed on the numerical memory address. This embodiment of the invention determines the target parameter from the parameter mirror data structure using the parameter identifier code, and then calculates the numerical memory address corresponding to the parameter identifier code based on the target parameter. This allows for direct read / write operations on the numerical memory address, which is beneficial for improving the retrieval efficiency of parameter values ​​in embedded devices; simultaneously, it eliminates the need to construct array indices, enabling direct parameter read / write operations after calculating the memory address, effectively reducing memory usage.

[0100] In this embodiment, a parameter mirror data structure is constructed to retrieve parameter values. The memory address of the parameter value is directly obtained based on the calculation, thus enabling direct read and write operations on the memory address. Simultaneously, an array is used to store the parameter values, minimizing memory usage.

[0101] Please refer to Figure 7 , as a response to the above Figure 1 The implementation of the method shown in this application provides an embodiment of an embedded device parameter value retrieval device, which is similar to... Figure 1 Corresponding to the method embodiments shown, this device can be specifically applied to various embedded devices.

[0102] like Figure 7 As shown, the embedded device parameter value retrieval device of this embodiment includes: a parameter identification code acquisition unit 41, a target parameter determination unit 42, and a read / write operation unit 43, wherein:

[0103] The parameter identification code acquisition unit 41 is used to acquire the parameter identification code to be retrieved.

[0104] The target parameter determination unit 42 is used to determine the target parameter from the pre-built parameter mirror data structure through the target parameter identifier code when it is determined that the identifier code of the parameter to be retrieved meets the preset legal conditions.

[0105] The read / write operation unit 43 is used to calculate the numerical memory address corresponding to the identifier code of the parameter to be retrieved based on the target parameter, and to perform read / write operations on the numerical memory address.

[0106] Furthermore, the parameter identification code acquisition unit 41 also includes:

[0107] An initial parameter acquisition unit is used to acquire initial parameters, classify and label the initial parameters, and generate parameter identification codes;

[0108] The target initial parameter identification unit is used to traverse the parameter identification code and identify the target initial parameters corresponding to the logic control module.

[0109] The parameter mirror data structure construction unit is used to sequentially construct the header data, index area data, and value area data in the parameter mirror data structure based on the target initial parameters.

[0110] Furthermore, the target initial parameter identification unit includes:

[0111] The first marking unit is used to classify and mark all the initial parameters according to the logic control module, and use the module number as the third byte of the parameter marking code;

[0112] The second marking unit is used to classify and mark the initial parameters belonging to the same logic control module according to the functional information, and use the group number as the second byte of the parameter marking code;

[0113] The third marking unit is used to mark the initial parameters of the same type of functional information belonging to the same logic control module in sequence, and to use the ID number as the first byte of the parameter identification code.

[0114] A reserved position unit is used to reserve the fourth byte of the parameter identifier code as a reserved position.

[0115] Furthermore, the target initial parameters include the logic control module number, the number of logic control modules, the maximum parameter group number, the maximum parameter ID in the parameter group, and the parameter extreme value ID; the parameter mirror data structure construction unit includes:

[0116] The identifier header assignment unit is used to assign a value to the identifier header corresponding to the header data, and to assign values ​​to the number of modules and the number of parameter groups in the header data according to the number of logic control modules and the maximum parameter group number, respectively.

[0117] The summation unit is used to calculate the sum of the maximum parameter ID in all the parameter groups, and to assign a value to the number of parameters in the header data based on the summation.

[0118] An index area offset assignment unit, configured to assign an index area offset in the header data according to the number of bytes in the parameter identification code;

[0119] The numerical area assignment unit is used to calculate the offset value based on the number of modules, the number of parameter groups, and the index area offset, and to assign the numerical area offset in the header data according to the offset value;

[0120] a mirror assignment unit, configured to calculate a mirror value based on the value area offset and the number of parameters, and assign a mirror size in the header data according to the mirror value;

[0121] The index area construction unit is used to construct the index area data and the value area data in the parameter mirror data structure.

[0122] Furthermore, the index area building unit includes:

[0123] a row and column number confirmation unit, configured to use the number of modules as the number of rows of the index area data and the number of parameter groups as the number of columns of the index area data;

[0124] a first row filling unit, configured to fill the first row of the logic control module with the information of the logic control module, and assign the first column of the index area data with the number of the logic control module;

[0125] a position assignment unit, configured to assign values ​​to respective positions of the index area data by gradually superimposing the largest parameter ID in the parameter group;

[0126] The numerical area construction unit is used to assign values ​​to the numerical area data in sequence according to the number of parameters to construct the numerical area data.

[0127] Furthermore, the target parameter determination unit 42 further includes:

[0128] The target module number determination unit is used to obtain the number of modules and the number of parameter groups in the parameter mirror data result, and to obtain the target module number and the target parameter group number;

[0129] The first determination unit is used to determine that the parameter identification code to be retrieved satisfies the preset legal conditions if the second byte of the parameter identification code to be retrieved is greater than the number of target parameter groups and the third byte is the number of target modules.

[0130] The second determination unit is used to determine that the parameter identifier code to be retrieved does not meet the preset legal conditions if the second byte of the identifier code to be retrieved is greater than the number of target parameter groups and the third byte is the number of target modules.

[0131] Furthermore, the target parameter determination unit 42 includes:

[0132] The traversal unit is used to traverse the parameter mirror data structure through the identifier code of the parameter to be retrieved, so as to determine the target parameter from the parameter mirror data structure, wherein the target parameter includes the starting address of the parameter mirror data structure, the offset of the target data area, and the offset of the target index area.

[0133] To address the aforementioned technical problems, embodiments of this application also provide an embedded device. Please refer to [link / reference] for details. Figure 8 , Figure 8 This is a basic structural block diagram of the embedded device in this embodiment.

[0134] Embedded device 5 includes a memory 51, a processor 52, and a network interface 53 that are interconnected via a system bus. It should be noted that... Figure 8 Only an embedded device 5 with three components—memory 51, processor 52, and network interface 53—is shown. It should be understood that implementing all shown components is not required; more or fewer components may be implemented alternatively. Those skilled in the art will understand that an embedded device is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), digital digital processors (DSPs), and other embedded devices.

[0135] The memory 51 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, magnetic disk, optical disk, etc. In some embodiments, the memory 51 can be an internal storage unit of the embedded device 5, such as the hard disk or memory of the embedded device 5. In other embodiments, the memory 51 can also be an external storage device of the embedded device 5, such as a plug-in hard disk equipped on the embedded device 5, a smart memory card (SMC), a secure digital (SD) card, a flash memory card, etc. Of course, the memory 51 can also include both the internal storage unit of the embedded device 5 and its external storage device. In this embodiment, the memory 51 is generally used to store the operating system and various application software installed on the embedded device 5, such as the program code of the method for retrieving the value of the embedded device parameter. In addition, the memory 51 can also be used to temporarily store various types of data that have been output or are about to be output.

[0136] In some embodiments, the processor 52 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 52 is generally used to control the overall operation of the embedded device 5. In this embodiment, the processor 52 is used to execute program code stored in the memory 51 or process data, such as executing the program code of the above-mentioned embedded device parameter value retrieval method to implement various embodiments of the embedded device parameter value retrieval method.

[0137] The network interface 53 may include a wireless network interface or a wired network interface. The network interface 53 is generally used to establish a communication connection between the embedded device 5 and other electronic devices.

[0138] This application also provides another embodiment, namely, a computer-readable storage medium storing a computer program that can be executed by at least one processor to cause the at least one processor to perform the steps of the embedded device parameter value retrieval method described above.

[0139] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of the various embodiments of this application.

[0140] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, these embodiments are provided to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.

Claims

1. A method for retrieving a numerical value of an embedded device parameter, characterized in that: include: Get the parameter identification code to be retrieved; When it is determined that the parameter identification code to be retrieved satisfies a preset legal condition, the target parameter is determined from a pre-constructed parameter mirror data structure by using the parameter identification code to be retrieved; The numerical memory address corresponding to the parameter identification code to be retrieved is calculated according to the target parameter, and the numerical memory address is read and written.

2. The method for retrieving embedded device parameter values ​​according to claim 1, characterized in that: Before obtaining the identification code of the parameter to be retrieved, the method further includes: Acquire initial parameters, classify and label the initial parameters, and generate parameter identification codes; Traversing the parameter identification code to identify the target initial parameters corresponding to the logic control module; The header data, the index area data and the value area data in the parameter mirror data structure are sequentially constructed based on the target initial parameters.

3. The method for retrieving embedded device parameter values ​​according to claim 2, characterized in that: The obtaining of initial parameters, classifying and marking the initial parameters, and generating parameter identification codes include: Classify and label all the initial parameters according to the logic control module, and use the module number as the third byte of the parameter label code; Classify and mark the initial parameters belonging to the same logic control module according to the functional information, and use the group number as the second byte of the parameter marking code; Marking the initial parameters of the same type of functional information belonging to the same logic control module in sequence, and using the ID number as the first byte of the parameter identification code; The fourth byte of the parameter identification code is used as a reserved position.

4. The method for retrieving embedded device parameter values ​​according to claim 2, characterized in that: The target initial parameters include the logic control module number, the number of logic control modules, the maximum parameter group number, the maximum parameter ID in the parameter group, and the parameter extreme value ID; the header data, index area data, and value area data in the parameter mirror data structure are sequentially constructed based on the target initial parameters, including: Assigning a value to the identification header corresponding to the header data, and assigning a value to the number of modules and the number of parameter groups in the header data according to the number of logic control modules and the maximum parameter group number respectively; Calculating the cumulative sum of the maximum parameter IDs in all the parameter groups, and assigning a value to the number of parameters in the header data based on the cumulative sum; Assigning a value to the index area offset in the header data according to the number of bytes in the parameter identification code; Calculating an offset value based on the number of modules, the number of parameter groups and the index area offset, and assigning a value area offset in the header data according to the offset value; Calculating a mirror value based on the value area offset and the number of parameters, and assigning a mirror size in the header data according to the mirror value; Construct the index area data and the value area data in the parameter mirror data structure.

5. The method for retrieving embedded device parameter values ​​according to claim 4, characterized in that: The step of constructing the index area data and the value area data in the parameter mirror data structure includes: The number of modules is used as the number of rows of the index area data, and the number of parameter groups is used as the number of columns of the index area data; Fill the first row of the logic control module with the information of the logic control module, and assign the first column of the index area data with the number of the logic control module; Assigning values ​​to each position of the index area data in a manner of gradually superimposing the maximum parameter ID in the parameter group; The numerical area data is assigned values ​​in sequence according to the number of parameters to construct the numerical area data.

6. The method for retrieving embedded device parameter values ​​according to any one of claims 1 to 5, characterized in that: When it is determined that the parameter identification code to be retrieved satisfies the preset legal condition, before determining the target parameter from the pre-constructed parameter mirror data structure by using the parameter identification code to be retrieved, the method further includes: Obtain the number of modules and the number of parameter groups in the parameter mirroring data result, and obtain the target number of modules and the target number of parameter groups; If the second byte of the parameter identification code to be retrieved is greater than the number of target parameter groups and the third byte is greater than the number of target modules, it is determined that the parameter identification code to be retrieved meets the preset legal condition; If the second byte of the parameter identification code to be retrieved is greater than the number of target parameter groups and the third byte is greater than the number of target modules, it is determined that the parameter identification code to be retrieved does not meet the preset legal condition.

7. The method for retrieving embedded device parameter values ​​according to any one of claims 1 to 5, characterized in that: When it is determined that the parameter identification code to be retrieved satisfies the preset legal condition, determining the target parameter from the pre-constructed parameter mirror data structure by using the parameter identification code to be retrieved includes: The parameter mirror data structure is traversed through the parameter identification code to be retrieved to determine the target parameter from the parameter mirror data structure, wherein the target parameter includes a first address of the parameter mirror data structure, a target data area offset and a target index area offset.

8. A device for retrieving parameter values ​​of embedded devices, characterized in that: include: A parameter identification code acquisition unit, used to acquire a parameter identification code to be retrieved; A target parameter determination unit, configured to determine the target parameter from a pre-constructed parameter mirror data structure by using the parameter identification code to be retrieved when it is determined that the parameter identification code to be retrieved satisfies a preset legal condition; The read-write operation unit is used to calculate the numerical memory address corresponding to the parameter identification code to be retrieved according to the target parameter, and perform read-write operations on the numerical memory address.

9. An embedded device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the method for retrieving the value of an embedded device parameter as claimed in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for retrieving a parameter value of an embedded device according to any one of claims 1 to 7 is implemented.