Disclosure of Invention
The invention aims to provide a data storage method, a data storage device and a management server, which are used for solving the problem of low data analysis and calculation efficiency caused by the fact that various types of data are stored in a cloud storage server in a traditional use condition analysis system.
In order to solve the above technical problem, the present invention provides a data storage method, which is applied to a management server in a use situation analysis system, wherein the use situation analysis system further includes a client and a cloud storage server, and the method includes:
receiving the service condition data to be stored sent by the client;
partitioning the service condition data according to the service condition types to obtain a plurality of data blocks;
according to the type of the use condition of each data block, determining a cloud storage server for storing the data block from a plurality of cloud storage servers;
and storing the data blocks to corresponding cloud storage servers.
Wherein the determining, from the plurality of cloud storage servers, a cloud storage server for storing the data block according to the type of the use condition of each data block comprises:
and determining a cloud storage server for storing the data blocks from the plurality of cloud storage servers according to the use condition type of each data block and the idle and busy condition of the cloud storage server.
After determining a cloud storage server for storing the data blocks from a plurality of cloud storage servers according to the use condition types of the data blocks, the method comprises the following steps:
and sending the corresponding relation between the data block and a cloud storage server for storing the data block to the client.
The corresponding relation comprises an IP address and a port number of the cloud storage server.
Before the receiving the use condition data to be stored, which is sent by the client, the method comprises the following steps:
receiving a connection establishment request sent by the client, wherein the connection establishment request comprises the geographic position or the machine type of the client;
determining a cloud storage server for storing data on the client according to the connection establishment request;
the determining, from the plurality of cloud storage servers, a cloud storage server for storing each data block respectively includes:
and determining cloud storage servers respectively used for storing the data blocks from a plurality of cloud storage servers used for storing data on the client.
The cloud storage server is a computer adopting a Hadoop distributed file system.
Wherein the usage types include at least two of device usage, database usage, and user usage.
In addition, the present invention also provides a data storage device, which is applied to a management server in a use condition analysis system, wherein the use condition analysis system further includes a client and a cloud storage server, and the data storage device includes:
a to-be-stored data receiving module: the system comprises a client, a storage module and a server, wherein the client is used for receiving the service condition data to be stored sent by the client;
a data dividing module: the data processing device is used for partitioning the use condition data according to the use condition types to obtain a plurality of data blocks;
the cloud storage server determination module: the cloud storage server is used for determining a cloud storage server used for storing the data blocks from a plurality of cloud storage servers according to the use condition type of each data block;
a data block storage module: the data storage device is used for storing the data blocks to the corresponding cloud storage server.
The cloud storage server determination module is specifically configured to: and determining a cloud storage server for storing the data blocks from the plurality of cloud storage servers according to the use condition type of each data block and the idle and busy condition of the cloud storage server.
Finally, the invention also provides a management server which is applied to a service condition analysis system, wherein the service condition analysis system comprises a client and a cloud storage server, and the management server is used for receiving the service condition data to be stored, which is sent by the client, and blocking the service condition data according to the service condition types to obtain a plurality of data blocks; the data storage system is further used for determining a cloud storage server used for storing the data blocks from the plurality of cloud storage servers according to the use condition type of each data block, and storing the data blocks to the corresponding cloud storage servers.
The data storage method provided by the invention is applied to a management server in a use condition analysis system, and after receiving the use condition data to be stored sent by a client, the use condition data is blocked according to the use condition types, and the data blocks are stored in the corresponding cloud storage servers according to the use condition types. Therefore, the data storage method provided by the invention can be used for partitioning the use condition data according to the use condition types and storing the partitioned use condition data to the corresponding cloud storage server, so that the data types stored on the cloud storage server are single, only one type of data needs to be analyzed and calculated when the data is analyzed and calculated, the occupied memory resources are less, and the data analysis and calculation efficiency is improved.
In addition, the invention also provides a data storage device and a management server, the function of which corresponds to the function of the method, and the description is omitted here.
Detailed Description
The core of the invention is to provide a data storage method, a data storage device and a management server, so that the occupation of memory resources during data analysis and calculation is reduced, and the efficiency of data analysis and calculation is improved.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
An application scenario of the embodiment of the data storage method provided by the present invention is described below, and referring to fig. 1, the data storage method mainly includes a management server 100 in a use case analysis system, and further includes a client 200 and a cloud storage server 300. Referring to fig. 2, the embodiment includes:
step S201: and receiving the service condition data to be stored sent by the client 200.
Before data storage is performed, that is, before step S101, a connection needs to be established between the client 200 and the management server 100. When the connection is established, the cloud storage server 300 for storing the data on the client 200 may be determined by considering the situation of the client at the same time, for example, the address location of the client 200 may be obtained when the connection is formed or when the connection is initiated, so that the cloud storage server 300 with a shorter distance may be allocated to the client 200 according to the address location of the client 200. In addition, the cloud storage server 300 may be allocated to the client 200 based on factors such as the machine type thereof.
The specific process of establishing the connection may be as follows: the method comprises the steps that a client 200 sends a connection establishment request to a management server 100, wherein the connection establishment request comprises information such as the geographic position or the machine type of the client 200, and after the management server 100 receives the connection establishment request sent by the client, the cloud storage server 300 used for storing data on the client is determined according to the connection establishment request.
Step S202: and partitioning the use case data according to the use case types to obtain a plurality of data blocks.
The types of usage to which the present invention relates may include at least two of device usage, database usage, and user usage.
Step S203: according to the type of the use condition of each data block, the cloud storage server 300 used for storing the data block is determined from the plurality of cloud storage servers 300.
Specifically, in the process of determining the data blocks to be stored, idle and busy conditions of the respective cloud storage servers 300 may be comprehensively considered, and even the available storage space may be considered.
After determining the cloud storage server 300 for storing each data block, the correspondence between the data block and the cloud storage server 300 for storing the data block may be sent to the client 200, for example, an IP address and a port number of the cloud storage server 300.
It is noted that, in order to facilitate later data search, after determining which cloud storage server 300 each data block is stored in, the storage location of each data block of client — > whole data file — > each data block — > may be recorded in a directory.
The cloud storage server 300 may be a computer using a Hadoop distributed file system.
Step S204: and storing the data blocks to the corresponding cloud storage server 300.
In summary, the data storage method provided by this embodiment is applied to a management server in a usage analysis system, and after receiving usage data to be stored sent by a client, the usage data is blocked according to usage types, and data blocks are stored in corresponding cloud storage servers according to the usage types. Therefore, the data storage method provided by the embodiment can be used for partitioning the use condition data according to the use condition types and storing the partitioned use condition data to the corresponding cloud storage server, so that the data types stored on the cloud storage server are single, when the data are analyzed and calculated, only one type of data needs to be analyzed and calculated, the occupied memory resources are less, and the data analysis and calculation efficiency is improved.
In the following, a data storage device provided by an embodiment of the present invention is described, and a data storage device described below and a data storage method described above may be referred to correspondingly.
The embodiment of the apparatus is mainly applied to the management server 100 of the usage analysis system, and referring to fig. 3, the embodiment of the apparatus specifically includes:
the to-be-stored data receiving module 301: the system is used for receiving the service condition data to be stored, which is sent by the client.
The data partitioning module 302: the method is used for partitioning the use case data according to the use case types to obtain a plurality of data blocks.
Cloud storage server determination module 303: the cloud storage server is used for determining the cloud storage server used for storing the data blocks from the plurality of cloud storage servers according to the use condition type of each data block.
Data block storage module 304: the data storage device is used for storing the data blocks to the corresponding cloud storage server.
The cloud storage server determining module 303 is specifically configured to: and determining a cloud storage server for storing the data blocks from the plurality of cloud storage servers according to the use condition type of each data block and the idle and busy condition of the cloud storage server.
A data storage device of this embodiment is used to implement a data storage method described above, and therefore specific implementations of the device may be seen in the foregoing embodiments of the data storage device, for example, the to-be-stored data receiving module 301, the data dividing module 302, the cloud storage server determining module 303, and the data block storing module 404, which are respectively used to implement steps S201, S202, S203, and S204 in the data storage method described above. Therefore, specific embodiments thereof may be referred to in the description of the corresponding respective partial embodiments, and will not be described herein.
In addition, since the data storage device provided in this embodiment is used to implement the foregoing data storage method, the role of the data storage device corresponds to that of the foregoing method, and details are not described here.
Finally, referring to fig. 1, the present invention further provides a management server 100, which is applied to a use condition analysis system, where the use condition analysis system includes a client 200 and a cloud storage server 300, and the management server 100 is configured to receive use condition data to be stored sent by the client 200, and block the use condition data according to a use condition type to obtain a plurality of data blocks; the method is further configured to determine, according to the type of the use condition of each data block, a cloud storage server 300 used for storing the data block from the plurality of cloud storage servers 300, and store the data block to the corresponding cloud storage server 300.
Since a management server provided by the present invention is used for implementing the foregoing data storage method, the specific implementation manner of the management server may refer to the description of the foregoing data storage method embodiment, and is not described herein again.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The data storage method, the data storage device and the management server provided by the invention are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.