CN116939398A - Internet of things equipment control method, system, device, electronic equipment and storage medium - Google Patents

Internet of things equipment control method, system, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116939398A
CN116939398A CN202210374968.5A CN202210374968A CN116939398A CN 116939398 A CN116939398 A CN 116939398A CN 202210374968 A CN202210374968 A CN 202210374968A CN 116939398 A CN116939398 A CN 116939398A
Authority
CN
China
Prior art keywords
equipment
simulation
attribute
target
strategy
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210374968.5A
Other languages
Chinese (zh)
Inventor
于洪达
杜洪军
纪高
王怀亮
郑海涛
李世野
李国旗
袁浩
范琳翊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BOE Technology Group Co Ltd
Original Assignee
BOE Technology Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BOE Technology Group Co Ltd filed Critical BOE Technology Group Co Ltd
Priority to CN202210374968.5A priority Critical patent/CN116939398A/en
Publication of CN116939398A publication Critical patent/CN116939398A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q9/00Arrangements in telecontrol or telemetry systems for selectively calling a substation from a main station, in which substation desired apparatus is selected for applying a control signal thereto or for obtaining measured values therefrom
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45508Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q2209/00Arrangements in telecontrol or telemetry systems
    • H04Q2209/70Arrangements in the main station, i.e. central controller
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Medical Informatics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The disclosure provides an Internet of things equipment control method, system, device, electronic equipment and storage medium. The method comprises the following steps: receiving a device control request, and obtaining target devices according to the device control request; the target device is created based on a simulation device set in a device simulator; and transmitting the device control request to the simulation device based on the target device to control the simulation device based on the device control request. According to the method and the device, the real Internet of things equipment is simulated through the equipment simulator, so that a large number of simulation equipment can be simulated through the equipment simulator under the condition that mass real Internet of things equipment cannot be obtained, and the simulation equipment can be of different types, so that the scenes of verification of an intelligent Internet of things scheme of an Internet of things platform, simple display of an Internet of things system and the like are met.

Description

Internet of things equipment control method, system, device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of internet of things, and in particular relates to an internet of things device control method, an internet of things device control system, electronic equipment and a storage medium.
Background
The internet of things (internet of things, ioT), i.e., the internet to which everything is connected, is a network formed by combining various sensors with the internet, and can realize interconnection and interworking of people, machines and things.
The Internet of things platform can realize the connection of mass equipment to cloud, equipment and cloud two-way message communication and the like. The mass equipment can verify the functions of the Internet of things platform, and the user can test intelligent Internet of things schemes under various service types.
However, in actual situations, users may encounter problems that it is difficult to quickly and conveniently provide a large number of connectable real devices to verify an intelligent internet of things scheme based on an internet of things platform, or the real devices want to acquire device data in advance for simple display when not developed.
Disclosure of Invention
In view of the above, the present disclosure aims to provide a method, a system, an electronic device and a storage medium for controlling an internet of things device.
Based on the above object, the present disclosure provides a control method for an internet of things device, which is characterized by comprising:
receiving a device control request, and obtaining target devices according to the device control request; the target device is created based on a simulation device set in a device simulator;
And transmitting the device control request to the simulation device based on the target device to control the simulation device based on the device control request.
Optionally, the method further comprises:
receiving a simulation device creation request, and creating the simulation device in the device simulator;
acquiring object model information of the simulation equipment, and performing equipment mapping based on the object model information of the simulation equipment to acquire target equipment;
and creating a simulated device shadow based on the target device.
Optionally, the object model information includes attributes, events and services corresponding to the simulation device, where the attributes, events and services of the simulation device are stored in the shadow of the simulation device, and at least one of the attributes, events and services corresponds to a policy.
Optionally, the method further comprises:
acquiring a plurality of simulation devices to be created according to the simulation device creation request;
generating a plurality of device numbers matching the plurality of simulated devices based on one or more of device type, region code, creation date, creation lot, lot count, start index;
and generating a first equipment number list based on the plurality of equipment numbers, and sequentially creating the simulation equipment in the equipment simulator based on the equipment numbers in the first equipment number list.
Optionally, the method further comprises: the device numbers of the plurality of analog devices are the same, and at least one of the attributes, events, and services of the plurality of analog devices are different.
Optionally, the method further comprises:
acquiring an analog device ID of the analog device;
acquiring at least one of an attribute name of the attribute, an event name of the event and a service name of the service;
the policy is created based on the simulated device ID and at least one of the attribute name, the event name, and the service name.
Optionally, the method further comprises:
in response to not obtaining the simulated device ID, creating the policy based on the device number and at least one of the attribute name, the event name, and the service name;
in response to not obtaining the simulated device ID and the device number, obtaining a device type of the simulated device, creating the policy based on the device type and at least one of the attribute name, the event name, and the service name.
Optionally, the method further comprises:
receiving an equipment online request of the simulation equipment, and acquiring the equipment number of the simulation equipment based on the equipment online request;
Acquiring equipment information of the target equipment corresponding to the simulation equipment based on the equipment number;
initializing the shadow of the simulation equipment and restoring a strategy corresponding to the target equipment based on the equipment information of the target equipment;
establishing a connection between the target device and the analog device;
and updating the device information of the target device based on the simulation value of the attribute of the simulation device.
Optionally, the method further comprises:
acquiring a plurality of simulation devices to be online according to the device online request of the simulation device;
generating a plurality of device numbers matching the plurality of simulated devices based on one or more of device type, region code, creation date, creation lot, lot count, start index;
and generating a second equipment number list based on the plurality of equipment numbers, and sequentially acquiring the equipment information of the target equipment corresponding to the simulation equipment based on the equipment numbers in the second equipment number list so as to initialize the shadow of the simulation equipment and restore the strategy corresponding to the target equipment based on the equipment information of the target equipment.
Optionally, the initializing the simulated device shadow includes: a fixed initial value is assigned to at least one of the attribute, event, and service based on a fixed value policy.
The fixed value-based policy assigns a fixed initial value to at least one of an attribute, an event, and a service, including at least one of:
acquiring a simulation equipment ID of the simulation equipment, and searching a first fixed value strategy based on at least one of the attribute name, the event name and the service name and the simulation equipment ID so as to endow an initial value for the shadow of the simulation equipment according to the first fixed value strategy;
in response to not obtaining the simulation device ID of the simulation device, searching a second fixed value strategy based on the device number and at least one of the attribute name, the event name and the service name, so as to endow an initial value for the simulation device shadow according to the second fixed value strategy;
and searching a third fixed value strategy based on at least one of the attribute name, the event name and the service name and the equipment type in response to the fact that the simulated equipment ID and the equipment number of the simulated equipment are not acquired, so as to endow the shadow of the simulated equipment with an initial value according to the third fixed value strategy.
Optionally, the method further comprises:
receiving an attribute updating request, and acquiring the simulation equipment to be updated;
Changing a strategy corresponding to the simulation equipment in response to the strategy type change of the simulation equipment to be updated;
responding to the strategy starting state change of the simulation equipment to be updated, and changing the strategy state corresponding to the simulation equipment;
and changing the strategy updating time corresponding to the simulation equipment in response to the strategy updating time change of the simulation equipment to be updated.
Optionally, the simulation device includes a first simulation device and a second simulation device, and the method further includes:
the method comprises the steps that a first simulation device receives a device attribute expected value setting request, and the attribute of the first simulation device is updated based on the device attribute expected value setting request;
updating a simulation device shadow corresponding to the first simulation device based on the updated attribute of the first simulation device;
based on the updated shadow of the simulation device, acquiring first rule information corresponding to the first simulation device in a rule engine and controlling the first simulation device based on the first rule information;
acquiring a second simulation device associated with the first simulation device based on the first rule;
and acquiring second rule information corresponding to second simulation equipment, and controlling the second simulation equipment based on the second rule information.
Optionally, the method further comprises:
receiving a device offline request of the simulation device, and acquiring a simulation device ID of the simulation device based on the device offline request;
and updating the equipment state of the simulation equipment based on the simulation equipment ID, and disconnecting the connection between the target equipment and the simulation equipment.
The present disclosure also provides an internet of things device control system, comprising:
a device simulator for creating a simulated device;
the device management unit is used for receiving a device control request and obtaining target devices according to the device control request; and transmitting the device control request to the simulation device based on the target device to control the simulation device based on the device control request.
Optionally, the method further comprises:
the equipment shadow unit is used for acquiring the object model information of the simulation equipment in the equipment simulator and sending the object model information to the equipment management unit; creating a simulated device shadow based on the target device in the device management unit;
the device management unit is further configured to perform device mapping based on object model information of the simulation device, and obtain the target device.
The present disclosure also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a method as claimed in any one of the preceding claims when executing the program.
The present disclosure also provides a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform any of the methods described above.
From the above, it can be seen that the control method, system, electronic device and storage medium for the internet of things device provided by the present disclosure simulate real internet of things devices through the device simulator, so that a large number of simulation devices can be simulated through the device simulator under the condition that a large number of real internet of things devices cannot be obtained, and the simulation devices can be of different types, so that the scenes of verification of an intelligent internet of things scheme of an internet of things platform, simple display of an internet of things system and the like are satisfied.
Drawings
In order to more clearly illustrate the technical solutions of the present disclosure or related art, the drawings required for the embodiments or related art description will be briefly described below, and it is apparent that the drawings in the following description are only embodiments of the present disclosure, and other drawings may be obtained according to these drawings without inventive effort to those of ordinary skill in the art.
Fig. 1 is a schematic structural diagram of an internet of things system;
fig. 2 is a schematic structural diagram of an internet of things system according to an embodiment of the disclosure;
fig. 3 is a schematic structural diagram of an internet of things platform according to an embodiment of the disclosure;
fig. 4 is a schematic flow chart of a control method of an internet of things device according to an embodiment of the disclosure;
FIG. 5 is a flow chart of a method for creating a simulation device according to an embodiment of the present disclosure;
FIG. 6a is a schematic illustration of an object model of a simulation device according to an embodiment of the present disclosure;
FIG. 6b is a schematic diagram of one embodiment of an object model of a simulation device according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of an online flow of a second class of simulation devices according to an embodiment of the disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
For the purposes of promoting an understanding of the principles and advantages of the disclosure, reference will now be made to the embodiments illustrated in the drawings and specific language will be used to describe the same.
It should be noted that unless otherwise defined, technical or scientific terms used in the embodiments of the present disclosure should be given the ordinary meaning as understood by one of ordinary skill in the art to which the present disclosure pertains. The terms "first," "second," and the like, as used in embodiments of the present disclosure, do not denote any order, quantity, or importance, but rather are used to distinguish one element from another. The word "comprising" or "comprises", and the like, means that elements or items preceding the word are included in the element or item listed after the word and equivalents thereof, but does not exclude other elements or items. The terms "connected" or "connected," and the like, are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", etc. are used merely to indicate relative positional relationships, which may also be changed when the absolute position of the object to be described is changed.
Fig. 1 shows a schematic diagram of an exemplary internet of things system architecture.
Referring to fig. 1, the internet of things system includes an internet of things platform, an internet of things device, and a message server for realizing connection between the internet of things platform and the internet of things device. In the system, the Internet of things platform can realize the connection of mass Internet of things equipment to the cloud, the two-way message communication between the Internet of things equipment and the cloud, the intelligent linkage of the Internet of things equipment and the like. Mass intelligent devices hosted on the internet of things platform can generate mass device data including but not limited to device online state, device attribute change, device service call, device event reporting, rule linkage and the like, all the data are not isolated, time elements are combined to form time sequence data, and powerful support can be provided for follow-up trend change pre-judgment. The mass internet of things equipment can verify basic functions, bearing capacity, stability, fault tolerance, throughput performance and intelligence of the internet of things platform, and a user can test intelligent internet of things schemes under various service types, for example, in a smart city, an intelligent lamp post controller controls automatic switching of a street lamp.
However, users can encounter the problems that a large number of connectable real and internet of things devices are difficult to provide quickly and conveniently to verify an intelligent internet of things scheme based on an internet of things platform, or the real devices want to acquire device data in advance for simple display when not developed.
In view of the above, the present disclosure provides a control method for an internet of things device, which simulates a real internet of things device through a device simulator and realizes communication connection with a device management unit of an internet of things platform, thereby solving a mass device source problem.
Fig. 2 shows a schematic diagram of an exemplary internet of things system 100 architecture according to an embodiment of the present disclosure.
As shown in fig. 2, the internet of things system 100 includes an internet of things platform 200 and a server 400. The internet of things platform 200 is implemented based on cloud computing technology, and provides capabilities such as multi-protocol/multi-class device access capability, device full life cycle management, device monitoring, unified device model/device shadow, data processing analysis and the like.
The internet of things platform 200 includes a device simulator 220 and a device management unit 210. The device simulator 220 may simulate devices of various device types, where the device types include information of type numbers, names, networking types, networking protocols, authentication modes, type descriptions, and the like. The simulation device created through the device simulator 220 may be connected to the internet of things platform 200 through the device management unit 210 and has the capability of a real device, which does not appear to be different from the real device in the internet of things platform.
The device management unit 210 includes a plurality of target devices, and each real device or analog device forms a target device in the device management unit 210 after the internet of things platform 200 is registered. When the real device or the analog device maintains a communication connection with the target device through the server 400, the real device or the analog device maintains consistency with the device information of the corresponding target device.
In some embodiments, the internet of things platform 200 may employ a micro-service architecture, where the device simulator 220 and the device management unit 210 are micro-services mounted on the internet of things platform 200. As shown in fig. 3, the internet of things platform 200 may include one server cluster, and may further include a Load balancer (Load Balance) 202, an API server 204, an RPC server 206, and a plurality of micro-service clusters (e.g., micro-service clusters 2082, 2084, 2086). In some scenarios, server 200 may also include a central gateway 210. Load balancer 202 may distribute traffic requests 302 from clients 300 according to load balancing rules. API server 204, i.e., an Application Programming Interface (API) server. The API server 204 may be implemented as an API gateway and may have gateway functionality, and traffic-independent functions (e.g., routing, authentication, throttling security, etc.) may be handled in the API server 204. The RPC server 206 may invoke micro services in the micro service clusters 2082-2086 based on Remote Procedure Call (RPC) means. The micro service clusters 2082 to 2086 may include a plurality of micro services, for example, the device simulator 220 and the device management unit 210 are disposed in the same micro service cluster in a micro service structure. One micro service cluster may correspond to one tenant (tenant) or multiple tenants, and different tenants may also correspond to multiple micro service clusters, so for one tenant, its business requirements may require invoking multiple micro services of the same micro service cluster or across micro service clusters. Invocation may be accomplished by the RPC server 206 between micro services of the same micro service cluster or between micro services across micro service clusters. In the micro service architecture 100, the number of the load balancer 202, the API server 204, and the RPC server 206 may be plural, and the specific number may be set according to the actual requirement, and fig. 3 is only schematically shown for simplicity.
The internet of things system 100 may further include a client 300 connected to the internet of things platform 200, and a service request may be sent to the internet of things platform 200 through the client 300. When a client 300 initiates a service request 302, the load balancer 202 may distribute the service request 302 to a corresponding API server (e.g., API server 204) according to the rules of load balancing. After receiving the service request 302 allocated by the load balancer 202, the API server 204 may authenticate the service request 302 and inject a traffic id 304 into the traffic corresponding to the service request 302 based on the service request 302, and then pass the traffic corresponding to the service request 302 and the id 304 downstream, e.g., to the corresponding RPC server 206. The RPC server 206 may determine the corresponding target micro service according to the identity 304, then transfer the traffic with the identity 304 to the target micro service, and then implement the function corresponding to the service request 302 through each micro service.
In this embodiment, the service request 302 may be a device control request for a certain analog device, and implement control of the corresponding analog device based on the device control request. As shown in fig. 4, the method for controlling the internet of things device includes:
Step S101, receiving a device control request, and obtaining target devices according to the device control request; the target device is created based on a simulation device provided in a device simulator.
When the internet of things platform 200 receives the device control request, the internet of things platform 200 obtains a target device according to the device control request; the target device is created based on the simulation device set in the device simulator, that is, the target device is a device body formed in the device management unit 210 after the simulation device is registered in the internet of things platform 200.
The simulation device obtained by simulating the internet of things device through the device simulator may include a plurality of different types, so as to meet the requirement of the internet of things platform 200 on the internet of things device.
Step S102, based on the target device, of transmitting the device control request to the simulation device to control the simulation device based on the device control request.
The internet of things platform 200 transmits the device control request to the simulation device through the server 400 based on the target device to control the simulation device based on the device control request.
In this embodiment, the device simulator simulates the real internet of things device, so that a large number of simulation devices can be simulated by the device simulator under the condition that a large number of real internet of things devices cannot be obtained, and the simulation devices can be of different types, so that the scenes of verification of an intelligent internet of things scheme of an internet of things platform, simple display of an internet of things system and the like are satisfied.
In some embodiments, it may be desirable to create the analog device prior to implementing control of the analog device. As shown in fig. 5, the creation process of the simulation device includes:
step S201, receiving a simulation device creation request, and creating the simulation device in the device simulator.
In this embodiment, the device simulator is a single micro-service unit in the internet of things platform 200, which includes svc.apigw, svc.devsilmulator, where svc.apigw is used to implement interface route management between the device simulator and other micro-services; the svc.devsilmulator is used for realizing simulator management and strategy management, namely unified management of attribute strategies and event strategies.
In this embodiment, the device simulator microservice of the internet of things platform 200 provides a visual page for simulating device creation, and creation of a simulated device can be achieved through operations on the visual page. In creating the simulated device, a registered device may be selected to create the simulated device. The information of the device type (category) of the simulation device comes from the data table of the device, and a custom device name (deviceName) can be input to identify a simulation device. The simulation device data of successful creation is stored in a simulation device table (simulator_device), which includes a simulation device ID (deviceId), a device type, an attribute, and the like.
In other embodiments, the device simulator microservice may also provide a command operation window to facilitate direct instruction interaction with the service by a developer for rapid verification purposes.
In the above embodiment, a plurality of simulation devices may be created based on the same device number (sn), each having different attribute values, policies, and the like, so that different states of the devices may be simulated. But only one analog device of the same device number can be wired at the same time.
Step S202, object model information of the simulation equipment is obtained, equipment mapping is conducted based on the object model information of the simulation equipment, and target equipment is obtained.
In this embodiment, after the device simulator creates the simulation device, the internet of things platform 200 may acquire the object model of the simulation device through the device shadow unit thereof, and perform device mapping in the device management unit based on the object model of the simulation device, so as to create the target device corresponding to the simulation device. Wherein the analog device and the target device may be associated with a device number.
The object model information of the simulation device is used to define the type capability of the simulation device, as shown in fig. 6a, and includes attributes, events and services thereof, and at least one of the attributes, events and services corresponds to one policy.
Properties (properties) are used to describe the specific information and state of the simulation device at runtime. For example, the current ambient temperature, intelligent light switch status, electric fan wind level, etc., as read by the environmental monitoring device. Each attribute is associated with a piece of policy information.
The analog value of each attribute may be maintained, may be changed manually or automatically. The simulation value is only a local value of simulation equipment, can change in real time in the equipment simulator, and can update the value of the equipment shadow in the equipment shadow unit in real time; however, the cloud end is not affected, and the value of the target device in the cloud end, namely the device management unit, is affected after the cloud end is reported.
When the analog value of the attribute is manually updated, the analog value can be directly modified, then the shadow of the analog device is updated, and the analog value is immediately reported. The simulation value of the attribute is automatically updated by editing a strategy, and the intelligent equipment simulator updates the simulation value according to the strategy to update the starting state; when the updating is started and opened, the simulation value changes along with the strategy in real time; when the update starts and closes, the strategy is not effective, and the analog value is not changed.
In this embodiment, the simulated values of the attributes may be reported according to reporting rules defined by the object model (e.g., loop reporting, on-demand reporting, interval reporting, etc.). And when the strategy is updated, the simulation value of the attribute is controlled within the object model definition value range, such as offset, scaling and the like, and an abnormal value can be added to the array randomly and the like to simulate abnormal reporting.
Events (events) are used to actively report information to the cloud when the analog device is running, and generally include information, alarms and faults that need to be perceived and processed externally. The event may include a plurality of output parameters. For example, notification information after a certain task is completed; temperature and time information when equipment fails; the operating state of the device when the device alarms, etc. Events may be subscribed to and pushed. The editing of the strategy can be realized through the event, and the event is reported according to the event interval.
Service refers to an instruction or method that simulates a device for external invocation. Input and output parameters may be set in the service call. The input parameters are parameters at the time of service execution, and the output parameters are results after service execution. In contrast to attributes, a service may implement more complex business logic, such as performing a particular task, through one instruction. Services are divided into asynchronous and synchronous call modes. The modification of the analog output parameters of the analog device through the internet of things platform can be realized based on the service, and the analog output parameters modified based on the service are not related to the change of the attribute analog values involved in the modification event.
In this embodiment, the attribute policy and the event policy are maintained together. Each attribute analog value for each analog device needs to be refreshed on a strategic and timed basis. One executor for each attribute, the executor binds the policy and the policy metadata, and the metadata is updated according to the timer execution policy. A policy is indexed by deviceId and name. The Enable is used for recording whether a strategy is started or not, and when the strategy is started, a local analog value/reporting event is updated according to the strategy, and the analog value changes in real time (the front-end analog value shows real-time change); cur_value is used for recording the initial value of the current policy (attribute policy); strategy_type is used for recording the current policy type, including attribute policies (0-none, 1-offset, 2-scale, 3-range random, 4-offset random, 5-scale random, 6-array loop, 7-array random), event policies (8-event report), etc.; the strategy_json is used for recording auxiliary parameters corresponding to the current strategy type, such as 1-offset (offset value), 2-scaling (scaling factor), 3-range random (random range: x-y), 4-offset random (offset value range: x-y), 5-scaling random (scaling factor decimal place, scaling factor range: x-y), 6-array cycle (cyclic member array), 7-array random (random member array); interval is used to record the policy enforcement interval in seconds. The attribute policy is the update interval and the event policy is the reporting interval.
In this embodiment, each simulation device may include at least one attribute (e.g., including attributes a and b), at least one event (e.g., event Test and event Test 2), and at least one service (e.g., including service SwitchOn and service Test (arg)). Each attribute, event, service may be bound with a policy. For example, attribute a corresponds to policy 1 (update the analog value randomly every 30 seconds, policy enable), attribute b corresponds to policy 2 (update the analog value circularly every 60 seconds, policy disable), event test corresponds to policy 3 (report event every 30 seconds, policy disable), event test2 corresponds to policy 4 (report event every 45 seconds, policy enable), and this embodiment is not limited.
Step S203, based on the target device, creating a simulated device shadow.
And finally, the equipment shadow unit creates a simulation equipment shadow corresponding to the simulation equipment and the target equipment in the equipment shadow unit based on the information of the target equipment.
In this embodiment, the attribute, event, and service status of the simulation device are maintained in the form of the shadow of the simulation device in the memory. The device shadow unit may be a micro service unit.
In other embodiments, the simulation devices may be created in bulk. Specifically, the internet of things platform 200 may obtain a plurality of analog devices to be created according to the analog device creation request; then, the internet of things platform 200 generates a plurality of device numbers (sn) matched with the plurality of analog devices based on one or more of the information of the device type, the region code, the creation date, the creation lot, the lot count, the start index, and the like; finally, the internet of things platform 200 generates a first device number list (snList 1) based on the plurality of device numbers, sequentially creates the simulation devices in the device simulator based on the device numbers in the first device number list, acquires object model information of each simulation device, performs device mapping based on the object model information of the simulation device, obtains a target device, and creates a corresponding simulation device shadow based on the target device, thereby realizing batch creation of the simulation devices.
For example, a plurality of analog devices to be created may be imported through an interface. The device numbers (sn) may be generated in batch based on a preset rule when each analog device is imported. For example, a plurality of device numbers may be automatically generated based on one or more of information such as a device type (category), a region code (region code), a creation date (date), a creation batch (batch), a batch count (batch count), a start index (startIndex), etc., and a simulation device may be created based on the device numbers in the device number list after a device number list (snList) is generated based on the plurality of device numbers.
In this embodiment, after the simulation device is successfully created in the device simulator, the simulation device ID of the simulation device may be obtained, and at least one of the attribute name of the attribute, the event name of the event, and the service name of the service may be obtained; thereafter, the policy is created based on the simulated device ID and at least one of the attribute name, the event name, and the service name.
In the above-described embodiment, when an analog device is created based on a device number, since the device number already exists, an analog device associated with the device can be created based on the device number, and an analog device ID of the analog device can be obtained. As shown in FIG. 6b, since the Device number SN-001 already exists, it is possible to create the analog Device 001 (analog Device ID: device Id-001) and the analog Device 002 (analog Device ID: device Id-002) associated with the Device number based on the Device number SN-001.
Taking the attribute of the simulation Device 001 as an example, since each attribute of the simulation Device 001 can be stored in the form of an attribute name, when creating a policy for the attribute a of the simulation Device 001, the attribute name of the attribute a can be acquired, and the policy-001 corresponding to the attribute a of the simulation Device 001 can be created based on the simulation Device ID (Device ID-001) of the simulation Device 001 and the attribute name of the attribute a. Accordingly, when creating a policy for the attribute B of the simulation Device 002, a policy-004 corresponding to the attribute B of the simulation Device 002 is created with the simulation Device ID (Device ID-002) of the simulation Device 002 and the attribute name of the attribute B. The method for creating the policy corresponding to the event or service is the same as that of the above embodiment, and the present embodiment is not limited to this.
In other embodiments, the simulated device ID may not be directly available at the time of policy creation in some cases. For example, when the simulation device is created in batch, since the simulation device and the policy are simultaneously imported through the interface to realize batch creation of the simulation device, the device number and the simulation device ID are dynamically generated, and at this time, the simulation device ID cannot be directly obtained when the simulation device is created, and at this time, the policy may be created based on the device number and at least one of the attribute name, the event name, and the service name.
Further, in some cases, if not only the simulated device ID but also the device number cannot be directly obtained, the policy is created based on the device type, and at least one of the attribute name, the event name, and the service name.
Correspondingly, when inquiring the strategy, firstly inquiring the strategy based on at least one of the attribute name, the event name and the service name and the simulated equipment ID; if the simulated equipment ID can not be acquired, inquiring the strategy based on the equipment number and at least one of the attribute name, the event name and the service name; if the simulated equipment ID and the equipment number cannot be acquired, acquiring the equipment type of the simulated equipment, and inquiring the strategy based on at least one of the attribute name, the event name and the service name and the equipment type.
In some embodiments, control of the analog device may be achieved after the analog device is first brought to an on-line state; as shown in fig. 7, the method for controlling the on-line of the analog device includes:
step S301, receiving an equipment online request for the analog equipment, and acquiring an equipment number of the analog equipment based on the equipment online request.
In this embodiment, the simulation device may be operated on-line through a visual interface of the device simulator. For example, in the simulation device list, a simulation device is selected to click to view details, enter a detail page of the simulation device, and click on a simulation of the page to launch a simulation device.
After clicking to start the simulation equipment, the equipment simulator receives the equipment online request and acquires the equipment number of the simulation equipment corresponding to the equipment online request.
Step S302, acquiring device information of the target device corresponding to the analog device based on the device number.
The internet of things platform 200 can determine whether the analog device corresponding to the device number is on line based on the device number, if so, the operation is ended, and the device is successfully on line. If not, creating a simulation equipment instance in the memory, and acquiring equipment information of the target equipment corresponding to the simulation equipment according to the equipment number, wherein the equipment information comprises information such as attribute, time, service and the like.
Step S303, initializing the shadow of the simulation device and restoring the strategy corresponding to the target device based on the device information of the target device.
In this embodiment, based on the obtained information such as the attribute, time, and service of the analog device and the target device, the analog device shadow corresponding to the analog device and the target device in the device shadow unit is initialized, so that the policy corresponding to the analog device, for example, a simulator_strategy database table, is restored according to the related information in the analog device shadow, and whether the policy corresponding to the analog device deviceid+name exists or not is checked, and if any, the policy corresponding to the analog device deviceid+name exists, the policy corresponding to the analog device shadow is restored to the corresponding policy executor.
In this embodiment, the policy is created based on at least one of the attribute name, the event name and the service name and the simulated device ID, and when initializing the simulated device shadow, since the simulated device ID and the corresponding attribute name, event name or service name thereof can be acquired, at this time, assignment of the initial value can be performed based on the attribute, event or service type thereof, and based on the type. For example, when the attribute type is int/float type, the initial value of the shadow of the simulation device is 0; when the attribute type is string type, the initial value of the shadow of the analog device is "" (blank string).
In other embodiments, at least one of the attribute, event, and service is assigned a fixed initial value based on a fixed value policy. Wherein the fixed value policy does not relate to a timer.
In this embodiment, when initializing the simulation device shadow, a fixed value may be assigned to each attribute, event or service as an initial value of the corresponding attribute, event or service based on a preset fixed value policy.
Optionally, a simulation device ID of the simulation device may be obtained, and a first fixed value policy may be searched for based on the simulation device ID and at least one of the attribute name, the event name, and the service name, so as to assign an initial value to a shadow of the simulation device according to the first fixed value policy; when the simulated device ID cannot be acquired, a second fixed value policy may be searched based on the device number and at least one of the attribute name, the event name, and the service name, so as to assign an initial value to the simulated device shadow according to the second fixed value policy; when the simulated device ID and the device number cannot be acquired, a third fixed value policy may be searched based on the device type and at least one of the attribute name, the event name, and the service name, so as to assign an initial value to the simulated device shadow according to the third fixed value policy. Alternatively, the third fixed value policy or the second fixed value policy may be directly selected to give an initial value to the shadow of the analog device according to the actual situation, which is not limited in this embodiment.
In the above embodiment, the initial value is given to the shadow of the simulation device by the third fixed value policy or the second fixed value policy, so that time consumption during policy creation and online can be reduced, and on the one hand, the problem that the ID of the simulation device cannot be obtained due to batch creation and online simulation of the simulation device can be solved.
And initializing the memory executor according to the strategy. The memory executor comprises an updating executor and a reporting executor.
Step S304, establishing a connection between the target device and the analog device.
In this embodiment, a message server (for example, MQTT server) is initialized, and MQTT connection authentication is performed according to a DMA device format using a unified key, so that communication connections between a target device and the message server and between the message server and an analog device are respectively established, and thus communication connection between the target device and the analog device is implemented through the message server.
After the communication connection between the target device and the message server and between the message server and the simulation device is established successfully, the simulation device is online. Meanwhile, communication between the target device and the analog device is realized based on Topic. Meanwhile, ping messages are sent between the two to maintain the online state of the simulation device.
Step S305 updates the device information of the target device based on the analog value of the attribute of the analog device.
Alternatively, in this embodiment, a batch on-line operation may also be performed. Specifically, a plurality of simulation devices to be online can be obtained according to a device online request of the simulation device; generating a plurality of device numbers matching the plurality of simulated devices based on one or more of device type, region code, creation date, creation lot, lot count, start index; generating a second equipment number list based on a plurality of equipment numbers, sequentially acquiring equipment information of the target equipment corresponding to the simulation equipment based on the equipment numbers in the second equipment number list, initializing the shadow of the simulation equipment based on the equipment information of the target equipment, recovering a strategy corresponding to the target equipment, establishing connection between the target equipment and the simulation equipment, and finally updating the equipment information of the target equipment based on the simulation value of the attribute of the simulation equipment, thereby realizing batch online of the plurality of simulation equipment.
For example, a plurality of analog devices that need to be brought online may be imported through an interface. When each simulation device is imported, a plurality of device numbers can be automatically generated in batches based on one or more of information such as a device type (category), a region code (region code), a creation date (date), a creation batch (batch), a batch count (batch count), a start index (startIndex), and the like, a device number list (anist) is generated based on the plurality of device numbers, and then an online operation of a single simulation device is sequentially executed based on the device numbers in the device number list.
After the analog device is successfully on line, the analog device actively reports the default analog values of all the attributes of the analog device once, so as to ensure that the attribute analog values of the target device in the device management unit are consistent with the attribute analog values of the analog device in the device simulator.
After the simulation equipment is on line, the running simulation equipment instance is maintained in a process memory, and meanwhile, information of one running simulation equipment instance is stored in redis/db and is used for recording the current running simulation equipment, and the on-site use is recovered when the svc.devsilmulator service process is suspended and restarted. For example, when the simulation device instance 1 and the simulation device instance 2 are in an online state, the svc.devsilator service instance is abnormally hung up, and the simulation device instance 1 and the simulation device instance 2 may be in an offline state (lose heartbeats), after the service is restarted, the online state of the simulation device instance 1 and the simulation device instance 2 needs to be restored (the online simulation operation is automatically performed).
When the standby mode operates, all services operate in one process, and all simulation device instances operate in one service instance.
When the distributed deployment runs, multiple svc.devsilzer service instances are respectively responsible for managing own simulation equipment instances. For example, three service instances (svc.devsilmulator 1, svc.devsilmulator 2, svc.devsilmulator 3) are currently running, and the three instances may run in a distributed manner on different machine nodes or may run in multiple processes on the same machine node.
When the simulator instance is started, a service instance is randomly selected (go-micro self-implements/maintains the map of a service) and a simulation device instance is created in the service instance.
It is assumed at this point that the service instance runs the simulated device instance snapshot as follows,
svc.devsimulator1(simulator1,simulator3),
svc.devsimulator2(simulator5),
svc.devsimulator3(simulator2,simulator4),
to stop the simulation device instance simultator 2, a svc.dev. Simultator 3 service instance is found, and then the operation stops the simulation device instance simultator 2.
In some embodiments, the policies associated with the attributes may be updated, including: receiving an attribute updating request, and acquiring the simulation equipment to be updated; changing a strategy corresponding to the simulation equipment in response to the strategy type change of the simulation equipment to be updated; responding to the strategy starting state change of the simulation equipment to be updated, and changing the strategy state corresponding to the simulation equipment; and changing strategy updating timing information corresponding to the simulation equipment in response to the strategy updating time change of the simulation equipment to be updated.
In this embodiment, policies associated with attributes may be edited and updated. When the attribute editing is carried out on the visual interface of the Internet of things platform, the equipment simulator receives an attribute updating request, and obtains the simulation equipment ID based on the attribute updating request, so that the simulation equipment to be updated is obtained according to the simulation equipment ID.
Then, the internet of things platform judges whether the simulation equipment exists in the memory or not, if not, the error reporting is finished, and if so, whether the strategy starting state of the simulation equipment is changed or not is further judged; and if the strategy starting state of the simulation equipment is changed, changing the strategy corresponding to the simulation equipment, namely changing the strategy bound by the actuator corresponding to the simulation equipment.
And then, the internet of things platform further judges whether the strategy starting state of the simulation equipment is changed, if so, the strategy state corresponding to the simulation equipment is changed based on the state, for example, an actuator corresponding to the simulation equipment is started or stopped based on the current state.
And then, the internet of things platform further judges whether the strategy updating time of the simulation equipment is changed, if so, the strategy updating time corresponding to the simulation equipment is changed, for example, a timer of an actuator corresponding to the simulation equipment can be changed, so that the strategy updating of the simulation equipment is realized.
Specifically, when the attribute update request includes an update of a simulation value of an attribute, the internet of things platform obtains a corresponding simulation device to be updated according to a simulation device ID included in the request based on the obtained simulation value of the attribute, synchronously updates device information of a target device in the device management unit, and updates a shadow of the simulation device.
In this embodiment, the updating of the attribute and the policy may adopt modes of immediate reporting, batch reporting, etc., and report the attribute simulation value to the target device of the device management unit.
After the device is on-line, the analog device can be controlled by setting the attribute expected value. For example, in some embodiments, the simulation device comprises a first simulation device and a second simulation device, the method further comprising:
in step S401, a first analog device receives a device attribute expected value setting request, and updates an attribute of the first analog device based on the device attribute expected value setting request.
In this embodiment, the device attribute expected value setting request may be generated by setting an attribute expected value for the first simulation device in the device simulator or the device management unit of the internet of things platform. The first analog device receives the device attribute desired value setting request, and updates the corresponding attribute information based on the first analog device receiving the device attribute desired value setting request.
Step S402, updating a simulation device shadow corresponding to the first simulation device based on the updated attribute of the first simulation device.
After the attribute of the first simulation device is updated, the updated attribute information is sent to a message server based on the Topic message, and the message server sends the attribute information to a device shadow unit to update a simulation device shadow of the first simulation device.
Step S403, based on the updated shadow of the simulation device, acquiring first rule information corresponding to the first simulation device in the rule engine, and controlling the first simulation device based on the first rule information.
And then, the internet of things platform retrieves first rule information corresponding to the first simulation equipment from the rule engine based on the updated shadow of the simulation equipment, and controls the first simulation equipment to act, such as controlling the temperature change of the temperature sensor, based on the first rule information.
Step S404, based on the first rule, acquiring a second simulation device associated with the first simulation device.
In some embodiments there may be an associated action between the different devices, for example in some embodiments the state of the second analog device (e.g. light bulb) is adjusted (turned on or off) when the temperature of the first analog device (e.g. temperature sensor) meets a preset requirement. At this time, after the temperature sensor is controlled to execute the action based on the first rule, the association requirement between the temperature sensor and the first rule is met, and then attribute change of the second simulation equipment associated with the first simulation equipment is triggered, so that the second simulation equipment associated with the first simulation equipment can be acquired.
Step S405, obtaining second rule information corresponding to a second simulation device, and controlling the second simulation device based on the second rule information.
In this embodiment of the present market, the second simulation device may be controlled to act based on the second rule information corresponding to the second simulation device, so as to implement attribute change of the second simulation device; and simultaneously, after the second simulation equipment attribute is changed, reporting the changed attribute expected value to an equipment management unit of the Internet of things platform.
In this embodiment, the linkage between two analog devices having an association relationship may be implemented, or the linkage between an analog device having an association relationship and a real device may be implemented, which is not limited in this embodiment.
In some embodiments, after the analog device is used, the analog device may be taken offline. The method for controlling the off-line of the analog equipment comprises the following steps:
step S501, receiving a device offline request for the analog device, and acquiring an analog device ID of the analog device based on the device offline request.
In this embodiment, the simulation device may be operated to be offline through the visual interface of the device simulator. For example, in the simulation device list, a simulation device is selected to click on viewing details, enter a detail page of the simulation device, and click on the simulation of the page to stop a simulation device.
After clicking to stop the simulation device, the device simulator receives the device offline request and acquires the simulation device ID of the simulation device corresponding to the device offline request.
Step S502, updating the device status of the analog device based on the analog device ID, and disconnecting the connection between the target device and the analog device.
The internet of things platform 200 judges whether the analog device ID exists or not based on the analog device ID, and if the analog device ID does not exist, the error reporting is finished; if so, updating the equipment state (runStatus) of the simulation equipment into false, simultaneously operating the corresponding simulation equipment instance in the memory, stopping all the executors associated with the simulation equipment instance, stopping and deleting the simulation equipment instance, finally disconnecting the message server, and disconnecting the connection between the target equipment and the message server and between the message server and the simulation equipment.
Alternatively, in this embodiment, a batch offline operation may also be performed. For example, a plurality of device numbers may be acquired, and a device number list (anList) is generated based on the plurality of device numbers, and then a single analog device is sequentially operated to be disconnected based on the device numbers in the device number list.
It should be noted that the method of the embodiments of the present disclosure may be performed by a single device, such as a computer or a server. The method of the embodiment can also be applied to a distributed scene, and is completed by mutually matching a plurality of devices. In the case of such a distributed scenario, one of the devices may perform only one or more steps of the methods of embodiments of the present disclosure, the devices interacting with each other to accomplish the methods.
It should be noted that the foregoing describes some embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments described above and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Based on the same inventive concept, the present disclosure also provides an electronic device corresponding to the method of any embodiment, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where the processor implements the method of any embodiment when executing the program.
Fig. 8 shows a more specific hardware architecture of an electronic device according to this embodiment, where the device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 implement communication connections therebetween within the device via a bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit ), microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc. for executing relevant programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory ), static storage device, dynamic storage device, or the like. Memory 1020 may store an operating system and other application programs, and when the embodiments of the present specification are implemented in software or firmware, the associated program code is stored in memory 1020 and executed by processor 1010.
The input/output interface 1030 is used to connect with an input/output module for inputting and outputting information. The input/output module may be configured as a component in a device (not shown) or may be external to the device to provide corresponding functionality. Wherein the input devices may include a keyboard, mouse, touch screen, microphone, various types of sensors, etc., and the output devices may include a display, speaker, vibrator, indicator lights, etc.
Communication interface 1040 is used to connect communication modules (not shown) to enable communication interactions of the present device with other devices. The communication module may implement communication through a wired manner (such as USB, network cable, etc.), or may implement communication through a wireless manner (such as mobile network, WIFI, bluetooth, etc.).
Bus 1050 includes a path for transferring information between components of the device (e.g., processor 1010, memory 1020, input/output interface 1030, and communication interface 1040).
It should be noted that although the above-described device only shows processor 1010, memory 1020, input/output interface 1030, communication interface 1040, and bus 1050, in an implementation, the device may include other components necessary to achieve proper operation. Furthermore, it will be understood by those skilled in the art that the above-described apparatus may include only the components necessary to implement the embodiments of the present description, and not all the components shown in the drawings.
The electronic device of the foregoing embodiment is configured to implement the corresponding method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which is not described herein.
Based on the same inventive concept, corresponding to any of the above-described embodiments of the method, the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the method as described in any of the above embodiments.
The computer readable media of the present embodiments, including both permanent and non-permanent, removable and non-removable media, may be used to implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device.
The storage medium of the foregoing embodiments stores computer instructions for causing the computer to perform the method of any of the foregoing embodiments, and has the advantages of the corresponding method embodiments, which are not described herein.
Those of ordinary skill in the art will appreciate that: the discussion of any of the embodiments above is merely exemplary and is not intended to suggest that the scope of the disclosure, including the claims, is limited to these examples; the technical features of the above embodiments or in the different embodiments may also be combined under the idea of the present disclosure, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in details for the sake of brevity.
Additionally, well-known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown within the provided figures, in order to simplify the illustration and discussion, and so as not to obscure the embodiments of the present disclosure. Furthermore, the devices may be shown in block diagram form in order to avoid obscuring the embodiments of the present disclosure, and this also accounts for the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform on which the embodiments of the present disclosure are to be implemented (i.e., such specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the disclosure, it should be apparent to one skilled in the art that embodiments of the disclosure can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative in nature and not as restrictive.
While the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of those embodiments will be apparent to those skilled in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
The disclosed embodiments are intended to embrace all such alternatives, modifications and variances which fall within the broad scope of the appended claims. Accordingly, any omissions, modifications, equivalents, improvements, and the like, which are within the spirit and principles of the embodiments of the disclosure, are intended to be included within the scope of the disclosure.

Claims (18)

1. The method for controlling the equipment of the Internet of things is characterized by comprising the following steps of:
receiving a device control request, and obtaining target devices according to the device control request; the target device is created based on a simulation device set in a device simulator;
and transmitting the device control request to the simulation device based on the target device to control the simulation device based on the device control request.
2. The method as recited in claim 1, further comprising:
Receiving a simulation device creation request, and creating the simulation device in the device simulator;
acquiring object model information of the simulation equipment, and performing equipment mapping based on the object model information of the simulation equipment to acquire target equipment;
and creating a simulated device shadow based on the target device.
3. The method of claim 2, wherein the step of determining the position of the substrate comprises,
the object model information comprises attributes, events and services corresponding to the simulation equipment, the attributes, events and services of the simulation equipment are stored in the shadow of the simulation equipment, and at least one of the attributes, events and services corresponds to one strategy.
4. The method as recited in claim 2, further comprising:
acquiring a plurality of simulation devices to be created according to the simulation device creation request;
generating a plurality of device numbers matching the plurality of simulated devices based on one or more of device type, region code, creation date, creation lot, lot count, start index;
and generating a first equipment number list based on the plurality of equipment numbers, and sequentially creating the simulation equipment in the equipment simulator based on the equipment numbers in the first equipment number list.
5. A method according to claim 3, further comprising:
the device numbers of the plurality of analog devices are the same, and at least one of the attributes, events, and services of the plurality of analog devices are different.
6. A method according to claim 3, further comprising:
acquiring an analog device ID of the analog device;
acquiring at least one of an attribute name of the attribute, an event name of the event and a service name of the service;
the policy is created based on the simulated device ID and at least one of the attribute name, the event name, and the service name.
7. The method as recited in claim 6, further comprising:
in response to not obtaining the simulated device ID, creating the policy based on the device number and at least one of the attribute name, the event name, and the service name;
in response to not obtaining the simulated device ID and the device number, obtaining a device type of the simulated device, creating the policy based on the device type and at least one of the attribute name, the event name, and the service name.
8. The method as recited in claim 2, further comprising:
receiving an equipment online request of the simulation equipment, and acquiring the equipment number of the simulation equipment based on the equipment online request;
acquiring equipment information of the target equipment corresponding to the simulation equipment based on the equipment number;
initializing the shadow of the simulation equipment and restoring a strategy corresponding to the target equipment based on the equipment information of the target equipment;
establishing a connection between the target device and the analog device;
and updating the device information of the target device based on the simulation value of the attribute of the simulation device.
9. The method as recited in claim 8, further comprising:
acquiring a plurality of simulation devices to be online according to the device online request of the simulation device;
generating a plurality of device numbers matching the plurality of simulated devices based on one or more of device type, region code, creation date, creation lot, lot count, start index;
and generating a second equipment number list based on the plurality of equipment numbers, and sequentially acquiring the equipment information of the target equipment corresponding to the simulation equipment based on the equipment numbers in the second equipment number list so as to initialize the shadow of the simulation equipment and restore the strategy corresponding to the target equipment based on the equipment information of the target equipment.
10. The method of claim 7, wherein the initializing the simulated device shadow comprises: a fixed initial value is assigned to at least one of the attribute, event, and service based on a fixed value policy.
11. The method of claim 10, wherein assigning a fixed initial value to at least one of an attribute, an event, and a service based on a fixed value policy comprises at least one of:
acquiring a simulation equipment ID of the simulation equipment, and searching a first fixed value strategy based on at least one of the attribute name, the event name and the service name and the simulation equipment ID so as to endow an initial value for the shadow of the simulation equipment according to the first fixed value strategy;
in response to not obtaining the simulation device ID of the simulation device, searching a second fixed value strategy based on the device number and at least one of the attribute name, the event name and the service name, so as to endow an initial value for the simulation device shadow according to the second fixed value strategy;
and searching a third fixed value strategy based on at least one of the attribute name, the event name and the service name and the equipment type in response to the fact that the simulated equipment ID and the equipment number of the simulated equipment are not acquired, so as to endow the shadow of the simulated equipment with an initial value according to the third fixed value strategy.
12. The method according to any one of claims 1-11, further comprising:
receiving an attribute updating request, and acquiring the simulation equipment to be updated;
changing a strategy corresponding to the simulation equipment in response to the strategy type change of the simulation equipment to be updated;
responding to the strategy starting state change of the simulation equipment to be updated, and changing the strategy state corresponding to the simulation equipment;
and changing the strategy updating time corresponding to the simulation equipment in response to the strategy updating time change of the simulation equipment to be updated.
13. The method of claim 12, wherein the analog device comprises a first analog device and a second analog device, the method further comprising:
the method comprises the steps that a first simulation device receives a device attribute expected value setting request, and the attribute of the first simulation device is updated based on the device attribute expected value setting request;
updating a simulation device shadow corresponding to the first simulation device based on the updated attribute of the first simulation device;
based on the updated shadow of the simulation device, acquiring first rule information corresponding to the first simulation device in a rule engine and controlling the first simulation device based on the first rule information;
Acquiring a second simulation device associated with the first simulation device based on the first rule;
and acquiring second rule information corresponding to second simulation equipment, and controlling the second simulation equipment based on the second rule information.
14. The method as recited in claim 2, further comprising:
receiving a device offline request of the simulation device, and acquiring a simulation device ID of the simulation device based on the device offline request;
and updating the equipment state of the simulation equipment based on the simulation equipment ID, and disconnecting the connection between the target equipment and the simulation equipment.
15. An internet of things device control system, comprising:
a device simulator for creating a simulated device;
the device management unit is used for receiving a device control request and obtaining target devices according to the device control request; and transmitting the device control request to the simulation device based on the target device to control the simulation device based on the device control request.
16. The system of claim 15, further comprising:
the equipment shadow unit is used for acquiring the object model information of the simulation equipment in the equipment simulator and sending the object model information to the equipment management unit; creating a simulated device shadow based on the target device in the device management unit;
The device management unit is further configured to perform device mapping based on object model information of the simulation device, and obtain the target device.
17. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 14 when the program is executed by the processor.
18. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1 to 14.
CN202210374968.5A 2022-04-11 2022-04-11 Internet of things equipment control method, system, device, electronic equipment and storage medium Pending CN116939398A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210374968.5A CN116939398A (en) 2022-04-11 2022-04-11 Internet of things equipment control method, system, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210374968.5A CN116939398A (en) 2022-04-11 2022-04-11 Internet of things equipment control method, system, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116939398A true CN116939398A (en) 2023-10-24

Family

ID=88379487

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210374968.5A Pending CN116939398A (en) 2022-04-11 2022-04-11 Internet of things equipment control method, system, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116939398A (en)

Similar Documents

Publication Publication Date Title
US10887404B2 (en) Method and apparatus for virtualized network function chaining management
CN112214330A (en) Method and device for deploying master nodes in cluster and computer-readable storage medium
US10678975B2 (en) Code module selection for device design
US20220229652A1 (en) Application Deployment Method, Apparatus, and System
CN113778623B (en) Resource processing method and device, electronic equipment and storage medium
CN109375986A (en) Virtual machine configuration based on metadata
JP6201917B2 (en) System and method for configuring field devices
US11354152B2 (en) Self-evolving microservices
CN111064626B (en) Configuration updating method, device, server and readable storage medium
CN116257438A (en) Updating method of interface test case and related equipment
CN113315754A (en) Intelligent linkage method, device, equipment and medium for firewall of container visit
CN115248692A (en) Device and method for supporting cloud deployment of multiple deep learning framework models
CN115328662A (en) Process thread resource management control method and system
CN113419818B (en) Basic component deployment method, device, server and storage medium
CN114826869A (en) Device management method and device management system
CN115129574A (en) Code testing method and device
CN113971191A (en) Data import method and device and computer readable storage medium
CN116939398A (en) Internet of things equipment control method, system, device, electronic equipment and storage medium
CN115883669A (en) Data distribution method, system, equipment and medium
US9949046B2 (en) Automating repairs to audio systems
CN107547607B (en) Cluster migration method and device
CN114490073A (en) Electronic map operation and maintenance method, electronic map data using method and service system
CN112667350A (en) Configuration scheduling method, device and system
CN112486037B (en) Communication matching method and system for train and regional controller in CBTC simulation system
CN113703798A (en) Distributed service updating method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination