CN115550305A - Equipment control method and related device - Google Patents

Equipment control method and related device Download PDF

Info

Publication number
CN115550305A
CN115550305A CN202211190901.2A CN202211190901A CN115550305A CN 115550305 A CN115550305 A CN 115550305A CN 202211190901 A CN202211190901 A CN 202211190901A CN 115550305 A CN115550305 A CN 115550305A
Authority
CN
China
Prior art keywords
target
message
state
tracking
terminal equipment
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.)
Granted
Application number
CN202211190901.2A
Other languages
Chinese (zh)
Other versions
CN115550305B (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.)
Shenzhen Kaidisi Intelligent Technology Co ltd
Original Assignee
Shenzhen Kaidisi Intelligent Technology 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 Shenzhen Kaidisi Intelligent Technology Co ltd filed Critical Shenzhen Kaidisi Intelligent Technology Co ltd
Priority to CN202211190901.2A priority Critical patent/CN115550305B/en
Publication of CN115550305A publication Critical patent/CN115550305A/en
Application granted granted Critical
Publication of CN115550305B publication Critical patent/CN115550305B/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/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • 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]

Abstract

The embodiment of the application discloses a device control method and a related device, which are applied to a server in an Internet of things system, wherein the Internet of things system also comprises at least one terminal device, each terminal device corresponds to a unique identifier, and the method comprises the following steps: acquiring a target message, wherein the target message carries a target unique identifier of target terminal equipment; acquiring the switch state of a target message tracking switch corresponding to the target unique identifier; detecting whether the tracking state of the target terminal equipment is in an opening state or not according to the switching state; and when the tracking state of the target terminal equipment is in an opening state, asynchronously distributing the target message to a specified processing module for service operation. By adopting the embodiment of the application, the message tracking efficiency can be improved.

Description

Equipment control method and related device
Technical Field
The present application relates to the field of electronic technologies and communications technologies, and in particular, to an apparatus control method and a related device.
Background
With the development of the internet of things, the types of terminal devices are increasing, service interaction logic between a terminal and an internet of things (IoT) platform is also increasing complex, and when the terminal developer and the IoT platform are in docking interaction, a large number of protocols and logic between the protocols need to be docked and debugged. The tedious debugging work requires the IoT platform developer and the terminal developer to coordinate, process and feed back various detailed problems, such as abnormal feedback, whether a message link is abnormal, whether a message arrives, whether a message is replied, and the like. For the debugging problem of the type, if the platform side can feed back to the terminal developer in time, the development efficiency is improved, and unnecessary time cost is saved. However, the platform side needs a fixed or relatively fixed person to process and feed back the debugging problem in the whole product cycle, and thus the message tracing efficiency is low, and therefore, the problem of how to improve the message tracing efficiency needs to be solved urgently.
Disclosure of Invention
The embodiment of the application provides an equipment control method and a related device, which can improve the message tracking efficiency.
In a first aspect, an embodiment of the present application provides an apparatus control method, which is applied to a server in an internet of things system, where the internet of things system further includes at least one terminal apparatus, and each terminal apparatus corresponds to a unique identifier, where the method includes:
acquiring a target message, wherein the target message carries a target unique identifier of target terminal equipment;
acquiring the switch state of a target message tracking switch corresponding to the target unique identifier;
detecting whether the tracking state of the target terminal equipment is in an on state or not according to the on-off state;
and when the tracking state of the target terminal equipment is in an opening state, asynchronously distributing the target message to a specified processing module for service operation.
In a second aspect, an embodiment of the present application provides an apparatus control device, which is applied to a server in an internet of things system, where the internet of things system further includes at least one terminal device, each terminal device corresponds to a unique identifier, and the apparatus includes: an acquisition unit, a detection unit and a service processing unit, wherein,
the acquisition unit is used for acquiring a target message, and the target message carries a target unique identifier of target terminal equipment; acquiring the switch state of a target message tracking switch corresponding to the target unique identifier;
the detection unit is used for detecting whether the tracking state of the target terminal equipment is in an on state or not through the on-off state;
and the service processing unit is used for asynchronously distributing the target message to a specified processing module for service operation when the tracking state of the target terminal equipment is in an open state.
In a third aspect, an embodiment of the present application provides a server, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps in the first aspect of the embodiment of the present application.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program enables a computer to perform some or all of the steps described in the first aspect of the embodiment of the present application.
In a fifth aspect, embodiments of the present application provide a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, where the computer program is operable to cause a computer to perform some or all of the steps as described in the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
The embodiment of the application has the following beneficial effects:
the method for controlling the equipment and the related device are applied to a server in an Internet of things system, the Internet of things system further comprises at least one terminal device, each terminal device corresponds to a unique identifier, a target message is obtained, the target message carries the unique target identifier of the target terminal device, the on-off state of a target message tracking switch corresponding to the unique target identifier is obtained, whether the tracking state of the target terminal device is in the on state or not is detected through the on-off state, when the tracking state of the target terminal device is in the on state, the target message is asynchronously distributed to a specified processing module for business operation, and then the corresponding message tracking switch can be obtained through the identifier of the terminal device, so that message tracking is achieved, and message tracking efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of an internet of things system for implementing a device control method according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of an apparatus control method according to an embodiment of the present application;
FIG. 3 is a schematic illustration of a rule engine expression provided by an embodiment of the present application;
fig. 4 is a data flow diagram of an IoT device development aid data flow provided in an embodiment of the present application;
FIG. 5 is a schematic diagram illustrating a switch flag keep-alive sequence according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a server according to an embodiment of the present application;
fig. 7 is a block diagram of functional units of an apparatus control device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," and the like in the description and claims of the present application and in the foregoing drawings are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may alternatively include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In this embodiment, the terminal device may include at least one of the following: may include, but is not limited to: a smart phone, a tablet computer, a smart robot, an in-vehicle device, a wearable device, a smart car, a smart home device, a computing device or other processing device connected to a wireless modem, as well as various forms of User Equipment (UE), a Mobile Station (MS), a terminal device (terminal device), and the like, without limitation.
Wherein, smart home devices can include at least one of the following: intelligent TV set, intelligent doorbell, intelligent electric rice cooker, intelligent refrigerator, intelligence laundry, intelligent treadmill, intelligent air conditioner, intelligent dish washer, intelligent microwave oven, intelligent sofa, intelligent massage armchair, intelligent (window) curtain, intelligent oven, intelligent camera, intelligent gateway, intelligent router, intelligent flush mounting plate, intelligent robot etc. of sweeping the floor do not do the injecion here.
The following describes embodiments of the present application in detail.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an internet of things system for implementing a device control method according to an embodiment of the present application, and as shown in the drawing, the internet of things system may include at least one server and at least one terminal device, where each terminal device corresponds to a unique identifier.
Based on the server in the internet of things system, the following functions can be realized:
acquiring a target message, wherein the target message carries a target unique identifier of target terminal equipment;
acquiring the on-off state of a target message tracking switch corresponding to the target unique identifier;
detecting whether the tracking state of the target terminal equipment is in an opening state or not according to the switching state;
and when the tracking state of the target terminal equipment is in an opening state, asynchronously distributing the target message to a specified processing module for service operation.
Optionally, the method further includes:
detecting the duration of the opening state, and ending the opening state when the duration is longer than a first preset duration;
and stopping executing the step of asynchronously distributing the target message to a specified processing module for service operation.
Optionally, the method further includes:
acquiring the ending duration for ending the opening state;
and when the ending duration is longer than a second preset duration, continuing to execute the step of asynchronously distributing the target message to a specified processing module for service operation.
Optionally, the asynchronously distributing the target message to a designated processing module for service operation includes:
acquiring a target rule logic expression of the target message;
processing the target message according to the target rule logic expression to obtain a reference message;
and asynchronously distributing the reference message to the appointed processing module for service operation.
Optionally, the method further includes:
receiving a first request message, wherein the first request message is used for requesting to start a device information tracking function of the target terminal device;
and responding to the first request message, setting a switch mark of a target message tracking switch of the target terminal equipment to be in an on state, and setting an expiration time of a key value of the target terminal equipment, wherein the expiration time is used for representing the duration of the on state.
Optionally, the method further includes:
receiving a second request message, wherein the second request message is used for requesting to close the device information tracking function of a target message tracking switch of the target terminal device;
and deleting the switch mark in response to the second request message.
Referring to fig. 2, fig. 2 is a schematic flow diagram of a device control method provided in an embodiment of the present application, and as shown in the drawing, the method is applied to a server in an internet of things system, where the internet of things system further includes at least one terminal device, and each terminal device corresponds to a unique identifier, and the device control method may include:
201. and acquiring a target message, wherein the target message carries a target unique identifier of the target terminal equipment.
In the embodiment of the application, the internet of things system can comprise at least one server, and when the number of the servers is multiple, a service cluster can be formed by the multiple servers.
In this embodiment of the present application, the unique identifier of the terminal device is used to uniquely identify the terminal device, and the unique identifier may include at least one of the following: an Electronic Serial Number (ESN), a physical address, an IP address, and the like, without limitation.
In a specific implementation, the server may obtain a target message, where the target message carries a target unique identifier of the target terminal device, and the target unique identifier may uniquely identify the target terminal device. The target message may carry various data, e.g. may carry a target unique identification.
In the embodiment of the application, one device can simultaneously track uplink and downlink data by a plurality of users.
In the embodiment of the application, the function of capturing the input and output information of the appointed terminal equipment can be realized, the information capture is started for a single equipment without influencing the input and output information of other irrelevant equipment, wherein the appointed terminal equipment can be preset or defaulted by a system. A device can be simultaneously monitored by a plurality of users for the interaction messages of the tracking device, and the interaction messages are isolated from each other and do not interfere with each other. In addition, the real-time output of the uplink and downlink data of the equipment reduces the butt joint work of the platform and a terminal equipment developer, and basically does not need the intervention of platform personnel in the debugging process.
For example, in the embodiment of the present application, a specification is unified in an uplink and downlink message body of a device, specifically, an electronic serial number is uniformly specified in a data structure as a field of a device serial number, and the field of an ESN is required to be included in both uplink and downlink data structures. The unified and standardized data structure is beneficial to unified processing of service data under various scenes. For example, the message tracking switch of the corresponding device may be found by the ESN in the message at the device uplink data main entry and the device downlink data main exit of the server, to determine whether the tracking state of the current device is on, and if the switch is on, the data is asynchronously distributed to other processing modules for the next service operation.
For another example, in this embodiment of the present application, an ESN may be specifically used as a switch identifier for capturing uplink and downlink messages of a device, and then the ESN is used to define a unique name as a key value to the device in accordance with a certain rule to store whether the device is in a tracked state, for example, the ESN is used as the key value, Y is set to be on, an author uses redis as a persistence frame of the key value pair, and the expiration time of the key is set to be 15 minutes, and if the key value pair is not found when a message is processed at an uplink and downlink bus exit and entry of the device, the device is considered to have turned off a message tracking function of the device. The asynchronous forwarding processing will not be performed on the current message, and the normal service operation thereof will not be affected.
In the embodiment of the present application, the device message capture switch timing invalidation mechanism and its reactivation mechanism, for example, after the message capture (tracking) switch of the device is turned on once, a request for renewing the switch needs to be initiated periodically, otherwise, after a certain time (15 minutes), the switch will expire, and the current device stops forwarding the uplink and downlink data. The reason for this is to recover and release the resources occupied by the device message trace within a specified time, for example, the user terminal initiates a request for closing the device trace state, and the request is not successfully executed at the service terminal (network fluctuation causes time-out, service shutdown, restart, request blocking time-out, and other complications), then the switch in the device trace state will be closed after 15 minutes because there is no continuous activity, and the occupied resources are released, so in the device message trace process, the user needs to continuously keep alive the switch state.
202. And acquiring the switch state of the target message tracking switch corresponding to the target unique identifier.
In this embodiment, the target message tracking switch may be a software switch, for example, the target message tracking switch may be represented by a flag, where flag =0 represents that the target message tracking switch is in an off state, and flag =1 represents that the target message tracking switch is in an on state.
In the embodiment of the application, the on-off state of the target message tracking switch corresponding to the unique target identifier is obtained, and specifically, the server may obtain the target message at the device uplink data total inlet and the device downlink data total outlet of the server, find the message tracking switch of the device corresponding to the unique target identifier through the unique target identifier, and then detect the on-off state of the target message tracking switch.
Furthermore, in the embodiment of the present application, a switch function for capturing input/output information of a specific terminal device may be provided. The information capturing function of the specified terminal device can be arbitrarily turned on or off.
In the embodiment of the application, different devices correspond to different message tracking switches, that is, whether the message tracking switch of one device is turned on or not does not affect other terminal devices.
203. And detecting whether the tracking state of the target terminal equipment is in an opening state or not through the switch state.
In the embodiment of the application, whether the tracking state of the target terminal device is in the on state or not can be detected through the on-off state.
204. And when the tracking state of the target terminal equipment is in an opening state, asynchronously distributing the target message to a specified processing module for service operation.
In the embodiment of the application, the designated processing module may be preset or default, and the designated processing module may refer to a designated server in the internet of things system, or a designated terminal device in the internet of things system.
In the embodiment of the application, the captured information of the input and output of a single device can be sent to a plurality of listening terminals, for example, a plurality of browser-end users can listen to the input and output information of the same device at the same time.
Optionally, in step 204, the asynchronously distributing the target message to a designated processing module for performing a service operation may include the following steps:
41. acquiring a target rule logic expression of the target message;
42. processing the target message according to the target rule logic expression to obtain a reference message;
43. and asynchronously distributing the reference message to the appointed processing module for service operation.
In the embodiment of the application, the target rule logic expression can be set by a user and defaulted by a system, namely interactive data can be screened in a customized manner, and data required by the user can be screened according to a user-defined rule. The target rule logic expression can be composed of a target unique identifier and user requirement parameters, the user requirement parameters can be set by a user, and the user requirement parameters can realize at least one of the following functions: data screening, data extraction, data splicing, keyword extraction, data fusion, and the like, which are not limited herein.
In specific implementation, a target rule logic expression of a target message can be obtained, the target message is processed according to the target rule logic expression to obtain a reference message, and finally the reference message can be asynchronously distributed to a specified processing module for service operation, so that input and output information is filtered based on a rule engine. And screening more valuable and targeted terminal input and output information.
For example, in the embodiment of the present application, customized filtering of uplink and downlink messages of a device may be implemented, that is, the customized filtering may be maintained through a rule engine logical expression. The user can edit the corresponding message rule according to own will and store the corresponding rule into the cache or the session information. Combining an ESN and a connection session ID into a unique key value, storing a rule expression as a value corresponding to the key value in a public storage redis, and setting certain expiration time, for example, when the corresponding rule expression needs to be deleted, deleting the corresponding rule expression from the redis through the ESN and the session ID; for another example, when a connection session is disconnected, because it cannot be distinguished whether the connection is actively disconnected or accidentally disconnected, only the session information in the current service instance is cleared when the connection is disconnected, and when the connection is reconnected, the expiration time of the redis of the rule expression corresponding to the key is refreshed.
In the embodiment of the application, the message is screened through the logic expression, when the service instance forwards the message to the client, the service instance can acquire the rule logic expression in the session, perform rule filtering processing on the message and finally send the message to the client for data display, so that more valuable and targeted terminal input and output information can be screened.
For example, as shown in fig. 3, different sessions may correspond to different rule engine expressions, for example, session a, session B, and session C, where session a corresponds to rule engine expression a, session B corresponds to rule engine expression B, a message corresponding to session a may be processed through rule engine expression a, a message corresponding to session B may be processed through rule engine expression B, and then a corresponding processing result is output. The rules engine customizes the filtering of device upstream and downstream data.
Optionally, the method may further include the following steps:
a1, detecting the duration of the opening state, and ending the opening state when the duration is longer than a first preset duration;
and A2, stopping executing the step of asynchronously distributing the target message to a specified processing module for service operation.
In a specific implementation, the duration of the on state may be detected, and when the duration is longer than the first preset duration, the on state is ended, that is, the target message tracking switch is in the off state, and then the step of asynchronously distributing the target message to the designated processing module for service operation may be stopped. The setting of the timing failure switch enables the system to recover the connection resources lost due to network fluctuation, and the connection resources of the server cannot be occupied for a long time. The switch is failed at fixed time, and the switch needs to be continuously activated at regular intervals.
For example, ESN may be used as a switch identifier for capturing uplink and downlink messages of a device, and ESN cooperates with a certain rule to define a unique name as a key value for the device to store whether the device is in a tracked state, for example, ESN is used as the key value, and Y is set to be on. The asynchronous forwarding processing will not be performed on the current message, and the conventional service operation will not be affected.
Further, optionally, the method may further include the following steps:
b1, acquiring the ending duration for ending the opening state;
and B2, when the ending time length is longer than a second preset time length, continuing to execute the step of asynchronously distributing the target message to a specified processing module for service operation.
The second preset time length may be preset or default to the system. In specific implementation, the ending time length for ending the opening state can be obtained, and when the ending time length is greater than a second preset time length, the step of asynchronously distributing the target message to the designated processing module for service operation is continuously executed.
In the embodiment of the application, the target message tracking switch can be used as an auxiliary tool for equipment data interaction tracking development, and can start the function of tracking input and output messages for a single equipment, and under the condition of relatively complex network conditions, if the function of starting message tracking of the continuous equipment is not available within a certain time, the message tracking function of the equipment can be automatically closed, so that the condition that the command for closing equipment information tracking is lost due to network fluctuation, the equipment information tracking function is always in an on state, unnecessary resource waste is caused, the server downtime caused by resource consumption due to accumulation of the scene is avoided, and the risk of a server cluster is reduced. Meanwhile, the input and output information of the tracking equipment is customized by using the rule engine, so that unnecessary information transmission resources are reduced to a certain extent, the tracking function of the equipment is more flexible, more scenes are adapted, and more tracking requirements of related personnel are met.
In the embodiment of the present application, as shown in fig. 4, the IoT device development aid data stream of the server may include the following parts: the method comprises the steps that terminal equipment, an IoT service platform, data processing services, web users and public storage redis are provided with equipment switch identifiers openflag through the public storage redis, whether equipment uplink data openflag is tracked is detected, if yes, message Queue (MQ) messages are asynchronously delivered to the data processing services, then the MQ messages are consumed by the data processing services, and when the service clusters are arranged, the message is broadcasted in the service clusters to detect whether websocket connection sessions corresponding to ESN exist in service instances, if yes, the messages are sent to the web end users through the websocket sessions, and if not, the messages are ignored; if the service cluster is not available, the direct message is sent to the web end user through the websocket session. In addition, when the device uplink data openflag is detected not to be tracked, a device interaction result is issued, whether the device downlink data openflag is tracked is detected, if not, the operation is ended, if yes, the MQ message is asynchronously delivered to the data processing service, and the subsequent steps are executed by the data processing service. Furthermore, the server cluster scene can be adapted according to the embodiment of the application.
In addition, the web user can start the tracking device message, save the correspondence between the websocket session ID and the ESN, and further start the message tracking identifier openflag = true of the device (ESN). The web user may also close the tracking device message, delete the session message, delete the switch identification.
In the embodiment of the application, a plurality of subscription terminals can monitor uplink and downlink messages of the same device at the same time, that is, a plurality of device end developers can see uplink and downlink data of the same device at the same time without mutual interference. The subscription terminal, for example, may refer to a browser terminal, which establishes a connection with a server terminal through a websocket protocol, based on which full-duplex communication between the browser and the server may be implemented, and the server may actively transmit data to the client terminal. In practical application, the connection can be maintained through a heartbeat mechanism, and the reconnection mechanism can reestablish the connection when the connection is accidentally disconnected, so that the smoothness of a message link is ensured. And meanwhile, the server side and the stored subscriber side session information (session ID, ESN and the like) find all sessions subscribed to the ESN through the ESN field when the message arrives, and distribute the message to all the subscriber sides, so that all the subscriber sides receive the message.
In the embodiment of the application, message broadcasting in a service cluster is compatible with message distribution under a service cluster mode, a message subscriber end establishes connection with a server instance through a websocket protocol, in a singleton mode, only one service instance is provided, the connection between the subscriber end and the service end and the logic of message distribution are in the same service instance, and message forwarding is not problematic. In order to simplify routing logic, the message is directly broadcasted in the service cluster through a service cluster message bus, then each instance respectively matches whether the subscriber session connection of the message belongs to the current service instance, if the current message does not belong to the current service instance (namely, corresponding connection sessions can not be found in the current service instance), the message is ignored without processing, and if the current message does not belong to the current service instance (namely, corresponding connection sessions can not be found in the current service instance), the message is forwarded to the corresponding session connection. Under the design, the method adapts to the service cluster scene.
Optionally, the method may further include the following steps:
c1, receiving a first request message, wherein the request message is used for requesting to start an equipment information tracking function of the target terminal equipment;
and C2, responding to the first request message, setting a switch mark of a target message tracking switch of the target terminal equipment to be in an on state, and setting the expiration time of a key value of the target terminal equipment, wherein the expiration time is used for representing the duration of the on state.
In the embodiment of the application, a first request message may be received, where the first request message is used to request to start a device information tracking function of a target terminal device, a switch flag of a target message tracking switch of the target terminal device is set to an on state in response to the first request message, and an expiration time of a key value of the target terminal device is set, where the expiration time is used to indicate a duration of the on state, so that it may be ensured that the message tracking function is implemented within an effective time.
Further, optionally, the method may further include the following steps:
d1, receiving a second request message, wherein the second request message is used for requesting to close the equipment information tracking function of a target information tracking switch of the target terminal equipment;
and D2, responding to the second request message, and deleting the switch mark.
In this embodiment of the present application, a second request message may be received, where the second request message is used to request to turn off a device information tracking function of a target message tracking switch of a target terminal device, and the switch flag may be deleted in response to the second request message, so that the message tracking function is turned off.
For example, as shown in fig. 5, the browser end may request to turn on the device information tracking, and the data processing service may mark the switch as an on state, set the expiration time of the key, and store it in the redis. And a timing request function can be set, if the user does not continue to live, the device message tracking is closed, after the data processing service receives the switch continuing request, the switch mark expiration time can be refreshed, and the refreshing result is stored in redis. The data processing service can also receive a message requesting to close the device, and if the switch mark is deleted, corresponding deletion operation is carried out in redis.
In the embodiment of the application, the capture switch for the input and output information of the designated terminal equipment is continuously activated at regular time, so that unnecessary resource waste caused by the fact that the information capture switch is not closed in time due to network fluctuation and the equipment is always in an equipment message tracking state can be avoided.
In this embodiment, at least one terminal device may include at least one consumption end, and/or at least one subscription end, and/or at least one browser end, and the device distributes (intercepts, copies, and sends) uplink and downlink messages to a designated consumption end, and may further deliver the messages asynchronously through a message queue.
In practical application, certain computation scheduling is needed for delivery of uplink and downlink data messages of a device, in order to weaken the influence brought by the temporary function, when the messages are distributed, the messages are encapsulated (or not encapsulated) and distributed to corresponding consumption terminals through an MQ technical framework in an asynchronous mode, and some more complex business operations (filtering, cleaning and repackaging) are carried out at the MQ consumption terminals, so that extra delay is inevitably caused if synchronous distribution is carried out, and the method is global. The message asynchronous distribution logic is independent, normal service is not influenced, the fault tolerance of the system is improved, and normal service interaction is not influenced even if the equipment message tracking service is abnormal.
In the embodiment of the application, only the device interaction information is exposed (or the device interaction information can be reduced to a smaller range according to actual conditions). The uplink and downlink data of any equipment can be tracked, and the uplink and downlink data of other equipment which is not tracked can be ignored by the service without any processing, only the normal service interaction is kept, and the computing and storage resources of the server are not occupied. Under the condition that mass equipment is on line, a lot of server resources can be saved, and a relatively stable operating environment is maintained.
The equipment control method is applied to a server in an Internet of things system, and the Internet of things system further comprises at least one terminal device, wherein each terminal device corresponds to a unique identifier, a target message is obtained, the target message carries the target unique identifier of the target terminal device, the on-off state of a target message tracking switch corresponding to the target unique identifier is obtained, whether the tracking state of the target terminal device is in an on state or not is detected through the on-off state, when the tracking state of the target terminal device is in the on state, the target message is asynchronously distributed to a specified processing module for service operation, and then the corresponding message tracking switch can be obtained by utilizing the identifier of the terminal device, so that message tracking is realized, and the message tracking efficiency is improved.
Referring to fig. 6 in keeping with the above embodiments, fig. 6 is a schematic structural diagram of a server according to an embodiment of the present application, where the server includes a processor, a memory, a communication interface, and one or more programs, and the one or more programs are stored in the memory and configured to be executed by the processor, and in an embodiment of the present application, the programs include instructions for:
acquiring a target message, wherein the target message carries a target unique identifier of target terminal equipment;
acquiring the switch state of a target message tracking switch corresponding to the target unique identifier;
detecting whether the tracking state of the target terminal equipment is in an on state or not according to the on-off state;
and when the tracking state of the target terminal equipment is in an opening state, asynchronously distributing the target message to a specified processing module for service operation.
Optionally, the program further includes instructions for performing the following steps:
detecting the duration of the opening state, and ending the opening state when the duration is longer than a first preset duration;
and stopping executing the step of asynchronously distributing the target message to a specified processing module for service operation.
Optionally, the program further includes instructions for performing the following steps:
acquiring the ending duration for ending the opening state;
and when the ending duration is longer than a second preset duration, continuing to execute the step of asynchronously distributing the target message to a specified processing module for service operation.
Optionally, in the aspect of asynchronously distributing the target message to a designated processing module for service operation, the program includes instructions for executing the following steps:
acquiring a target rule logic expression of the target message;
processing the target message according to the target rule logic expression to obtain a reference message;
and asynchronously distributing the reference message to the appointed processing module for service operation.
Optionally, the program further includes instructions for performing the following steps:
receiving a first request message, wherein the first request message is used for requesting to start an equipment information tracking function of the target terminal equipment;
and responding to the first request message, setting a switch mark of a target message tracking switch of the target terminal equipment to be in an on state, and setting an expiration time of a key value of the target terminal equipment, wherein the expiration time is used for representing the duration of the on state.
Optionally, the program further includes instructions for performing the following steps:
receiving a second request message, wherein the second request message is used for requesting to close the device information tracking function of a target message tracking switch of the target terminal device;
and deleting the switch mark in response to the second request message.
The server described in the embodiment of the application is applied to an internet of things system, and the internet of things system further comprises at least one terminal device, wherein each terminal device corresponds to one unique identifier, a target message is obtained, the target message carries the target unique identifier of the target terminal device, the on-off state of a target message tracking switch corresponding to the target unique identifier is obtained, whether the tracking state of the target terminal device is in an on state or not is detected through the on-off state, when the tracking state of the target terminal device is in the on state, the target message is asynchronously distributed to a specified processing module for service operation, and then the corresponding message tracking switch can be obtained by using the identifier of the terminal device, so that message tracking is realized, and the message tracking efficiency is improved.
Fig. 7 is a block diagram of functional units of a device control apparatus 700 according to an embodiment of the present application. The device control device 700 is applied to a server in an Internet of things system, the Internet of things system further comprises at least one terminal device, each terminal device corresponds to a unique identifier, and the device 700 comprises: an acquisition unit 701, a detection unit 702 and a service processing unit 703, wherein,
the acquiring unit 701 is configured to acquire a target message, where the target message carries a target unique identifier of a target terminal device; acquiring the on-off state of a target message tracking switch corresponding to the target unique identifier;
the detecting unit 702 is configured to detect whether the tracking state of the target terminal device is in an on state according to the switch state;
the service processing unit 703 is configured to asynchronously distribute the target message to a designated processing module for performing a service operation when the tracking state of the target terminal device is in an on state.
Optionally, the apparatus 700 is further specifically configured to:
detecting the duration of the opening state, and finishing the opening state when the duration is longer than a first preset duration;
and stopping executing the step of asynchronously distributing the target message to a specified processing module for service operation.
Optionally, the apparatus 700 is further specifically configured to:
acquiring the ending time length for ending the opening state;
and when the ending duration is longer than a second preset duration, continuing to execute the step of asynchronously distributing the target message to a specified processing module for service operation.
Optionally, in the aspect of asynchronously distributing the target message to a designated processing module for performing a service operation, the service processing unit 703 is specifically configured to:
acquiring a target rule logic expression of the target message;
processing the target message according to the target rule logic expression to obtain a reference message;
and asynchronously distributing the reference message to the appointed processing module for service operation.
Optionally, the apparatus 700 is further specifically configured to:
receiving a first request message, wherein the first request message is used for requesting to start an equipment information tracking function of the target terminal equipment;
and responding to the first request message, setting a switch mark of a target message tracking switch of the target terminal equipment to be in an on state, and setting an expiration time of a key value of the target terminal equipment, wherein the expiration time is used for representing the duration of the on state.
Optionally, the apparatus 700 is further specifically configured to:
receiving a second request message, wherein the second request message is used for requesting to close the device information tracking function of a target message tracking switch of the target terminal device;
and deleting the switch mark in response to the second request message.
The device control device described in the embodiment of the application is applied to a server in an internet of things system, and the internet of things system further comprises at least one terminal device, wherein each terminal device corresponds to a unique identifier to obtain a target message, the target message carries the target unique identifier of the target terminal device, the on-off state of a target message tracking switch corresponding to the target unique identifier is obtained, whether the tracking state of the target terminal device is in an on state or not is detected through the on-off state, and when the tracking state of the target terminal device is in the on state, the target message is asynchronously distributed to a specified processing module to carry out service operation, so that the corresponding message tracking switch can be obtained by using the identifier of the terminal device, message tracking is realized, and message tracking efficiency is improved.
It can be understood that the functions of each program module of the device control apparatus in this embodiment may be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process may refer to the related description of the foregoing method embodiment, which is not described herein again.
Embodiments of the present application also provide a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, the computer program enables a computer to execute part or all of the steps of any one of the methods described in the above method embodiments, and the computer includes a server.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods as described in the above method embodiments. The computer program product may be a software installation package, the computer comprising a server.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art will recognize that the embodiments described in this specification are preferred embodiments and that acts or modules referred to are not necessarily required for this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to the related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the above-described units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some interfaces, indirect coupling or communication connection between devices or units, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit may be stored in a computer readable memory if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above-mentioned method of the embodiments of the present application. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash Memory disks, read-Only memories (ROMs), random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. The equipment control method is applied to a server in an Internet of things system, the Internet of things system further comprises at least one terminal equipment, each terminal equipment corresponds to a unique identifier, and the method comprises the following steps:
acquiring a target message, wherein the target message carries a target unique identifier of target terminal equipment;
acquiring the switch state of a target message tracking switch corresponding to the target unique identifier;
detecting whether the tracking state of the target terminal equipment is in an on state or not according to the on-off state;
and when the tracking state of the target terminal equipment is in an opening state, asynchronously distributing the target message to a specified processing module for service operation.
2. The apparatus control method according to claim 1, characterized in that the method further comprises:
detecting the duration of the opening state, and finishing the opening state when the duration is longer than a first preset duration;
and stopping executing the step of asynchronously distributing the target message to a specified processing module for service operation.
3. The device control method according to claim 2, characterized in that the method further comprises:
acquiring the ending duration for ending the opening state;
and when the ending duration is longer than a second preset duration, continuing to execute the step of asynchronously distributing the target message to a specified processing module for service operation.
4. The device control method according to any one of claims 1 to 3, wherein the asynchronously distributing the target message to a designated processing module for a business operation comprises:
acquiring a target rule logic expression of the target message;
processing the target message according to the target rule logic expression to obtain a reference message;
and asynchronously distributing the reference message to the appointed processing module for service operation.
5. The apparatus control method according to claim 1 or 2, characterized in that the method further comprises:
receiving a first request message, wherein the first request message is used for requesting to start a device information tracking function of the target terminal device;
and responding to the first request message, setting a switch mark of a target message tracking switch of the target terminal equipment to be in an on state, and setting an expiration time of a key value of the target terminal equipment, wherein the expiration time is used for representing the duration of the on state.
6. The apparatus control method according to claim 5, characterized in that the method further comprises:
receiving a second request message, wherein the second request message is used for requesting to close the device information tracking function of a target message tracking switch of the target terminal device;
and deleting the switch mark in response to the second request message.
7. The device control device is applied to a server in an Internet of things system, the Internet of things system also comprises at least one terminal device, each terminal device corresponds to a unique identifier, and the device comprises: an acquisition unit, a detection unit and a service processing unit, wherein,
the acquiring unit is used for acquiring a target message, and the target message carries a target unique identifier of target terminal equipment; acquiring the on-off state of a target message tracking switch corresponding to the target unique identifier;
the detection unit is used for detecting whether the tracking state of the target terminal equipment is in an on state or not through the on-off state;
and the service processing unit is used for asynchronously distributing the target message to a specified processing module to perform service operation when the tracking state of the target terminal equipment is in an open state.
8. The device control apparatus according to claim 7, wherein the apparatus is further specifically configured to:
detecting the duration of the opening state, and ending the opening state when the duration is longer than a first preset duration;
and stopping executing the step of asynchronously distributing the target message to a specified processing module for service operation.
9. A server, comprising a processor, a memory for storing one or more programs and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-6.
10. A computer-readable storage medium, characterized in that a computer program for electronic data exchange is stored, wherein the computer program causes a computer to perform the method according to any one of claims 1-6.
CN202211190901.2A 2022-09-28 2022-09-28 Equipment control method and related device Active CN115550305B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211190901.2A CN115550305B (en) 2022-09-28 2022-09-28 Equipment control method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211190901.2A CN115550305B (en) 2022-09-28 2022-09-28 Equipment control method and related device

Publications (2)

Publication Number Publication Date
CN115550305A true CN115550305A (en) 2022-12-30
CN115550305B CN115550305B (en) 2024-03-01

Family

ID=84730430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211190901.2A Active CN115550305B (en) 2022-09-28 2022-09-28 Equipment control method and related device

Country Status (1)

Country Link
CN (1) CN115550305B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104468333A (en) * 2014-12-10 2015-03-25 深圳中兴网信科技有限公司 Message server based on XMPP and signaling tracking method thereof
US20170293853A1 (en) * 2016-04-07 2017-10-12 Fujitsu Limited Behavior prediction
CN111800354A (en) * 2019-04-08 2020-10-20 中移(苏州)软件技术有限公司 Message processing method and device, message processing equipment and storage medium
CN113327146A (en) * 2020-02-28 2021-08-31 北京沃东天骏信息技术有限公司 Information tracking method and device
CN113672487A (en) * 2021-08-24 2021-11-19 济南浪潮数据技术有限公司 Message tracking method, device and system and computer readable storage medium
CN114385674A (en) * 2021-12-30 2022-04-22 天翼物联科技有限公司 Platform message tracking method, system, device and storage medium
CN114546817A (en) * 2020-11-25 2022-05-27 华为技术有限公司 Information processing method, device, storage medium and computer program product
CN114978993A (en) * 2022-04-24 2022-08-30 欧冶云商股份有限公司 Message routing method based on label expression calculation and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104468333A (en) * 2014-12-10 2015-03-25 深圳中兴网信科技有限公司 Message server based on XMPP and signaling tracking method thereof
US20170293853A1 (en) * 2016-04-07 2017-10-12 Fujitsu Limited Behavior prediction
CN111800354A (en) * 2019-04-08 2020-10-20 中移(苏州)软件技术有限公司 Message processing method and device, message processing equipment and storage medium
CN113327146A (en) * 2020-02-28 2021-08-31 北京沃东天骏信息技术有限公司 Information tracking method and device
CN114546817A (en) * 2020-11-25 2022-05-27 华为技术有限公司 Information processing method, device, storage medium and computer program product
CN113672487A (en) * 2021-08-24 2021-11-19 济南浪潮数据技术有限公司 Message tracking method, device and system and computer readable storage medium
CN114385674A (en) * 2021-12-30 2022-04-22 天翼物联科技有限公司 Platform message tracking method, system, device and storage medium
CN114978993A (en) * 2022-04-24 2022-08-30 欧冶云商股份有限公司 Message routing method based on label expression calculation and electronic equipment

Also Published As

Publication number Publication date
CN115550305B (en) 2024-03-01

Similar Documents

Publication Publication Date Title
US8446816B2 (en) Control method for access gateway and communication system
CN100440799C (en) Main/standby board back-up in access-in apparatus and rearranging method therefor
CN110633442A (en) Pushing method and device and electronic equipment
CN104639367B (en) A kind of method and system for realizing active/standby server switching
CN108847976B (en) Distribution network control method, mobile terminal, device and computer readable storage medium
CN102638417A (en) Information communication method, device and system
CN112422684B (en) Target message processing method and device, storage medium and electronic device
CN113315665B (en) Message sending method, device, equipment and medium of dual-network-card terminal equipment
WO2017215408A1 (en) Session switching control method and apparatus and access point device
CN111541555A (en) Group chat optimization method and related product
CN110809262B (en) COAP protocol-based operation and maintenance management method for Internet of things equipment
CN106789287B (en) Front-end load balancer, back-end server and registration method
CN113794597B (en) Alarm information processing method, system, electronic equipment and storage medium
CN115550305A (en) Equipment control method and related device
CN104737596A (en) Putting a piece of equipment connected to a multi-link network on standby
WO2017101028A1 (en) Data transmission method, m2m server, pgw, sgw and serving network node
CN114422100B (en) Up-and-down connection processing system, computer equipment and medium of national standard signaling service terminal
US20190036793A1 (en) Network service implementation method, service controller, and communications system
CN114087727B (en) Wireless pairing method, device and system, upper and lower computer nodes and air conditioning unit
CN113014615B (en) Data synchronization method, device and system
CN110519397B (en) SIP terminal access load balancing system and method based on NGINX
CN109947630B (en) Fault notification method, device and storage medium
CN109257444B (en) Load sharing method, device and system
CN113965495A (en) Method and device for detecting activity of terminal application program, electronic equipment and storage medium
KR20120128031A (en) System and method for providing push service

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
GR01 Patent grant
GR01 Patent grant