Data transmission method and device and electronic equipment
By deploying the server on the same server terminal and utilizing Unix domain socket communication, the problem of low data transmission efficiency of IoT devices is solved and fast and efficient transmission is achieved.
Patent Information
- Application Number
- CN202410771276.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-10-11
AI Technical Summary
The low efficiency of data transmission between IoT devices leads to increased network latency, reduced bandwidth utilization, and increased energy consumption. Existing technologies fail to effectively solve this problem.
By deploying the first and second servers on the same server terminal, and deploying the collector client on the edge device, the collected data is quickly transmitted using the Unix domain socket communication method, thereby achieving efficient data transmission.
The data transmission rate is increased, the problem of difficulty in data transmission collected by Internet of Things devices is solved, and the transmission efficiency is improved.
Smart Images

Figure CN118764549A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Internet of Things, and more specifically, to a data transmission method, device and electronic device. Background Art
[0002] With the continuous development of Internet of Things technology and the continuous expansion of application fields such as smart cities, the Internet of Things presents characteristics such as dynamic changes in heterogeneous network topology, inefficient and redundant transmission, and multi-state discrete resources. Among them, there are various heterogeneous devices in the Internet of Things, and their resources (such as processing power, storage capacity, energy, etc.) may be different, which makes the communication and data exchange between devices face more challenges. The transmission of data may be transferred through multiple intermediate nodes, resulting in redundant transmission paths and low transmission efficiency. This inefficient and redundant transmission may increase network latency, reduce bandwidth utilization, and increase energy consumption.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a data transmission method, device and electronic device to at least solve the technical problem of data transmission difficulties collected by IoT devices in the related art.
[0005] According to one aspect of an embodiment of the present application, a data transmission method is provided, including: receiving data to be displayed collected by a collector client through a first server end, and quantifying the data to be displayed to obtain target data; transmitting the target data to a second server end through the first server end, the first server end and the second server end are deployed in the same server terminal, and the collector client is deployed in an edge device connected to the server terminal; and outputting the target data to the terminal for display through the second server end.
[0006] Optionally, receiving the data to be displayed collected by the collector client through the first server includes: obtaining the data to be displayed from the collector client through the first server, wherein the data to be displayed includes at least sensor data and stored data, the stored data is obtained through a target application, and the sensor data is obtained through multiple sensors, and the multiple sensors include at least: a first sensor for obtaining humidity and temperature, a second sensor for obtaining gas concentration, and a third sensor for ranging.
[0007] Optionally, receiving the data to be displayed collected by the collector client through the first server includes: subscribing to a topic message published by the collector client through the first server, the topic message being used to associate the data to be displayed; and receiving the data to be displayed when the collector client publishes the topic message, the data to be displayed including: static data and dynamic data, the dynamic data including: data with a collection frequency greater than a preset frequency.
[0008] Optionally, transmitting the target data to the second server through the first server includes: placing the target data into variables of a preset multi-process communication module through a Unix domain socket communication method through the first server, and the variables of the preset multi-process communication module are used for the first server and the second server to share data; and obtaining the target data from the variables of the preset multi-process communication module after detecting the target data in the variables of the preset multi-process communication module through the second server.
[0009] Optionally, outputting the target data to the terminal for display through the second server includes: encapsulating the target data through the second server to obtain encapsulated data; converting the encapsulated data into a target data format supported by a target interface; and outputting the encapsulated data in the target data format to the terminal for display through the target interface.
[0010] Optionally, the method further includes: generating multiple display pages in the display interface of the terminal, the multiple display pages including at least: a first type of display page for displaying multiple resource information and a second type of display page for displaying multiple edge device information for deploying the collector client.
[0011] Optionally, outputting the target data to the terminal for display through the second server includes: receiving a display request through the second server, the display request is used to request the second server to output the target data, the display request receives an access request at the terminal, and is issued when the access request is verified.
[0012] According to another aspect of an embodiment of the present application, a data transmission device is also provided, including: a collection module, used to receive the data to be displayed collected by a collector client through a first server end, and quantify the data to be displayed to obtain target data; a transmission module, used to transmit the target data to a second server end through the first server end, the first server end and the second server end are deployed in the same server terminal, and the collector client is deployed in an edge device connected to the server terminal; a display module, used to output the target data to the terminal for display through the second server end.
[0013] According to another aspect of the embodiment of the present application, an electronic device is also provided, including: a memory for storing program instructions; a processor, connected to the processor, for executing program instructions to implement the following functions: receiving data to be displayed collected by a collector client through a first server end, and quantifying the data to be displayed to obtain target data; transmitting the target data to a second server end through the first server end, the first server end and the second server end are deployed in the same server terminal, and the collector client is deployed in an edge device connected to the server terminal; outputting the target data to the terminal for display through the second server end.
[0014] According to another aspect of the embodiments of the present application, a computer program product is provided, including computer instructions, which implement the above-mentioned data transmission method when executed by a processor.
[0015] In an embodiment of the present application, the first server receives the data to be displayed collected by the collector client, and quantifies the data to be displayed to obtain target data; the target data is transmitted to the second server through the first server, the first server and the second server are deployed in the same server terminal, and the collector client is deployed in an edge device connected to the server terminal; the target data is output to the terminal for display through the second server, and by deploying the first server and the second server in the same server terminal, the purpose of quickly transmitting the collected data is achieved, thereby achieving the technical effect of improving the data transmission rate, and further solving the technical problem of difficult data transmission collected by Internet of Things devices in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0017] Figure 1 is a hardware structure block diagram of a computer terminal for implementing a data transmission method according to an embodiment of the present application;
[0018] Figure 2 is a flow chart of a data transmission method according to an embodiment of the present application;
[0019] Figure 3 is a structural schematic diagram of a data transmission system according to an embodiment of the present application;
[0020] Figure 4 It is a structural diagram of a data transmission device according to an embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] The information collected in the embodiments of the present application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or reject automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.
[0024] In order to solve the problems in the related technology, the embodiment of the present application provides a data transmission method, which can be run in an application-driven heterogeneous Internet of Things ternary divide-and-rule architecture. The architecture is centered on "data-resource-service" and realizes consistent data expression, unified abstract resource management and service synergy and integration among different Internet of Things systems through a series of standardized and open interfaces, thereby improving the heterogeneous interconnection effect. In addition, the method can also be run on Figure 1 In the computer terminal shown, the computer terminal is described below.
[0025] The data transmission method embodiment provided in the embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a data transmission method. Figure 1As shown, the computer terminal 10 may include one or more (shown by 102a, 102b, ..., 102n in the figure) processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions connected via a wired and / or wireless network. In addition, it may also include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, and a BUS bus. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0026] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0027] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the data transmission method in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned data transmission method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0028] The transmission module 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission module 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0029] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .
[0030] It should be noted that, in some optional embodiments, the above Figure 1 The computer terminal shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computer terminal described above.
[0031] In the above-mentioned operating environment, an embodiment of the present application provides an embodiment of a data transmission method. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0032] Figure 2 is a flow chart of a data transmission method according to an embodiment of the present application, which is applied to a heterogeneous interconnection platform (or referred to as a heterogeneous interconnection system), such as Figure 2 As shown, the method comprises the following steps:
[0033] Step S202: receiving the data to be displayed collected by the collector client through the first server, and quantifying the data to be displayed to obtain target data.
[0034] In the above step S202, the first server may be a collection server, which is used to obtain the data to be displayed obtained by the collector client. The data to be displayed may be obtained through application requirements. Application requirements refer to specific operations that the client wants the system to perform or specific services to be provided. These requirements may include data queries, control instructions, status updates, etc. Available resource information refers to the current status of resources such as devices, data, and processing power available in the Internet of Things system. For example, it may include the current status of a sensor, the remaining battery power of a device, the stability of the network connection, etc. When sending application requirements, the client needs to understand the resource situation in the Internet of Things environment in which it is located so that the system can respond to its needs more accurately.
[0035] Step S204: The target data is transmitted to the second server through the first server. The first server and the second server are deployed in the same server terminal, and the collector client is deployed in an edge device connected to the server terminal.
[0036] In the above step S204, the edge device may be a microcomputer based on ARM architecture, and the second server may be a server running the backend of the application. The first server and the second server may be in different processes, for example, the first server is in the first process, and the second server is in the second process. Since the two servers are deployed in the same server terminal, the data transmission efficiency can be improved through a specific communication method.
[0037] Step S206: Output the target data to the terminal for display through the second server.
[0038] In the above step S206, the second server may transmit the target data to the application front end, and the application front end may display the target data. The application front end may be deployed in the server terminal or deployed separately in the terminal.
[0039] Through steps S202 to S206 in the above data transmission method, the first server receives the data to be displayed collected by the collector client, and quantifies the data to be displayed to obtain target data; the first server transmits the target data to the second server, the first server and the second server are deployed in the same server terminal, and the collector client is deployed in the edge device connected to the server terminal; the second server outputs the target data to the terminal for display, and by deploying the first server and the second server in the same server terminal, the purpose of quickly transmitting the collected data is achieved, thereby achieving the technical effect of improving the data transmission rate, and further solving the technical problem of difficult data transmission collected by IoT devices in related technologies. The following is a detailed description.
[0040] In step S202 of the above-mentioned data transmission method, receiving the data to be displayed collected by the collector client through the first server includes: obtaining the data to be displayed from the collector client through the first server, wherein the data to be displayed includes at least sensor data and stored data, the stored data is obtained through the target application, and the sensor data is obtained through multiple sensors, and the multiple sensors include at least: a first sensor for obtaining humidity and temperature, a second sensor for obtaining gas concentration, and a third sensor for ranging.
[0041] like Figure 3 As shown, multiple sensors are connected to the edge device. The first sensor can be a digital temperature and humidity sensor, which is a temperature and humidity composite sensor with a calibrated digital signal output, and can be used to measure the temperature and humidity information in the current environment. The second sensor can be a gas sensor, which has good sensitivity to harmful gases in a wide concentration range, and is highly sensitive to ammonia, sulfide, and benzene vapors. It is widely used in leak alarms, industrial combustible gas alarms, and portable gas detectors. The third sensor can be an ultrasonic ranging sensor, including an ultrasonic transmitter, a receiver, and a control circuit. It is often used in intelligent robots and can obtain the exact distance of obstacles within the sonar range.
[0042] It should be noted that the storage data includes information such as CPU, memory, disk and network, and the sensor data includes: temperature and humidity data, obstacle distance, etc.
[0043] In other embodiments of the present application, the data to be displayed may be further divided into static data and dynamic data, and the dynamic data includes: data with a collection frequency greater than a preset frequency.
[0044] Specifically, static data refers to data that is collected at a frequency lower than the preset frequency. For example, dynamic data includes sensor information collected every 2 seconds and edge device CPU occupancy, memory occupancy, disk IO rate, and network rate information collected every 1 second. The storage and calculation data information is obtained through the target application, for example, through the psutil library (python system and process utility).
[0045] The first server can receive the data to be displayed collected by the collector client through the MQTT (Message Queuing Telemetry Transport) communication method, and subscribe to the topic message published by the collector client through the first server. The topic message is used to associate the data to be displayed. Specifically, after collecting the data, the collector client connects to the MQTT broker (the central node for message transmission), publishes the topic and data information, and the server subscribed to the topic will receive the new message published by the client. At the same time, the collector client also subscribes to a topic published by the first server, which is used to request the collector client to send a message for registration when the first server is started.
[0046] In step S204 of the above-mentioned data transmission method, the target data is transmitted to the second server through the first server, including: the first server puts the target data into the variables of the preset multi-process communication module through the Unix domain socket communication method, and the variables of the preset multi-process communication module are used for the first server and the second server to share data; after the second server detects the target data in the variables of the preset multi-process communication module, the target data is obtained from the variables of the preset multi-process communication module.
[0047] When the first server is started, two services are started using multi-process, which are used to connect to the MQTT broker and establish Unix domain socket communication respectively.
[0048] It should be noted that Unix domain sockets only copy data and do not perform protocol processing, do not need to add or delete network headers, do not need to calculate checksums, do not generate sequence numbers, and do not need to send confirmation messages. Each time data arrives, it is placed in the variables of the preset multi-process communication module to ensure that the shared data always keeps the latest data.
[0049] It should be noted that the variable of the preset multi-process communication module can be multiprocessing.Manage().dict() (a variable object of a multi-process communication module, which returns a variable object of a multi-process communication module that can be shared and modified between multiple processes. The variable object of the multi-process communication module returned by this method can be read and written between multiple processes, thereby realizing data sharing between processes).
[0050] In some embodiments of the present application, outputting the target data to the terminal for display through the second server includes: encapsulating the target data through the second server to obtain encapsulated data; converting the encapsulated data into a target data format supported by a target interface; and outputting the encapsulated data in the target data format to the terminal for display through the target interface.
[0051] In other embodiments of the present application, the data model may also be defined in the form of a Python class, and the data model may be connected to a preset database to form a database application program interface to retrieve data.
[0052] In some embodiments of the present application, multiple display pages are generated in the display interface of the terminal, and the multiple display pages include at least: a first type of display page for displaying multiple resource information and a second type of display page for displaying multiple edge device information for deploying the collector client.
[0053] In some embodiments of the present application, outputting the target data to the terminal for display through the second server includes: receiving a display request through the second server, the display request is used to request the second server to output the target data, the display request receives an access request at the terminal, and is issued when the access request is verified.
[0054] The present application also provides a data transmission system, such as Figure 3 As shown, it includes: a server terminal 30, an edge device 32 and a sensor 34, the server terminal 30 is connected to the edge device 32, and the edge device 32 is connected to the sensor 34, wherein the server terminal 30 is used to deploy the first server, the second server and the application front end, and the edge device 32 is used to deploy the collector client.
[0055] The server terminal 30 is used to deploy a first server, a second server and an application front end, receive the data to be displayed collected by the collector client through the first server, quantify the data to be displayed to obtain target data, and transmit the target data to the second server through the first server, and output the target data to the application front end for display through the second server.
[0056] Edge device 32, used to deploy collector client to obtain data to be displayed from sensor 34;
[0057] The sensor 34 is used to obtain data to be displayed.
[0058] Figure 4 is a structural diagram of a data transmission device according to an embodiment of the present application, such as Figure 4 As shown, the device comprises:
[0059] The collection module 40 is used to receive the data to be displayed collected by the collector client through the first server, and quantify the data to be displayed to obtain target data;
[0060] A transmission module 42, configured to transmit the target data to a second server via the first server, wherein the first server and the second server are deployed in the same server terminal, and the collector client is deployed in an edge device connected to the server terminal;
[0061] The display module 44 is used to output the target data to the terminal for display through the second server.
[0062] Through the collection module 40, transmission module 42, and display module 44 in the above-mentioned data transmission device, by deploying the first server end and the second server end in the same server terminal, the purpose of quickly transmitting the collected data is achieved, thereby achieving the technical effect of improving the data transmission rate, and further solving the technical problem of difficult data transmission collected by Internet of Things devices in related technologies.
[0063] The receiving module 40 in the above-mentioned data transmission device includes: a first receiving submodule and a second receiving submodule, wherein the first receiving submodule is used to receive the data to be displayed collected by the collector client through the first server, including: obtaining the data to be displayed from the collector client through the first server, wherein the data to be displayed includes at least sensor data and stored data, the stored data is obtained through the target application, and the sensor data is obtained through multiple sensors, and the multiple sensors include at least: a first sensor for obtaining humidity and temperature, a second sensor for obtaining gas concentration, and a third sensor for ranging.
[0064] The second receiving submodule is used to receive the data to be displayed collected by the collector client through the first server, including: subscribing to the topic message published by the collector client through the first server, and the topic message is used to associate the data to be displayed; when the collector client publishes the topic message, receiving the data to be displayed, the data to be displayed includes: static data and dynamic data, and the dynamic data includes: data with a collection frequency greater than a preset frequency.
[0065] The first receiving submodule includes: a transmission unit, which is used to transmit the target data to the second server through the first server, including: putting the target data into the variables of the preset multi-process communication module through the Unix domain socket communication method through the first server, and the variables of the preset multi-process communication module are used for the first server and the second server to share data; after the second server detects the target data in the variables of the preset multi-process communication module, the target data is obtained from the variables of the preset multi-process communication module.
[0066] The display module 44 includes: a display submodule, which is used to output the target data to the terminal for display through the second server, including: encapsulating the target data through the second server to obtain encapsulated data; converting the encapsulated data into a target data format supported by the target interface; and outputting the encapsulated data in the target data format to the terminal for display through the target interface.
[0067] The display submodule includes: a generation unit for generating multiple display pages in the display interface of the terminal, and the multiple display pages include at least: a first type of display page for displaying multiple resource information and a second type of display page for displaying multiple edge device information for deploying the collector client.
[0068] The display module 44 also includes: a verification submodule, which is used to receive a display request through the second server, the display request is used to request the second server to output the target data, the display request receives an access request at the terminal, and is issued when the access request is verified.
[0069] It should be noted that Figure 4 The data transmission device shown is used to perform Figure 2 The data transmission method shown, therefore the relevant explanations in the above data transmission method are also applicable to the data transmission device, and will not be repeated here.
[0070] An embodiment of the present application also provides an electronic device, including: a memory for storing program instructions; a processor, connected to the processor, for executing program instructions to implement the following functions: receiving data to be displayed collected by a collector client through a first server end, and quantifying the data to be displayed to obtain target data; transmitting the target data to a second server end through the first server end, the first server end and the second server end are deployed in the same server terminal, and the collector client is deployed in an edge device connected to the server terminal; outputting the target data to the terminal for display through the second server end.
[0071] It should be noted that the above electronic equipment is used to execute Figure 2 The data transmission method shown, therefore the relevant explanations in the above data transmission method are also applicable to the electronic device and will not be repeated here.
[0072] An embodiment of the present application also provides a non-volatile storage medium, which includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the following data transmission method by running the computer program: receiving the data to be displayed collected by the collector client through a first server end, and quantifying the data to be displayed to obtain target data; transmitting the target data to a second server end through the first server end, the first server end and the second server end are deployed in the same server terminal, and the collector client is deployed in an edge device connected to the server terminal; outputting the target data to the terminal for display through the second server end.
[0073] It should be noted that the above non-volatile storage medium is used to execute Figure 2 The data transmission method shown, therefore the relevant explanations in the above data transmission method are also applicable to the non-volatile storage medium and will not be repeated here.
[0074] An embodiment of the present application further provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data transmission method in each embodiment of the present application are implemented.
[0075] An embodiment of the present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the data transmission method in each embodiment of the present application.
[0076] The embodiments of the present application also provide a computer program, which, when executed by a processor, implements the steps of the data transmission method in each embodiment of the present application.
[0077] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0078] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0079] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0080] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0081] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0082] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly or all or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc., which can store program code.
[0083] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A data transmission method, characterized in that: The method comprises: The first server receives the data to be displayed collected by the collector client, and quantifies the data to be displayed to obtain target data; The target data is transmitted to the second server through the first server, the first server and the second server are deployed in the same server terminal, and the collector client is deployed in an edge device connected to the server terminal; The target data is output to the terminal for display through the second server.
2. The method according to claim 1, characterized in that Receiving the data to be displayed collected by the collector client through the first server, including: The data to be displayed is obtained from the collector client through the first server, wherein the data to be displayed includes at least sensor data and stored data, the stored data is obtained through a target application, and the sensor data is obtained through multiple sensors, and the multiple sensors include at least: a first sensor for obtaining humidity and temperature, a second sensor for obtaining gas concentration, and a third sensor for ranging.
3. The method according to claim 1, characterized in that Receiving the data to be displayed collected by the collector client through the first server, including: Subscribe to the topic message published by the collector client through the first server, where the topic message is used to associate the data to be displayed; In the case where the collector client publishes the topic message, the data to be displayed is received, the data to be displayed includes: static data and dynamic data, and the dynamic data includes: data with a collection frequency greater than a preset frequency.
4. The method according to claim 2, characterized in that: The method of transmitting the target data to the second server through the first server includes: The target data is placed into a variable of a preset multi-process communication module by the first server through a Unix domain socket communication method, and the variable of the preset multi-process communication module is used for the first server and the second server to share data; After detecting the target data in the variable of the preset multi-process communication module, the second server obtains the target data from the variable of the preset multi-process communication module.
5. The method according to claim 1, characterized in that Outputting the target data to a terminal for display through the second server includes: Encapsulating the target data by the second server to obtain encapsulated data; Converting the encapsulated data into a target data format supported by the target interface; The encapsulated data in the target data format is output to the terminal through the target interface for display.
6. The method according to claim 5, characterized in that The method further comprises: A plurality of display pages are generated in the display interface of the terminal, and the plurality of display pages at least include: a first type of display page for displaying a variety of resource information and a second type of display page for displaying a plurality of edge device information for deploying a collector client.
7. The method according to claim 1, characterized in that Outputting the target data to a terminal for display through the second server includes: The second server receives a display request, the display request being used to request the second server to output the target data. The terminal receives an access request and issues the display request when the access request is verified.
8. A data transmission device, characterized in that: include: A collection module, used for receiving the data to be displayed collected by the collector client through the first server, and quantifying the data to be displayed to obtain target data; A transmission module, used to transmit the target data to a second server through the first server, the first server and the second server are deployed in the same server terminal, and the collector client is deployed in an edge device connected to the server terminal; A display module is used to output the target data to a terminal for display through the second server.
9. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is connected to the processor and is used to execute program instructions to implement the following functions: receiving the data to be displayed collected by the collector client through the first server end, and quantifying the data to be displayed to obtain target data; transmitting the target data to the second server end through the first server end, the first server end and the second server end are deployed in the same server terminal, and the collector client is deployed in an edge device connected to the server terminal; outputting the target data to the terminal for display through the second server end.
10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the data transmission method according to any one of claims 1 to 7 is implemented.
