CN114760326B - Data storage method, data query method, data storage system and electronic device - Google Patents
Data storage method, data query method, data storage system and electronic device Download PDFInfo
- Publication number
- CN114760326B CN114760326B CN202210202125.7A CN202210202125A CN114760326B CN 114760326 B CN114760326 B CN 114760326B CN 202210202125 A CN202210202125 A CN 202210202125A CN 114760326 B CN114760326 B CN 114760326B
- Authority
- CN
- China
- Prior art keywords
- storage
- data
- equipment
- information
- data storage
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/745—Address table lookup; Address filtering
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application relates to a data storage method, a data query method, a data storage system and an electronic device, wherein the data storage method comprises the following steps: acquiring first router information of a first router, and acquiring first equipment port information of at least one first equipment connected with the first router based on the first router information; acquiring first storage judgment information corresponding to the first equipment, and selecting and acquiring target data storage equipment from all the first equipment based on the first storage judgment information; and sending the first device storage data corresponding to all the first devices to the target data storage device for storage according to all the first device port information. The application solves the problems of high data storage cost and low security, and achieves the purposes of reducing the data storage cost of the intelligent home and improving the data security.
Description
Technical Field
The present application relates to the field of data storage, and in particular, to a data storage method, a data query method, a data storage system, and an electronic device.
Background
Currently, more and more smart home devices are installed in a home environment, so that the smart home devices generate a large amount of data in a smart home scene. At present, a method for storing a large amount of intelligent home data in a cloud database of a cloud server is generally adopted, and a user pays a certain cloud storage value-added fee to a cloud storage server for the intelligent home data stored in the cloud database. However, one year of cloud storage added value of one intelligent home equipment is enough to purchase one new intelligent home equipment, so that the cloud database storage method can greatly increase the intelligent home data storage cost of the user.
In the related art, in order to reduce the cost of storing smart home data of a user, a method for storing the smart home data locally is generally adopted. However, for an outdoor smart home device, such as a monitoring camera, when the outdoor smart home device is lost or damaged, the history data stored locally in the outdoor smart home device is lost, so that the smart home data storage of the user cannot be properly secured.
Aiming at the problems of high data storage cost and low security in the related technology, no effective solution is proposed at present.
Disclosure of Invention
The embodiment provides a data storage method, a data query method, a data storage system and an electronic device, so as to solve the problems of high data storage cost and low security in the related art.
In a first aspect, in this embodiment, there is provided a data storage method, including:
Acquiring first router information of a first router, and acquiring first equipment port information of at least one first equipment connected with the first router based on the first router information;
Acquiring first storage judgment information corresponding to the first equipment, and selecting and acquiring target data storage equipment from all the first equipment based on the first storage judgment information;
And sending the first device storage data corresponding to all the first devices to the target data storage device for storage according to all the first device port information.
In some of these embodiments, the selecting a target data storage device from all of the first devices based on the first storage determination information includes:
Acquiring storage device information based on the first storage judgment information; wherein the storage device information is used for indicating an independent storage unit;
And taking the independent storage unit as the target data storage device according to the storage device information.
In some embodiments, the sending the first device storage data corresponding to all the first devices to the target data storage device for storage includes:
Transmitting the first device storage data to the target data storage device;
And obtaining cloud server port information of a cloud server connected with the first router based on the first router information, and sending all first equipment data summaries corresponding to the first equipment storage data to the cloud server for storage according to the cloud server port information.
In some embodiments, after obtaining the cloud server port information of the cloud server connected to the first router based on the first router information, the method further includes:
Acquiring second router information of a second router connected with the cloud server according to the cloud server port information, and acquiring second equipment port information of at least one second equipment connected with the second router based on the second router information;
And sending second equipment storage data of all second equipment to the target data storage equipment for storage according to all the second equipment port information, and sending second equipment data abstract corresponding to the second equipment storage data to the cloud server for storage.
In some of these embodiments, the sending the second device storage data of all second devices to the target data storage device for storage includes:
and indicating the cloud server to establish a connection channel between the second device and the target data storage device according to all the second device port information, and sending all the second device storage data to the target data storage device for storage according to the connection channel.
In some embodiments, after the target data storage device is selected from all the first devices based on the first storage determination information, the method further includes:
receiving alarm information generated by the first equipment;
and sending the first equipment storage data corresponding to the alarm information to the target data storage equipment for storage according to the alarm information.
In some embodiments, after the sending the first device storage data corresponding to all the first devices to the target data storage device for storage, the method further includes:
acquiring second storage judgment information corresponding to the first equipment;
Obtaining appointed storage equipment according to the second storage judgment information;
acquiring a designated device corresponding to the designated storage device from the first device;
transmitting the designated equipment data of the designated equipment to the designated storage equipment for storage;
acquiring storage attribute information of the specified equipment data in the specified storage equipment;
And deleting the first device storage data corresponding to the designated storage device in the target data storage device according to the storage attribute information.
In a second aspect, in this embodiment, there is provided a data query method, including:
the cloud server is instructed to acquire a query instruction of the control terminal, and the cloud server matches the first equipment data abstract according to the query instruction and generates a first equipment matching result;
Reading the first equipment storage data corresponding to the first equipment matching result in the data storage equipment according to the first equipment matching result; wherein the first device stored data is data stored by the target data storage device according to any one of the data storage methods of the first aspect above;
and sending the first equipment storage data to the control terminal for display.
In some embodiments, the cloud server matches the first device data digest according to the query instruction and generates a first device matching result, and further includes:
The cloud server matches the second equipment data abstract according to the query instruction and generates a second equipment matching result;
Reading the second equipment storage data corresponding to the second equipment matching result in the data storage equipment according to the second equipment matching result;
And sending the second equipment storage data to the control terminal for display.
In a third aspect, in this embodiment there is provided a data storage system comprising: the system comprises a master control device, a first router and at least one first device;
the main control device is used for executing the data storage method in the first aspect;
the first router is used for generating first router information;
The at least one first device is configured to generate corresponding first device port information and first storage judgment information.
In a fourth aspect, in this embodiment, there is provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the data storage method of the first aspect.
In a fifth aspect, in the present embodiment, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements the data storage method of the first aspect described above.
Compared with the related art, the data storage method, the data query method, the data storage system and the electronic device provided in the embodiment obtain the first device port information of at least one first device connected with a first router based on the first router information by obtaining the first router information of the first router; acquiring first storage judgment information corresponding to the first equipment, and selecting and acquiring target data storage equipment from all the first equipment based on the first storage judgment information; according to the port information of all the first devices, the first device storage data corresponding to all the first devices are sent to the target data storage device for storage, so that the problems of high data storage cost and low security are solved, and the purposes of reducing the intelligent home data storage cost and improving the data security are achieved.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the other features, objects, and advantages of the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is an application scenario diagram of a data storage method in one embodiment;
FIG. 2 is a flow diagram of a method of data storage in one embodiment;
FIG. 3 is a flow diagram of a method of data polling in one embodiment;
FIG. 4 is a flow chart of a method of data storage in another embodiment;
FIG. 5 is a flow chart of a method of data storage in yet another embodiment;
FIG. 6 is a flow chart of a method of data storage in yet another embodiment;
Fig. 7 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be described and illustrated with reference to the accompanying drawings and examples for a clearer understanding of the objects, technical solutions and advantages of the present application.
Unless defined otherwise, technical or scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terms "a," "an," "the," "these" and similar terms in this application are not intended to be limiting in number, but may be singular or plural. The terms "comprising," "including," "having," and any variations thereof, as used herein, are intended to encompass non-exclusive inclusion; for example, a process, method, and system, article, or apparatus that comprises a list of steps or modules (units) is not limited to the list of steps or modules (units), but may include other steps or modules (units) not listed or inherent to such process, method, article, or apparatus. The terms "connected," "coupled," and the like in this disclosure are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" as used herein means two or more. "and/or" describes an association relationship of an association object, meaning that there may be three relationships, e.g., "a and/or B" may mean: a exists alone, A and B exist together, and B exists alone. Typically, the character "/" indicates that the associated object is an "or" relationship. The terms "first," "second," "third," and the like, as referred to in this disclosure, merely distinguish similar objects and do not represent a particular ordering for objects.
The data storage method provided by the application can be applied to an application environment shown in figure 1. Wherein the master device 102 communicates with the first router 104 via a local connection and the first router 104 communicates with the first device 106 via a local connection. The method comprises the steps that a master control device 102 obtains first router information of a first router 104, and obtains first device port information of at least one first device 106 connected with the first router based on the first router information; the master control device 102 obtains first storage judgment information corresponding to the first device 106, and selects and obtains target data storage devices from all the first devices 106 based on the first storage judgment information; the master control device 102 sends all the first device storage data corresponding to the first device 106 to the target data storage device for storage according to all the first device port information. The master device 102 may be, but not limited to, various computing processing units such as CPU, GPU, etc.; the first router 104 may also be various communication relay devices that provide a communication switching function; the first device 106 may be an intelligent home device such as a monitoring camera, a sweeping robot, an intelligent socket, an intelligent curtain, an intelligent medical device such as an electrocardiograph, a chest perspective instrument, a centrifuge, an intelligent traffic device such as a road bayonet camera, a signal control traffic light, an intelligent internet-connected vehicle, etc.; the first device 106 may be implemented as a stand-alone device or as a cluster of devices. The application environment can be applied to an intelligent home management system in a home environment, can be applied to the realization of an intelligent medical equipment cluster, and can also be applied to the realization of an intelligent equipment cluster in industries such as an intelligent traffic management system, and the like, and is not repeated here.
In this embodiment, a data storage method is provided, fig. 2 is a flowchart of the data storage method of this embodiment, and as shown in fig. 2, the flowchart includes the following steps:
Step S202, first router information of a first router is obtained, and first device port information of at least one first device connected with the first router is obtained based on the first router information.
The first router information comprises an IP address of a first router and first equipment port information of first equipment connected with the first router; the first device port information includes a first device name, a first device attribute, and a first device port address; the first device attribute refers to a device type and factory setting parameters of the first device, for example, the device type is a monitoring camera, and the factory setting parameters indicate parameters such as a manufacturer name, electric quantity, brightness and the like of the monitoring camera.
Step S204, first storage judgment information corresponding to the first equipment is obtained, and target data storage equipment is selected and obtained from all the first equipment based on the first storage judgment information.
The first storage judgment information refers to address information according to which all data acquired by the first equipment are stored in the first equipment, and the address information indicates the address of the first equipment which opens up a storage space; the first storage judgment information may be preset, or may be obtained by the master control device 102 according to the number of storage spaces and the size of the storage spaces after the master control device 102 obtains the number of storage spaces and the size of the storage spaces corresponding to all the first devices; in the case where the first storage determination information is preset, the acquisition of the first storage determination information may be acquired from the first device or may be acquired from the cloud server.
In this embodiment, a preferred implementation manner is provided, where the master device 102 first attempts to obtain preset first storage judgment information; under the condition that the master control device 102 fails to acquire from the first device, acquiring preset first storage judgment information from the cloud server; under the condition that the acquisition of preset first storage judgment information from the cloud server fails, the main control equipment 102 acquires the quantity and the size of the storage spaces corresponding to all the first equipment, and under the condition that the quantity of the storage spaces is 1, the address information of the corresponding first equipment which opens up the storage spaces is directly acquired as the first storage judgment information; under the condition that the number of the storage spaces is larger than 1, sorting the sizes of the storage spaces to obtain sorting results, and acquiring address information of a first device with the largest storage space as the first storage judgment information according to the sorting results; and finally, selecting and acquiring target data storage devices from all the first devices based on the first storage judgment information.
Step S206, according to all the first device port information, sending all the first device storage data corresponding to the first device to the target data storage device for storage.
The first device storage data refers to device data collected by the first device and used for storage.
Specifically, the master control device 102 establishes connection channels between all the first devices and the target data storage device according to all the first device port information; wherein the connection channel can be a long connection channel or a short connection channel; the master control device 102 sends all first device storage data corresponding to the first device to the target data storage device according to the connection channel; the target data storage device acquires a preset data storage mode corresponding to the first device, and stores the first device storage data according to the data storage mode; the data storage mode comprises front-to-back storage, back-to-front storage and the like; when the connection channel is a long connection channel, the master control device 102 does not disconnect the connection channel after sending all the first device storage data corresponding to the first device to the target data storage device according to the connection channel; when the connection channel is a short connection channel, the master device 102 disconnects the connection channel after sending the first device storage data to the target data storage device according to the connection channel, and reestablishes the connection channel when the master device 102 sends the first device storage data to the target data storage device next time.
Through the steps, the first device storage data of all the first devices 106 under the same first router 104 are stored in the first devices which open up the storage space by using the target data storage device, and each first device is not required to be provided with a storage hardware, so that the cost is reduced; meanwhile, in the at least one first device, when other first devices except the first device serving as the target data storage device cannot continue to be normally used due to loss, faults and the like, the first device storage data generated based on the other first devices are stored in the target data storage device, so that the first device storage data which cannot continue to be normally used can be perfectly stored, the condition that the first device storage data is lost cannot be generated, the data security is improved, and the problems of high data storage cost and low security are solved.
In some of these embodiments, the selecting a target data storage device from all of the first devices based on the first storage determination information includes:
Acquiring storage device information based on the first storage judgment information; wherein the storage device information is used for indicating the independent storage unit;
And taking the independent storage unit as the target data storage device according to the storage device information.
Wherein the storage device information includes address information of the independent storage unit, used storage space size information, available storage space size information, and the like.
Through the above steps, the master control device 102 is further configured to obtain an independent storage unit connected to the first router, and use the independent storage unit as the target data storage device, so that the independent device can be used to store the first device storage data, and the expandability of the target data storage device can be improved.
In some embodiments, the sending the first device storage data corresponding to all the first devices to the target data storage device for storage includes:
Transmitting the first device storage data to the target data storage device;
And obtaining cloud server port information of a cloud server connected with the first router based on the first router information, and sending all first equipment data summaries corresponding to the first equipment storage data to the cloud server for storage according to the cloud server port information.
The first device data abstract can also be sent to the target data storage device for storage; the first device data abstract refers to information such as a data content abstract and a data attribute corresponding to the first device data; the data attribute refers to time length, data content type, coding format and the like; the data content type is an event type of the real event content corresponding to the data, for example, a target detection event type or a face recognition event type, which will not be described herein.
Through the steps, the cloud server is connected with the first router, the first equipment data abstract corresponding to the first equipment storage data is stored in the cloud server, and compared with the technical scheme that the first equipment storage data and the first equipment data abstract corresponding to the first equipment storage data are stored in the cloud server in the related art, the data storage amount in the cloud server can be reduced, and the data storage cost is reduced.
In some embodiments, after obtaining the cloud server port information of the cloud server connected to the first router based on the first router information, the method further includes:
Acquiring second router information of a second router connected with the cloud server according to the cloud server port information, and acquiring second equipment port information of at least one second equipment connected with the second router based on the second router information;
And sending second equipment storage data of all second equipment to the target data storage equipment for storage according to all the second equipment port information, and sending second equipment data abstract corresponding to the second equipment storage data to the cloud server for storage.
The cloud server port information comprises an IP address of a cloud server and second router information of a second router connected with the cloud server; the second router information includes an IP address of a second router and second device port information of a second device connected to the second router; the second device port information includes a second device name, a second device attribute, and a second device port address; when the target data storage device stores the second device storage data, acquiring a preset data storage mode corresponding to the second device, and storing the second device storage data according to the data storage mode; the data storage mode comprises front-to-back storage, back-to-front storage and the like, and the data storage mode adopted when the second equipment stores data storage is different from that when the first equipment stores data storage; the second device data abstract refers to information such as a data content abstract and a data attribute corresponding to the second device data; the data attribute refers to data storage time, data content type, coding format and the like; the data content type is an event type of the real event content corresponding to the data, for example, a target detection event type or a face recognition event type, which will not be described herein.
Through the steps, the remote second router can be connected through the cloud server, the second device storage data generated by the second device under the remote second router and the first device storage data under the first router are stored together for local storage by the target data storage device under the first router by adopting the data storage method, the second device under the remote second router is not required to be provided with a storage hardware, and after faults such as loss and damage of the remote second device, the second device storage data cannot be lost, so that the cost of data storage is reduced, and the security of data storage is improved.
In some of these embodiments, the sending the second device storage data of all the second devices to the target data storage device for storage includes:
And indicating the cloud server to establish a connection channel between the second device and the target data storage device according to all the second device port information, and sending all the second device storage data to the target data storage device for storage according to the connection channel.
The connection channel between the target data storage device and the second device may be a direct connection channel, or an indirect connection channel may be established through the cloud server, where the indirect connection channel is forwarded by the cloud server when the second device stores data; the direct connection channel may be a long connection channel or a short connection channel, and may be used when a small amount of data is transmitted and the transmission interval is relatively long, or may be used when a large amount of data is transmitted.
Through the steps, when the second equipment and the target data storage equipment carry out data transmission so as to store, the connection mode between the target data storage equipment and the second equipment is selected according to actual needs, so that the occupied bandwidth during no transmission and the long connection adopted during large-scale data transmission can be avoided, the transmission speed is improved, and the transmission efficiency is improved.
In some embodiments, after the target data storage device is selected from all the first devices based on the first storage determination information, further comprising:
Receiving alarm information generated by the first equipment;
And sending the first equipment storage data corresponding to the alarm information to the target data storage equipment for storage according to the alarm information.
The alarm information may be target detection alarm information generated by the monitoring camera, or may be fault alarm information of a certain device in the smart home, etc., which will not be described herein.
Through the steps, after the alarm information is received, the first device storage data is sent to the target data storage device for storage, so that the storage space of the target data storage device is occupied when necessary, the consumption of the storage space can be saved, and the data storage cost is saved.
In some embodiments, after the sending the first device storage data corresponding to all the first devices to the target data storage device for storage, the method further includes:
Acquiring second storage judgment information corresponding to the first equipment;
obtaining a designated storage device according to the second storage judgment information;
Acquiring a designated device corresponding to the designated storage device from the first device;
transmitting the designated equipment data of the designated equipment to the designated storage equipment for storage;
acquiring storage attribute information of the specified device data in the specified storage device;
and deleting the first device storage data corresponding to the designated storage device in the target data storage device according to the storage attribute information.
Wherein the second storage judgment information indicates that there is a new data storage device compared to the first storage judgment information; the obtaining of the designated equipment can be obtained by judging according to the equipment where the storage unit is located, so that the designated equipment data with the storage unit is directly stored on the designated equipment; the storage unit may be a storage hard disk, an SD card, or the like; the acquiring of the specified device may also be acquiring a storage instruction of the control terminal, where the storage instruction indicates that the specific specified device data is stored in a specific storage unit or stored in the cloud server; the storage attribute information refers to an attribute corresponding to data collected by the designated device, for example, in the case that the designated device is a monitoring camera, the designated device data is video data, and the storage attribute information includes video attribute information such as video duration, video content type, video format and the like of the video data; the video content type refers to a type of a real event in the real world corresponding to the content recorded in the video file, for example, the video content type may be a target detection event type or a face recognition event type, and the like, which is not described herein again; in the case where the specified device is a sweeping robot, the specified device data is indoor map data, and the storage attribute information is a history map file of the indoor map data.
Through the steps, the newly acquired data is stored in the expanded storage space, and original data on the target data storage device is gradually released, so that the security of data storage can be improved.
The embodiment also provides a data query method. Fig. 3 is a flowchart of a data query method of the present embodiment, and as shown in fig. 3, the data query method includes the following steps:
Step S302, a cloud server is instructed to acquire a query instruction of a control terminal, and the cloud server matches the first device data abstract according to the query instruction and generates a first device matching result.
Step S304, reading the first equipment storage data corresponding to the first equipment matching result in the data storage equipment according to the first equipment matching result; wherein the first device stored data is data stored by the target data storage device according to any one of the data storage methods described above.
Step S306, the first device storage data is sent to the control terminal for display.
Through the steps, when the query instruction is executed, the corresponding first equipment data abstract is searched in the cloud server, and then the corresponding stored first equipment storage data is searched through the matched first equipment data abstract, so that the time consumption for querying when the data volume is large can be reduced, and the query efficiency is improved.
In some embodiments, the cloud server matches the first device data digest according to the query instruction and generates a first device matching result, and further includes:
The cloud server matches the second equipment data abstract according to the query instruction and generates a second equipment matching result;
reading the second equipment storage data corresponding to the second equipment matching result in the data storage equipment according to the second equipment matching result;
and sending the second equipment storage data to the control terminal for display.
Through the steps, when the query instruction is executed, the corresponding second equipment data abstract is searched in the cloud server, and then the corresponding stored second equipment storage data is searched through the matched second equipment data abstract, so that the time consumption for querying when the data volume is large can be reduced, and the query efficiency is improved.
The present embodiment is described and illustrated below by way of preferred embodiments.
Fig. 4 is a flowchart of another data storage method of the present embodiment. As shown in fig. 4, in this data storage method, an SD card is employed as a storage unit of the target data storage device 410. The first device 408 is a monitoring camera device and is placed outdoors without loading an SD card, the target data storage device 410 is placed indoors with an SD card, and the target data storage device 410 may be a separate storage device connected to the first router 406, or other first devices may be used as the target data storage device. In general, the data of the first device 408 is not stored, and the master device 102 sends the first device stored data to the target data storage device 410 for storage after receiving the alert message.
When the first router 406 and the second router 412 are connected to the cloud server 404, the cloud server 404 records SD memory card information of all the first devices 408 and the second devices 414 in the access network, and data such as memory card usage. The master control device 102 may be a cloud computing platform, and the master control device 102 determines that the first device 408 does not load an SD card according to the acquired SD memory card information, the target data storage device 410 has the SD card, and the second device 414 is a remote connection device of the target data storage device 410, and does not load the SD card; the first router 406 and all devices connected thereto, and the second router 412 and all devices connected thereto, access the cloud server 404 and are connected to the same control terminal 402. The control terminal 402 loads an application program for controlling the above-described devices.
In the above connection scenario, the cloud server 404 bridges the first device 408 and the target data storage device 410 to generate a connection channel. The connection channel may be implemented in a manner that the first device 408 stores the data receiving port IP of the target data storage device 410, and the target data storage device 410 stores the data sending port IP of the first device 408. If the first device 408 has first device stored data generated, the data is sent to the target data storage device 410.
When the target data storage device 410 is another first device, the target data storage device 410 receives the stored data and the data summary corresponding to the alarm information and stores the stored data and the data summary locally, and meanwhile, the target data storage device 410 reports the data summary to the cloud server 404, and the cloud server 404 stores the data summary. When the target data storage device 410 writes data to the SD card, a write-from-head/tail storage method may be employed, and when the target data storage device 410 stores the stored data, the cloud server 404 records the write-to-SD card method.
If the first device 408 generates an alarm event and generates alarm information, the first device storage data corresponding to the alarm information is sent to the target data storage device 410 for storage. The target data storage device 410 stores the first device stored data and the first device data digest and reports the first device data digest to the cloud server 404 for storage.
When the first router 406 accesses other devices, such as a sweeping robot, the sweeping robot transmits data such as an indoor map file of the target data storage device 410, and the target data storage device 410 also receives and stores the indoor map file and a map abstract corresponding to the indoor map file. While the target data storage device 410 uploads the map summary to the cloud server 404 for storage.
In the above data storage method, if different devices generate different device storage data, the storage is performed according to different storage strategies, for example, the first device storage data and the first device data digest are stored on the SD card from front to back, and the second device storage data and the second device data digest are stored from front to back.
Fig. 5 is a flowchart of still another data storage method of the present embodiment. As shown in fig. 5, in the case where the control terminal 402 is simultaneously connected to the second device 414, if the second device 414 does not carry an SD card and does not purchase cloud storage service, after the second device is online to the cloud server 404, the cloud server 404 builds a connection channel for the second device 414 and the target data storage device 410; that is, the second device 414 maintains the data receiving port IP of the target data storage device 410, and the target data storage device 410 maintains the data transmitting port IP of the second device 414. The second device 414 remains alive with the target data storage device 410. When the second device 414 sends data to the target data storage device 410, the data can be directly transmitted without being forwarded by the cloud server 404, and meanwhile, the second device 414 and the target data storage device 410 keep alive to the cloud server 404. Meanwhile, the first device 408 and the target data storage device 410 remain alive at a fixed time or keep alive to the cloud server 404 at the same time; a timed keep-alive is maintained between the robot and the target data storage device 410.
Fig. 6 is a flowchart of still another data storage method of the present embodiment. As shown in fig. 6, if the subsequent first device 408 and/or second device 414 performs storage space expansion, for example, in a case that an SD card is inserted into the first device 408 and/or second device 414, in a case that an expansion space is added to an independent target data storage device 410, or in a case that a purchase of a cloud storage value added service is added, a storage space expansion message is reported to the cloud server 404 with the data storage device with the added storage space, and the cloud server 404 sends a message for releasing the original data transmission channel relationship to the corresponding data storage device.
Taking the first device 408 as an example, the first device storage data stored in the target data storage device 410 is not immediately cleared after the expansion of the storage space is performed as described above. Cloud server 404 analyzes data time span T of first device storage data maintained on target data storage device 410. The data time span of the next first device storage data is Ta, and the space occupied by the historical first device storage data stored on the target data storage device 410 is Tb, ta+tb=t. If the data time span of the next first device storage data has reached T, i.e., tb=0, then the space occupied by the historical first device storage data stored in the target data storage device 410 has been fully freed. The historical first device data summary corresponding to the historical first device stored data stored on the cloud server 404 is also synchronously released.
It should be understood that, although the steps in the flowcharts of fig. 2-6 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows; the data interaction between the devices shown in the above figures is bi-directional, and although the figures are unidirectional arrows, it is not meant that the data is only transmitted unidirectionally as in the figures in the actual data processing. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2-6 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the sub-steps or stages are performed necessarily occur in sequence, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
There is also provided in this embodiment a data storage system comprising: a master device 102, a first router 104, and at least one first device 106;
The master device 102 is configured to perform any one of the above data storage methods;
the first router 104 is configured to generate first router information;
The at least one first device 106 is configured to generate corresponding first device port information and first storage determination information.
There is also provided in this embodiment an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
S1, acquiring first router information of a first router, and acquiring first equipment port information of at least one first equipment connected with the first router based on the first router information.
S2, acquiring first storage judgment information corresponding to the first equipment, and selecting and acquiring target data storage equipment from all the first equipment based on the first storage judgment information.
And S3, according to all the first equipment port information, sending all the first equipment storage data corresponding to the first equipment to the target data storage equipment for storage.
It should be noted that, specific examples in this embodiment may refer to examples described in the foregoing embodiments and alternative implementations, and are not described in detail in this embodiment.
In addition, in combination with the data storage method provided in the above embodiment, a storage medium may be provided in this embodiment. The storage medium has a computer program stored thereon; the computer program, when executed by a processor, implements any of the data storage methods of the above embodiments.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing first device storage data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data storage method.
It will be appreciated by those skilled in the art that the structure shown in FIG. 7 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (SYNCHLINK) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to be limiting. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure in accordance with the embodiments provided herein.
It is to be understood that the drawings are merely illustrative of some embodiments of the present application and that it is possible for those skilled in the art to adapt the present application to other similar situations without the need for inventive work. In addition, it should be appreciated that while the development effort might be complex and lengthy, it would nevertheless be a routine undertaking of design, fabrication, or manufacture for those of ordinary skill having the benefit of this disclosure, and thus should not be construed as a departure from the disclosure.
The term "embodiment" in this disclosure means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive. It will be clear or implicitly understood by those of ordinary skill in the art that the embodiments described in the present application can be combined with other embodiments without conflict.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the patent claims. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.
Claims (12)
1. A method of data storage, the method comprising:
Acquiring first router information of a first router, and acquiring first equipment port information of at least one first equipment connected with the first router based on the first router information;
Acquiring first storage judgment information corresponding to the first equipment, and selecting and acquiring target data storage equipment from all the first equipment based on the first storage judgment information; the first storage judgment information refers to address information according to which all data acquired by the first equipment are stored in the first equipment; the first storage judgment information is preset, and/or the first storage judgment information is obtained by the main control equipment according to the storage space quantity and the storage space size after obtaining the storage space quantity and the storage space size corresponding to all the first equipment;
And sending the first device storage data corresponding to all the first devices to the target data storage device for storage according to all the first device port information.
2. The data storage method according to claim 1, wherein the selecting a target data storage device from all the first devices based on the first storage judgment information includes:
Acquiring storage device information based on the first storage judgment information; wherein the storage device information is used for indicating an independent storage unit;
And taking the independent storage unit as the target data storage device according to the storage device information.
3. The method of claim 1, wherein the sending the first device storage data corresponding to all the first devices to the target data storage device for storage includes:
Transmitting the first device storage data to the target data storage device;
And obtaining cloud server port information of a cloud server connected with the first router based on the first router information, and sending all first equipment data summaries corresponding to the first equipment storage data to the cloud server for storage according to the cloud server port information.
4. The data storage method according to claim 3, further comprising, after the obtaining cloud server port information of a cloud server connected to the first router based on the first router information:
Acquiring second router information of a second router connected with the cloud server according to the cloud server port information, and acquiring second equipment port information of at least one second equipment connected with the second router based on the second router information;
And sending second equipment storage data of all second equipment to the target data storage equipment for storage according to all the second equipment port information, and sending second equipment data abstract corresponding to the second equipment storage data to the cloud server for storage.
5. The data storage method of claim 4, wherein the sending second device storage data for all second devices to the target data storage device for storage comprises:
and indicating the cloud server to establish a connection channel between the second device and the target data storage device according to all the second device port information, and sending all the second device storage data to the target data storage device for storage according to the connection channel.
6. The data storage method according to claim 1, further comprising, after the target data storage device is selected from all the first devices based on the first storage judgment information:
receiving alarm information generated by the first equipment;
and sending the first equipment storage data corresponding to the alarm information to the target data storage equipment for storage according to the alarm information.
7. The data storage method according to claim 1, further comprising, after said sending the first device storage data corresponding to all the first devices to the target data storage device for storage:
acquiring second storage judgment information corresponding to the first equipment;
Obtaining appointed storage equipment according to the second storage judgment information;
acquiring a designated device corresponding to the designated storage device from the first device;
transmitting the designated equipment data of the designated equipment to the designated storage equipment for storage;
acquiring storage attribute information of the specified equipment data in the specified storage equipment;
And deleting the first device storage data corresponding to the designated storage device in the target data storage device according to the storage attribute information.
8. A method of querying data, the method comprising:
the cloud server is instructed to acquire a query instruction of the control terminal, and the cloud server is matched with a first device data abstract according to the query instruction and generates a first device matching result;
Reading the first equipment storage data corresponding to the first equipment matching result in the data storage equipment according to the first equipment matching result; wherein the first device stored data is data stored by the target data storage device according to the data storage method of any one of claims 1 to 7;
and sending the first equipment storage data to the control terminal for display.
9. The data query method of claim 8, wherein the cloud server matches the first device data digest and generates a first device matching result according to the query instruction, further comprising:
The cloud server matches the second equipment data abstract according to the query instruction and generates a second equipment matching result;
Reading the second equipment storage data corresponding to the second equipment matching result in the data storage equipment according to the second equipment matching result;
And sending the second equipment storage data to the control terminal for display.
10. A data storage system, comprising: the system comprises a master control device, a first router and at least one first device;
the master device is configured to perform the data storage method of any one of claims 1 to 7;
the first router is used for generating first router information;
The at least one first device is configured to generate corresponding first device port information and first storage judgment information.
11. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the data storage method of any of claims 1 to 7.
12. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the data storage method of any of claims 1 to 7.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210202125.7A CN114760326B (en) | 2022-03-02 | 2022-03-02 | Data storage method, data query method, data storage system and electronic device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210202125.7A CN114760326B (en) | 2022-03-02 | 2022-03-02 | Data storage method, data query method, data storage system and electronic device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114760326A CN114760326A (en) | 2022-07-15 |
| CN114760326B true CN114760326B (en) | 2024-07-23 |
Family
ID=82325912
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210202125.7A Active CN114760326B (en) | 2022-03-02 | 2022-03-02 | Data storage method, data query method, data storage system and electronic device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114760326B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115514798B (en) * | 2022-08-29 | 2025-07-11 | 苏州浪潮智能科技有限公司 | Multi-device multi-port connection method, system, electronic device and storage medium |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110764700A (en) * | 2019-10-12 | 2020-02-07 | 上海陆家嘴国际金融资产交易市场股份有限公司 | Data storage method and device, computer equipment and storage medium |
Family Cites Families (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8005993B2 (en) * | 2007-04-30 | 2011-08-23 | Hewlett-Packard Development Company, L.P. | System and method of a storage expansion unit for a network attached storage device |
| CN107528870B (en) * | 2016-06-22 | 2019-08-23 | 腾讯科技(深圳)有限公司 | A kind of collecting method and its equipment |
| EP3792766A1 (en) * | 2017-12-20 | 2021-03-17 | Huawei Technologies Co., Ltd. | Data storage method, apparatus, and system |
| US11210009B1 (en) * | 2018-03-15 | 2021-12-28 | Pure Storage, Inc. | Staging data in a cloud-based storage system |
| CN111600797B (en) * | 2019-02-21 | 2022-12-30 | 华为技术有限公司 | Data transmission method, node and system |
| CN110457281A (en) * | 2019-08-14 | 2019-11-15 | 北京博睿宏远数据科技股份有限公司 | Data processing method, device, equipment and medium |
| CN113688072B (en) * | 2020-05-19 | 2024-03-26 | 华为技术有限公司 | Data processing methods and equipment |
| CN111858466A (en) * | 2020-06-30 | 2020-10-30 | 苏州浪潮智能科技有限公司 | A data storage method, device, device and storage medium |
| US11778055B2 (en) * | 2020-07-13 | 2023-10-03 | Samsung Electronics Co., Ltd. | Systems and methods for storage-efficient sensors |
-
2022
- 2022-03-02 CN CN202210202125.7A patent/CN114760326B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110764700A (en) * | 2019-10-12 | 2020-02-07 | 上海陆家嘴国际金融资产交易市场股份有限公司 | Data storage method and device, computer equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114760326A (en) | 2022-07-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN114244644B (en) | Control method and device for intelligent home, storage medium and electronic device | |
| CN110597887B (en) | Data management method, device and storage medium based on blockchain network | |
| US10212236B2 (en) | Information transmitting method and apparatus in robot operating system | |
| US20190087283A1 (en) | Aircraft aerial photography data backup method, apparatus and device, and computer readable storage medium | |
| CN111629371B (en) | Screen projection method and system | |
| CN113572834B (en) | Patrol data uploading method, device, system and storage medium | |
| CN114760326B (en) | Data storage method, data query method, data storage system and electronic device | |
| CN103119567B (en) | For the system and method in managing virtual tape pool territory | |
| CN112749142A (en) | Handle management method and system | |
| JP5962117B2 (en) | Video selection method in an environment with multiple image compression methods | |
| CN113468274A (en) | Data storage method and device, storage medium and electronic equipment | |
| CN107181825B (en) | Online processing method of terminal equipment data | |
| CN106331603A (en) | Video monitoring method, apparatus, system and server | |
| CN105450679A (en) | Method and system for performing data cloud storage | |
| CN111131512B (en) | Equipment information processing method and device, storage medium and processor | |
| CN106453663B (en) | Improved storage expansion method and device based on cloud service | |
| CN112835978A (en) | Data storage method and device and computer equipment | |
| CN114363640B (en) | Data storage method, device and system | |
| CN117119227A (en) | Page information acquisition method and device, computer equipment and storage medium | |
| CN110134547B (en) | Middleware-based repeated data deleting method and related device | |
| CN113190410A (en) | Log collection method, system, client and storage medium | |
| CN113015150B (en) | One-to-many, power consumption reduction and rapid wireless device connection method and system | |
| CN111405313A (en) | Method and system for storing streaming media data | |
| CN113132742A (en) | Queue-based double-buffer AI video transmission method and related equipment | |
| CN111159521B (en) | Data query method, system, computer device and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |