Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the related art, the purchased data destination is generally a public cloud service.
Public cloud services include, for example: a Time Series Database (TSD), a Relational Database Service (RDS), a Baidu Object Storage BOS (BOS), and the like.
These public cloud services require higher costs.
However, the user may have other data destination requirements, for example, the user may want to forward data to his service, for example, his monitoring system, which is advantageous in terms of cost, management convenience, and the like.
However, the related art provides a manner of using only a public cloud service as a data destination, and cannot satisfy the above-mentioned demand of the user.
In order to solve the problem that a user can only purchase a public cloud service, the present disclosure may provide the following embodiments.
Fig. 1 is a schematic diagram according to a first embodiment of the present disclosure, where this embodiment provides a data transmission method, including:
101. and receiving current data sent by a first Internet of things object used by a user.
102. Determining a current data destination corresponding to the current data based on a correspondence between data in a rule engine and data destinations, wherein the data destinations in the correspondence include: a second networked object used by the user.
103. Sending the current data to the current data destination.
The Internet of things (IoT), i.e., "Internet with everything connected", is an extended and expanded network based on the Internet, and combines various information sensing devices with the network to form a huge network, thereby realizing the interconnection and intercommunication of people, machines and things at any time and any place.
The internet of things object may include: internet of things equipment, an Internet of things system and the like.
Taking a user as an example of a certain manufacturer, the internet of things device is, for example, a water meter of the manufacturer, and the internet of things system is, for example, a monitoring system of the manufacturer.
As shown in fig. 2, taking the first internet of things object as an internet of things device as an example, in a physical network scenario, the first internet of things object may include an internet of things device 201, an internet of things core (IoT core)202, and a data destination 203, where the physical network device 201 in fig. 2 is represented by a device-1 and a device-2, the IoT core 202 may be located in a cloud, and the IoT core 202 may include a device access module and a rule engine, the device access module is configured to access each internet of things device, and the rule engine is configured to process data sent by each accessed internet of things device and forward the data to the data destination 203.
The method of the present embodiment may be applied to a rules engine.
The internet of things equipment is nonstandard equipment, can be mutually wirelessly connected to a network and can transmit data. Internet connection of internet-of-things equipment is expanding, and standard equipment such as smart phones, notebook computers, tablet computers and desktop computers is surpassed. Embedding these devices by technology enables us to communicate and interact over a network and to monitor and control them remotely.
The types of the internet of things devices may include: consumer, enterprise, and industrial.
Consumer internet of things devices are intended for use by consumers, such as including: smart televisions, smart speakers, toys, wearable devices, smart appliances, and the like.
Enterprise internet of things devices are edge devices intended for enterprises, including for example: intelligent lock, intelligent thermostat, intelligent illumination and intelligent security equipment etc..
Industrial type internet of things devices are intended for use in factories or other industrial environments, mostly for monitoring sensors of assembly lines or other manufacturing processes, such as including: water meters, electricity meters, and the like.
For example, a user is a certain factory, and data acquired by internet of things devices such as water meters in the factory can be sent to the rule engine in the cloud.
The user can create a rule in the rule engine, and the rule engine processes, forwards and the like the data reported by the physical network equipment corresponding to the user based on the rule created by the user.
In the related art, the data destination may include a public cloud service, such as RDS, TSDB, kafka.
In this embodiment, the data destination includes a user-defined data destination, and the user-defined data destination includes an internet of things object used by the user. For the purpose of differentiation, the internet of things object that transmits data may be referred to as a first internet of things object, and the internet of things object that receives data may be referred to as a second internet of things object.
The internet of things object receiving data can be an internet of things system, such as a service provided by a user.
Further, the service provided by the user itself may include a hypertext Transfer Protocol (HTTP) service or a secure HTTP (HTTPs) service.
The service provided by the user is, for example, a monitoring service provided by the user, or referred to as a monitoring system.
Before using the rule engine, the user may create a rule in the rule engine, and the rule engine performs operations such as processing and forwarding on the received data based on the rule created by the user.
A device identification of the internet of things device may be added in the created rule, and the current data destination is selected from available data destinations to establish a correspondence between the current data corresponding to the device identification and the current data destination.
The current data sent by the internet of things device may include a device identifier of the internet of things device, and the current data may be forwarded to the current data destination based on a correspondence between the device identifier in the rule and the current data destination.
By based on the device identification and available data destinations, a correspondence between data and data destinations can be established.
In some embodiments, the method may further comprise: presenting a custom data destination page to the user; receiving a user-defined data destination input by the user through the page, wherein the user-defined data destination comprises a service provided by the user; obtaining the available data destination based on the user-defined data destination.
As shown in fig. 3, the rule engine may include: custom data destination creation module 301, rule creation module 302, rule editing module 303, rule processing execution module 304.
The custom data destination creating module 301 is configured to create a user-defined data destination, for example, a corresponding custom data destination creating button may be provided on a page of the rule engine, and after the user clicks the custom data destination creating button, the custom data destination creating page may be displayed, and the user may input information of the custom data destination, such as a Uniform Resource Locator (URL) address, in the custom data destination creating page.
The rule creating module 302 is used to create a rule, for example, a corresponding rule creating button may be provided on a page of the rule engine, and after the user clicks the rule creating button, the rule creating page may be displayed.
The rule editing module 303 is configured to edit a rule, for example, after the user displays the rule creating page by using the rule creating module, the user may edit specific rule content in the rule creating page by using the rule editing module.
The rule processing execution module 304 is configured to process the received data of the internet of things device based on the created rule, for example, the data sent by each internet of things device may be stored in a Message center, for example, a Message queue Telemetry Transport protocol server (MQTT broker), and the rule processing execution module may read the data from the Message center and forward the data to a data destination defined by the user.
The rule content may include a correspondence between the data identifier and the data destination, and specifically, may be a correspondence between the device identifier of the internet of things and the data destination.
The device identification of the internet of things may be user input.
The data destination may be user selected among available data destinations.
For example, a data destination add button can be included on the rule creation page, and when the user clicks on the add button, a list of available data destinations can be presented, and the user can select a current data destination from the presented list.
By displaying the user-defined data destination page to the user, the user-defined data destination can be obtained through the page, and the user-defined data destination is supported.
In some embodiments, said obtaining said available data destination based on said user-customized data destination comprises: performing an availability test on the user-defined data destination, the availability test comprising: authentication, and/or connectivity testing; adding a user-defined data destination that passes the availability test to the available data destination.
The user can create a custom data destination for service A through the custom data destination creation module, which can be a service provided by the user, such as a monitoring service.
After the user creates service a, service a may be authenticated and/or tested for connectivity.
Authentication is used to verify the validity of service a and connectivity testing is used to test the connectivity of service a.
The connectivity test may be, for example, that the rule engine sends a test message to the service a, if a feedback message corresponding to the test message is received within a preset time period, the connectivity test is passed, otherwise, the connectivity test is not passed.
In some embodiments, said authenticating said user-defined data destination comprises: presenting a token (token) generated by a rules engine to the user to cause the user to write the token into a profile of the user-defined data destination; receiving a verification message sent by the user-defined data destination, wherein the verification message comprises the token; and if the token contained in the verification message is consistent with the token generated by the rule engine, determining that the user-defined data destination passes authentication.
Wherein, the field can be encrypted based on the SHA-256 algorithm to generate token, and the field can include real-time timestamp information and a database unique identifier to ensure the uniqueness of the field.
Taking the authentication of the HTTP service provided by the user himself as an example, the authentication process may be as shown in fig. 4.
The validity of available data destinations can be improved by adding user-defined data destinations that pass authentication and/or connectivity tests to the available data destinations.
Furthermore, the user writes the token into the configuration file of the user-defined data destination instead of transmitting the token to the user-defined data destination through the network, so that the safety of the token can be ensured, and the legality of the user-defined data destination can be further ensured.
If the current data destination is the second networking object used by the user, and the second networking object used by the user comprises: an HTTP service or an HTTPS service, said sending said current data to said current data destination, comprising: establishing corresponding HTTP or HTTPS connection with the HTTP service or the HTTPS service; sending the current data to the current data destination over the HTTP or HTTPS connection.
Taking HTTP service as an example, if the HTTP service passes the availability test, the rule engine may establish an HTTP connection with the HTTP service, so that the current data may be transmitted to the HTTP service through the HTTP connection.
By establishing a communication connection with the HTTP/HTTPs service, current data may be transmitted over the communication connection.
In some embodiments, further comprising: receiving a control instruction obtained by the current data destination based on the current data; and controlling the Internet of things equipment based on the control instruction.
Wherein, when the service provided by the user is used as the data destination, the event driving can be realized.
Taking a service provided by a user as an HTTP service as an example, after the HTTP service receives data sent by the internet of things device, if it is determined that the corresponding internet of things device is abnormal based on the data, for example, power consumption is abnormal, the HTTP service may process the data, for example, add a command: and shutting down the equipment, and then sending a control instruction containing the command to the corresponding Internet of things equipment.
The control instruction can be sent to the internet of things device through the rule engine, and also can be sent to the internet of things device through the MQTT browser or directly sent to the internet of things device.
In addition, when the data is forwarded to the service provided by the user, other flexible processing schemes can be supported, for example, after the user can use the monitoring service access rule engine of the user as a data destination, the monitoring service can receive the state information of the internet of things equipment in the internet of things where the user is located at regular time, such as online and offline, fault abnormality and the like, so that the monitoring report form, analysis and visualization are further realized at the service end of the user.
Event driving can be achieved by controlling the first internet of things object based on the control instruction of the current data destination.
In this embodiment, by including the service provided by the user in the data destination, when the rule engine is used to forward data, the data sent by the internet of things device corresponding to the user can be sent to the service provided by the user through the rule engine, so that cost and resources can be saved. By customizing the data destination in the rule engine in a customized manner, the expansibility and flexibility can be improved.
Fig. 5 is a schematic diagram according to a fifth embodiment of the present disclosure, where the embodiment provides a data transmission method, including:
501. the rules engine receives user-customized data destinations created by the user, including services provided by the user himself.
Wherein, the service provided by the user is HTTP/HTTPS service, such as monitoring service.
502. The rule engine authenticates the user-defined data destination and performs connectivity testing.
During authentication, taking HTTP service as an example, a socket connection is established between a rule engine and the HTTP service, the rule engine generates and displays a token to a user, the user writes the token into a configuration file of the HTTP service, the HTTP service sends the token in the configuration file to the rule engine through the socket connection, and when the rule engine is consistent with the rule engine, the rule engine determines that the HTTP service passes the authentication.
Further, an authentication validity period may also be set, for example, the rule engine sets the token validity period to default for 3 days, if the creating user does not complete the HTTP service authentication within the validity period, the rule engine considers that the user authentication fails, and the subsequent user cannot add the user-defined HTTP destination and the user-defined HTTP destination transmission data in the rule.
503. The rules engine adds the user-defined data destinations that pass authentication and connectivity tests to the available data destinations.
The rule engine may include a query module for the available data destinations, such as a query button on a page, and the user may display the list of available data destinations when clicking the query button.
The list of available data destinations may include purchased public cloud services, etc., in addition to user-defined data destinations.
Further, a data destination deletion module can be included, such as by which a custom data destination can be deleted.
By creating/deleting data destinations, configuration flexibility of the data destinations can be improved.
504. And the rule engine adds the equipment identification of the Internet of things equipment in the created rule and selects the current data destination from available data destinations to establish the corresponding relation between the current data corresponding to the equipment identification and the current data destination.
The rule engine may configure information of the data to be processed when creating the rule, for example, add a device identifier of the internet of things device corresponding to the data to be processed.
In addition, upon adding a data destination, a list of available data destinations can be presented to the user, and the user can select one of the available data destinations as the current data destination.
505. The rules engine establishes a communication connection with the current data destination.
For example, if the current data destination is an HTTP service, the rule engine may establish an HTTP connection with the HTTP service after the HTTP service passes the authentication and connectivity test.
506. The rule engine receives current data sent by the Internet of things equipment, determines a current data destination corresponding to the current data based on the corresponding relation between the data and the data destination, and sends the current data to the current data destination through the communication connection.
In the embodiment, the user-defined data destination is created, so that the user-defined data destination can be supported; by presenting a list of available data destinations, queries for available data destinations can be supported; the usability of the user-defined data destination can be ensured by carrying out authentication and connectivity test on the user-defined data destination; by establishing a connection with a user-defined data destination, data transfer can be achieved. Based on the scheme, the rule engine can support the service provided by the user as a data destination.
Fig. 6 is a schematic diagram according to a sixth embodiment of the present disclosure, which provides a data transmission device. The apparatus may be applied in a rules engine. As shown in fig. 6, the apparatus 600 includes: a receiving module 601, a determining module 602 and a sending module 603.
The receiving module 601 is configured to receive current data sent by a first internet of things object used by a user; the determining module 602 is configured to determine a current data destination corresponding to current data based on a correspondence between data in a rule engine and data destinations, where the data destinations in the correspondence include: a second networking object used by the user; the sending module 603 is configured to send the current data to the current data destination.
In some embodiments, the correspondence is recorded in a rule adopted by the rule engine, and the apparatus further includes: a creating module, configured to add a device identifier of the internet of things device to the rule created by the user, and select the current data destination from available data destinations, so as to establish a correspondence between the current data corresponding to the device identifier and the current data destination.
In some embodiments, the apparatus 600 further comprises: the display module is used for displaying a user-defined data destination page to the user; the receiving module is used for receiving a user-defined data destination input by the user through the page, wherein the user-defined data destination comprises a service provided by the user; an obtaining module to obtain the available data destination based on the user-defined data destination.
In some embodiments, the obtaining module is specifically configured to: performing an availability test on the user-defined data destination, the availability test comprising: authentication, and/or connectivity testing; and the user-defined data destination passing the availability test is used as the available data destination.
In some embodiments, the obtaining module is further specifically configured to: presenting a token generated by a rules engine to the user, such that the user writes the token into a configuration file of the user-defined data destination; receiving a verification message sent by the user-defined data destination, wherein the verification message comprises the token; and if the token contained in the verification message is consistent with the token generated by the rule engine, determining that the user-defined data destination passes authentication.
In some embodiments, if the current data destination is a second networking object used by the user, the second networking object used by the user includes: the sending module is specifically configured to: establishing corresponding HTTP or HTTPS connection with the HTTP service or the HTTPS service; sending the current data to the current data destination over the HTTP or HTTPS connection.
In some embodiments, the apparatus 600 further comprises: receiving a control instruction obtained by the current data destination based on the current data; and controlling the first Internet of things object based on the control instruction.
In this embodiment, by including the service provided by the user in the data destination, when the rule engine is used to forward data, the data sent by the internet of things device corresponding to the user can be sent to the service provided by the user through the rule engine, so that cost and resources can be saved. By customizing the data destination in the rule engine in a customized manner, the expansibility and flexibility can be improved.
It is to be understood that in the disclosed embodiments, the same or similar elements in different embodiments may be referenced.
It is to be understood that "first", "second", and the like in the embodiments of the present disclosure are used for distinction only, and do not indicate the degree of importance, the order of timing, and the like.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 7 illustrates a schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 7, the electronic device 700 includes a computing unit 701, which may perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Various components in the electronic device 700 are connected to the I/O interface 707, including: an input unit 706 such as a keyboard, a mouse, or the like; an output unit 707 such as various types of displays, speakers, and the like; a storage unit 708 such as a magnetic disk, optical disk, or the like; and a communication unit 709 such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows the electronic device 700 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Computing unit 701 may be a variety of general purpose and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 701 executes the respective methods and processes described above, such as the data transmission method. For example, in some embodiments, the data transfer method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 700 via the ROM 702 and/or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the data transfer method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the data transfer method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual Private Server", or simply "VPS"). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.