Detailed Description
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 apparent that the described embodiments are only some embodiments of the present application, but not all embodiments, and that different embodiments may be adaptively combined. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a data communication system according to an embodiment of the application. As shown in fig. 1, the data communication system includes an internet of things server, a data processing server and a target memory.
Specifically, the internet of things server is used for acquiring target data acquired by the associated equipment and storing the target data into the target memory. The data processing server is used for extracting target data from the target database. The target memory is used for storing target data stored by the Internet of things server.
In an implementation scenario, a serial communication line is provided between the internet of things server and the data processing server, and information related to the target data is transmitted between the internet of things server and the data processing server through the serial communication line. Or in other implementation scenarios, the internet of things server and the data processing server may be integrated into the same server device.
Referring to fig. 2 in conjunction with fig. 1, fig. 2 is a flow chart illustrating an embodiment of a data communication method according to the present application. The implementation method takes the internet of things server in the data communication system as an execution main body, and the implementation process comprises the following steps:
s101: and acquiring target data acquired by the associated equipment, and storing the target data into a target memory.
In one embodiment, in response to the internet of things server being coupled to at least one associated device, the internet of things server obtains target data collected by the associated device and stores the target data to the target memory.
In an implementation scenario, the associated device includes different types of sensors, such as temperature sensors, humidity sensors, or pressure sensors, among others. And responding to the wired connection of the associated equipment and the Internet of things server, and acquiring target data acquired by the associated equipment by the Internet of things server through a connected line. Or the associated device may be other, such as an image acquisition device or a video acquisition device. Or the associated equipment can be other equipment, and the target data is the data generated by the associated equipment in the running process. Optionally, in other implementation scenarios, the internet of things server and the associated device may also be connected wirelessly.
In an implementation scenario, the target memory is a SAS (Serial Attached SCSI) hard disk with a higher transfer rate. An SAS bus is arranged between the Internet of things server and the target memory, so that the Internet of things server stores target data into the target memory through the SAS bus.
In another embodiment, after the obtained target data, the internet of things server adds the matched unique target information to the target data, and stores the target data containing the target information into the target memory.
In an implementation scenario, the target information of the internet of things server is determined based on the IP address of the internet of things server, and is used for distinguishing from other servers. Specifically, the target information is obtained after the IP address of the Internet of things server is encrypted according to a preset encryption mode.
S102: generating data index information based on the target data; wherein the data index information is determined based on the storage address and the storage size of the target data.
In an embodiment, the internet of things server stores the obtained target data in the target memory and generates corresponding data index information according to the target data.
Specifically, a storage address and a storage scale of target data in a target memory are acquired, and the storage address and the storage scale are used as data index information. Wherein the storage scale is used to represent the data size of the target data.
In another embodiment, the generated data index information further includes target information of the internet of things server, that is, when the internet of things server generates the data index information, the encrypted target information of the internet of things server is used as part of the data index information. The target information of the Internet of things server is merged into the data index information, so that verification basis is provided for the subsequent data processing server to extract target data, and the safety of data communication is improved.
S103: the data index information is transmitted to the data processing server so that the data processing server obtains the target data from the target memory through the data index information.
In an embodiment, the internet of things server sends the generated data index information to the data processing server, so that the data processing server obtains the target data from the target memory according to the data index information after obtaining the data index information.
In an implementation scenario, in response to a serial communication line being provided between the internet of things server and the data processing server, the internet of things server sends data index information to the data processing server through a communication protocol matched with the serial communication line.
In another embodiment, the manner in which the internet of things server sends the data index information to the data processing server may be other. For example, the data index information is transmitted to a data processing server or the like through a wireless network.
In yet another embodiment, the internet of things server preferentially determines whether a communication state between the internet of things server and the data processing server is normal before transmitting the data index information to the data processing server. If the data index information is normal, sending the data index information; otherwise, the communication between the data processing server and the data processing server is judged to be interrupted, and the data index information is stopped from being sent.
Specifically, the determining process of the communication state between the internet of things server and the data processing server comprises the following steps: the method comprises the steps that an Internet of things server sends a keep-alive instruction to a data processing server according to a preset mode; for example, keep-alive instructions are sent to the data processing server via the serial communication line every preset time period. And after receiving the keep-alive instruction, the data processing server sends a feedback instruction to the Internet of things server to characterize that the communication state between the Internet of things server and the data processing server is normal. If the data processing server does not send the feedback instruction within the preset time length, the communication between the Internet of things server and the data processing server is interrupted.
According to the data communication method provided by the application, after the target data acquired by the associated equipment is acquired, the Internet of things server stores the target data into the target memory, and generates data index information based on the storage address and the storage scale of the target data in the target memory. And the internet of things server sends the data index information to the data processing server so that the data processing server extracts the target data from the target memory according to the data index information. According to the method, the direct data communication between the Internet of things server and the data processing server is avoided, and the stability and safety of data transmission are improved.
Referring to fig. 3, fig. 3 is a flowchart of step S101 in fig. 2 according to another embodiment. Specifically, after the internet of things server obtains the target data, the specific implementation process of storing the target data into the target memory includes:
S201: and acquiring the storage authority given by the target storage.
In an embodiment, after acquiring the target data, the internet of things server generates a storage request instruction and sends the storage request instruction to the target memory. And responding to the target storage to allow data to be stored and giving the storage authority to the Internet of things server, so that the Internet of things server stores the target data to the target storage according to the storage authority after acquiring the storage authority.
In another embodiment, in order to improve security of the data processing server obtaining the target data from the target memory and prevent other servers from stealing the storage authority to store the target memory in a malignant manner, the storage request instruction generated by the internet of things server includes the target information of the internet of things server. Based on the above, the storage authority generated by the target storage according to the storage request instruction includes encrypted authentication information, and when the internet of things server stores target data according to the storage authority, the target storage verifies whether the authentication information in the storage authority provided by the internet of things server is matched with the target information of the internet of things server. If the target data is matched with the target storage, the Internet of things server successfully stores the target data into the target storage; otherwise, the storage fails. The process of obtaining the target information of the internet of things server may refer to the corresponding embodiment, which is not described in detail herein.
S202: the target data is stored to the target memory based on the storage rights.
In an embodiment, according to the obtained storage authority, the internet of things server stores the target data into the target memory.
In another embodiment, in response to the target memory including a plurality of memory modules, the storage authority further includes a recommended address, where the recommended address is determined according to the storage condition of different memory modules in the target memory. And the internet of things server stores the target data into the target memory according to the recommended address in the storage authority so as to improve the data storage balance in the target memory.
In a specific embodiment, according to the storage conditions of different storage modules, the storage module with the larger remaining storage space is preferentially used as the recommended address. Or ordering all the storage modules in the target memory according to the sequence of the residual storage space from large to small, and taking the obtained storage module sequence as a recommended address, so that the internet of things server sequentially stores target data or data blocks obtained by splitting the target data into corresponding storage modules according to the storage module sequence.
Referring to fig. 4 in conjunction with fig. 1, fig. 4 is a flow chart corresponding to step S101 in fig. 2 according to another embodiment. Specifically, in response to the target memory including a plurality of storage modules, the implementation of storing the target data in the target memory in any of the above embodiments may further include:
S301: and splitting the target data into a plurality of data blocks and checking information matched with the plurality of data blocks.
In one embodiment, the target data is split into a plurality of data blocks and verification information that matches the plurality of data blocks. The verification information is used for representing the association relation among the plurality of data blocks, and the residual data blocks can be verified and recovered through the verification information and part of the data blocks. The target data is split into a plurality of data blocks and verification information, so that the safety of target data storage is improved.
In an implementation scenario, the check information may be a hamming code.
S302: and storing all the data blocks and the verification information into different storage modules.
In one embodiment, in response to the target memory including a plurality of storage modules, all data blocks and verification information corresponding to the target data are stored to different storage modules.
In another embodiment, the data blocks are preferentially stored in the memory modules with larger remaining memory space according to the remaining memory space of each memory module in the target memory.
According to the scheme, the data blocks corresponding to the target data and the verification information are stored in different storage modules in the target memory, so that when part of the data blocks are lost or part of the storage modules in the target memory are damaged to cause the loss of part of the data blocks, the lost data blocks can be recovered according to the residual data blocks and the verification information, and the safety of the target data storage is improved.
Further, after storing all the data blocks and the verification information in different storage modules, the method further comprises: and acquiring the reference information respectively matched with the data block and the verification information. And determining data index information based on the reference information respectively corresponding to the data block and the check information. Wherein the reference information includes at least one of a memory address and a memory size.
Specifically, a storage address and a storage scale of each data block in a target memory are obtained, and the storage address and the storage scale are used as reference information of the corresponding data block; similarly, the storage address and storage scale of the verification information in the target memory are obtained and used as the reference information corresponding to the verification information. And respectively matching all the data blocks corresponding to the target data with the check information to serve as data index information, so that the subsequent data processing server extracts all the data blocks and the check information from the target memory according to the data index information.
Referring to fig. 5, fig. 5 is a flow chart of another embodiment of the data communication method according to the present application. The implementation method takes a data processing server in a data communication system as an execution main body, and the implementation process comprises the following steps:
s401: acquiring data index information sent by an Internet of things server and reading permission given by a target memory; the data index information is determined based on target data acquired by the Internet of things server.
In an embodiment, the data processing server obtains data index information sent by the internet of things server, generates a read request instruction according to the data index information, and sends the read request instruction to the target memory. And responding to the target memory to allow the data to be read and endowing the data processing server with read authority, so that the data processing server extracts the target data from the target memory according to the read authority and the data index information after acquiring the read authority. The data index information is determined based on the target data acquired by the internet of things server, and the specific generation process may refer to the corresponding embodiment, which is not described in detail herein.
In an implementation scenario, in response to a serial communication line being provided between the data processing server and the internet of things server, the data processing server obtains data index information sent by the internet of things server through the serial communication line.
In another embodiment, in response to the data index information further including the target information, the data processing server generates a read request instruction according to the target information therein after acquiring the data index information, and sends the read request instruction to the target memory. After the target memory acquires the reading request instruction, the data processing server is endowed with corresponding reading authority according to the target information in the target memory. The read authority only supports the data processing server to read the target data stored by the Internet of things server matched with the corresponding target information, so that the safety of other data stored in the target memory is ensured.
S402: and extracting target data matched with the data index information from the target database based on the data index information and the read authority.
In one embodiment, the data processing server extracts the matched target data from the target database according to the acquired data index information and the read authority.
Specifically, in response to the data index information including the storage address and the storage size to which the target data matches, the target data is acquired from the target memory based on the read authority, the storage address, and the storage size.
In another embodiment, in response to the target data being split into a plurality of data blocks and verification information matched with the plurality of data blocks, and the obtained data index information includes reference information matched with the data blocks and reference information matched with the verification information, the data processing server obtains all the data blocks and the verification information from different storage modules of the target memory according to the reference information in the data index information, and obtains the target data according to all the data blocks and the verification information. The splitting process of the target data may refer to the corresponding embodiment, and will not be described in detail herein.
In an implementation scenario, after the data processing server obtains all the corresponding data blocks and the verification information according to the data index information, the verification information is utilized to verify all the data blocks so as to determine whether a data bit error occurs in the data blocks. If the data bit errors occur, the data processing server corrects the data in the corresponding data blocks according to the verification information, and obtains target data according to all corrected data blocks.
Further, after the data processing server extracts the target data, the target data is processed and analyzed. The processing and analyzing modes include, but are not limited to, operation and maintenance management of data, equipment operation state analysis and the like.
Referring to fig. 6, fig. 6 is a flow chart illustrating an embodiment of a data communication method according to the present application. In order to facilitate understanding of the data communication method provided by the application, the data communication method is described by combining the angles of the internet of things server and the data processing server, and the specific implementation process comprises the following steps:
s501: the internet of things server acquires target data acquired by the associated equipment and stores the target data into the target memory.
In one embodiment, in response to the internet of things server being coupled to at least one associated device, the internet of things server obtains target data collected by the associated device and stores the target data to the target memory.
The specific process of obtaining the target data by the internet of things server and the specific storage process of the target data may refer to the above corresponding embodiments, and will not be described herein.
S502: the Internet of things server generates data index information based on the target data and sends the data index information to the data processing server; wherein the data index information is determined based on the storage address and the storage size of the target data.
In an embodiment, the internet of things server stores the obtained target data in the target memory, and determines a storage address and a storage scale of the target data in the target memory, and uses the storage address and the storage scale as the data index information. Wherein the storage scale is used to represent the data size of the target data.
Further, the internet of things server sends the generated data index information to the data processing server. The generation process and the transmission process of the data index information can refer to the corresponding embodiments.
S503: the data processing server acquires the data index information sent by the Internet of things server and the reading authority given by the target memory.
In an embodiment, the data processing server obtains data index information sent by the internet of things server, generates a read request instruction according to the data index information, and sends the read request instruction to the target memory. In response to the target memory allowing the data to be read, the data processing server is given read rights.
S504: the data processing server extracts target data matching the data index information from the target database based on the data index information and the read authority.
In one embodiment, in response to the data index information including a storage address and a storage size to which the target data matches, the data processing server retrieves the target data from the target memory according to the storage address and the storage size.
Further, the data processing server performs data processing and analysis of specific tasks according to the acquired target data.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the application. The electronic device includes: a memory 10 and a processor 20 coupled to each other. The memory 10 has stored therein program instructions, and the processor 20 is configured to execute the program instructions to implement the data communication method according to any of the above embodiments. Specifically, the electronic device includes, but is not limited to: desktop computers, notebook computers, tablet computers, servers, etc., are not limited herein. Processor 20 may also be referred to as a CPU (Center Processing Unit, central processing unit). The processor 20 may be an integrated circuit chip having signal processing capabilities. The Processor 20 may also be a general purpose Processor, a digital signal Processor (DIGITAL SIGNAL Processor, DSP), an Application SPECIFIC INTEGRATED Circuit (ASIC), a Field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. In addition, the processor 20 may be commonly implemented by an integrated circuit chip.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an embodiment of a storage device according to the present application, where the storage device 30 stores program instructions 40 that can be executed by a processor, and the program instructions 40 implement the data communication method according to any of the above embodiments when executed by the processor.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical, or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing description is only of embodiments of the present application, and is not intended to limit the scope of the application, and all equivalent structures or equivalent processes using the descriptions and the drawings of the present application or directly or indirectly applied to other related technical fields are included in the scope of the present application.