Disclosure of Invention
In order to solve the technical problem, the invention provides a data operation method, a data operation device and a data operation system, so that the operability of the data system is improved, and the data operation method, the data operation device and the data operation system are more beneficial to popularization.
The embodiment of the invention discloses the following technical scheme:
a data operating system comprises user equipment, a server, a first data source and a second data source, wherein the first data source and the second data source are different kinds of data sources in the data system:
the server is used for respectively processing the data of the first data source and the data of the second data source according to the data content, and obtaining a label set corresponding to the first data source and a label set corresponding to the second data source through processing; the processing specific to the first data source is as follows: processing the data of the first data source by taking the data content as a basis; obtaining a label set corresponding to the first data source through the processing, wherein the label set of the first data source comprises a data source label for positioning the first data source, a service object label for positioning a target service object in the first data source and an attribute label for positioning a target attribute of the target service object;
the user equipment is used for sending a data operation request to the server, wherein the data operation request comprises the identifier of the first data source, the identifier of the target business object, the identifier of the target attribute and an operation requirement;
when the server receives the data operation request, determining a label set of the first data source according to the identifier of the first data source; calling the service object label and the attribute label from the label set of the first data source according to the identification of the target service object and the identification of the target attribute; determining the access position of the first data source in the data system according to the data source tag, determining the storage position of the target business object in the first data source according to the business object tag, and determining the storage position of the target attribute in the first data source according to the attribute tag; acquiring the target service object and the target attribute according to the determined access position and the storage position; and performing data operation on the target service object and the target attribute according to the operation requirement to obtain an operation result.
A data operation method is applied to data systems with different kinds of data sources, data of the different kinds of data sources are respectively processed according to data contents, and tag sets corresponding to the different kinds of data sources are obtained through processing; the processing specific to the target data source is as follows: processing the data of the target data source by taking the data content as a basis, wherein the target data source is one of the different kinds of data sources; obtaining a tag set corresponding to the target data source through the processing, where the tag set of the target data source includes a data source tag for identifying the target data source, a plurality of service object tags for identifying service objects in the target data source, and a plurality of attribute tags for identifying related attributes of the service objects in the target data source, and the method includes:
acquiring a data operation request, wherein the data operation request comprises an identifier of the target data source, an identifier of a target service object, an identifier of a target attribute and an operation requirement;
determining a label set of the target data source according to the identifier of the target data source; calling a label corresponding to the target business object and a label corresponding to the target attribute from a label set of the target data source according to the identification of the target business object and the identification of the target attribute;
determining an access position of the target data source in the data system according to a data source tag in the target data source tag set, determining a storage position of the target business object in the target data source according to a tag corresponding to the target business object, and determining a storage position of the target attribute in the target data source according to a tag corresponding to the target attribute;
acquiring the target service object and the target attribute according to the determined access position and the storage position;
and performing data operation on the target service object and the target attribute according to the operation requirement to obtain an operation result.
Optionally, the data source tag includes an identification of the target data source and an access location of the target data source in the data system; the target business object label comprises an identification of a target business object and a storage position of the target business object in the target data source, and the target business object label is one of the business object labels; the target attribute tag comprises an identifier of a target attribute and a storage location of the target attribute in the target data source, wherein the target attribute tag is one of the attribute tags, and the target attribute is one of attributes related to the target service object.
Optionally, the data source tag further includes a type, an access right, and access interface information of the target data source.
Optionally, the data operation request further includes a display parameter, and after performing data operation on the target service object and the target attribute according to the operation requirement to obtain an operation result, the method further includes:
and displaying the operation result to a sender of the data operation request according to the display parameters.
Optionally, the data operation request further includes a return parameter, where the return parameter includes a return mode and a return position, and after performing data operation on the target service object and the target attribute according to the operation requirement to obtain an operation result, the method further includes:
and returning the operation result to the return position in the return mode.
A data manipulation device for use in a data system having heterogeneous data sources, the device comprising:
the processing unit is used for respectively processing the data of the different kinds of data sources according to the data content;
a tag obtaining unit, configured to obtain, through processing, tag sets corresponding to the different types of data sources; the processing specific to the target data source is as follows:
the processing unit is specifically configured to process data of the target data source based on data content, where the target data source is one of the different types of data sources;
the tag obtaining unit is specifically configured to obtain, through the processing, a tag set corresponding to the target data source, where the tag set of the target data source includes a data source tag used to identify the target data source, a plurality of service object tags used to identify a service object in the target data source, and a plurality of attribute tags used to identify related attributes of the service object in the target data source;
a request obtaining unit, configured to obtain a data operation request, where the data operation request includes an identifier of the target data source, an identifier of a target service object, an identifier of a target attribute, and an operation requirement;
a first determining unit, configured to determine a tag set of the target data source according to the identifier of the target data source; calling a label corresponding to the target business object and a label corresponding to the target attribute from a label set of the target data source according to the identification of the target business object and the identification of the target attribute;
a second determining unit, configured to determine, according to a data source tag in the target data source tag set, an access position of the target data source in the data system, determine, according to a tag corresponding to the target business object, a storage position of the target business object in the target data source, and determine, according to a tag corresponding to a target attribute, a storage position of the target attribute in the target data source; acquiring the target service object and the target attribute according to the determined access position and the storage position;
and the operation unit is used for performing data operation on the target service object and the target attribute according to the operation requirement to obtain an operation result.
Optionally, the data source tag includes an identification of the target data source and an access location of the target data source in the data system; the target business object label comprises an identification of a target business object and a storage position of the target business object in the target data source, and the target business object label is one of the business object labels; the target attribute tag comprises an identifier of a target attribute and a storage location of the target attribute in the target data source, wherein the target attribute tag is one of the attribute tags, and the target attribute is one of attributes related to the target service object.
Optionally, the data source tag further includes a type, an access right, and access interface information of the target data source.
Optionally, the data operation request further includes a display parameter, and further includes:
and the display unit is used for displaying the operation result to a sender of the data operation request according to the display parameters.
Optionally, the data operation request further includes a return parameter, where the return parameter includes a return mode and a return position, and the method further includes:
and the return unit is used for returning the operation result to the return position in the return mode.
According to the technical scheme, in the data system with different types of data sources, the data of the different types of data sources are respectively processed according to the data content to obtain the label sets corresponding to the different types of data sources, and the data sources, the service objects and the attributes in the data sources are identified through the data source labels, the service object labels and the attribute labels included in the label sets. The data content in different types of data sources can be defined uniformly by a label set mode, when a user faces a data system with different types of data sources, the user can operate the data of each data source in the data system by only sending a data operation request according to the uniform definition mode, and a corresponding operation result is obtained, so that the operability of the data system with different types of data sources is improved, and the popularization is facilitated.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments, but not all embodiments, of the present 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.
With the development of big data, the sources of data to be processed in data processing are increasing, and in a data system, the data to be processed may come from different kinds of data sources. Whether a data source belongs to a category can generally be distinguished from the type of external interface to which the data source belongs. The interface types of the different kinds of data sources are different. The data sources may be various types of databases in the conventional sense, for example, the real-time database, the batch database, and the streaming database may be three different types of data sources. The data source may also be a text file stored in a data repository, a NoSQL database (a non-relational database), or the like. The storage, description and operation modes of data from different kinds of data sources are different.
The data system with multiple types of data sources can also be called as a heterogeneous data system, when in use, the operation is complex due to different types of data sources, a user needs to learn data operation methods of different data sources, and the user setting the data system also needs to learn and use other connection tools so as to perform operations such as mutual association, copying and pasting among different types of data sources. Therefore, the heterogeneous data system is very dependent on personal experience of a user, and data processing stability is not high, so that the heterogeneous data system is not beneficial to popularization.
The inventor finds that if unified definition description of data in different kinds of data sources can be realized, operation description is processed uniformly. The operational difficulty of such heterogeneous data systems can be greatly simplified.
In a data system with different types of data sources, data of the different types of data sources are respectively processed according to data content to obtain tag sets corresponding to the different types of data sources, and the data sources, service objects and attributes in the data sources are identified through data source tags, a plurality of service object tags and a plurality of attribute tags included in the tag sets. The data content in different types of data sources can be defined uniformly by a label set mode, when a user faces a data system with different types of data sources, the user can operate the data of each data source in the data system by only sending a data operation request according to the uniform definition mode, and a corresponding operation result is obtained, so that the operability of the data system with different types of data sources is improved, and the popularization is facilitated.
An embodiment of the present invention provides a data operating system, as shown in fig. 1a, which may include a user equipment 10, a server 20, a first data source 30, and a second data source 40.
The first data source 30and the second data source 40 are different kinds of data sources in the data system. The formats of data in different kinds of data sources are generally different, for example, the data in the data source a may be stored and operated in the form of a table structure, and the data in the data source b may be stored and operated in the form of a file. When data processing is required to be carried out by means of data in the data sources a and b, data calling and processing are required to be carried out by means of other linking tools, and the implementation process is complex.
In order to implement uniform definition processing on data in different types of data sources, the inventors found that, if attention is paid to the data processing process itself and instead to the operation on the data content as in the conventional data processing method, a data operation language closer to the data content is adopted to process the data from a logic level, and a uniform object attribute modeling model is established in a uniform manner, the content in the model may be a set of tags (english: Tag) described in the embodiment of the present invention, and the tags may specifically be in a format such as fields. Through unified definition, when data in a data source needs to be operated, a data processing process can be described from a service operation angle, so that a data processing code is easier to read, a data operation logic is more intuitive, and an operation instruction is closer to the expression of service requirements. The processing of data in different data sources may be implemented by a server. Such as server 20 in fig. 1a
The server 20 may process the data of the first data source 30and the data of the second data source 40 respectively according to the data content, and obtain the tag set corresponding to the first data source 30and the tag set corresponding to the second data source 40 through the processing. Such as the data processing shown by the dashed lines in fig. 1 a.
The processing for the first data source 30 specifically includes: the data of the first data source 30 is processed in accordance with the data content. The tag set corresponding to the first data source 30 is obtained through the processing, and the tag set of the first data source 30 includes a data source tag for locating the first data source 30, a service object tag for locating a target service object in the first data source 30, and an attribute tag for locating a target attribute of the target service object.
The data content of different data structures of various database systems can be uniformly defined and described, and the operation description is uniformly processed. The data content can be read, associated, calculated, verified, checked and written in a cross-system mode.
Therefore, when the user equipment 10 needs to operate the data in the first data source 30, the user equipment 10 may send a data operation request to the server 20 according to the unified data definition, where the data operation request includes the identifier of the first data source, the identifier of the target service object, the identifier of the target attribute, and the operation requirement.
When receiving the data operation request, the server 20 determines a tag set of the first data source 30 according to the identifier of the first data source 30; calling the service object label and the attribute label from the label set of the first data source 30 according to the identification of the target service object and the identification of the target attribute; determining an access position of a first data source 30 in the data system according to the data source tag, determining a storage position of the target business object in the first data source 30 according to the business object tag, and determining a storage position of the target attribute in the first data source 30 according to the attribute tag; acquiring the target service object and the target attribute according to the determined access position and the storage position; and performing data operation on the target service object and the target attribute according to the operation requirement to obtain an operation result.
The data operation method provided by the embodiment of the invention is applied to data systems with different kinds of data sources, and in the method, the data of the different kinds of data sources are respectively processed to obtain the label sets of the different kinds of data sources; and uniformly defining different kinds of data sources in a label set mode.
For a data source in the data system, a specific manner of obtaining a tag set through processing may be as shown in fig. 1. The processing for the target data source specifically includes:
s101: and processing the data of the target data source by taking the data content as a basis, wherein the target data source is one of the different kinds of data sources.
S102: obtaining a tag set of the target data source through the processing, wherein the tag set of the target data source comprises a data source tag, a plurality of business object tags and a plurality of attribute tags, and the data source tag is used for identifying the target data source and comprises an identifier of the target data source and an access position of the target data source in the data system; the target business object label is used for identifying a target business object in the target data source, and comprises the identification of the target business object and the storage position of the target business object in the target data source, wherein the target business object label is one of the business object labels; the target attribute tag is used for identifying a target attribute related to the target business object, and includes an identifier of the target attribute and a storage location of the target attribute in the target data source, where the target attribute tag is one of the attribute tags, and the target attribute is one of the attributes related to the target business object.
For example, the content of different types of data source data can be uniformly processed through a predetermined data processing rule. The interface type and information of a data source can be identified by using predefined object attribute processing rules, so that a data source label (English: Schema) for the data source is created, and then a plurality of service object labels and a plurality of attribute labels are created according to the data of the data source.
A business object is a software abstraction that can be used to represent a person, place, thing or concept, etc. For example, a user may be a business object. The attributes are related to the data content corresponding to the business object, such as the age, sex, transaction amount, etc. of the user.
The three types of tags may have a corresponding relationship, for example, the data source tag corresponds to a plurality of business object tags, and one business object tag corresponds to one or more attribute tags. Therefore, a tree structure with the data source label as a root node and other labels as child nodes can be formed through the corresponding relation between the data source label and the child nodes.
The definition statements carried in the data source tags can be shown in table 1, and the right column in table 1 is a chinese description:
TABLE 1
The "set code" in table 1 may be an identifier of the target data source, and the "set project" may be a visiting location of the target data source in the data system. Optionally, the data source tag may further include a type of the target data source (see "set type" in table 1), an access right (see "set accesskey" and "set access" in table 1), and access interface information (see "set end" in table 1). Thereby accurately defining a data source with more refined information. The data source tag may also be customized to show a name ("set name" in table 1) for easy understanding by the user.
A business object tag in the tag set may be used to identify a business object, a definition statement carried in a business object tag (taking the target business object tag as an example) may be as shown in table 2, and the right column of table 2 is a chinese description:
TABLE 2
The "set code" in table 2 may be the identity of the target service object,
field of "set meta schema0.project0.table in Table 2. field type
Field of "set meta schema1.project1.table. field" and
field type may be a storage location of the target service object in the target data source. The target business object tag can also be used for customizing a display name (see "set name" in table 2) so as to be convenient for a user to understand.
An attribute tag in the tag set may be used to identify an attribute of a business object, a definition statement carried in an attribute tag (taking the target attribute tag as an example) may be as shown in table 3, where the right column of table 3 is a chinese description:
TABLE 3
The "set code" in table 3 may be an identifier of the target attribute, and the "set meta schema0.project0.table field" in table 3 may be a storage location of the target attribute in the target data source. Optionally, the method may further include an identifier of the service object corresponding to the attribute (see "set object" in table 3), and a deletion mode of the content of the attribute (see "set production button" in table 3), and the target attribute tag may further define a display name (see "set name" in table 3) by user, so as to facilitate understanding by the user.
It can be seen that, in a data system having different kinds of data sources, data of the different kinds of data sources are respectively processed according to data content to obtain tag sets corresponding to the different kinds of data sources, and the data sources, service objects and attributes in the data sources are identified by data source tags, a plurality of service object tags and a plurality of attribute tags included in the tag sets. The unified definition of the data content in the data sources of different types can be realized through the label set mode, when a user faces a data system with the data sources of different types, the data of each data source in the data system can be operated only by mastering the unified definition mode, and the data operation of the data source is crossed, so that the operability of the data system is improved, and the popularization is facilitated.
Next, how to implement the operation on the data in the data system will be described on the basis of the embodiment corresponding to fig. 1.
Fig. 2 is a flowchart of a method for operating data according to an embodiment of the present invention, where the method includes:
s201: and acquiring a data operation request, wherein the data operation request comprises the identification of the target data source, the identification of the target business object, the identification of the target attribute and an operation requirement.
For example, the data operation request may be created for a system or a user, and is not limited in the present invention.
The operation statements used in the heterogeneous data system can correspond to statements uniformly defining data contents, and the specific data operation and the calling of an execution interface of the heterogeneous data system are completed by converting the operation statements into actual statements. After the data operation request is received, the statement in the data operation request is analyzed to determine which specific operation is to be performed on which data by the data operation request.
The definition statement carried in the data operation request can be shown in table 4, and the right column of table 4 is a chinese description:
TABLE 4
Wherein "on" in table 4 may be the identification of the target data source. "use" may be an identification of the target business object. "while" may be the identification and operational requirements of the target attribute. For example: the target business object is specifically a client (English), and the target attributes include three types, namely gender (English), age (English) and last website browsing time (English). The operation requirements are specifically as follows: the use custom place age >20and age <30and gender ═ 1and last _ visit _ time >2016-04-01 is used for representing the group of users who have visited the website after 2016 4 months and have the age between 20and 30and the gender of women.
Optionally, the data operation request may further include an exposure parameter (see "show [ distinguishing ]" in table 4), which may be used to instruct to expose, to a sender of the data operation request, an operation result for the data operation request.
Optionally, the data operation request further includes a return parameter (see "into" in table 4), where the return parameter includes a return mode and a return position, and after the operation result is obtained according to the operation requirement, the operation result may be returned to the return position in the return mode according to an indication of the return parameter. For example, a return mode can be defined as one in which callback | ads | ots | rds | osps | odps. Each return mode may specify parameters such as: in callback mode, parameters need to be specified: url address for callback, timeout, Rollback, etc. ads is an Aliskiu product, and data source identification and the like need to be specified.
S202: determining a label set of the target business object according to the identifier of the target data source; and calling the target business object label and the target attribute label from the label set of the target business object according to the identification of the target business object and the identification of the target attribute.
S203: and acquiring the target business object and the target attribute from the target data source according to the obtained access position of the target data source in the data system, the storage position of the target business object in the target data source and the storage position of the target attribute in the target data source.
S204: and performing data operation on the target service object and the target attribute according to the operation requirement to obtain an operation result.
For example, according to the identifier carried in the data operation request, the corresponding tag can be accurately and quickly found in the pre-obtained tag set. In this embodiment, the found tags may be the target business object tag and the target attribute tag, and may further include a plurality of other business object tags and attribute tags. Since the target business object tag and the target attribute tag each include a storage location for the identified target business object and target attribute, obtaining the target business object and target attribute from the target data source may be facilitated. For the sender of the data operation request, it is not necessary to know the data definition mode and the data operation mode of the target data source, and the statement carried in the data operation request may be used to represent the data operation requirement. Data in other different kinds of data sources in the data system may also be operated on with data operation requests in the same format (e.g., statement format). The data access mode is uniform, which is equivalent to processing different kinds of data sources in the data system by adopting a uniform interface, thereby simplifying the operation difficulty of the data system.
Therefore, when a user faces a data system with different types of data sources, the user only needs to send a data operation request according to the uniform definition mode, and the system searches a corresponding label set according to the data operation request, so that a target service object and a target attribute are obtained, a corresponding operation result is obtained, and the operability of the data system with the different types of data sources is improved.
Fig. 3 is a device structure diagram of a data processing device according to an embodiment of the present invention, which is applied to a data system having different types of data sources, and the device includes:
a processing unit 301, configured to process the data of the different types of data sources respectively;
a tag obtaining unit 302, configured to obtain a tag set of the data sources of different types;
the processing specific to the target data source is as follows:
the processing unit 301 is specifically configured to process data of the target data source according to data content, where the target data source is one of the different types of data sources;
the tag obtaining unit 302 is specifically configured to obtain, through the processing, a tag set of the target data source, where the tag set of the target data source includes a data source tag, multiple service object tags, and multiple attribute tags, where the data source tag is used to identify the target data source, and includes an identifier of the target data source and an access location of the target data source in the data system; the target business object label is used for identifying a target business object in the target data source, and comprises the identification of the target business object and the storage position of the target business object in the target data source, wherein the target business object label is one of the business object labels; the target attribute tag is used for identifying a target attribute related to the target business object, and includes an identifier of the target attribute and a storage location of the target attribute in the target data source, where the target attribute tag is one of the attribute tags, and the target attribute is one of the attributes related to the target business object.
Optionally, the data source tag further includes a type, an access right, and access interface information of the target data source.
Optionally, on the basis of the embodiment corresponding to fig. 3, fig. 4 is a device structure diagram of a data operating device according to an embodiment of the present invention, including:
an obtaining unit 401, configured to obtain a data operation request, where the data operation request includes an identifier of the target data source, an identifier of the target service object, an identifier of the target attribute, and an operation requirement;
a first determining unit 402, configured to determine a tag set of the target service object according to the identifier of the target data source; calling the target business object label and the target attribute label from the label set of the target business object according to the identification of the target business object and the identification of the target attribute;
a second determining unit 403, configured to obtain the target business object and the target attribute from the target data source according to the obtained access position of the target data source in the data system, the storage position of the target business object in the target data source, and the storage position of the target attribute in the target data source;
an operation unit 404, configured to perform data operation on the target service object and the target attribute according to the operation requirement, so as to obtain an operation result.
Optionally, the data operation request further includes a display parameter, and further includes:
and the display unit is used for displaying the operation result to a sender of the data operation request according to the display parameters.
Optionally, the data operation request further includes a return parameter, where the return parameter includes a return mode and a return position, and the method further includes:
and the return unit is used for returning the operation result to the return position in the return mode.
It can be seen that, in a data system having different kinds of data sources, data of the different kinds of data sources are respectively processed according to data content to obtain tag sets corresponding to the different kinds of data sources, and the data sources, service objects and attributes in the data sources are identified by data source tags, a plurality of service object tags and a plurality of attribute tags included in the tag sets. The data content in different types of data sources can be defined uniformly by a label set mode, when a user faces a data system with different types of data sources, the user can operate the data of each data source in the data system by only sending a data operation request according to the uniform definition mode, and a corresponding operation result is obtained, so that the operability of the data system with different types of data sources is improved, and the popularization is facilitated.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium may be at least one of the following media: various media that can store program codes, such as read-only memory (ROM), RAM, magnetic disk, or optical disk.
It should be noted that, in the present specification, all the embodiments are described in a progressive manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus and system embodiments, since they are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described embodiments of the apparatus and system are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.