CN114650310B - Equipment control method and device based on Internet of things, electronic equipment and storage medium - Google Patents

Equipment control method and device based on Internet of things, electronic equipment and storage medium Download PDF

Info

Publication number
CN114650310B
CN114650310B CN202210237416.XA CN202210237416A CN114650310B CN 114650310 B CN114650310 B CN 114650310B CN 202210237416 A CN202210237416 A CN 202210237416A CN 114650310 B CN114650310 B CN 114650310B
Authority
CN
China
Prior art keywords
execution
execution plan
plan
time
internet
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.)
Active
Application number
CN202210237416.XA
Other languages
Chinese (zh)
Other versions
CN114650310A (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202210237416.XA priority Critical patent/CN114650310B/en
Publication of CN114650310A publication Critical patent/CN114650310A/en
Application granted granted Critical
Publication of CN114650310B publication Critical patent/CN114650310B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • 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
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • 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)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application provides an equipment control method and device based on the Internet of things, electronic equipment, a computer readable storage medium and a computer program product; the method can be applied to a vehicle-mounted scene, and comprises the following steps: acquiring an execution plan set for target Internet of things equipment in the Internet of things, wherein the execution plan comprises execution time and operation required to be executed at the execution time; determining a plan task expression corresponding to the execution plan, wherein the plan task expression is used for describing the execution plan in a character string form; carrying out legality detection on the execution plan based on the plan task expression; in response to a pass of the validity detection of the execution plan, storing the execution plan in a wait for execution queue; and in response to the execution time being reached, reading the execution plan from the waiting execution queue, converting the execution plan into a machine instruction, and sending the machine instruction to the target Internet of things equipment. Through the application, the stability of controlling the Internet of things equipment can be improved while resources are saved.

Description

Equipment control method and device based on Internet of things, electronic equipment and storage medium
Technical Field
The present application relates to the field of internet of things technology, and in particular, to an internet of things-based device control method and apparatus, an electronic device, and a computer-readable storage medium.
Background
The Internet of Things (IoT), i.e., the Internet with which everything is connected, is an extension and expansion performed on the basis of the Internet, combines various information sensing devices with the Internet to form a huge network, and realizes ubiquitous connection between objects and people through network access. With the development of the technology of the internet of things, the related application of the internet of things is more and more popular. For example, a non-timely execution plan may be set for the internet of things device in a usage scenario of smart home, smart security, smart city, and the like, for example, "exhaust fan execution is delayed by 10 seconds", "remind me to pay a call fee 1 day per month", "10 start a sweeping robot per working day.
However, in the solutions provided in the related art, all execution plans set for a certain internet of things device are generally stored at one time, resulting in a high resource occupancy rate. In addition, when a plurality of mutually exclusive operation instructions are set for the same time point of the same internet of things device, an unpredictable execution result is also easy to occur, that is, the stability of control for the internet of things device is also poor.
Disclosure of Invention
The embodiment of the application provides an equipment control method and device based on the Internet of things, electronic equipment, a computer readable storage medium and a computer program product, and can improve the stability of controlling the equipment of the Internet of things while saving resources.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides an equipment control method based on the Internet of things, which comprises the following steps:
acquiring an execution plan set for target Internet of things equipment in the Internet of things, wherein the execution plan comprises execution time and operation required to be executed at the execution time;
determining a plan task expression corresponding to the execution plan, wherein the plan task expression is used for describing the execution plan in a character string form;
carrying out legality detection on the execution plan based on the plan task expression;
in response to the validity detection of the execution plan passing, storing the execution plan into a waiting execution queue;
in response to the execution time being reached, reading the execution plan from the wait execution queue, converting the execution plan into a machine instruction, and sending the machine instruction to the target internet of things device.
The embodiment of the application provides an equipment control device based on thing networking, includes:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring an execution plan set for target Internet of things equipment in the Internet of things, and the execution plan comprises execution time and operation required to be executed at the execution time;
the determining module is used for determining a plan task expression corresponding to the execution plan, wherein the plan task expression is used for describing the execution plan in a character string form;
the detection module is used for carrying out legality detection on the execution plan based on the plan task expression;
the storage module is used for responding to the passing of the validity detection of the execution plan and storing the execution plan into a waiting execution queue;
a reading module, configured to read the execution plan from the wait execution queue in response to reaching the execution time;
a conversion module for converting the execution plan into machine instructions;
and the sending module is used for sending the machine instruction to the target Internet of things equipment.
An embodiment of the present application provides an electronic device, including:
a memory for storing executable instructions;
and the processor is used for realizing the equipment control method based on the Internet of things provided by the embodiment of the application when the executable instructions stored in the memory are executed.
The embodiment of the application provides a computer-readable storage medium, which stores executable instructions and is used for realizing the equipment control method based on the internet of things provided by the embodiment of the application when being executed by a processor.
The embodiment of the application provides a computer program product, which comprises a computer program or instructions, and is used for realizing the device control method based on the internet of things provided by the embodiment of the application when being executed by a processor.
The embodiment of the application has the following beneficial effects:
after an execution plan set for target internet of things equipment in the internet of things is acquired, the execution plan is converted into a corresponding plan task expression, then legality detection is carried out on the execution plan based on the plan task expression, the execution plan passing the legality detection is stored in a waiting execution queue, and finally when the execution time is reached, the execution plan is read from the waiting execution queue, converted into a corresponding machine instruction and sent to the target internet of things equipment, so that on one hand, the resource occupancy rate can be effectively reduced because the execution plan reaching the execution time is only stored in the waiting execution queue; on the other hand, the execution plan is subjected to legality detection in advance, so that the condition that the mutual exclusion instruction is set for the same Internet of things device is avoided, and the stability of the Internet of things device in control is effectively improved.
Drawings
Fig. 1A is a schematic architecture diagram of an internet-of-things-based device control system 1000 provided in an embodiment of the present application;
fig. 1B is an architecture diagram of an internet of things-based device control system 1001 provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a server 200 according to an embodiment of the present application;
fig. 3 is a schematic flowchart of an apparatus control method based on the internet of things according to an embodiment of the present application;
fig. 4 is a schematic flowchart of an apparatus control method based on the internet of things according to an embodiment of the present application;
fig. 5 is a schematic flowchart of an apparatus control method based on the internet of things according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an internet of things cloud control system provided in an embodiment of the present application;
fig. 7 is a schematic flowchart of an apparatus control method based on the internet of things according to an embodiment of the present application;
FIG. 8 is a schematic diagram illustrating a flow of setting an execution plan according to an embodiment of the present application;
FIG. 9 is a schematic diagram of an embodiment of the present application for bitwise AND operation for two year bitmaps;
FIG. 10 is a schematic flow chart of time coincidence detection provided by an embodiment of the present application;
FIG. 11 is a schematic diagram illustrating processing for multiple execution plans stored in a wait execution queue according to an embodiment of the present application;
fig. 12 is a schematic diagram illustrating a principle of adjusting the number of threads according to an embodiment of the present application.
Detailed Description
In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the attached drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the description that follows, reference is made to the term "first \ second \ 8230," which merely distinguishes between similar objects and does not denote a particular ordering for the objects, and it is understood that "first \ second \ 8230," where permitted, may be interchanged in a particular order or sequence so that embodiments of the application described herein may be performed in an order other than that shown or described herein.
It is understood that, in the embodiments of the present application, data related to execution plans set by users and the like need to be approved or approved by users when the embodiments of the present application are applied to specific products or technologies, and collection, use and processing of the related data need to comply with relevant laws and regulations and standards of relevant countries and regions.
In the following description, the term "plurality" referred to means at least two.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
Before further detailed description of the embodiments of the present application, terms and expressions referred to in the embodiments of the present application will be described, and the terms and expressions referred to in the embodiments of the present application will be used for the following explanation.
1) And (3) executing a plan: the execution time and the operation that the internet of things device needs to execute at the execution time are included, for example, the execution plan may be: "the exhaust fan is executed with a delay of 10 seconds", "1 day per month reminds me to pay a call", "10 days per workday starts the sweeping robot at 30", and the like.
2) And (3) planning a task expression: the expression is also called Cron expression, which is a group of character strings composed of a plurality of numbers, spaces and symbols according to a certain rule, thereby expressing the information of time. Wherein, the character string is usually separated by 5 or 6 spaces and divided into 6 or 7 fields, and each field represents a meaning. For example, cron expression generally has the following two syntax formats:
(1)Seconds Minutes Hours DayofMonth Month DayofWeek Year
(2)Seconds Minutes Hours DayofMonth Month DayofWeek
wherein "Seconds Minutes homes from left to right (spaced by a space)" means dayofMonth DayofWeek Year "of the Cron expression: "year of day in the week of the month of the second minute-hour month".
3) In response to: for indicating the condition or state on which the performed operation depends, when the condition or state on which the performed operation depends is satisfied, the performed operation or operations may be in real time or may have a set delay; there is no restriction on the order of execution of the operations performed unless otherwise specified.
4) A gateway: the gateway can be virtual or have a entity, and services related to control, such as access control, admission control and the like, can be deployed on the gateway. The gateways include a core gateway and an edge gateway (i.e., a gateway deployed at the edge of a network, which connects the physical and digital worlds by functions such as network connection and protocol conversion, and provides lightweight connection management, real-time data analysis and application management functions).
5) According to the bit sum: the bitwise and operator "&" is a binocular operator, and has the function of taking part in the addition of the binary phase corresponding to each of the two numbers, and the result bit is 1 only when the two corresponding binary phases are both 1.
6) Bitmap (Bitset \ Bitmap): a data structure in which particular data is represented by a very compact contiguous array space.
The embodiment of the application provides an equipment control method and device based on the Internet of things, electronic equipment, a computer readable storage medium and a computer program product, and can improve the stability of controlling the equipment of the Internet of things while saving resources. An exemplary application of the electronic device provided in the embodiment of the present application is described below, and the electronic device provided in the embodiment of the present application may be implemented as various types of terminal devices such as a notebook computer, a tablet computer, a desktop computer, a mobile device (e.g., a mobile phone, a personal digital assistant, a dedicated messaging device), a home gateway, a vehicle-mounted terminal, and the like, or may be implemented as a server, or implemented by the terminal device and the server cooperatively. The following description will be given taking an example in which the electronic device is implemented as a server.
Referring to fig. 1A, fig. 1A is a schematic diagram of an architecture of an internet of things-based device control system 1000 (for example, a cloud internet of things control system) provided in an embodiment of the present application, and in order to support an application that saves resources and improves stability of controlling internet of things devices, the internet of things-based device control system 1000 shown in fig. 1A includes: the system comprises a server 200, a core gateway 300 of the internet of things, an edge gateway 400 of the internet of things, a terminal device 500 and a target internet of things device 600.
In some embodiments, a target object (e.g., a home user or an enterprise user) may set, through a client 510 (e.g., a dedicated control application of an internet-of-things device or an applet integrated in another application) running on a terminal device 500, an execution plan for a target internet-of-things device 600 (e.g., a smart appliance, which is illustrated in fig. 1A by taking an air conditioner as an example) in the internet of things (of course, the target object may also set, through a web page displayed on a browser, an execution plan for the target internet-of-things device 600), where the execution plan includes an execution time and an operation to be executed at the execution time, for example, the execution plan set by the target object for the air conditioner may be "dehumidification is turned on at 5 pm every day" before the terminal device 500 sends the execution plan set by the target object for the target internet-of-things device 600 to a server 200 (e.g., a cloud control system), and after receiving the execution plan, the server 200 first determines a planned task expression (i.e., a Cron expression) corresponding to the execution plan, and then performs validity detection on the execution plan based on the Cron expression; then the server 200 stores the execution plan in the wait execution queue (for example, in a wait execution queue provided in a database or in a wait execution queue provided in a memory) in response to passing of the validity detection of the execution plan; finally, in response to the execution time being reached, server 200 reads the execution plan from the wait execution queue and converts it into a machine instruction, and transmits the converted machine instruction to core gateway 300. After receiving the machine instruction sent by the server 200, the core gateway 300 sends the machine instruction to the edge gateway 400 according to the routing rule, so that after receiving the machine instruction, the edge gateway 400 can send the machine instruction to the target internet of things device 600, so that the target internet of things device 600 executes the received machine instruction (e.g., starts a dehumidification function).
In other embodiments, in addition to directly setting an execution plan for the target internet of things device 600 by the target object, the server 200 may further obtain the execution plan set for the target internet of things device 600 in the internet of things from the scenario control system (not shown in fig. 1A), for example, the target internet of things device 600 and the scenario control system may form linkage, so that the scenario control system may set the execution plan for the target internet of things device 600 according to its own logic rule, and thus, a more intelligent experience may be provided for a user.
In other embodiments, taking an on-vehicle scene as an example, referring to fig. 1B, fig. 1B is a schematic architecture diagram of an internet-of-things-based device control system 1001 provided in an embodiment of the present application, and as shown in fig. 1B, the internet-of-things-based device control system 1001 includes: the vehicle-mounted terminal 700 (e.g., a vehicle-mounted console) and the target internet of things device 800 (e.g., a steering wheel controller; of course, an execution plan for devices such as an air conditioner and a sound box in a vehicle may also be set by the vehicle-mounted terminal 700), wherein the vehicle-mounted terminal 700 and the target internet of things device 800 may be connected in a wired (e.g., a universal serial bus protocol) or wireless (e.g., based on a bluetooth or zigbee communication protocol) manner. For example, a vehicle driver may set an execution plan for a target internet of things device 800 in a vehicle through a human-computer interaction interface presented by the vehicle-mounted terminal 700, and then, after receiving the execution plan set by the vehicle driver, the vehicle-mounted terminal 700 may detect, store, calculate, and trigger the execution plan set by the vehicle driver by using the device control method based on the internet of things provided in the embodiment of the present application, so that the stability of controlling the internet of things device is improved while resources are saved under a condition that the internet is not relied on.
In some embodiments, the device control method based on the internet of things provided in the embodiments of the present application may also be applied to an edge internet of things control system, for example, the device control method based on the internet of things provided in the embodiments of the present application may be applied to hardware devices such as a home gateway, for example, after receiving an execution plan set by a user for a target internet of things device (e.g., a washing machine) and detecting, storing, calculating, and triggering the execution plan, a terminal device (e.g., a mobile phone) may send a machine instruction to the target internet of things device through the home gateway, so that execution does not need to rely on the internet.
In some embodiments, the terminal device 400 or the server 200 may further implement the internet of things-based device control method provided in the embodiments of the present application by running a computer program, for example, the computer program may be a native program or a software module in an operating system; can be a local (Native) Application program (APP), that is, a program that needs to be installed in an operating system to run, such as a control program dedicated to the internet of things device (corresponding to the client 510 above); or may be an applet, i.e. a program that can be run only by downloading it to the browser environment; but also an applet that can be embedded in any APP, such as an applet component embedded in an instant messaging class application, where the applet component can be run or shut down by user control. In general, the computer programs described above may be any form of application, module or plug-in.
In other embodiments, the server 200 may be an independent physical server, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a web service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), and a big data and artificial intelligence platform, where the cloud service may be an equipment control service based on the internet of things, and is used by the terminal device 400 to call the equipment control service. The terminal device 400 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart television, a smart watch, and the like. The terminal device and the server may be directly or indirectly connected through wired or wireless communication, and the embodiment of the present application is not limited.
The following description will take the electronic device provided in the embodiments of the present application as an example. Referring to fig. 2, fig. 2 is a schematic structural diagram of a server 200 according to an embodiment of the present application, where the server 200 shown in fig. 2 includes: at least one processor 210, memory 240, at least one network interface 220. The various components in server 200 are coupled together by a bus system 230. It is understood that the bus system 230 is used to enable connected communication between these components. The bus system 230 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 230 in FIG. 2.
The Processor 210 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The memory 240 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. Memory 240 optionally includes one or more storage devices physically located remote from processor 210.
The memory 240 includes either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a Random Access Memory (RAM). The memory 240 described in embodiments herein is intended to comprise any suitable type of memory.
In some embodiments, memory 240 is capable of storing data, examples of which include programs, modules, and data structures, or subsets or supersets thereof, to support various operations, as exemplified below.
An operating system 241, including system programs for handling various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and handling hardware-based tasks;
a network communication module 242 for communicating to other electronic devices via one or more (wired or wireless) network interfaces 220, exemplary network interfaces 220 including: bluetooth, wireless compatibility authentication (WiFi), and Universal Serial Bus (USB), etc.;
in some embodiments, the internet-of-things-based device control apparatus provided in the embodiments of the present application may be implemented in a software manner, and fig. 2 illustrates an internet-of-things-based device control apparatus 243 stored in a memory 240, which may be software in the form of programs, plug-ins, and the like, and includes the following software modules: the module comprises an acquisition module 2431, a determination module 2432, a detection module 2433, a storage module 2434, a reading module 2435, a conversion module 2436, a sending module 2437, a query module 2438, a generation module 2439, a capacity expansion module 24310 and a capacity reduction module 24311, which are logical and thus can be arbitrarily combined or further separated according to the functions implemented. It should be noted that, for convenience of description, all the above modules are shown in fig. 2 at a time, and in practical applications, it is not excluded that only the obtaining module 2431, the determining module 2432, the detecting module 2433, the storing module 2434, the reading module 2435, the converting module 2436 and the sending module 2437 are included in the device control apparatus 243 based on the internet of things, and functions of the respective modules will be described below.
The device control method based on the internet of things provided by the embodiment of the present application will be described below with reference to an exemplary application and implementation of the server provided by the embodiment of the present application.
Referring to fig. 3, fig. 3 is a schematic flowchart of an apparatus control method based on the internet of things according to the embodiment of the present application, and will be described with reference to the steps shown in fig. 3.
In step 101, an execution plan set for a target internet-of-things device in the internet of things is obtained.
Here, the execution plan includes execution time and an operation that needs to be executed at the execution time.
For example, taking a target internet of things device in the internet of things as a washing machine as an example, an execution plan set for the washing machine may be: "start washing at 3 pm".
In some embodiments, step 101 described above may be implemented by: performing at least one of the following processes: acquiring an execution plan set by a target object (such as a home user or an enterprise user) for a target internet of things device in the internet of things, wherein the execution plan can be set by the target object through a client running on a terminal device associated with the target object or a Web page (Web) displayed in a browser; the method comprises the steps of obtaining an execution plan set by a scene control system for target internet of things equipment in the internet of things, wherein the execution plan is set by the scene control system based on logic rules.
For example, taking the target object as a home user as an example, the home user may use an APP (for example, a dedicated control application for an internet of things device, or an applet integrated in an instant messaging application) or a Web page as a setting entry of an execution plan, so as to set a corresponding execution plan for the target internet of things device in the internet of things.
For example, in addition to directly setting an execution plan for the target internet of things device by the target object, the target internet of things device may be linked with the scene control system, so that the scene control system may set a corresponding execution plan for the target internet of things device according to its own logic rule (for example, assuming that the scene control system automatically delays to turn off the lighting system after 1 minute after detecting that no person is in a certain public area), and further, more intelligent experience is provided for the user.
In other embodiments, after the execution plan set for the target internet-of-things device in the internet of things is obtained, the following processing may be further performed: carrying out support detection on target Internet of things equipment based on an execution plan; responding to the operation which is required to be executed in the execution time and is included in the fact that the target Internet of things equipment does not support the execution plan and is represented by the support detection result, and sending a prompt message to a setting party of the execution plan, wherein the prompt message is used for prompting that the setting party target Internet of things equipment of the execution plan does not support the operation which is required to be executed in the execution time and is included in the execution plan; responding to the operation which is required to be executed at the execution time and included in the support execution plan of the target internet of things equipment and is represented by the support detection result, and executing the step 102 shown in fig. 3.
For example, taking a target internet of things device as a soybean milk machine as an example, after an execution plan set for the soybean milk machine in the internet of things is obtained (for example, the target object is an execution plan set for the soybean milk machine through an APP), whether an operation required to be executed at an execution time and included in the execution plan set for the target object (for example, a home user a) is supported by the soybean milk machine or not may be detected first, and when a detection result is supported to indicate that the operation required to be executed at the execution time and included in the execution plan set for the home user a of the soybean milk machine is not supported (for example, if the execution plan set for the home user a is that "call charge is reminded to me at 1 day per month", but the soybean milk machine does not have a function of reminding the user of call charge), a prompt message may be sent to a terminal device associated with the home user a, so as to prompt that the execution plan currently set for the home user a is not supported by the soybean milk machine and needs to be reset; when the detection result is supported to represent the operation which needs to be executed in the execution time and is included in the execution plan which supports the home user A of the soybean milk machine (for example, the execution plan which is set by the home user A is assumed to be that the fruit and vegetable juice is made in 3 pm, and the soybean milk machine has the function of making the fruit and vegetable juice), the step of determining the plan task expression corresponding to the execution plan can be carried out, so that after the execution plan which is set for the target Internet of things equipment is obtained, whether the execution plan can be supported by the target Internet of things equipment is detected, and the subsequent execution success rate is effectively improved.
In step 102, a plan task expression corresponding to the execution plan is determined.
Here, the plan task expression (i.e., cron expression) is used to describe the execution time included in the execution plan in the form of a character string.
In some embodiments, after an execution plan set for a target internet of things device in the internet of things is obtained and an operation that needs to be executed at the execution time and is supported by the target internet of things device is detected, a Cron expression corresponding to the execution plan may be determined. The Cron expression is a character string, the character string is separated by 5 or 6 blank spaces and is divided into 6 or 7 fields, and each field represents a meaning. For example, a Cron expression may generally include at least one of the following domains: the system comprises a second domain, a subdomain, a small time domain, a day domain, a month domain, a week domain and a year domain, wherein the effective range of the second domain and the subdomain is an integer from 0 to 59, the effective range of the hour domain is an integer from 0 to 23, the effective range of the day domain is an integer from 1 to 31, the effective range of the month domain is an integer from 1 to 12, the effective range of the week domain is an integer from 1 to 7, and the effective range of the year domain is from 1970 to 2099. In addition, special characters may also appear in Cron's expression as follows: "," - "," + ","/", where", "indicates that the enumerated values are listed, for example, assuming that" 5, 20 "is used in the subdomain, it indicates that each trigger is once in the 5 th and 20 th divisions; "-" indicates a range, e.g., assuming that "5-20" is used in the domain, this indicates one trigger per minute from 5 th to 20 th minute; "indicates any value that matches the field, e.g., assuming" "is used in a domain, it indicates that every minute will trigger; "/" indicates that the trigger starts at a start time and then starts every fixed time, e.g. assuming that "5/20" is used in the domain, it indicates that the trigger is triggered once for the 5 th minute, and again at the 25 th and 45 th minute, respectively.
For example, taking as an example that the execution plan includes an execution time of "2022 years current time and 11 am every day after the current time" as an example, for the second domain, since the execution time starts from 0 th second, it is displayed as "0" in the Cron expression; for the domain, since the execution time starts from the 15 th point, it is shown as "15" in Cron expression; for the small time domain, since the execution time starts from the 11 th hour, it is shown as "11" in Cron expression; for the day field, since the execution time includes the current date and each day after the current date, it is displayed as "+" in Cron expression; for the month domain, since the execution time includes the current month and the month following the current month, it is displayed as "+" in Cron expression; for week domains, since the execution time includes the current week and the week following the current week, it is shown as "+" in Cron expression; for the year domain, since the execution time starts from 2022 years, it is shown as "2022" in the Cron expression, so that for an execution plan with an execution time of "2022 years current time and 15 am every day after the current time" 11", the following corresponding Cron expression" 0 15 x 2022 "can be obtained, indicating 15 am every day after the current time in 2022 years.
In step 103, the execution plan is legally checked based on the plan task expression.
In some embodiments, step 103 may be implemented by: inquiring a plan task configuration table based on the identification of the target Internet of things equipment, and generating a legality detection result of the execution plan based on the inquiry result; the scheduled task configuration table includes identifiers of a plurality of internet of things devices, and scheduled task expressions and operation descriptors corresponding to each internet of things device (i.e., symbols used for describing operations that the internet of things devices need to execute at an execution time, for example, when the internet of things devices are used as an air conditioner, the corresponding operation descriptors may be "open" when the operations included in the execution plan are to turn on the air conditioner, and the corresponding operation descriptors may be "close" when the operations included in the execution plan are to turn off the air conditioner).
For example, referring to table 1, table 1 is a planned task configuration table provided in this embodiment of the application, and as shown in table 1, identifiers of multiple internet of things devices (for example, unique codes (IDs) of the internet of things devices) and Cron expressions and operation descriptors corresponding to each internet of things device are stored in the planned task configuration table, so that after an execution plan set for a target internet of things device is obtained, an existing planned task configuration table may be queried based on the identifier of the target internet of things device, so as to determine whether a mutually exclusive execution plan is set for the target internet of things device.
TABLE 1 scheduled task configuration Table
Identification Device identification Expression of Cron Operation descriptor
1 Air conditioner 1 0 0 8 1/1** open
2 Air conditioner 2 0 0 18 1/1** close
3 Soya-bean milk machine 1 0 0 8 1/1** open
4 Soya-bean milk machine 2 0 15 1 1*** close
In other embodiments, following the above, the validity detection result of the execution plan generated based on the query result may be implemented as follows: and when no record which is the same as the identification of the target Internet of things equipment and has the mutual exclusion of the operation descriptors exists in the plan task configuration table, generating a legality detection result which represents that the legality detection of the execution plan passes.
For example, taking the target internet of things device as the air conditioner 1 as an example, after the execution plan set for the air conditioner 1 is obtained, the plan task configuration table may be queried based on the identifier of the air conditioner 1, and when there is no record in the plan task configuration table that is the same as the identifier of the air conditioner 1 and has the mutual exclusion with the operation descriptor (that is, there is no mutually exclusive execution plan set for the air conditioner 1), a validity detection result that indicates that the validity detection of the execution plan passes may be directly generated.
It should be noted that, after the validity of the execution plan is detected, the execution plan may be further stored in the planned task configuration table, for example, the identifier of the target internet of things device corresponding to the execution plan, the Cron expression corresponding to the execution plan, and the operation descriptor obtained by converting the operation that needs to be executed at the execution time and is included in the execution plan may be stored in the planned task configuration table, so that the planned task configuration table is updated in real time, and the success rate of subsequent execution of the internet of things device is further improved.
In some embodiments, the above-mentioned generating the validity detection result of the execution plan based on the query result may also be implemented by: when a record which is the same as the identification of the target Internet of things equipment and has mutually exclusive operation descriptors exists in the plan task configuration table, performing time coincidence detection based on a plan task expression corresponding to the execution plan and a plan task expression corresponding to the record; generating a legality detection result representing that legality detection of the execution plan passes in response to that the execution time included by the time coincidence detection result representing the execution plan is not coincident with the execution time included by the record; and generating a legality detection result representing that the legality detection of the execution plan fails in response to the time coincidence detection result representing that the execution time included in the execution plan coincides with the execution time included in the record.
For example, taking a target internet of things device as an air conditioner 1 as an example, after an execution plan set for the air conditioner 1 is acquired, a planned task configuration table may be queried based on an identifier of the air conditioner 1, and when a record exists in the planned task configuration table, where the record is identical to the identifier of the air conditioner 1 and is mutually exclusive to an operation descriptor (for example, assuming that an operation descriptor corresponding to an operation that needs to be executed at an execution time included in the execution plan is "open" and an operation descriptor included in a record that is queried in the planned task configuration table and is identical to the identifier of the air conditioner 1 is "close"), time coincidence detection may be performed based on a planned task expression corresponding to the execution plan (assumed to be Cron expression 1) and a planned task expression corresponding to the record (assumed to be Cron expression 2), and when a time coincidence detection result indicates that an execution time included in the execution plan and an execution time included in the record are not coincident (for example, assuming that an execution time included in the execution plan and the two execution plans are not coincident, the execution times included in the execution plan and thus, the execution times included in the execution plan and the execution times included in the execution plan and the execution times are considered to be legally detected as being mutually exclusive, a legal execution time conflict, namely, the legal execution plan is generated by; when the time coincidence detection result indicates that the execution time included in the execution plan coincides with the execution time included in the record (for example, it is assumed that the execution time included in the execution plan is 11 a day, and the execution time included in the record is also 11 a day, that is, the execution plan with mutual exclusion is set for the air conditioner 1 at the same time point, and therefore, it can be considered that the two execution plans are in conflict with each other), a validity detection result indicating that the validity detection of the execution plan fails is generated.
It should be noted that, for an execution plan for which the validity detection fails, a corresponding prompt message may also be sent to a setting party of the execution plan, where the prompt message may also carry a specific reason for the setting failure, such as a conflict with a previously set execution plan, that the internet of things device does not support the currently set execution plan, and the like.
In some embodiments, for a case that there is a record in the planned task configuration table that is the same as the identifier of the target internet of things device and is mutually exclusive to the operation descriptor, performing time coincidence detection based on the planned task expression corresponding to the execution plan and the planned task expression corresponding to the record may be further implemented by: respectively generating a plurality of first bitmaps in one-to-one correspondence with respect to a plurality of time dimensions included in a plan task expression (assumed to be Cron expression 1) corresponding to an execution plan, and respectively generating a plurality of second bitmaps in one-to-one correspondence with respect to a plurality of time dimensions included in a plan task expression (assumed to be Cron expression 2) corresponding to a record; performing bitwise AND operation on the first bitmap and the second bitmap corresponding to each time dimension to obtain a result bitmap corresponding to each time dimension; and performing time coincidence detection on the execution time included by the execution plan and the execution time included by the record based on a plurality of result bitmaps corresponding to a plurality of time dimensions in a one-to-one mode.
For example, the above-mentioned multiple result bitmaps corresponding to one-to-one based on multiple time dimensions may be implemented in the following manner, and time coincidence detection may be performed on the execution time included in the execution plan and the execution time included in the record: let t satisfy: t is more than or equal to 2 and less than or equal to T-1, the time dimensions from the 1 st time dimension to the T th time dimension are in descending order, T is the total number of the plurality of time dimensions, and T is a positive integer greater than 1; when the value of each grid included in the result bitmap corresponding to the 1 st time dimension is 0, determining that the execution time included in the execution plan is not coincident with the execution time included in the record; when at least one grid value in a plurality of grids included in each result bitmap is 1 and each grid value included in the result bitmap corresponding to the t +1 th time dimension is 0 in the t result bitmaps corresponding to the 1 st to the t time dimension in a one-to-one manner, determining that the execution time included in the execution plan is not coincident with the execution time included in the record; and when at least one grid exists in a plurality of grids included in each result bitmap and has a value of 1 in the T result bitmaps corresponding to the 1 st time dimension to the T time dimension in a one-to-one manner, determining that the execution time included in the execution plan coincides with the execution time included in the record.
For example, assume that a plan task expression (assumed to be Cron expression 1) corresponding to the execution plan includes a plurality of time dimensions: generating 7 first bitmaps corresponding to each other one by one aiming at the 7 time dimensions, namely a first year bitmap, a first month bitmap, a first day bitmap, a first week bitmap, a first hour bitmap, a first division bitmap and a first second bitmap; meanwhile, it is assumed that recording the corresponding planned task expression (assumed to be Cron expression 2) includes a plurality of time dimensions as: and generating 7 second bitmaps corresponding to each other one by one for the 7 time dimensions, namely a second year bitmap, a second february bitmap, a second day bitmap, a second week bitmap, a second hour bitmap, a second division bitmap and a second bitmap. Then, performing bitwise and operation on the first year bitmap and the second year bitmap to obtain a year result bitmap (that is, a result bitmap obtained by taking the year as a time dimension), and when values in each grid included in the year result bitmap are both 0 (representing that an execution time included in the execution plan and an execution time included in the record do not coincide with each other in the time dimension of the year, for example, assuming that the execution time included in the execution plan is 2022 years and the execution time included in the record is 2021 years), determining that the execution time included in the execution plan does not coincide with the execution time included in the record (that is, the validity of the execution plan is detected to pass); when at least one of the plurality of grids included in the year result bitmap has a value of 1 (the execution time included in the representation execution plan and the execution time included in the record coincide with each other in the time dimension of the year, for example, assuming that the execution time included in the representation execution plan is 2022 years, and the execution time included in the record is also 2022 years), the first month bitmap and the second month bitmap may be bitwise and operated to obtain the month result bitmap. When the value in each grid included in the month result bitmap is 0, determining that the execution time included in the execution plan does not coincide with the execution time included in the record (i.e., although the execution time included in the execution plan and the execution time included in the record are the same year, months are different, and thus the execution times of the two are different); when at least one of the plurality of lattices included in the month result bitmap has a value of 1 (that is, the execution time is the same in the time dimension of the month), the first day bitmap and the second day bitmap may be bitwise and operated to obtain the day result bitmap. By analogy, when the execution time included in the daily result bitmap representation execution plan and the execution time included in the record coincide in the time dimension of the day, whether the execution time included in the execution plan and the execution time included in the record coincide in the time dimension of the week, the hour, the minute, and the second can be further detected. That is, when the execution time included in the execution plan does not coincide with the execution time included in the record in any time dimension, it can be determined that the validity detection of the execution plan passes; when the execution time included in the execution plan and the execution time included in the record coincide in all time dimensions, it may be determined that the validity detection of the execution plan fails.
In step 104, the execution plan is stored in the wait for execution queue in response to a validity check of the execution plan passing.
In some embodiments, the execution plan may be a plurality of periodic execution plans, and the operation of storing the execution plan into the wait execution queue in step 104 may be implemented by step 1041 shown in fig. 4, which will be described in conjunction with step 1041 shown in fig. 4.
In step 1041, for the plurality of periodic execution plans, the execution plan corresponding to the cycle closest to the current time in the plurality of cycles to be executed is stored in the queue for waiting for execution.
For example, when the execution plan set for the target internet-of-things device is a plurality of periodic execution plans, for example, assuming that the execution plan is "remind me to pay a call fee 1 month by 1 month" (the execution plan includes 12 execution plans reminding me to pay a call fee from 1 month by 1 month to 12 months), for the plurality of periodic execution plans, the execution plan corresponding to the cycle closest to the current time in the plurality of cycles to be executed may be stored in the wait execution queue (for example, assuming that the current time is 2 months and 21 days, the execution plan reminding me to pay a call fee in 1 month by 3 months may be stored in the wait execution queue).
It should be noted that, the multiple execution plans corresponding to the multiple cycles close to the current time may also be stored in the execution waiting queue at one time, or the multiple execution plans corresponding to all the cycles may be stored in the execution waiting queue at one time, or the number of the execution plans stored in the execution waiting queue may be automatically adjusted according to a cache of a device (for example, a server) (for example, when a remaining storage space of the server is greater than a storage space threshold, the multiple execution plans corresponding to the multiple cycles close to the current time may be stored in the execution waiting queue at one time, and when the remaining storage space of the server is less than the storage space threshold, only the execution plan corresponding to the cycle closest to the current time may be stored in the execution waiting queue).
In step 105, in response to the execution time being reached, the execution plan is read from the wait execution queue and converted into a machine instruction, and the machine instruction is sent to the target internet of things device.
In some embodiments, a plurality of execution plans including an execution plan set for the target internet of things device may be stored in the wait execution queue, and the plurality of execution plans may be sorted in the wait execution queue according to the order of execution time from morning to evening, so step 105 shown in fig. 3 may be implemented by steps 1051 to 1053 shown in fig. 5, which will be described with reference to steps 1051 to 1053 shown in fig. 5.
In step 1051, multiple threads are started.
In some embodiments, multiple message queue nodes (e.g., a Broker, which may be considered a message forwarder responsible for some control and management operations) may be launched in the server, and at least one thread may be launched in each message queue node.
It should be noted that, in order to save system resources of the server, when the execution time included in the execution plan is not reached (i.e., when the thread does not need to work), the plurality of threads may be controlled to be in the sleep state, and when the execution time included in the execution plan is reached (i.e., when the thread needs to work), the thread is waken up from the sleep state.
In step 1052, in response to any execution plan of the plurality of execution plans reaching the execution time, reading any execution plan from the minimum time side of the wait execution queue based on an idle thread of the plurality of threads, and converting an operation required to be executed at the execution time, which is included in any execution plan, into a machine instruction.
Here, the idle thread is used for processing any execution plan in a blocking manner (that is, before a call result returned by the internet of things device is received, the idle thread is suspended until the call result is obtained, and other operations cannot be executed continuously), and when the execution time is not reached, the idle thread is in a dormant state.
For example, it is assumed that 4 execution plans including an execution plan set for a target internet of things device are stored in the wait execution queue, and the execution plans are respectively: an execution plan a, an execution plan B, an execution plan C, and an execution plan D, where the execution plan B is an execution plan set for a target internet of things device, and assuming that an execution time included in the execution plan a is 10: execution plan B, execution plan a, execution plan C, and execution plan D. Then, in response to that any one of the execution plans reaches the execution time (for example, assuming that the current time is 9.
In some embodiments, for a case where a plurality of execution plans are stored in the wait execution queue, the following processing may also be performed: determining a performance pressure of the server based on a delay time (which may be, for example, an average delay time of the plurality of threads) of each thread in processing the execution plan stored in the wait execution queue; when the pressure value of the performance pressure is larger than the performance pressure threshold value, expanding the capacity of the server; and when the pressure value of the performance pressure is smaller than or equal to the performance pressure threshold value, carrying out capacity reduction on the server.
For example, a plurality of message queue nodes may be started in a server, and a plurality of threads may be started in each message queue node, so that the above capacity expansion of the server may be implemented in the following manner: in response to that each message queue node cannot add a thread, adding a new message queue node in the server (i.e. starting a new message queue node in the server), and starting a new thread in the new message queue node (for example, assuming that there are 3 message queue nodes started in the server, respectively a message queue node 1, a message queue node 2, and a message queue node 3, when none of the message queue nodes 1 to 3 can add a thread, a new message queue node, for example, a message queue node 4, can be started in the server to start a new thread in a message queue node 4); in response to the existence of a message queue node capable of adding a thread in a plurality of message queue nodes, starting a new thread in the message queue node capable of adding a thread (for example, assuming that there are 3 message queue nodes started in a server, respectively a message queue node 1, a message queue node 2, and a message queue node 3, where the message queue node 3 is a message queue node capable of adding a thread, a new thread may be started in the message queue node 3), so that the performance pressure of the server may be reduced by adding a thread, and the delay time of the thread in processing an execution plan may be reduced.
For example, in connection with the above, the server may be reduced in the following manner: in response to that each message queue node cannot reduce threads, closing at least one message queue node in the server (for example, assuming that 3 message queue nodes, namely, a message queue node 1, a message queue node 2, and a message queue node 3, are started in the server, when none of the message queue nodes 1 to 3 cannot reduce threads, any one of the 3 message queue nodes may be closed, for example, a message queue node 1 may be closed in the server, thereby reducing the number of threads); in response to the existence of the message queue node capable of reducing threads in the plurality of message queue nodes, closing at least one thread in the message queue node capable of reducing threads (for example, assuming that 3 message queue nodes are started in the server, namely, the message queue node 1, the message queue node 2 and the message queue node 3, respectively, wherein the message queue node 2 is the message queue node capable of reducing threads, at least one thread can be closed in the message queue node 2), so that when the performance pressure of the server is reduced, the waste of system resources of the server is avoided by reducing threads.
In step 1053, a machine instruction is sent to a core gateway of the internet of things.
Here, the core gateway is configured to send the machine instruction to an edge gateway of the internet of things according to the routing rule after receiving the machine instruction, so that the edge gateway sends the machine instruction to the target internet of things device.
For example, taking a target internet of things device as the air conditioner 1 as an example, after converting an operation that needs to be executed at an execution time and is included in an execution plan set for the air conditioner 1 into a corresponding machine instruction, the converted machine instruction may be first sent to a core gateway of the internet of things, so that after receiving the machine instruction, the core gateway may further send the machine instruction to an edge gateway according to a routing rule (for example, the machine instruction may carry an identifier of the air conditioner 1, so that the core gateway may send the machine instruction to the edge gateway matched with the identifier of the air conditioner 1), and after receiving the machine instruction, the edge gateway may determine the air conditioner 1 from a plurality of subordinate internet of things devices according to the identifier of the air conditioner 1, and send the machine instruction received from the core gateway to the air conditioner 1, so that the air conditioner 1 executes a corresponding operation (for example, start or close or the like) according to the machine instruction.
According to the device control method based on the Internet of things, after an execution plan set for a target Internet of things device in the Internet of things is obtained, the execution plan is converted into a corresponding plan task expression, then legality detection can be carried out on the execution plan based on the plan task expression, the execution plan passing the legality detection is stored into a waiting execution queue, and finally when the execution time is reached, the execution plan is read from the waiting execution queue, converted into a corresponding machine instruction and sent to the target Internet of things device; on the other hand, the execution plan is subjected to the legality detection in advance based on the plan task expression, so that the condition that a mutual exclusion instruction is set for the same Internet of things equipment can be avoided, and the stability of the Internet of things equipment in control is greatly improved.
In the following, an exemplary application of the embodiments of the present application in a practical application scenario will be described.
The internet of things equipment often needs to set a non-timely execution plan in use scenes such as smart homes, smart security, smart cities and the like, for example, "the exhaust fan is executed with a delay of 10 seconds", "1 day per month reminds me to pay a telephone fee", "10 days per working day starts a sweeping robot", and the like.
However, in the solutions provided in the related art, for the internet of things device, the user can only manually set the timing function, for example, the washing machine and the soymilk machine with the reservation function cannot be linked with the cloud. In addition, the internet of things equipment controlled by the cloud end provided by the related technology only can be set with a simple timing or delayed execution plan, and meanwhile, the cloud end execution plan control system provided by the related technology has the defects of insufficient processing capacity, high failure rate and the like. It can be seen that the solutions provided by the related art have insufficient processing capability, and the periodic execution plan needs to store all time points at a time, resulting in large storage space occupation. In addition, when a plurality of mutually exclusive operation instructions are set for the same time point of the same internet of things device, unpredictable execution results are easy to occur.
In view of this, an embodiment of the present application provides an apparatus control method based on the internet of things, and a set of solutions including detection, storage, calculation, and triggering of a periodic execution plan is designed. Besides the execution plan of the Internet of things is directly set, the system can be linked with a scene control system (for example, after no person is detected in a certain public area, a lighting system is automatically turned off after 1 minute of delay), and the scene control system can set a corresponding execution plan for the Internet of things equipment according to the logic rule of the scene control system, so that more intelligent experience is provided for a user.
Before specifically describing the device control method based on the internet of things provided by the embodiment of the present application, a framework of a cloud control system of the internet of things is described first.
For example, referring to fig. 6, fig. 6 is a schematic diagram of an architecture of an internet of things cloud control system provided in the embodiment of the present application, as shown in fig. 6, an architecture of a typical internet of things cloud control system may be simplified into a client, a service layer, a control layer, an access layer, and an internet of things device (which may include multiple internet of things devices, for example, an internet of things device 1, an internet of things device 2, and an internet of things device 3). The following describes a specific implementation process for managing and triggering the execution plan under the architecture of a complete internet of things cloud control system with reference to fig. 6. Firstly, a user can set an execution plan for certain internet of things equipment (such as the internet of things equipment 1, for example, an air conditioner) by taking an APP or a Web page running on terminal equipment (such as a mobile phone, a computer and the like) as a setting inlet; then, after receiving the execution plan set by the user, the plan task management system converts the execution plan set by the user into a corresponding Cron expression and stores the Cron expression. Meanwhile, the plan task management system can also determine the execution time from the execution plan set by the user and record the execution time. When the system time reaches the execution time, a trigger in the plan task management system sends an execution plan set by a user to the equipment shadow model system, so that the equipment shadow model system translates the execution plan set by the user into a corresponding machine instruction according to the current state of the Internet of things equipment, and calls an instruction system to issue the machine instruction. For example, the instruction system may issue the machine instruction to a core gateway of the internet of things, so that the core gateway issues the machine instruction to an edge gateway of the internet of things according to the routing rule, and the edge gateway may deliver the machine instruction to a target internet of things device (i.e., the internet of things device 1, i.e., an air conditioner) for execution.
The following describes an apparatus control method based on the internet of things provided in the embodiment of the present application in detail.
For example, referring to fig. 7, fig. 7 is a schematic flowchart of a device control method based on the internet of things according to an embodiment of the present application, and as shown in fig. 7, after a user inputs an execution plan once, a server processes the execution plan, stores the processed execution plan in a queue waiting for execution, and after the execution plan is processed, calculates the next execution plan and stores the next execution plan in the queue waiting for execution, and the process is repeated to achieve the purpose of periodic execution. The data structure can satisfy two use scenes of periodic execution and timing execution. In addition, only the last executed task of the execution plan (for example, an operation that needs to be executed at the execution time included in the execution plan corresponding to the cycle that is the latest in the current time) may be stored in the execution waiting queue, so that the purpose of saving the storage space is achieved.
The method for controlling the equipment based on the internet of things provided by the embodiment of the application is mainly divided into two parts, wherein the first part is the setting of an execution plan, and the second part is the triggering of the execution plan, which are respectively described below.
Setting of execution plan
In some embodiments, referring to fig. 8, fig. 8 is a schematic view of a setting flow of an execution plan provided in the embodiment of the present application, and as shown in fig. 8, after an execution plan set by a user for a certain internet of things device is received, a Cron expression corresponding to the execution plan is first calculated, and stored by using characteristics of the Cron expression, for example, the Cron expression may be stored in a database, or may be stored in an internal memory. When a periodic execution plan (or instruction) is set, validity of the execution plan setting needs to be detected, for example, whether operations (i.e., tasks) that need to be executed in execution time included in the execution plan are supported by the internet of things device is detected, whether a mutually exclusive execution plan exists needs to be detected (for example, whether time dimensions overlap by using a bitmap calculation is detected), and if the mutually exclusive execution plan exists and the execution time overlaps, validity detection of the execution plan set this time fails. In addition, for an execution plan that passes the validity detection (i.e., an execution plan that is successfully set), it is necessary to immediately generate an execution time using a Cron expression, store a task to be triggered (e.g., an operation that needs to be executed at the execution time included in the execution plan) in the queue to be executed, and wait for the trigger to execute.
The time coincidence detecting process in the setting of the execution plan is specifically described below.
In some embodiments, each Cron expression may consist of 7 parts, from left to right: second, minute, hour, day, month, week, year, the server may generate 7 bitmaps corresponding one-to-one for the 7 time dimensions after parsing the Cron expression. The following description will be made by taking the annual map as an example.
For example, referring to fig. 9, fig. 9 is a schematic diagram illustrating a principle of performing bitwise and operation on two year bitmaps according to an embodiment of the present application, as shown in fig. 9, a bitmap may be stored in a memory by using continuous spaces, a value in each grid is 0 or 1, a subscript is a corresponding year, cron expression 1 and Cron expression 2 respectively indicate whether two data are executed every year from 1970 to 2100, and performing bitwise and operation on two bitmaps generated by Cron expression 1 and Cron expression 2 respectively may obtain a result bitmap, and if values of all grids in the result bitmap are 0, it indicates that Cron expression 1 and Cron expression 2 do not conflict in a time dimension of the year (that an execution plan set this time does not coincide with an execution plan included in a record queried in a plan task configuration table).
Similarly, besides the year bitmap, the month bitmap, the day bitmap, the week bitmap, the hour bitmap, the minute bitmap, and the second bitmap can be used to detect whether they overlap, and the description will be made with reference to fig. 10.
For example, referring to fig. 10, fig. 10 is a schematic flowchart of a time coincidence detection provided in the embodiment of the present application, and as shown in fig. 10, after receiving an execution plan set for a certain internet of things device (e.g., the internet of things device 1), first determining whether multiple execution plans exist (i.e., multiple execution plans set for the internet of things device 1), and if not, determining that the current execution plan is successfully set; when the execution plans exist, generating a corresponding bitmap for each execution plan (for example, generating a group of bitmaps including a year bitmap, a month bitmap, a day bitmap, a week bitmap, an hour bitmap, a minute bitmap and a second bitmap for a Cron expression corresponding to each execution plan), and then detecting whether the time of each execution plan coincides with that of each other, wherein the specific process is as follows: firstly, whether annual bitmaps conflict or not is detected (namely whether execution time coincides in time dimension of the year, a specific detection process can refer to the description of fig. 9, and the embodiment of the application is not repeated here), when the annual bitmap detection result representations do not conflict, it is determined that the execution plan setting of the current time is successful, when the annual bitmap detection result representations conflict, it is detected that the monthly bitmaps conflict or not, when the monthly bitmap detection result representations do not conflict, it is determined that the execution plan setting of the current time is successful, when the monthly bitmap detection result representations conflict, it is continuously detected that the daily bitmaps conflict or not, and so on, until it is detected that the second bitmaps conflict or not, and when the bitmap detection results of all time dimensions conflict, it is determined that the execution plan setting of the current time is failed.
(II) triggering of execution plan
After the setting flow for the execution plan is performed, a wait execution queue storing a plurality of execution plans may be obtained, and the trigger is required to perform the trigger operation according to the order in the wait execution queue. The execution plans stored in the queue waiting for execution are sorted according to the sequence of the execution time, so that the trigger only needs to acquire the next execution plan from the side of the minimum time of the queue waiting for execution.
For example, referring to fig. 11, fig. 11 is a schematic diagram illustrating a principle of processing multiple execution plans stored in a wait execution queue according to an embodiment of the present application, and as shown in fig. 11, multiple threads (e.g., 3 consuming threads) may be simultaneously started in a trigger, and a next execution plan is obtained from the wait execution queue in a blocking manner. When the system time does not reach the execution time of the next execution plan, the consuming thread is blocked until the execution time of the execution plan arranged at the top in the waiting execution queue reaches, and at the moment, the consuming thread is woken up. Such message logic may be implemented by a script (e.g., lua script in Redis). After the consumption thread acquires the execution plan, a control layer downstream may be called to perform specific execution according to an identifier (e.g., ID) of the internet of things device carried in the execution plan and an operation to be executed, for example, as shown in the architecture in fig. 1, so that the detection, storage, calculation, and trigger processing of a complete execution plan are completed.
In other embodiments, when the number of execution plans to be executed stored in the wait execution queue increases to exceed the processing capability of the fixed thread number, backlog of the execution plans may be caused, which may result in delayed execution of the execution plans, which may impair the product experience of the user, and therefore an adaptive feedback process is also required to dynamically adjust the number of threads.
For example, referring to fig. 12, fig. 12 is a schematic diagram illustrating a principle of adjusting the number of threads according to an embodiment of the present disclosure, as shown in fig. 12, the performance pressure of the entire cloud control system of the product networking may be inferred according to a delay time (for example, an average delay time of a plurality of threads) of each thread when processing an execution plan stored in a wait execution queue, and when a pressure value of the performance pressure is greater than a pressure threshold, it is determined that capacity expansion is required (when it is determined that capacity expansion is required, it is first detected whether each breaker has a thread that can be increased, when each breaker cannot increase the thread, a breaker is increased; when the pressure value of the performance pressure is smaller than or equal to the pressure threshold value, capacity reduction is determined to be needed (when capacity reduction is determined to be needed, whether threads exist in each brooker can be reduced is detected firstly, when the threads cannot be reduced in each brooker, the brookers are reduced, and when the brookers capable of reducing the threads exist, the threads are reduced in the brookers capable of reducing the threads). Therefore, the internet of things cloud control system can automatically adjust the number of threads of the whole processing capacity or expand or contract the capacity of the cluster according to the feedback data (namely the pressure value of the performance pressure), for example, an automatic capacity expansion and contraction mechanism of a public cloud (for example, tencent cloud) can be used, and the capacity expansion and contraction can also be performed manually.
It should be noted that the device control method based on the internet of things provided by the embodiment of the present application may be applied to a cloud internet of things control system, and may also be applied to an edge internet of things control system, for example, the device control method based on the internet of things provided by the embodiment of the present application may be applied to hardware devices such as a home gateway, and thus is not dependent on the internet to execute.
To sum up, the device control method based on the internet of things provided by the embodiment of the application has the following beneficial effects:
1) The storage space of the periodic execution plan can be saved, each time point of the periodic execution plan does not need to be stored, the execution time included in the execution plan of the next cycle is calculated after the execution plan of the previous cycle is processed, and the storage cost is saved;
2) Whether the execution time included by the execution plan is overlapped and whether the execution plan is set reasonably (for example, whether the operation included by the execution plan is supported by the equipment of the internet of things) can be detected in advance, so that the execution success rate is improved;
3) The performance of the whole cloud Internet of things control system can be dynamically adjusted, automatic expansion and contraction are achieved by means of real-time feedback data, and cost is saved.
Continuing with the exemplary structure of the internet-of-things based device control apparatus 243 provided by the embodiment of the present application implemented as software modules, in some embodiments, as shown in fig. 2, the software modules stored in the internet-of-things based device control apparatus 243 of the memory 240 may include: an acquisition module 2431, a determination module 2432, a detection module 2433, a storage module 2434, a reading module 2435, a conversion module 2436, and a sending module 2437.
An obtaining module 2431, configured to obtain an execution plan set for a target internet of things device in the internet of things, where the execution plan includes an execution time and an operation that needs to be executed at the execution time; a determining module 2432, configured to determine a plan task expression corresponding to the execution plan, where the plan task expression is used to describe the execution plan in a form of a character string; a detection module 2433, configured to perform validity detection on the execution plan based on the plan task expression; a storing module 2434, configured to store the execution plan in the wait for execution queue in response to passing of validity detection of the execution plan; a reading module 2435, configured to read the execution plan from the wait execution queue in response to reaching the execution time; a conversion module 2436 to convert the execution plan to machine instructions; the sending module 2437 is configured to send the machine instruction to the target internet of things device.
In some embodiments, the obtaining module 2431 is further configured to perform at least one of the following: acquiring an execution plan set by a target object for target Internet of things equipment, wherein the execution plan is set by the target object through a client or a webpage; and acquiring an execution plan set by the scene control system for the target Internet of things equipment, wherein the execution plan is set by the scene control system based on logic rules.
In some embodiments, the detection module 2433 is further configured to perform support detection on the target internet of things device based on the execution plan; the sending module 2437 is further configured to send a prompt message to a setting party of the execution plan in response to the detection result representation that the target internet of things device does not support the operation that needs to be executed at the execution time and is included in the execution plan, where the prompt message is used to prompt that the target internet of things device does not support the operation that needs to be executed at the execution time and is included in the execution plan; the determining module 2432 is further configured to shift to a step of determining a plan task expression corresponding to the execution plan in response to the operation that needs to be executed at the execution time and is included in the support of the execution plan by the target internet of things device in response to the detection result.
In some embodiments, the internet of things based device control apparatus 243 further includes a query module 2438 for querying the scheduled task configuration table based on the identification of the target internet of things device; the internet-of-things-based device control apparatus 243 further includes a generating module 2439, configured to generate a validity detection result of the execution plan based on the query result; the planning task configuration table comprises the identifications of a plurality of internet of things devices, and a planning task expression and an operation descriptor which are respectively corresponding to each internet of things device.
In some embodiments, the generating module 2439 is further configured to generate a validity detection result that represents that validity detection of the execution plan passes when no record that is identical to the identifier of the target internet of things device and is mutually exclusive to the operation descriptor exists in the plan task configuration table; the storage module 2434 is further configured to store the execution plan passed by the validity detection in the planned task configuration table.
In some embodiments, the detection module 2433 is further configured to, when there is a record that is the same as the identifier of the target internet of things device and is mutually exclusive with the operation descriptor in the planned task configuration table, perform time coincidence detection based on a planned task expression corresponding to the execution plan and a planned task expression corresponding to the record; the generating module 2439 is further configured to generate a validity detection result that validity detection of the representation execution plan passes in response to that an execution time included in the representation execution plan of the time coincidence detection result does not coincide with an execution time included in the record; and generating a legality detection result representing that the legality detection of the execution plan fails in response to that the execution time included by the time coincidence detection result representing the execution plan coincides with the execution time included by the record.
In some embodiments, the generating module 2439 is further configured to generate a plurality of first bitmaps in a one-to-one correspondence with respect to a plurality of time dimensions included in the plan task expression corresponding to the execution plan, and generate a plurality of second bitmaps in a one-to-one correspondence with respect to a plurality of time dimensions included in the plan task expression corresponding to the record; performing bitwise and operation on the first bitmap and the second bitmap corresponding to each time dimension to obtain a result bitmap corresponding to each time dimension; the detection module 2433 is further configured to perform time coincidence detection on the execution time included in the execution plan and the execution time included in the record based on a plurality of result bitmaps corresponding to a plurality of time dimensions in a one-to-one manner.
In some embodiments, the detecting module 2433 is further configured to: let t satisfy: t is more than or equal to 2 and less than or equal to T-1, and the 1 st time dimension and the Tth time dimension are descending order of the time dimensions, wherein T is the total number of the time dimensions, and T is a positive integer more than 1; when the value of each grid included in the result bitmap corresponding to the 1 st time dimension is 0, determining that the execution time included in the execution plan is not coincident with the execution time included in the record; when at least one grid value in a plurality of grids included in each result bitmap is 1 and each grid value included in the result bitmap corresponding to the t +1 th time dimension is 0 in the t result bitmaps corresponding to the 1 st to the t time dimension in a one-to-one manner, determining that the execution time included in the execution plan is not coincident with the execution time included in the record; when the value of at least one grid in a plurality of grids included in each result bitmap is 1 in the T result bitmaps corresponding from the 1 st time dimension to the T time dimension in a one-to-one manner, determining that the execution time included in the execution plan coincides with the execution time included in the record.
In some embodiments, the storing module 2434 is further configured to store, for the multiple periodic execution plans, an execution plan corresponding to a cycle closest to the current time in the multiple cycles to be executed into the wait execution queue.
In some embodiments, the reading module 2435 is further configured to, in response to any one of the plurality of execution plans reaching the execution time, read any one of the execution plans from the minimum time side of the wait execution queue based on an idle thread of the plurality of threads; a conversion module 2436, configured to convert an operation, included in any execution plan, that needs to be executed at an execution time into a machine instruction; the idle thread processes any execution plan in a blocking mode, and is in a dormant state when the execution time is not reached.
In some embodiments, the determining module 2432 is further configured to determine the performance pressure of the server based on a delay time of each thread in processing the execution plan stored in the wait execution queue; the device control apparatus 243 based on the internet of things further includes a capacity expansion module 24310 and a capacity reduction module 24311, where the capacity expansion module 24310 is configured to, when a pressure value of the performance pressure is greater than a performance pressure threshold, expand the capacity of the server; and the capacity reducing module 24311 is configured to reduce the capacity of the server when the pressure value of the performance pressure is less than or equal to the performance pressure threshold.
In some embodiments, the capacity expansion module 24310 is further configured to add a new message queue node in the server and start a new thread in the new message queue node in response to each message queue node failing to add a thread; and for starting a new thread in the message queue node capable of adding a thread in response to the existence of the message queue node capable of adding a thread in the plurality of message queue nodes; a capacity reduction module 24311, further configured to close at least one message queue node in the server in response to each message queue node failing to reduce threads; and means for turning off at least one thread in the thread-capable message queue nodes in response to a thread-capable message queue node being present in the plurality of message queue nodes.
In some embodiments, the sending module 2437 is further configured to send the machine instruction to a core gateway of the internet of things, where the core gateway is configured to send the machine instruction to an edge gateway of the internet of things according to the routing rule after receiving the machine instruction, so that the edge gateway sends the machine instruction to the target internet of things device.
It should be noted that the description of the apparatus in the embodiment of the present application is similar to the description of the method embodiment, and has similar beneficial effects to the method embodiment, and therefore, the description is not repeated. Inexhaustible technical details in the device control apparatus based on the internet of things provided by the embodiment of the application can be understood according to the description of any one of the drawings in fig. 3 to 5.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions (i.e., executable instructions) stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the electronic device executes the method for controlling the device based on the internet of things according to the embodiment of the present application.
Embodiments of the present application provide a computer-readable storage medium storing executable instructions, which when executed by a processor, cause the processor to execute an internet of things-based device control method provided in an embodiment of the present application, for example, the internet of things-based device control method as shown in any one of fig. 3 to 5.
In some embodiments, the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
As an example, executable instructions may be deployed to be executed on one electronic device or on multiple electronic devices located at one site or distributed across multiple sites and interconnected by a communication network.
The above description is only an example of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (15)

1. An equipment control method based on the Internet of things is characterized by comprising the following steps:
acquiring an execution plan set for target Internet of things equipment in the Internet of things, wherein the execution plan comprises execution time and operation required to be executed at the execution time;
determining a plan task expression corresponding to the execution plan, wherein the plan task expression is used for describing the execution plan in a character string form;
inquiring a plan task configuration table based on the identification of the target Internet of things equipment, when a record which is the same as the identification of the target Internet of things equipment and has mutually exclusive operation descriptors exists in the plan task configuration table, generating a plurality of first bitmaps in one-to-one correspondence according to a plurality of time dimensions included in a plan task expression corresponding to the execution plan, and generating a plurality of second bitmaps in one-to-one correspondence according to a plurality of time dimensions included in the plan task expression corresponding to the record;
performing bitwise AND operation on the first bitmap and the second bitmap corresponding to each time dimension to obtain a result bitmap corresponding to each time dimension;
performing time coincidence detection on the execution time included by the execution plan and the execution time included by the record based on a plurality of result bitmaps corresponding to the plurality of time dimensions in a one-to-one manner;
responding to the execution time included by the time coincidence detection result representing the execution plan and the execution time included by the record not coincident, and generating a validity detection result representing that validity detection of the execution plan passes;
in response to a pass in the validity detection of the execution plan, storing the execution plan in a wait for execution queue;
in response to the execution time being reached, reading the execution plan from the wait execution queue, converting the execution plan into a machine instruction, and sending the machine instruction to the target internet of things device.
2. The method of claim 1, wherein obtaining the execution plan set for the target internet of things device in the internet of things comprises:
performing at least one of the following processes:
acquiring an execution plan set by a target object for the target Internet of things equipment, wherein the execution plan is set by the target object through a client or a webpage;
acquiring an execution plan set by a scene control system for the target Internet of things equipment, wherein the execution plan is set by the scene control system based on a logic rule.
3. The method of claim 1, wherein after obtaining the execution plan set for the target internet of things device in the internet of things, the method further comprises:
performing support detection on the target Internet of things equipment based on the execution plan;
in response to a detection result of support indicating that the target internet of things device does not support the operation which is required to be executed at the execution time and included in the execution plan, sending a prompt message to a setting party of the execution plan, wherein the prompt message is used for prompting that the target internet of things device does not support the operation which is required to be executed at the execution time and included in the execution plan;
and in response to the fact that the target Internet of things equipment supports the operation which needs to be executed in the execution time and is included in the execution plan and is represented by the support detection result, executing a step of determining a plan task expression corresponding to the execution plan.
4. The method of claim 1, wherein the scheduled task configuration table comprises identifications of a plurality of internet of things devices, and a scheduled task expression and an operation descriptor corresponding to each internet of things device.
5. The method of claim 1, further comprising:
when no record which is the same as the identification of the target Internet of things equipment and has mutually exclusive operation descriptors exists in the plan task configuration table, generating a legality detection result representing that the legality detection of the execution plan passes;
the method further comprises the following steps:
and storing the execution plan passing the legality detection into the plan task configuration table.
6. The method of claim 1, further comprising:
and generating a legality detection result representing legality detection failure of the execution plan in response to that the execution time included in the execution plan represented by the time coincidence detection result is coincided with the execution time included in the record.
7. The method of claim 1,
the time coincidence detection of the execution time included in the execution plan and the execution time included in the record based on the result bitmaps corresponding to the time dimensions in a one-to-one manner includes:
let t satisfy: t is more than or equal to 2 and less than or equal to T-1, and the time dimensions are in descending order from the 1 st time dimension to the Tth time dimension, wherein T is the total number of the time dimensions, and T is a positive integer greater than 1;
when the value of each grid included in the result bitmap corresponding to the 1 st time dimension is 0, determining that the execution time included in the execution plan is not coincident with the execution time included in the record;
when the value of at least one grid in a plurality of grids included in each result bitmap is 1 and the value of each grid included in the result bitmap corresponding to the t +1 time dimension is 0, in t result bitmaps corresponding to the 1 st to the t time dimensions in a one-to-one manner, determining that the execution time included in the execution plan is not coincident with the execution time included in the record;
when at least one grid exists in a plurality of grids included in each of the T result bitmaps corresponding from the 1 st time dimension to the T th time dimension in a one-to-one manner, the value of 1 is determined, and the execution time included in the execution plan coincides with the execution time included in the record.
8. The method of claim 1,
the execution plan comprises a plurality of periodic execution plans;
the storing the execution plan into a wait for execution queue includes:
and aiming at the plurality of periodical execution plans, storing the execution plan corresponding to the cycle closest to the current time in the plurality of cycles to be executed into a waiting execution queue.
9. The method of claim 1,
a plurality of execution plans including an execution plan set for the target internet of things device are stored in the waiting execution queue, and the execution plans are sequenced in the waiting execution queue from early to late according to execution time;
the reading the execution plan from the wait for execution queue and converting into machine instructions in response to reaching the execution time, comprising:
starting a plurality of threads;
in response to any execution plan in the plurality of execution plans reaching an execution time, reading the any execution plan from the minimum time side of the waiting execution queue based on an idle thread in the plurality of threads, and converting an operation which needs to be executed at the execution time and is included in the any execution plan into a machine instruction;
wherein the idle thread processes the any execution plan in a blocking mode, and is in a dormant state when the execution time is not reached.
10. The method of claim 9, further comprising:
determining a performance pressure of a server based on a delay time of each of the threads in processing the execution plans stored in the wait for execution queue;
when the pressure value of the performance pressure is larger than the performance pressure threshold value, expanding the capacity of the server;
and when the pressure value of the performance pressure is smaller than or equal to the performance pressure threshold value, carrying out capacity reduction on the server.
11. The method of claim 10,
the server comprises a plurality of message queue nodes, and each message queue node comprises a plurality of threads;
the expanding the capacity of the server includes:
responding to the situation that each message queue node cannot be added with a thread, adding a new message queue node in the server, and starting a new thread in the new message queue node;
in response to a message queue node capable of adding a thread existing in the plurality of message queue nodes, starting a new thread in the message queue node capable of adding a thread;
the capacity reduction of the server comprises the following steps:
responsive to each of said message queue nodes failing to reduce threads, shutting down at least one of said message queue nodes in said server;
in response to a thread-decrementable message queue node among the plurality of message queue nodes, shutting down at least one thread among the thread-decrementable message queue nodes.
12. The method of claim 1, wherein the sending the machine instruction to the target internet of things device comprises:
and sending the machine instruction to a core gateway of the Internet of things, wherein the core gateway is used for sending the machine instruction to an edge gateway of the Internet of things according to a routing rule after receiving the machine instruction, so that the edge gateway sends the machine instruction to the target Internet of things equipment.
13. An equipment control device based on the internet of things, the device comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring an execution plan set for target Internet of things equipment in the Internet of things, and the execution plan comprises execution time and operation required to be executed at the execution time;
the determining module is used for determining a plan task expression corresponding to the execution plan, wherein the plan task expression is used for describing the execution plan in a character string form;
the query module is used for querying a plan task configuration table based on the identification of the target Internet of things equipment;
a generating module, configured to generate, when there is a record in the planned task configuration table that is identical to the identifier of the target internet of things device and is mutually exclusive of the operation descriptors, a plurality of first bitmaps that correspond to one another for a plurality of time dimensions included in a planned task expression corresponding to the execution plan, and a plurality of second bitmaps that correspond to one another for a plurality of time dimensions included in the planned task expression corresponding to the record; performing bitwise AND operation on the first bitmap and the second bitmap corresponding to each time dimension to obtain a result bitmap corresponding to each time dimension;
a detection module, configured to perform time coincidence detection on the execution time included in the execution plan and the execution time included in the record based on a plurality of result bitmaps that are in one-to-one correspondence with the plurality of time dimensions;
the generating module is further used for responding to the fact that the execution time included by the time coincidence detection result for representing the execution plan is not coincident with the execution time included by the record, and generating a validity detection result for representing the validity detection passing of the execution plan;
the storage module is used for responding to the passing of the legality detection of the execution plan and storing the execution plan into a waiting execution queue;
a reading module, configured to read the execution plan from the wait execution queue in response to reaching the execution time;
a conversion module for converting the execution plan into machine instructions;
and the sending module is used for sending the machine instruction to the target Internet of things equipment.
14. An electronic device, characterized in that the electronic device comprises:
a memory for storing executable instructions;
a processor configured to implement the method of controlling an internet of things-based device of any one of claims 1 to 12 when executing the executable instructions stored in the memory.
15. A computer-readable storage medium storing executable instructions for implementing the internet of things-based device control method of any one of claims 1 to 12 when executed by a processor.
CN202210237416.XA 2022-03-11 2022-03-11 Equipment control method and device based on Internet of things, electronic equipment and storage medium Active CN114650310B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210237416.XA CN114650310B (en) 2022-03-11 2022-03-11 Equipment control method and device based on Internet of things, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210237416.XA CN114650310B (en) 2022-03-11 2022-03-11 Equipment control method and device based on Internet of things, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114650310A CN114650310A (en) 2022-06-21
CN114650310B true CN114650310B (en) 2023-03-14

Family

ID=81993409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210237416.XA Active CN114650310B (en) 2022-03-11 2022-03-11 Equipment control method and device based on Internet of things, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114650310B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115981811B (en) * 2022-12-19 2024-03-15 上海新迪数字技术有限公司 Task scheduling method, system, electronic device and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014005535A1 (en) * 2012-07-04 2014-01-09 中兴通讯股份有限公司 Message processing method, device and system for internet of things
CN109951559A (en) * 2019-03-27 2019-06-28 京东方光科技有限公司 Timed task configuration method, server, system and computer readable storage medium
CN110971614A (en) * 2019-12-17 2020-04-07 软通动力信息技术(集团)有限公司 Internet of things adaptation method and system, computer equipment and storage medium
CN111324077A (en) * 2020-04-07 2020-06-23 四川虹美智能科技有限公司 Internet of things equipment control method, device and system
CN111818155A (en) * 2020-07-07 2020-10-23 腾讯科技(深圳)有限公司 Equipment control method and device based on Internet of things and computer program product
CN112799789A (en) * 2021-03-22 2021-05-14 腾讯科技(深圳)有限公司 Node cluster management method, device, equipment and storage medium
CN113140279A (en) * 2020-04-23 2021-07-20 罗姆科技股份有限公司 Method and system for describing and recommending optimal rehabilitation plan in adaptive telemedicine
CN113626379A (en) * 2021-08-10 2021-11-09 中国工商银行股份有限公司 Research and development data management method, device, equipment and medium
CN113900834A (en) * 2021-09-24 2022-01-07 天津同阳科技发展有限公司 Data processing method, device, equipment and storage medium based on Internet of things technology

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103885364B (en) * 2014-03-24 2016-09-28 三和智控(北京)系统集成有限公司 A kind of method called by the dynamic delay of schedule queue realization control logic
US11768823B2 (en) * 2016-02-17 2023-09-26 Verizon Patent And Licensing Inc. Rules execution system for IoT devices
CN111091343B (en) * 2018-10-24 2021-03-12 北京乐柏信息咨询有限公司 Teaching resource detection method and computer storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014005535A1 (en) * 2012-07-04 2014-01-09 中兴通讯股份有限公司 Message processing method, device and system for internet of things
CN109951559A (en) * 2019-03-27 2019-06-28 京东方光科技有限公司 Timed task configuration method, server, system and computer readable storage medium
CN110971614A (en) * 2019-12-17 2020-04-07 软通动力信息技术(集团)有限公司 Internet of things adaptation method and system, computer equipment and storage medium
CN111324077A (en) * 2020-04-07 2020-06-23 四川虹美智能科技有限公司 Internet of things equipment control method, device and system
CN113140279A (en) * 2020-04-23 2021-07-20 罗姆科技股份有限公司 Method and system for describing and recommending optimal rehabilitation plan in adaptive telemedicine
CN111818155A (en) * 2020-07-07 2020-10-23 腾讯科技(深圳)有限公司 Equipment control method and device based on Internet of things and computer program product
CN112799789A (en) * 2021-03-22 2021-05-14 腾讯科技(深圳)有限公司 Node cluster management method, device, equipment and storage medium
CN113626379A (en) * 2021-08-10 2021-11-09 中国工商银行股份有限公司 Research and development data management method, device, equipment and medium
CN113900834A (en) * 2021-09-24 2022-01-07 天津同阳科技发展有限公司 Data processing method, device, equipment and storage medium based on Internet of things technology

Also Published As

Publication number Publication date
CN114650310A (en) 2022-06-21

Similar Documents

Publication Publication Date Title
US9953639B2 (en) Voice recognition system and construction method thereof
CN114662159A (en) Data processing method, device and equipment
CN111767144B (en) Transaction route determination method, device, equipment and system for transaction data
CN114650310B (en) Equipment control method and device based on Internet of things, electronic equipment and storage medium
CN112486915A (en) Data storage method and device
CN102882988A (en) Method, device and equipment for acquiring address information of resource information
CN109586970B (en) Resource allocation method, device and system
CN115329170A (en) Webpage crawling method, device, equipment and storage medium
CN114595972A (en) Smart city management method applying virtual digital people
CN109542917B (en) Data reading method and computer readable medium
CN112257884B (en) Order management method and system
US9621656B2 (en) Distributed deployment device and method
CN105138372A (en) Backstage service management and control system and method based on Android system
WO2021174779A1 (en) Data pre-processing system and method, computer device, and readable storage medium
CN113626438B (en) Data table management method, device, computer equipment and storage medium
CN104079540A (en) Method, device and system of updating application as well as user equipment
CN113326172B (en) Operation and maintenance knowledge processing method, device and equipment
CN110109986B (en) Task processing method, system, server and task scheduling system
TWI654528B (en) System and method for automatic construction and horizontal extension of service elements based on dynamic clustering rule template
CN104462235A (en) Internet of Things general event service mechanism based on Restful Web Service
CN112100226B (en) Data query method and computer readable storage medium
KR20190077926A (en) Iot device monitoring framework, fog server equipped with the same and fog computing system
CN113360558A (en) Data processing method, data processing device, electronic device, and storage medium
CN113852501A (en) Intelligent linkage system and method for Internet of things equipment
CN111522642A (en) Method for acquiring state monitoring data of wind turbine generator, query method and electronic equipment

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40071971

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant