Configuration information analysis method and device

文档序号:851595 发布日期:2021-03-16 浏览:3次 中文

阅读说明:本技术 配置信息解析方法和装置 (Configuration information analysis method and device ) 是由 陈家艳 栾慎勇 周葆林 陈万兴 于 2020-11-26 设计创作,主要内容包括:本发明提供了一种配置信息解析方法和装置,其中,该方法包括:接收负载的配置信息;从所述配置信息中获取第一消息部和第二消息部;从所述第一消息部中解析出端口类型和端口位置;从所述第二消息部中解析出扩展模块的个数,并确定所述配置信息所关联的控制模块的模块类型。通过上述方案解决了现有的负载与控制模块的关联固定导致的灵活性较差的问题,达到了对端口配置和控制模块类型进行灵活配置的技术效果。(The invention provides a method and a device for analyzing configuration information, wherein the method comprises the following steps: receiving configuration information of a load; acquiring a first message part and a second message part from the configuration information; analyzing the port type and the port position from the first message part; and analyzing the number of the extension modules from the second message part, and determining the module type of the control module associated with the configuration information. By the scheme, the problem of poor flexibility caused by the fixed association of the existing load and the control module is solved, and the technical effect of flexibly configuring the port configuration and the control module type is achieved.)

1. A method for analyzing configuration information is characterized by comprising the following steps:

receiving configuration information of a load;

acquiring a first message part and a second message part from the configuration information;

analyzing the port type and the port position from the first message part;

and analyzing the number of the extension modules from the second message part, and determining the module type of the control module associated with the configuration information.

2. The method of claim 1, wherein obtaining the first message part and the second message part from the configuration information comprises:

and taking the lower eight bits of the configuration information as the first message part and taking the upper eight bits of the configuration information as the second message part.

3. The method of claim 2, wherein parsing port type and port location from the first message portion comprises:

determining the port type according to the upper three bits of the first message part;

and determining the position of the port according to the lower five bits of the first message part.

4. The method of claim 2, wherein parsing the number of extension modules from the second message part and determining the module type of the control module associated with the configuration information comprises:

converting the upper eight bits of the configuration information into a numerical value;

determining that the control module associated with the configuration information is a main module when the numerical value is 0, and determining that the control module associated with the configuration information is an expansion module when the numerical value is not 0;

and taking the maximum numerical value of the numerical values converted from the high eight bits in the configuration message of each load in the configuration messages of the plurality of loads as the number of the extension modules.

5. The method of claim 1, wherein after parsing the number of extension modules from the second message part and determining the module type of the control module associated with the configuration information, the method further comprises:

under the condition that the control module associated with the configuration information is determined to be a main module, directly processing the port information through the main module;

and under the condition that the control module associated with the configuration information is determined to be an expansion module, sending the port information to the associated expansion module for processing through the determined port position.

6. A configuration information analysis device, comprising:

the receiving module is used for receiving the configuration information of the load;

the acquisition module is used for acquiring a first message part and a second message part from the configuration information;

the first analysis module is used for analyzing the port type and the port position from the first message part;

and the second analysis module is used for analyzing the number of the extension modules from the second message part and determining the module type of the control module associated with the configuration information.

7. The apparatus of claim 6, wherein the obtaining module is specifically configured to use a lower eight bits of the configuration information as the first message part and a higher eight bits of the configuration information as the second message part.

8. The apparatus of claim 7, wherein the first parsing module comprises:

a first determining unit, configured to determine a port type according to the upper three bits of the first message part;

and the second determining unit is used for determining the position of the port according to the lower five bits of the first message part.

9. An air conditioning assembly comprising: the configuration information parsing apparatus of any one of claims 6 to 8.

10. A network device, comprising: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 5 when executing the computer program.

11. A non-transitory computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the method of any one of claims 1 to 5.

Technical Field

The invention relates to the technical field of equipment control, in particular to a configuration information analysis method and device.

Background

To accommodate a diverse control environment, there are many port types that can be configured for controllers such as: DDC, PLC, etc. For practical application of a controller, in order to meet some control requirements with little difference, a general program carrying a controller with selectable port types is generally developed, and for requirements covered by the general program, development of a new program is not needed, and only the port and the load need to be configured.

However, the configuration information in the existing configuration method is often scattered, which results in more protocol bits being occupied during communication, and if the number of hardware ports changes, the configuration method that has been set cannot be applied.

In view of the above problems, no effective solution has been proposed.

Disclosure of Invention

The embodiment of the invention provides a method and a device for analyzing configuration information, which aim to solve the problem of poor flexibility caused by the association and fixation of a load and a control module in the prior art, thereby achieving the aim of flexibly configuring the module and a port.

In one aspect, a method for parsing configuration information is provided, including:

receiving configuration information of a load;

acquiring a first message part and a second message part from the configuration information;

analyzing the port type and the port position from the first message part;

and analyzing the number of the extension modules from the second message part, and determining the module type of the control module associated with the configuration information.

In one embodiment, obtaining the first message part and the second message part from the configuration information includes:

and taking the lower eight bits of the configuration information as the first message part and taking the upper eight bits of the configuration information as the second message part.

In one embodiment, parsing out port types and port locations from the first message portion comprises:

determining the port type according to the upper three bits of the first message part;

and determining the position of the port according to the lower five bits of the first message part.

In one embodiment, parsing the number of extension modules from the second message part and determining the module type of the control module associated with the configuration information includes:

converting the upper eight bits of the configuration information into a numerical value;

determining that the control module associated with the configuration information is a main module when the numerical value is 0, and determining that the control module associated with the configuration information is an expansion module when the numerical value is not 0;

and taking the maximum numerical value of the numerical values converted from the high eight bits in the configuration message of each load in the configuration messages of the plurality of loads as the number of the extension modules.

In one embodiment, after parsing the number of extension modules from the second message part and determining the module type of the control module associated with the configuration information, the method further includes:

under the condition that the control module associated with the configuration information is determined to be a main module, directly processing the port information through the main module;

and under the condition that the control module associated with the configuration information is determined to be an expansion module, sending the port information to the associated expansion module for processing through the determined port position.

In another aspect, a configuration information analysis apparatus is provided, including:

the receiving module is used for receiving the configuration information of the load;

the acquisition module is used for acquiring a first message part and a second message part from the configuration information;

the first analysis module is used for analyzing the port type and the port position from the first message part;

and the second analysis module is used for analyzing the number of the extension modules from the second message part and determining the module type of the control module associated with the configuration information.

In an embodiment, the obtaining module is specifically configured to use the lower eight bits of the configuration information as the first message part, and use the upper eight bits of the configuration information as the second message part.

In one embodiment, the first parsing module comprises:

a first determining unit, configured to determine a port type according to the upper three bits of the first message part;

and the second determining unit is used for determining the position of the port according to the lower five bits of the first message part.

In yet another aspect, an air conditioning unit is provided, including: the above-mentioned configuration information analysis device.

In yet another aspect, a network device is provided, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the above method when executing the computer program.

In a further aspect, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the above-mentioned method.

In the above embodiment, the port type, the port position, the module type of the associated control module, and other information are identified by the data at different positions in the configuration information, so that flexible port configuration and control module type setting can be performed as required, and only the analysis is performed according to the preset analysis rule during the analysis, thereby solving the problem of poor flexibility caused by the fixed association between the existing load and the control module, and achieving the technical effect of flexibly configuring the port configuration and the control module type.

Drawings

The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the invention and, together with the description, serve to explain the invention and not to limit the invention. In the drawings:

FIG. 1 is a flow chart of a method of configuration information parsing in accordance with an embodiment of the present invention;

FIG. 2 is a schematic diagram of controller communications according to an embodiment of the present invention;

FIG. 3 is a schematic flow chart illustrating a configuration of a load according to an embodiment of the present invention;

FIG. 4 is a flow diagram of an example method of configuration information parsing according to an embodiment of the invention;

fig. 5 is a block diagram of a configuration information parsing apparatus according to an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the following embodiments and accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.

In order to realize flexible configuration of the ports and the modules, a set of configuration rules of configuration information can be set, then, one configuration information is configured for each load, and the configuration of the ports and the loads can be completed in one step by analyzing the configuration information.

For example, each load may carry 16 bits of interface configuration information according to the following configuration rules:

1) a 16-bit configuration message is defined, wherein the upper 8 bits consist of the module serial number and the lower 8 bits consist of the channel position.

Wherein, the high 8 bits: the serial number of the main module is 0, the serial number of the expansion module 1 is 1, and the serial numbers are sequentially increased according to the sequence of the expansion modules. The lower 8 bits: high 3 bits are signal type, 0: NC, 1: input, 2: AO, 3: and DO, the lower 5 bits are the positions of the modules, and the modules are sequentially sequenced according to the positions of the channels of the modules.

2) And (3) sequencing rules:

AI can be arranged in X channel and AI channel, AO can only be arranged in AO channel, DO can only be arranged in DO channel, DI can be arranged in X channel and DI channel.

The first controller inputs are ordered from 1 as X1... X (m1), DI1.. DI (n1), i.e., X1 is numbered 1, DI (n1) is numbered m1+ n 1; the second controller input is sorted from 1 by X1... X (m2), DI1.. DI (n2), AI1.. AI (j2), i.e., X1 is numbered 1 and AI (j2) is numbered m2+ n2+ j 2. AO, DO is according to its serial number sequencing, and first controller AO1 serial number is 1, AO (i1) serial number is i1, and second controller AO1 serial number is 1, AO (i2) serial number is i1. The first controller DO1 has serial number 1, DO (l1) has serial number l1, the second controller DO1 has serial number 1, and DO (l2) has serial number l 2.

Based on this, in this example, a configuration information parsing method is provided, as shown in fig. 1, which may include the following steps:

step 101: receiving configuration information of a load;

step 102: acquiring a first message part and a second message part from the configuration information;

step 103: analyzing the port type and the port position from the first message part;

step 104: and analyzing the number of the extension modules from the second message part, and determining the module type of the control module associated with the configuration information.

Specifically, the lower eight bits of the configuration information may be used as the first message part, and the upper eight bits of the configuration information may be used as the second message part.

Accordingly, parsing out port type and port location from the first message portion may include: determining the port type according to the upper three bits of the first message part; and determining the position of the port according to the lower five bits of the first message part. Analyzing the number of extension modules from the second message part, and determining the module type of the control module associated with the configuration information may include: converting the upper eight bits of the configuration information into a numerical value; determining that the control module associated with the configuration information is a main module when the numerical value is 0, and determining that the control module associated with the configuration information is an expansion module when the numerical value is not 0; and taking the maximum numerical value of the numerical values converted from the high eight bits in the configuration message of each load in the configuration messages of the plurality of loads as the number of the extension modules.

That is, the serial number of the main module in the high 8 bits is 0, the serial number of the expansion module 1 is 1, and the serial numbers are sequentially increased according to the sequence of the expansion modules, so that whether the associated module belongs to the main module or the expansion module can be represented by the high 8 bits, and when an expansion module needs to be newly added, the module can be represented by the high 8 bits directly.

In implementation, after the number of the extension modules is analyzed from the second message part and the module type of the control module associated with the configuration information is determined, the port information is directly processed by the main module under the condition that the control module associated with the configuration information is determined to be the main module; and under the condition that the control module associated with the configuration information is determined to be an expansion module, sending the port information to the associated expansion module for processing through the determined port position.

The above method is described below with reference to a specific example, however, it should be noted that the specific example is only for better describing the present application and is not to be construed as limiting the present application.

In this example, two types of controllers are provided, different from the existing way of fixing the main module and the expansion module, the main module of the controller provided in this example may be used as the expansion module, and the expansion module may be used as the main module, as shown in fig. 2, the expansion module is used as an extension of an IO port of the main module, and one main module may carry several expansion modules.

As shown in fig. 3, a plurality of loads (load 1, load 2, load 3 …, load n) exist in the system, and port configuration and load location assignment can be realized by analyzing load information configured as a load.

The existing port configuration method generally includes configuring information of each port of hardware, and then distributing loads to the configured ports as required, in this example, a manner of combining the steps of configuring the ports and selecting the port positions by the loads is provided, that is, each load which may appear carries selectable port information, when the load is selected, the load information is possessed, so that the configuration of each port of the hardware can be completed, and the position selection of the load can be completed.

Specifically, in this example, two configurable controller interface configuration rules are provided, and the two controllers can be used as not only the main module but also the expansion module, respectively.

The first controller is provided with 4 port types, X terminal, DI terminal, DO terminal and AO terminal, assuming that the controller has m 1X terminals, n1 DI terminals, l1 DO terminals, i1 AO terminals, respectively;

the second controller is provided with 5 interface types, X terminal, AI terminal, DI terminal, DO terminal and AO terminal, assuming that the controller has m 2X terminals, n2 DI terminals, l2 DO terminals, i2 AO terminals, j2 AI terminals, respectively. The X terminal, DI terminal, and AI terminal are combined into one type, and written as an input, as shown in table 1 below:

TABLE 1

Terminal type/controller type X terminal DI terminal DO terminal AO terminal AI terminal
First kind of controller m1 n1 l1 i1 /
Second controller m2 n2 l2 i2 j2

The configuration rules are as follows:

1) a 16-bit configuration message is defined, wherein the upper 8 bits consist of the module serial number and the lower 8 bits consist of the channel position.

Wherein, the high 8 bits: the serial number of the main module is 0, the serial number of the expansion module 1 is 1, and the serial numbers are sequentially increased according to the sequence of the expansion modules. The lower 8 bits: high 3 bits are signal type, 0: NC, 1: input, 2: AO, 3: and DO, the lower 5 bits are the positions of the modules, and the modules are sequentially sequenced according to the positions of the channels of the modules.

2) And (3) sequencing rules:

AI can be arranged in X channel and AI channel, AO can only be arranged in AO channel, DO can only be arranged in DO channel, DI can be arranged in X channel and DI channel.

The first controller inputs are ordered from 1 as X1... X (m1), DI1.. DI (n1), i.e., X1 is numbered 1, DI (n1) is numbered m1+ n 1; the second controller input is sorted from 1 by X1... X (m2), DI1.. DI (n2), AI1.. AI (j2), i.e., X1 is numbered 1 and AI (j2) is numbered m2+ n2+ j 2. AO, DO is according to its serial number sequencing, and first controller AO1 serial number is 1, AO (i1) serial number is i1, and second controller AO1 serial number is 1, AO (i2) serial number is i1. The first controller DO1 has serial number 1, DO (l1) has serial number l1, the second controller DO1 has serial number 1, and DO (l2) has serial number l 2.

3) Each load carries 16-bit interface configuration information, besides, the AI/AO type interface also fixedly carries 16-bit signal type information, a 16-bit engineering quantity lower limit value, 16-bit engineering quantity lower limit value and other configuration information, and if no configuration exists, the information is 0.

Based on the above configuration rules, port configuration may be performed according to the flow shown in fig. 4:

s1: the upper computer sends the 16-bit configuration information of the load to the main module for unified reception;

s2: analyzing the low eight-bit information, and dividing the information into high three bits and low five bits;

s3: analyzing the high three bits to obtain the port type, and connecting and disconnecting the low five bits to obtain the port position;

s4: analyzing the eight high bits, acquiring the number of the expansion modules, and dividing the configuration information into a main module and an expansion module;

s5: and under the condition that the configuration information is the main module, directly processing the port information, and under the condition that the configuration information is newly an expansion module, sending the low five-bit communication to the expansion module for processing.

In the above example, two types of controllers are provided, and both the two types of controllers can be used as a main module or an expansion module by configuring information, so that the types and the number of ports can be configured more flexibly, and the configuration of the ports and the load can be completed in one step by setting information represented by different bits of the configuration information, so that the configuration is more flexible, the configuration method is simpler, and the number of variable hardware ports can be compatible.

Based on the same inventive concept, the embodiment of the present invention further provides a device for analyzing configuration information, as described in the following embodiments. Because the principle of the configuration information analysis device for solving the problem is similar to that of the configuration information analysis method, the implementation of the configuration information analysis device can refer to the implementation of the configuration information analysis method, and repeated parts are not described again. As used hereinafter, the term "unit" or "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated. Fig. 5 is a block diagram of a configuration information analysis apparatus according to an embodiment of the present invention, and as shown in fig. 5, the configuration information analysis apparatus may include: the receiving module 501, the obtaining module 502, the first analyzing module 503, and the second analyzing module 504, and the structure thereof will be described below.

A receiving module 501, configured to receive configuration information of a load;

an obtaining module 502, configured to obtain a first message part and a second message part from the configuration information;

a first parsing module 503, configured to parse the port type and the port location from the first message part;

a second parsing module 504, configured to parse the number of extension modules from the second message part, and determine a module type of the control module associated with the configuration information.

In an embodiment, the obtaining module 502 may be specifically configured to use the lower eight bits of the configuration information as the first message part, and use the upper eight bits of the configuration information as the second message part.

In one embodiment, the first parsing module 503 may include: a first determining unit, configured to determine a port type according to the upper three bits of the first message part; and the second determining unit is used for determining the position of the port according to the lower five bits of the first message part.

In an embodiment, the second parsing module 504 may be specifically configured to convert the upper eight bits of the configuration information into a numerical value; determining that the control module associated with the configuration information is a main module when the numerical value is 0, and determining that the control module associated with the configuration information is an expansion module when the numerical value is not 0; and taking the maximum numerical value of the numerical values converted from the high eight bits in the configuration message of each load in the configuration messages of the plurality of loads as the number of the extension modules.

In an embodiment, the configuration information parsing device may be further configured to, after parsing the number of extension modules from the second message part and determining a module type of a control module associated with the configuration information, directly process, by the master module, the port information if the control module associated with the configuration information is determined to be the master module; and under the condition that the control module associated with the configuration information is determined to be an expansion module, sending the port information to the associated expansion module for processing through the determined port position.

In another embodiment, a software is provided, which is used to execute the technical solutions described in the above embodiments and preferred embodiments.

In another embodiment, a storage medium is provided, in which the software is stored, and the storage medium includes but is not limited to: optical disks, floppy disks, hard disks, erasable memory, etc.

From the above description, it can be seen that the embodiments of the present invention achieve the following technical effects: the port type, the port position, the module type of the associated control module and other information are identified through the data at different positions in the configuration information, so that flexible port configuration and control module type setting can be carried out according to requirements, and only the analysis is carried out according to the preset analysis rule in the analysis process, thereby solving the problem of poor flexibility caused by the fixed association of the existing load and the control module, and achieving the technical effect of flexibly configuring the port configuration and the control module type.

Although various specific embodiments are mentioned in the disclosure of the present application, the present application is not limited to the cases described in the industry standards or the examples, and the like, and some industry standards or the embodiments slightly modified based on the implementation described in the custom manner or the examples can also achieve the same, equivalent or similar, or the expected implementation effects after the modifications. Embodiments employing such modified or transformed data acquisition, processing, output, determination, etc., may still fall within the scope of alternative embodiments of the present application.

Although the present application provides method steps as described in an embodiment or flowchart, more or fewer steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an apparatus or client product in practice executes, it may execute sequentially or in parallel (e.g., in a parallel processor or multithreaded processing environment, or even in a distributed data processing environment) according to the embodiments or methods shown in the figures. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the presence of additional identical or equivalent elements in a process, method, article, or apparatus that comprises the recited elements is not excluded.

The devices or modules and the like explained in the above embodiments may be specifically implemented by a computer chip or an entity, or implemented by a product with certain functions. For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, in implementing the present application, the functions of each module may be implemented in one or more pieces of software and/or hardware, or a module that implements the same function may be implemented by a combination of a plurality of sub-modules, and the like. The above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and other divisions may be realized in practice, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed.

Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may therefore be considered as a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.

The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.

From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, or the like, and includes several instructions for enabling a computer device (which may be a personal computer, a mobile terminal, a server, or a network device) to execute the method according to the embodiments or some parts of the embodiments of the present application.

The embodiments in the present specification are described in a progressive manner, and the same or similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.

While the present application has been described by way of examples, those of ordinary skill in the art will appreciate that there are numerous variations and permutations of the present application that do not depart from the spirit of the present application and that the appended embodiments are intended to include such variations and permutations without departing from the present application.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种控制硬盘背板LED的方法和设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!