Method, apparatus, gateway and system for configuring a gateway
By optimizing the data storage structure and access device configuration of the gateway, the problem of inappropriate number of gateway access devices is solved, and more efficient device access and intelligent configuration are achieved.
Patent Information
- Application Number
- CN202411474977.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-10-22
AI Technical Summary
In the existing technology, the number of gateway access devices is too small or too large, resulting in data real-time problems and communication failures, and lightweight gateways cannot meet the access needs of large-scale devices due to hardware resource limitations.
By obtaining the configuration information of the gateway access device, optimizing the basic data storage structure, determining the remaining access capacity, and outputting configuration prompt information to reasonably configure the number of devices.
The maximum number of devices that can be connected to the gateway is increased, which alleviates the problem of too many devices and improves the intelligence level of the gateway configuration process.
Smart Images

Figure CN119316283B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of building automation, and in particular, to a method, device, gateway and system for configuring a gateway. BACKGROUND
[0002] In the related art, the access device information of a gateway is often configured based on human experience. This may likely result in too few or too many devices (such as expansion modules, or terminal devices accessing the gateway through the expansion modules, or terminal devices directly accessing the gateway, etc.) accessing the gateway, thereby causing a series of problems. For example, when there are too few expansion modules accessing the gateway, the large-scale device access demand cannot be met. When there are too many expansion modules accessing the gateway, a large amount of data will cause the communication bus to be busy, thereby causing the data of some expansion modules to be unable to be sent in time, affecting the real-time performance of the data, and generating communication failure information.
[0003] In addition, in a building automation system, a lightweight gateway is limited by hardware resources, and has a small running memory space, resulting in that the gateway does not support access to expansion modules, or the number of accessible expansion modules and devices accessing through the expansion modules is small. SUMMARY
[0004] The present disclosure provides a method, device, gateway and system for configuring a gateway.
[0005] According to a first aspect of the present disclosure, a method for configuring a gateway is provided, comprising: obtaining configuration information of an access device of the gateway; optimizing a basic data storage structure in the gateway according to the configuration information of the access device, to obtain an optimized data storage structure, the storage space occupied by the optimized data storage structure being smaller than the storage space occupied by the basic data storage structure; determining the storage space occupied by the access device in the gateway according to the storage space occupied by the optimized data storage structure; and determining a residual access capability representation index of the gateway according to the running memory space of the gateway and the storage space occupied by the access device in the gateway.
[0006] In some embodiments, the configuration information of the access device includes the type of the access device and data attribute configuration information of the access device.
[0007] In some embodiments, the gateway has multiple underlying data storage structures, and the optimizing the underlying data storage structure in the gateway according to the configuration information of the access device to obtain an optimized data storage structure comprises: selecting an underlying data storage structure corresponding to the type of the access device from the multiple underlying data storage structures as a target storage structure; and optimizing the target storage structure according to the data attribute configuration information of the access device to obtain the optimized data storage structure.
[0008] In some embodiments, the optimizing the target storage structure according to the data attribute configuration information of the access device to obtain the optimized data storage structure comprises: determining optimization levels of each attribute in the target storage structure according to the data attribute configuration information of the access device; determining optimized storage spaces of the each attribute according to the optimization levels of the each attribute and a corresponding relationship between optimization levels and attribute storage spaces; and determining the optimized data storage structure according to the optimized storage spaces of the each attribute.
[0009] In some embodiments, the data attribute configuration information comprises a value of a first attribute, and the determining the optimization levels of the each attribute in the target storage structure according to the data attribute configuration information of the access device comprises: in a case where the first attribute is all attributes in the target storage structure, determining the optimization levels of the each attribute in the target storage structure according to the value of the first attribute.
[0010] In some embodiments, the data attribute configuration information comprises a value of a first attribute, and the determining the optimization levels of the each attribute in the target storage structure according to the data attribute configuration information of the access device comprises: in a case where the first attribute is a part of attributes in the target storage structure, determining an optimization level of the first attribute according to the value of the first attribute; in a case where the target storage structure further comprises a second attribute associated with the first attribute, determining a value of the second attribute according to the value of the first attribute and a logical relationship between attributes; and determining an optimization level of the second attribute according to the value of the second attribute.
[0011] In some embodiments, the determining the optimization levels of the each attribute in the target storage structure according to the data attribute configuration information of the access device further comprises: in a case where the target storage structure further comprises a third attribute other than the first attribute and the second attribute, setting the optimization level of the third attribute as a set value, and the optimized storage space corresponding to the set value is the same as the storage space of the third attribute in the target storage structure.
[0012] In some embodiments, determining the optimized data storage structure based on the optimized storage space of each attribute includes: deleting attributes with zero optimized storage space from the attributes to obtain remaining attributes; and obtaining the optimized data storage structure based on the remaining attributes.
[0013] In some embodiments, the remaining access capability characterization indicator includes the remaining storage space of the running memory, and determining the remaining access capability characterization indicator of the gateway based on the running memory space of the gateway and the storage space occupied by the access device in the gateway includes: calculating the difference between the running memory space and the storage space occupied by the access device in the gateway; and determining the remaining storage space of the running memory based on the difference.
[0014] In some embodiments, the remaining access capability characterization indicator also includes the amount of configurable data of at least one remaining accessible device, and determining the remaining access capability characterization indicator of the gateway based on the running memory space of the gateway and the storage space occupied by the access device in the gateway also includes: determining the amount of configurable data of each remaining accessible device based on the remaining storage space of the running memory and the storage space occupied by the basic data storage structure corresponding to each remaining accessible device.
[0015] In some embodiments, the access device includes at least one of an expansion module and a device accessing the gateway through the expansion module.
[0016] In some embodiments, the method for configuring a gateway further includes: outputting configuration prompt information, wherein the configuration prompt information carries an indicator representing the remaining access capability of the gateway.
[0017] According to a second aspect of the present disclosure, an apparatus for configuring a gateway is provided, comprising: a program module for executing the aforementioned method for configuring a gateway.
[0018] According to a third aspect of the present disclosure, an apparatus for configuring a gateway is provided, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute the aforementioned method for configuring the gateway based on instructions stored in the memory.
[0019] According to a fourth aspect of the present disclosure, a gateway is provided, comprising: the apparatus for configuring a gateway as described above.
[0020] According to a fifth aspect of the present disclosure, a system for configuring a gateway is provided, comprising: the gateway as described above; and a configuration management device configured to receive the configuration prompt information from the gateway and display the configuration prompt information.
[0021] According to a sixth aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the method for configuring a gateway as previously described.
[0022] According to a seventh aspect of the present disclosure, there is provided a computer program product having stored thereon computer program instructions which, when executed by a processor, implement the method for configuring a gateway as previously described.
[0023] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments thereof, taken in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0024] The accompanying drawings, which constitute a part of this specification, illustrate embodiments of the present disclosure and serve to explain the principles of the present disclosure.
[0025] Figure 1 is a flowchart of a method for configuring a gateway according to some embodiments of the present disclosure;
[0026] Figure 2 is a flowchart of a storage structure optimization step in the method for configuring a gateway according to some embodiments of the present disclosure;
[0027] Figure 3 is Figure 2 is an exemplary flowchart of the step S22 shown;
[0028] Figure 4 is a flowchart of a method for configuring a gateway according to other embodiments of the present disclosure;
[0029] Figure 5 is a structural diagram of an apparatus for configuring a gateway according to some embodiments of the present disclosure;
[0030] Figure 6 is a structural diagram of an optimization module in the apparatus for configuring a gateway according to some embodiments of the present disclosure;
[0031] Figure 7 is a structural diagram of an apparatus for configuring a gateway according to other embodiments of the present disclosure;
[0032] Figure 8 is a structural diagram of a gateway according to some embodiments of the present disclosure;
[0033] Figure 9 is a structural diagram of a system for configuring a gateway according to some embodiments of the present disclosure;
[0034] Figure 10is a network topology diagram according to some embodiments of the present disclosure to which a method for configuring a gateway can be applied.
[0035] The present disclosure can be more clearly understood and appreciated from the following detailed description, taken in conjunction with the following drawings. DETAILED DESCRIPTION
[0036] Various exemplary embodiments of the present disclosure will now be described in detail below with reference to the accompanying drawings. Note that the relative arrangement, numerical expressions, and numerical values of components and steps set forth in these embodiments are not limiting to the scope of the present disclosure unless specifically stated otherwise.
[0037] Meanwhile, it should be understood that the sizes of the various portions shown in the drawings are not drawn to scale for the sake of convenience in description.
[0038] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way limiting to the scope of the disclosure and its applications or uses.
[0039] Techniques, methods, and apparatus known to those of ordinary skill in the relevant art can not be discussed in detail herein, but should be considered as part of the description of the present disclosure.
[0040] In all examples shown and discussed herein, any specific values should be interpreted as merely illustrative and not as a limitation. Thus, other examples of the exemplary embodiments can have different values.
[0041] Note that like reference numerals and letters indicate similar items in the following drawings, and thus once an item is defined in one drawing, it need not be discussed further in subsequent drawings.
[0042] In order to make the purposes, technical solutions, and advantages of the present disclosure clearer, the present disclosure is further described in detail below with reference to specific embodiments and in conjunction with the accompanying drawings.
[0043] In the related art, due to the deficiency of the gateway access device configuration process, the number of devices accessing the gateway is too small or too large, thereby causing a series of problems. In addition, due to the limitation of hardware resources of the gateway itself, the number of devices that can access the gateway is limited, and the large-scale device access demand cannot be met.
[0044] In view of this, the present disclosure proposes a method, device, gateway, and system for configuring a gateway, which can improve the maximum number of devices that can access the gateway, effectively alleviate the problem of too many access devices, and improve the intelligent level of the gateway configuration process.
[0045] Figure 1is a flowchart of a method for configuring a gateway according to some embodiments of the present disclosure. As shown in Figure 1 In some embodiments of the present disclosure, the method for configuring a gateway comprises steps S1 to S5.
[0046] Step S1: Obtain configuration information of an access device of the gateway.
[0047] The access device of the gateway can refer to at least one of an extension module of the gateway, a device accessing the gateway through the extension module, and a device directly accessing the gateway. The device accessing the gateway through the extension module or directly accessing the gateway can be a terminal device, such as an air conditioner indoor unit, an air conditioner outdoor unit, etc.
[0048] The configuration information of the access device can comprise at least one of the type of the access device, data attribute configuration information of the access device, etc.
[0049] For example, the configuration information of the access device comprises the type of the access device and the configuration information of the data attribute. By including both aspects in the configuration information of the access device, the subsequent fine optimization of the basic storage structure of the gateway is facilitated.
[0050] In some examples, the access device of the gateway refers to an extension module of the gateway. In these examples, the following configuration information can be obtained: data attribute configuration information of the extension module.
[0051] In other examples, the access device of the gateway refers to a device accessing the gateway through the extension module. In these examples, the following configuration information can be obtained: the type of the device accessing the gateway through the extension module, and the data attribute configuration information of the device accessing the gateway through the extension module. By obtaining the configuration information of the device accessing through the extension module, the fine level of the gateway configuration process is improved.
[0052] In still other examples, the access device of the gateway refers to the extension module and the device accessing the gateway through the extension module. In these examples, the following configuration information can be obtained: the type of the extension module, the data attribute configuration information of the extension module, the type of the device accessing the gateway through the extension module, and the data attribute configuration information of the device accessing the gateway through the extension module. By obtaining the configuration information of the extension module and the device accessing through the extension module, both the configuration granularity of the extension module and the device accessing through the extension module are taken into account, which helps to further improve the fine level of the gateway configuration process.
[0053] In step S1, there can be multiple ways to obtain the configuration information. In one example, the configuration information of the access device of the gateway is received from a configuration management device. In another example, the configuration information of the access device of the gateway is obtained from a local storage module.
[0054] Step S2: optimizing the basic data storage structure in the gateway according to the configuration information of the access device to obtain an optimized data storage structure.
[0055] The basic data storage structure in the gateway can be one or more. The basic data storage structure defines a plurality of attributes and the storage space occupied by each attribute. For example, the basic data storage structure is shown in Table 1.
[0056] Table 1
[0057]
[0058] As shown in Table 1, the basic data storage structure includes the following attributes of the data: name, address, data type, value, value range, operation formula, extension flag, unit, and priority. For each attribute in the basic data storage structure, a storage space is pre-allocated. For example, the storage space of the attribute "name" is N4 bytes, and the storage space of the attribute "data type" is N1 bytes.
[0059] It should be noted that Table 1 is only an example of the basic data storage structure. In actual implementation, the attributes included in the basic data storage structure and the storage space of each attribute can be flexibly set according to requirements.
[0060] In step S2, by optimizing the basic data storage structure, the storage space occupied by the optimized data storage structure is less than the storage space occupied by the basic data storage structure. In this way, adaptive compression can be performed on the data storage space occupied by each access device in the gateway, which helps the gateway to access more access devices.
[0061] In step S2, a variety of implementation methods can be used to optimize the storage structure. The following describes two exemplary methods.
[0062] In the first exemplary method, the configuration information of the access device includes the configuration information of the data attributes of the access device. In this method, the basic data storage structure is optimized according to the configuration information of the data attributes of the access device to obtain an optimized data storage structure.
[0063] For example, the gateway has a basic data storage structure. Assuming that the data attribute configuration information of terminal device a accessing the gateway is obtained, the basic data storage structure is optimized according to the data attribute configuration information of terminal device a to obtain an optimized data storage structure.
[0064] For example, the gateway has a basic data storage structure. Assuming that the configuration information of the data attribute of terminal device a accessing the gateway and the configuration information of the data attribute of terminal device b accessing the gateway are obtained, the basic data storage structure can be optimized according to the configuration information of the data attribute of terminal device a to obtain an optimized data storage structure p1, and the basic data storage structure can be optimized according to the configuration information of the data attribute of terminal device b to obtain an optimized data storage structure p2.
[0065] In the second exemplary manner, the configuration information of the access device includes the type of the access device and the configuration information of the data attribute of the access device. In this exemplary manner, the storage structure optimization step (i.e., step S2) specifically includes Figure 2 The steps S21 to S22 shown.
[0066] Step S21: Select a basic data storage structure corresponding to the type of the access device as a target storage structure.
[0067] In the second exemplary manner, the gateway has a plurality of basic data storage structures, and a corresponding relationship exists between the basic data storage structures and the device types. For example, the device type 1 corresponds to the basic data storage structure p1, and the device type 2 corresponds to the basic data storage structure p2. After the type of the access device is determined, the target storage structure is selected from the plurality of basic data storage structures according to the type of the access device.
[0068] For example, when the access device is terminal device a and terminal device b accessing through the expansion module A, and the device type of terminal device a is type 1 and the device type of terminal device b is type 2, the basic data storage structure corresponding to type 1 can be selected as the target storage structure of terminal device a, and the basic data storage structure corresponding to type 2 can be selected as the target storage structure of terminal device b.
[0069] For example, when the access device is terminal device a accessing through the expansion module A, and the device type of terminal device a is type 1, the basic data storage structure corresponding to type 1 can be selected as the target storage structure.
[0070] In the embodiments of the present disclosure, by setting the corresponding basic data storage structure for different types of devices, the flexibility of subsequent data storage structure optimization is improved. Moreover, compared with setting only one basic data storage structure for the gateway, since the basic storage structure designed for a specified type of device does not need to take into account the data attributes of various types of devices, the storage space occupied by the basic data storage structure is reduced, which helps the gateway to access more devices.
[0071] Step S22: Optimize the target storage structure according to the data attribute configuration information of the access device.
[0072] In some examples, in the case that the data attribute configuration information of one access device is acquired, the target storage structure of the access device is optimized to obtain the optimized data storage structure of the access device.
[0073] For example, assuming that the basic data storage structure shown in Table 1 is optimized to obtain the optimized data storage structure shown in Table 2.
[0074] Table 2
[0075]
[0076] As shown in Table 2, the optimized data storage structure includes five attributes, i.e., name, address, data type, value, and priority, and the storage spaces occupied by the attributes are N2 bytes, N1 bytes, N1 bytes, N1 bytes, and N1 bytes, respectively. Among them, N4>N2>N1. In this example, the number of attributes of the optimized data storage structure is less than that of the basic data storage structure, and the storage spaces occupied by the attributes are also less than those of the basic data storage structure. Therefore, the storage space occupied by the optimized data storage structure is less than that of the basic data storage structure.
[0077] In other examples, in the case that the data attribute configuration information of multiple access devices is acquired, the target storage structure of each access device is optimized according to the data attribute configuration information of the access device to obtain the optimized data storage structure of the access device.
[0078] In the embodiments of the present disclosure, by the flow shown in Figure 2 , the flexibility and accuracy of the storage structure optimization can be improved, and the process of configuring the access devices for the gateway is further optimized.
[0079] Returning to Figure 1 , step S3: determining the storage space occupied by the access device in the gateway according to the storage space occupied by the optimized data storage structure.
[0080] In some examples, in the case that the access devices are multiple, the storage spaces occupied by the optimized data storage structures corresponding to the access devices are summed up; and the storage space occupied by the access devices is determined according to the sum result.
[0081] Further, in some of the above examples, the storage spaces can be summed up according to the following formula: F1=m1*n1+m2*n2+…+mx*nx, wherein F1 is the summation result of the storage space, m1 is the storage space occupied by the optimized data storage structure corresponding to the access device 1, n1 is the data amount of the access device 1 using the optimized data storage structure, m2 is the storage space occupied by the optimized data storage structure corresponding to the access device 2, n2 is the data amount of the access device 2 using the optimized data storage structure, mx is the storage space occupied by the optimized data storage structure corresponding to the access device x, and nx is the data amount of the access device x using the optimized data storage structure.
[0082] In addition, in some examples described above, the summation of the storage space can also be performed according to the following formula: F1=c1*d1+c2*d2+…+cx*dx, wherein F1 is the summation result of the storage space, c1 is the storage space occupied by the optimized data storage structure corresponding to type 1, d1 is the data amount of all the access devices using the optimized data storage structure, c2 is the storage space occupied by the optimized data storage structure corresponding to type 2, d2 is the data amount of all the access devices using the optimized data storage structure, cx is the storage space occupied by the optimized data storage structure corresponding to type x, and dx is the data amount of all the access devices using the optimized data storage structure.
[0083] After obtaining the summation result, the summation result can be taken as the storage space occupied by the access devices. In addition, the summation result can be further operated to obtain the storage space occupied by the access devices.
[0084] In some other examples, in the case where the access device is one, the storage space occupied by the optimized data storage structure corresponding to the access device is taken as the storage space occupied by the access device. In addition, the storage space occupied by the optimized data storage structure corresponding to the access device can be further operated to obtain the storage space occupied by the access device.
[0085] Step S4: determining the residual access capability representation index of the gateway according to the running memory space of the gateway and the storage space occupied by the access devices in the gateway.
[0086] The residual access capability representation index of the gateway is used to represent the residual device access capability of the gateway.
[0087] In some examples, the remaining access capability representation index of the gateway comprises a remaining storage space of a running memory of the gateway. In these examples, step S4 specifically comprises: calculating a difference between the running memory space of the gateway and a storage space occupied by the access device in the gateway; and determining the remaining storage space of the running memory of the gateway according to the difference. For example, the difference is taken as the remaining storage space of the running memory. By calculating the remaining storage space of the running memory of the gateway, the user can be informed of the current remaining access capability of the gateway, and the number of access devices configured for the gateway can be reasonably determined according to the current remaining access capability, thereby improving the controllability and intelligent level of the gateway configuration process.
[0088] In other examples, the remaining access capability representation index of the gateway comprises a remaining storage space of a running memory of the gateway and a configurable data amount of at least one remaining access device. In these examples, step S4 specifically comprises: calculating a difference between the running memory space of the gateway and a storage space occupied by the access device in the gateway; determining the remaining storage space of the running memory of the gateway according to the difference; and determining the configurable data amount of each remaining access device according to the remaining storage space of the running memory of the gateway and a storage space occupied by a corresponding basic data storage structure of each remaining access device.
[0089] In these examples, the remaining access device refers to a device that can still be accessed by the gateway. For example, the remaining access device comprises a device of type "type 1" and a device of type "type 2". In this example, after obtaining the remaining storage space of the running memory of the gateway, the quotient of the remaining storage space of the running memory of the gateway and a storage space occupied by the basic data storage structure corresponding to the device of "type 1" is calculated, and the configurable data amount of the device of "type 1" is obtained according to the quotient; the quotient of the remaining storage space of the running memory of the gateway and a storage space occupied by the basic data storage structure corresponding to the device of "type 2" is calculated, and the configurable data amount of the device of "type 2" is obtained according to the quotient.
[0090] In the above examples, by calculating the remaining storage space of the running memory and the configurable data amount of the remaining access device, the remaining access capability of the gateway can be better represented, and the intelligent level of the gateway configuration process is further improved.
[0091] Further, in addition to steps S1 to S4, the method for configuring the gateway can further comprise: outputting configuration prompt information carrying the remaining access capability representation index of the gateway. By outputting the configuration prompt information, the user can reasonably determine the number of access devices according to the configuration prompt information, thereby improving the configuration experience of the user.
[0092] In the embodiments of the present disclosure, on one hand, by optimizing the basic data storage structure in the gateway according to the configuration information of the gateway access device, the adaptive compression of the storage space occupied by the data of the access device in the gateway is facilitated, and the maximum device quantity that can be accessed by the gateway is improved; on the other hand, by calculating the residual access capability representation index of the gateway, the user can configure a reasonable number of access devices for the gateway according to the index, effectively alleviate the problems caused by too few or too many access devices, and improve the intelligent level of the gateway configuration.
[0093] In order to better illustrate the optimization process of the storage structure, the following will be exemplarily described in combination with Figure 3 the steps S22 shown in FIG. 2. Figure 2 As shown in FIG. 2, the step S22 specifically includes steps S221 to S223. Figure 3
[0094] Step S221: According to the data attribute configuration information, the optimization level of each attribute in the target storage structure is determined.
[0095] The data attribute configuration information includes the value of the first attribute. The first attribute can be one or more attributes in the target storage structure.
[0096] In some examples, the first attribute is all the attributes in the target storage structure. In these examples, the step S221 includes: according to the value of the first attribute, the optimization level of each attribute in the target storage structure is determined.
[0097] Further, in the above examples, the actual storage space occupied by the first attribute can be estimated according to the value of the first attribute, and then the optimization level of the first attribute is determined according to the actual storage space occupied.
[0098] For example, assuming that the value of the first attribute “name” is configured as “temperature”, the actual storage space occupied by this attribute can be estimated to be greater than N1 bytes and less than N2 bytes, and then the optimization level of this attribute is determined to be M2 according to the actual storage space occupied.
[0099] In the above examples, the above process can meet the application scene use demand of the user for full-quantity configuration of the data attribute, and the optimization level of each attribute in the target storage structure can be accurately determined, and then the storage space occupied by each attribute can be accurately compressed subsequently.
[0100] In some examples, the first attribute is a part attribute in the target storage structure. In these examples, step S221 comprises: determining the optimization level of the first attribute according to the value of the first attribute; in the case that the target storage structure further comprises a second attribute associated with the first attribute, determining the value of the second attribute according to the value of the first attribute and the logical relationship between the attributes; and determining the optimization level of the second attribute according to the value of the second attribute.
[0101] Further, in the above-mentioned some examples, step S221 can further comprise: in the case that the target storage structure further comprises a third attribute other than the first attribute and the second attribute, setting the optimization level of the third attribute as a setting value, the setting value corresponding to the same optimization storage space as the storage space of the third attribute in the target storage structure.
[0102] For example, assuming that the target storage structure is as shown in Table 1, and the first attribute involved in the configuration information of the access device is the five attributes of “name”, “address”, “data range”, “extension flag”, and “priority”, and the target storage structure further comprises the four attributes of “data type”, “value”, “operation formula”, and “unit”. Among them, “unit” is an associated attribute of “extension flag”, and thus it belongs to the second attribute, and “data type”, “value”, and “operation formula” belong to the third attribute. Further, assuming that the value of “extension flag” is 0, and it is known through the query of the logical relationship between the attributes that when the value of “extension flag” is 0, the value of the associated attribute “unit” is also 0, and thus the optimization level of the second attribute “unit” is determined as M0. And the optimization level of the three third attributes of “data type”, “value”, and “operation formula” can be set as a setting value, the setting value corresponding to the same optimization storage space as their storage space in the target storage structure.
[0103] In the above-mentioned examples, the above process can meet the application scenario use requirements of the user for partial configuration of data attributes, and can accurately determine the optimization level of each attribute for the first attribute, the second attribute, and the third attribute, and thus facilitate subsequent accurate compression of the storage space occupied by each attribute.
[0104] Step S222: determining the optimization storage space of each attribute according to the optimization level of each attribute and the corresponding relationship between the optimization level and the storage space of the attribute.
[0105] The corresponding relationship between the optimization level and the storage space of the attribute defines the optimization storage space of the attribute corresponding to each optimization level. Table 3 gives an example of the corresponding relationship.
[0106] Table 3
[0107]
[0108] As shown in Table 3, the storage space of the attribute corresponding to the optimization level M0 is 0 bytes, the storage space of the attribute corresponding to the optimization level M1 is N1 bytes, the storage space of the attribute corresponding to the optimization level M2 is N2 bytes, the storage space of the attribute corresponding to the optimization level M3 is N3 bytes, and the storage space of the attribute corresponding to the optimization level M4 is N4 bytes. N1 to N4 are all integers greater than 0.
[0109] Step S223: determining the optimized data storage structure according to the optimized storage space of each attribute.
[0110] In some examples, step S223 includes: deleting, from each attribute, an attribute whose optimized storage space is zero to obtain remaining attributes; and obtaining the optimized data storage structure according to the remaining attributes.
[0111] For example, assuming that the target data storage structure contains 9 attributes, and it is determined through calculation that the optimized storage space of two attributes among the 9 attributes is zero, the two attributes are deleted, and the optimized data storage structure is constructed according to the remaining 7 attributes.
[0112] In Figure 3 In the flow shown in FIG. 4, the attribute of the data is taken as the optimization granularity of the storage structure, which improves the fine level of the storage structure optimization and further optimizes the gateway configuration process. Moreover, by pre-setting the correspondence between the optimization level and the storage space of the attribute and determining the optimized storage space of each attribute according to the correspondence in the storage structure optimization process, the processing efficiency of the storage structure optimization can be improved.
[0113] Figure 4 is a flow diagram of a method for configuring a gateway according to another embodiment of the present disclosure. As shown in Figure 4 In another embodiment of the present disclosure, the method for configuring a gateway includes steps 41 to 47.
[0114] Step 41: a user configures access device information of the gateway.
[0115] The user can configure the access device information of the gateway through an interactive interface provided by the configuration management device. For example, the user can configure information of an extension module accessed by the gateway and a terminal device accessed by the extension module.
[0116] Step 42: the configuration management device sends the configuration information of the access device of the gateway to the gateway.
[0117] The configuration management device can be a host computer installed with configuration software. After receiving the configuration information input by the user, the configuration management device sends the configuration information to the gateway.
[0118] Step 43: the gateway optimizes the basic data storage structure.
[0119] In this step, the gateway optimizes the basic data storage structure in the gateway according to the configuration information of the access device, to obtain an optimized data storage structure. The storage space occupied by the optimized data storage structure is smaller than the storage space occupied by the basic data storage structure.
[0120] For how to implement step 43, refer to the related description of the foregoing embodiments.
[0121] Step 44: the gateway determines a residual access capability representation index of the gateway.
[0122] For how to implement step 44, refer to the related description of the foregoing embodiments.
[0123] Step 45: the gateway sends configuration prompt information to the configuration management device.
[0124] The configuration prompt information carries the residual access capability representation index of the gateway. For example, the residual access capability representation index includes the residual storage space of the gateway running memory.
[0125] Step 46: the configuration management device displays the configuration prompt information.
[0126] Step 47: the user reconfigures the access device information of the gateway.
[0127] For example, the user configures more expansion modules and terminal devices according to the residual storage space of the gateway running memory. After the configuration is completed, the gateway can store the data of the corresponding access device through the optimized storage structure.
[0128] In the embodiments of the present disclosure, the above process can improve the maximum number of devices that can be accessed by the gateway, effectively alleviate the problem of too many access devices, and improve the intelligent level of the gateway configuration process.
[0129] Figure 5 is a structural schematic diagram of an apparatus for configuring a gateway according to some embodiments of the present disclosure. As shown in Figure 5 In some embodiments of the present disclosure, the apparatus 50 for configuring a gateway can be used to execute the method for configuring a gateway described in any of the foregoing embodiments, including an obtaining module 51, an optimization module 52, a first determination module 53, and a second determination module 54.
[0130] The obtaining module 51 is configured to obtain configuration information of an access device of the gateway.
[0131] The optimization module 52 is configured to optimize the basic data storage structure in the gateway according to the configuration information of the access device, to obtain an optimized data storage structure. The storage space occupied by the optimized data storage structure is smaller than the storage space occupied by the basic data storage structure.
[0132] The first determination module 53 is configured to determine the storage space occupied by the access device in the gateway according to the storage space occupied by the optimized data storage structure.
[0133] The second determination module 54 is configured to determine the residual access capability representation index of the gateway according to the running memory space of the gateway and the storage space occupied by the access device in the gateway.
[0134] In the embodiments of the present disclosure, the above device can improve the maximum number of devices that can be accessed by the gateway, effectively alleviate the problem of too many access devices, and improve the intelligent level of the gateway configuration process.
[0135] Figure 6 is a structural schematic diagram of an optimization module in a device for configuring a gateway according to some embodiments of the present disclosure. As shown in Figure 6 In some embodiments, the optimization module 52 includes an optimization level determination unit 521, a storage space determination unit 522, and a storage structure determination unit 523.
[0136] The optimization level determination unit 521 is configured to determine the optimization level of each attribute in the target storage structure according to the data attribute configuration information of the access device.
[0137] For example, assuming that the terminal device a accessed belongs to device type 1, the basic data storage structure of device type 1 is taken as the target storage structure, and the optimization level of each attribute in the structure is determined. Assuming that the terminal device b accessed belongs to device type 2, the basic data storage structure of device type 2 is taken as the target storage structure, and the optimization level of each attribute in the structure is determined.
[0138] The storage space determination unit 522 is configured to determine the optimized storage space of each attribute according to the optimization level of each attribute and the corresponding relationship between the optimization level and the storage space of the attribute.
[0139] The storage structure determination unit 523 is configured to determine the optimized data storage structure according to the optimized storage space of the attribute.
[0140] For example, assuming that the accessed terminal device a belongs to device type 1, the basic data storage structure for device type 1 is optimized to obtain an optimized data storage structure. Assuming that the accessed terminal device b belongs to device type 2, the basic data storage structure for device type 2 is optimized to obtain an optimized data storage structure.
[0141] In the embodiments of the present disclosure, the above optimization module improves the fine level of storage structure optimization, and further optimizes the gateway configuration process. Moreover, by pre-setting the correspondence between the optimization level and the storage space of the attribute, and determining the optimized storage space of each attribute according to the correspondence in the storage structure optimization process, the processing efficiency of the storage structure optimization can be improved.
[0142] Figure 7 is a structural schematic diagram of an apparatus for configuring a gateway according to some embodiments of the present disclosure. As shown in Figure 7 The apparatus 70 for configuring a gateway includes a memory 71 and a processor 72 coupled to the memory 71. The memory 71 is configured to store instructions for implementing corresponding embodiments of the method for configuring a gateway. The processor 72 is configured to execute the method for configuring a gateway in any of some embodiments of the present disclosure based on the instructions stored in the memory 71.
[0143] Figure 8 is a structural schematic diagram of a gateway according to some embodiments of the present disclosure. As shown in Figure 8 The gateway 80 includes an apparatus 81 for configuring a gateway.
[0144] The apparatus 81 for configuring a gateway is configured to execute the method for configuring a gateway described in any of the preceding embodiments.
[0145] In the embodiments of the present disclosure, through the above gateway, the maximum number of devices that can be accessed by the gateway can be improved, while effectively alleviating the problem of too many access devices, and improving the intelligent level of the gateway configuration process.
[0146] Figure 9 is a structural schematic diagram of a system for configuring a gateway according to some embodiments of the present disclosure. As shown in Figure 9 The system 90 for configuring a gateway includes a gateway 80 and a configuration management device 91.
[0147] The gateway 80 is configured to execute the method for configuring a gateway described in any of the preceding embodiments.
[0148] The configuration management device 91 is configured to receive configuration prompt information from the gateway 80 and display the configuration prompt information. In addition, the configuration management device 91 can also interact with the user to configure the information of the gateway access device by the user.
[0149] In the embodiments of the present disclosure, by means of the above system, the maximum number of devices accessible by the gateway can be increased, and meanwhile, the problem of excessive number of access devices can be effectively alleviated, and the intelligent level of the gateway configuration process is improved.
[0150] Figure 10 is a network topology diagram applicable to the method for configuring a gateway according to some embodiments of the present disclosure. As shown in the figure, the network topology includes a management layer, a network control layer, and a device layer. Figure 10 The management layer includes a configuration management device.
[0151] The network control layer includes a gateway (such as a lightweight gateway) and a plurality of extension modules. The gateway is configured to execute the method for configuring a gateway according to any one of the preceding embodiments.
[0152] The device layer includes a plurality of terminal devices that access the gateway through the extension modules.
[0153] In the embodiments of the present disclosure, by means of enhancing the function of the gateway, the maximum number of devices accessible by the gateway can be increased, and meanwhile, the problem of excessive number of access devices can be effectively alleviated, and the intelligent level of the gateway configuration process is improved.
[0154] Here, various aspects of the present disclosure are described with reference to flowcharts and / or block diagrams of the method, device and computer program product according to the embodiments of the present disclosure. It should be understood that each block of the flowchart and / or block diagram, and combinations thereof, can be implemented by computer readable program instructions.
[0155] These computer readable program instructions can be provided to a processor of a general purpose computer, a special purpose computer, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor generate the device that implements the functions specified in one or more blocks of the flowchart and / or block diagram.
[0156] These computer readable program instructions can also be stored in a computer readable storage medium that causes a computer to work in a specific manner, thereby producing a manufactured product including instructions that implement the functions specified in one or more blocks of the flowchart and / or block diagram.
[0157] The present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.
[0158] The present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.
[0159] So far, the method, device, gateway and system for configuring a gateway according to the present disclosure have been described in detail. In order not to obscure the concept of the present disclosure, some details known in the art are not described. Those skilled in the art can fully understand how to implement the technical solutions disclosed herein according to the above description.
Claims
1. A method for configuring a gateway, comprising: Obtain the configuration information of the gateway's access device; Optimizing a basic data storage structure in the gateway according to the configuration information of the access device to obtain an optimized data storage structure, wherein a storage space occupied by the optimized data storage structure is smaller than a storage space occupied by the basic data storage structure; determining the storage space occupied by the access device in the gateway according to the storage space occupied by the optimized data storage structure; A remaining access capability characterization indicator of the gateway is determined according to the running memory space of the gateway and the storage space occupied by the access device in the gateway.
2. The method for configuring a gateway according to claim 1, wherein: The configuration information of the access device includes the type of the access device and data attribute configuration information of the access device.
3. The method for configuring a gateway according to claim 2, wherein: There are multiple basic data storage structures of the gateway. Optimizing the basic data storage structure in the gateway according to the configuration information of the access device to obtain an optimized data storage structure includes: Selecting a basic data storage structure corresponding to the type of the access device from a plurality of basic data storage structures and using it as a target storage structure; The target storage structure is optimized according to the data attribute configuration information of the access device to obtain an optimized data storage structure.
4. The method for configuring a gateway according to claim 3, wherein: Optimizing the target storage structure according to the data attribute configuration information of the access device to obtain an optimized data storage structure includes: determining an optimization level for each attribute in the target storage structure according to the data attribute configuration information of the access device; Determining the optimized storage space of each attribute according to the optimization level of each attribute and the corresponding relationship between the optimization level and the storage space of the attribute; The optimized data storage structure is determined according to the optimized storage space of each attribute.
5. The method for configuring a gateway according to claim 4, wherein: The data attribute configuration information includes a value of a first attribute, and determining the optimization level of each attribute in the target storage structure according to the data attribute configuration information of the access device includes: In the case that the first attribute is all the attributes in the target storage structure, the optimization level of each attribute in the target storage structure is determined according to the value of the first attribute.
6. The method for configuring a gateway according to claim 4, wherein: The data attribute configuration information includes a value of a first attribute, and determining the optimization level of each attribute in the target storage structure according to the data attribute configuration information of the access device includes: In a case where the first attribute is a part of the attributes in the target storage structure, determining an optimization level of the first attribute according to a value of the first attribute; In a case where the target storage structure further includes a second attribute associated with the first attribute, determining a value of the second attribute according to the value of the first attribute and a logical relationship between attributes; An optimization level of the second attribute is determined according to the value of the second attribute.
7. The method for configuring a gateway according to claim 6, wherein: Determining the optimization level of each attribute in the target storage structure according to the data attribute configuration information of the access device further includes: When the target storage structure further includes a third attribute in addition to the first and second attributes, the optimization level of the third attribute is set to a set value, and the optimized storage space corresponding to the set value is the same as the storage space of the third attribute in the target storage structure.
8. The method for configuring a gateway according to claim 4, wherein: Determining the optimized data storage structure according to the optimized storage space of each attribute includes: Deleting the attributes whose storage space is zero after optimization from the attributes to obtain the remaining attributes; The optimized data storage structure is obtained according to the remaining attributes.
9. The method for configuring a gateway according to claim 1, wherein: The remaining access capability characterization indicator includes the remaining storage space of the running memory, and determining the remaining access capability characterization indicator of the gateway according to the running memory space of the gateway and the storage space occupied by the access device in the gateway includes: Calculating a difference between the running memory space and the storage space occupied by the access device in the gateway; The remaining storage space of the running memory is determined according to the difference.
10. The method for configuring a gateway according to claim 9, wherein: The remaining access capability characterization indicator further includes an amount of configurable data of at least one remaining accessible device, and determining the remaining access capability characterization indicator of the gateway based on the running memory space of the gateway and the storage space occupied by the access device in the gateway further includes: The configurable data volume of each remaining accessible device is determined according to the remaining storage space of the running memory and the storage space occupied by the basic data storage structure corresponding to each remaining accessible device.
11. The method for configuring a gateway according to any one of claims 1 to 10, wherein: The access device includes at least one of an expansion module and a device accessing the gateway through the expansion module.
12. The method for configuring a gateway according to any one of claims 1 to 10, further comprising: Output configuration prompt information, where the configuration prompt information carries a characterization indicator of the remaining access capability of the gateway.
13. An apparatus for configuring a gateway, comprising: A program module for executing the method for configuring a gateway according to any one of claims 1 to 12.
14. An apparatus for configuring a gateway, comprising: Memory; as well as A processor coupled to the memory, wherein the processor is configured to execute the method for configuring a gateway according to any one of claims 1 to 12 based on instructions stored in the memory.
15. A gateway comprising: The apparatus for configuring a gateway as claimed in claim 13 or 14.
16. A system for configuring a gateway, comprising: The gateway according to claim 15; The configuration management device is used to receive the configuration prompt information from the gateway and display the configuration prompt information.
17. A computer-readable storage medium having computer program instructions stored thereon, wherein when the instructions are executed by a processor, the method for configuring a gateway according to any one of claims 1 to 12 is implemented.
18. A computer program product having computer program instructions stored thereon, wherein when the instructions are executed by a processor, the method for configuring a gateway according to any one of claims 1 to 12 is implemented.
Citation Information
Patent Citations
Method and device for configuring user access network data
CN101087208A
Internet of things data acquisition and optimization method and system, gateway and storage medium
CN110650085A