Search

CN-116263670-B - Sensor assembly service packaging method and sensor

CN116263670BCN 116263670 BCN116263670 BCN 116263670BCN-116263670-B

Abstract

The sensor assembly service packaging method and the sensor comprise the following steps of constructing a target sensor module, wherein the target sensor module comprises a plurality of sub-function modules, connecting the target sensor module to a dynamic library, constructing a dynamic link relation between functions in the dynamic library and I/O interfaces of the sub-function modules, packaging an application program interface of the target sensor module after the dynamic link relation is generated in a Restful style to obtain the packaged target sensor module, and creating the sensor function block by using a basic function block in a way of linking an external library, so that the development difficulty of the function block is greatly reduced, the universality of the sensor function block is improved, the resource utilization of a sensor is reasonably optimized, and in addition, the scheme realizes the access to an output result and simultaneously changes the parameters of the function block by changing an API in a component service mode, so that different sensor functions and working modes are realized, and the sensor assembly service packaging method can be widely applied to the technical field of sensors.

Inventors

  • WANG TAO
  • ZHA YUNLONG
  • CHENG LIANGLUN

Assignees

  • 广东工业大学
  • 广东能哥知识科技有限公司

Dates

Publication Date
20260508
Application Date
20230215

Claims (6)

  1. 1. A method of service packaging a sensor assembly, comprising the steps of: constructing a target sensor module, wherein the target sensor module comprises a plurality of sub-function modules; Connecting to a dynamic library, and constructing a dynamic link relation between functions in the dynamic library and the I/O interfaces of the sub-functional modules; Carrying out Restful style packaging on an application program interface of the target sensor module after the dynamic link relation is generated to obtain a packaged target sensor module; The working modes of the target sensor module comprise at least one of a difference-based working mode, a time-based working mode, an automatic working mode and a default working mode; The sub-functional module comprises a selection functional block, a sensor integration functional block, an output functional block, an event circulation functional block and an event merging functional block; Simultaneously using a difference-based operation mode and a time-based operation mode in the automatic operation mode; The method further comprises the steps of: When the working mode is a working mode based on a difference value, the target sensor module outputs a first difference value between a first measured value at the current moment and a second measured value at the previous moment, or outputs a second difference value between the first measured value at the current moment and a first preset value; triggering an automatic working mode when the second difference value falls within a preset threshold range; Determining that the working mode is an automatic working mode, and outputting a fourth measured value by the target sensor according to a preset second time frequency, wherein a third difference value between the fourth measured value and the first preset value is kept within the threshold range; The method further comprises the steps of: Acquiring working mode parameters, and outputting a target event by the selection functional block according to the working mode parameters; starting a working mode corresponding to the working mode parameter according to the target event; And acquiring sensor class parameters, and loading the sensor integrated functional block into a sensor function implementation logic according to the sensor class parameters.
  2. 2. The method of claim 1, further comprising outputting a third measurement by the target sensor module based on a predetermined first time frequency when the operating mode is a time-based operating mode.
  3. 3. A method of servicing a sensor assembly according to claim 1, characterized in that the method further comprises: And acquiring a time frequency parameter, and circularly executing the target event by the event circulation functional block according to the time frequency parameter.
  4. 4. The method for service packaging a sensor assembly according to claim 1, wherein the step of performing Restful style packaging on the application program interface of the target sensor module after the dynamic link relation is generated to obtain a packaged target sensor module comprises: defining a request message and a response message of the application program interface according to a target management command; And carrying out data acquisition and service reconfiguration of the Restful service through the defined application program interface.
  5. 5. The method of claim 4, wherein the request message includes a synchronous request and an asynchronous request, and wherein when the request message is an asynchronous request, the defining the request message and the response message of the application program interface according to the target management command includes: And identifying a plurality of asynchronous requests with the same element through a parameter identifier, wherein the elements in the asynchronous requests comprise at least one of a device name, a resource name, an application program name, a function block instance name and a variable name.
  6. 6. A sensor realized by the sensor assembly service encapsulation method according to any one of claims 1 to 5, comprising: The selection function block is used for acquiring working mode parameters, outputting a target event according to the working mode parameters, and starting a working mode corresponding to the working mode parameters according to the target event; the sensor integrated functional block is used for acquiring sensor category parameters and loading sensor function realization logic according to the sensor category parameters; The output functional block is used for processing the sensor output according to the working mode parameters; The event circulation function block is used for acquiring time frequency parameters and circularly executing the target event according to the time frequency parameters; and the event merging function block is used for triggering at least one input event in the two input events to generate event output.

Description

Sensor assembly service packaging method and sensor Technical Field The invention relates to the technical field of sensors, in particular to a sensor assembly service packaging method and a sensor. Background At present, the physical scale and the function of manufacturing factories are continuously increased, and the calculation capability provided by the PLC cannot meet the requirement. Controlling such an automated system with a central PLC is often not feasible. In contrast, better performance can be achieved if the control logic is distributed over multiple PLCs that cooperate with each other. However, the architecture of the IEC 61131-3 standard is not suitable for distributed system architectures. To address the deficiencies of IEC 61131-3, another international standard, IEC 61499, was published in 2005 and revised in 2012 to assist in the development of distributed automation systems. The difference between the protocols of these two industries is the nature of the communications they need to support. On the internet, stateless communication plays a more important role, as communication is mostly short lived and less predictable than in a limited industrial environment. However, this technical gap of the internet of things core can be overcome. We show that OPC UA can support popular RESTful web service styles by simple extensions to the standard, which is the basis of many popular web technologies. In a related art scenario, a case study of an airport baggage handling system based on component architecture and IEC61499 standards is provided. The solution has a software component type for each device, such as a carousel, that is extracted from the library and instantiated. The scheme utilizes the standard based on the component architecture and IEC61499, but the hardware and the software components are bound, one hardware facility corresponds to one software component type, so that the application of a specific functional block to the specific hardware is realized, the universality of the functional block is reduced to a certain extent, meanwhile, one functional block can only represent one sensor, and a plurality of sensor functional blocks exist in the huge engineering, so that the component composition is extremely complex, and the readability is poor. In another related solution, a component-based distributed control software framework is proposed, which also uses the IEC61499 standard. The framework proposes new software components, called automation components, which can be embedded hierarchically to generate new components. By encapsulating the multi-layer automation component, a hierarchical structure of the system is presented. The framework is independent of the execution platform due to compliance with IEC61499, but it demonstrates how applications developed using the framework can be executed using the IEC61499 platform. The scheme can better realize the development of distributed control software based on components, the sensor module can only execute the function of inquiring the hardware state, certain operation can not be carried out on the IO port of the sensor module, and the state of the sensor module needs to be controlled through the control function block. Disclosure of Invention In view of the above, based on the technical problems or drawbacks mentioned in the background art, an object of an embodiment of the present invention is to provide a sensor component service packaging method and a sensor, so as to reduce the difficulty in developing components in a control process control system, and improve the reusability of the components and the utilization rate of embedded resources. In one aspect, the present application provides a method for service packaging a sensor assembly, including the following steps: constructing a target sensor module, wherein the target sensor module comprises a plurality of sub-function modules; Connecting to a dynamic library, and constructing a dynamic link relation between functions in the dynamic library and the I/O interfaces of the sub-functional modules; Carrying out Restful style packaging on an application program interface of the target sensor module after the dynamic link relation is generated to obtain a packaged target sensor module; The working modes of the target sensor module comprise at least one of a difference-based working mode, a time-based working mode, an automatic working mode and a default working mode; The sub-functional modules comprise a selection functional block, a sensor integration functional block, an output functional block, an event circulation functional block and an event merging functional block. In a possible embodiment of the present application, the method further includes outputting, by the target sensor module, a first difference between a first measurement value at a current time and a second measurement value at a previous time, or outputting a second difference between the first measurement value at th