Disclosure of Invention
The invention provides a data interaction method and device. The data interaction method and the data interaction device provided by the invention can effectively avoid the problem of repeated loading of data, and simultaneously can transmit the loaded data to different target storage media, thereby effectively shortening the transmission time and improving the transmission efficiency.
In order to solve the above technical problem, an embodiment of the present invention provides the following technical solutions:
a first aspect of the present invention provides a data interaction method, including,
accessing data from an object;
determining whether to read the data from the object based on identification information of the data from the object;
after the data from the object is read, generating a file corresponding to a target storage medium based on the characteristics of the target storage medium;
and unloading the file to a target storage medium corresponding to the file.
Preferably, the accessing data from the object includes,
the data from the subject is accessed at regular intervals.
Preferably, the data from the object is processed based on a plurality of sub-data; wherein the determining whether to read the data from the object based on the identification information of the data from the object includes,
judging corresponding identification information generated by the plurality of subdata according to the processing completion condition;
determining whether to read the data from the object based on the identification information.
Preferably, the reading of the data from the object and the generation of the file corresponding to the target storage medium based on the characteristics of the target storage medium include,
storing characteristics of at least one target storage medium;
and generating files corresponding to the characteristics of each target storage medium one by one with the data from the object respectively based on the characteristics of the target storage medium.
Preferably, when there are a plurality of target storage media, the offloading the file to the target storage media corresponding thereto includes,
and unloading the plurality of files to the corresponding target storage media in parallel.
A second aspect of the present invention provides a data interaction device, comprising,
an access module configured to access data from an object;
a processing module configured to determine whether to read the data from the object based on identification information of the data from the object;
a file generation module configured to generate a file corresponding to a target storage medium based on characteristics of the target storage medium after the reading module reads the data from the object;
a file offload module configured to offload the file to a target storage medium corresponding thereto.
Preferably, the access module is further configured to access the data from the object at regular time intervals.
Preferably, the data from the object is processed based on a plurality of sub-data; wherein the processing module is further configured to,
judging corresponding identification information generated by the plurality of subdata according to the processing completion condition;
determining whether to read the data from the object based on the identification information.
Preferably, the apparatus further comprises a storage module configured to store characteristics of at least one target storage medium;
the file generation module is further configured to,
and generating files corresponding to the characteristics of each target storage medium one by one with the data from the object respectively based on the characteristics of the target storage medium.
Preferably, when the target storage medium is a plurality of target storage media, the file unloading module is further configured to unload the plurality of files to the corresponding target storage medium in parallel.
Based on the disclosure of the above embodiments, it can be known that the embodiments of the present invention have the following beneficial effects:
the data interaction method and the data interaction device provided by the invention can effectively avoid the problem of repeated loading of data, and simultaneously can transmit the loaded data to different target storage media, thereby effectively shortening the transmission time and improving the transmission efficiency.
Detailed Description
The following detailed description of specific embodiments of the present invention is provided in connection with the accompanying drawings, which are not intended to limit the invention.
It will be understood that various modifications may be made to the embodiments disclosed herein. Accordingly, the foregoing description should not be construed as limiting, but merely as exemplifications of embodiments. Other modifications will occur to those skilled in the art within the scope and spirit of the disclosure.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the disclosure and, together with a general description of the disclosure given above, and the detailed description of the embodiments given below, serve to explain the principles of the disclosure.
These and other characteristics of the invention will become apparent from the following description of a preferred form of embodiment, given as a non-limiting example, with reference to the accompanying drawings.
It should also be understood that, although the invention has been described with reference to some specific examples, a person of skill in the art shall certainly be able to achieve many other equivalent forms of the invention, having the characteristics as set forth in the claims and hence all coming within the field of protection defined thereby.
The above and other aspects, features and advantages of the present disclosure will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
Specific embodiments of the present disclosure are described hereinafter with reference to the accompanying drawings; however, it is to be understood that the disclosed embodiments are merely examples of the disclosure that may be embodied in various forms. Well-known and/or repeated functions and structures have not been described in detail so as not to obscure the present disclosure with unnecessary or unnecessary detail. Therefore, specific structural and functional details disclosed herein are not to be interpreted as limiting, but merely as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present disclosure in virtually any appropriately detailed structure.
The specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may each refer to one or more of the same or different embodiments in accordance with the disclosure.
The embodiments of the present invention will be described in detail below with reference to the accompanying drawings,
as shown in fig. 1, a first embodiment of the present invention provides a data interaction method, including,
accessing data from an object;
determining whether to read the data from the object based on identification information of the data from the object;
after the data from the object is read, generating a file corresponding to a target storage medium based on the characteristics of the target storage medium;
and unloading the file to a target storage medium corresponding to the file.
In the embodiment provided by the present invention, the data from the object may be data on a business end system, for example, in banking services, the data from the object may be deposit data of a certain user, loan data of a certain user, repayment data of a certain user, or the like, and the data from the object in the embodiment of the present invention is not particularly limited and may be any data required by the target storage medium.
In another embodiment of the present invention, the data from the object may be processed by a plurality of sub-data, and the data from the object is formed whether the plurality of sub-data are processed or not, only the identification information of the data from the object is different. For example, the plurality of sub-data may be deposit data of a first user, a second user and a third user, respectively, the business system may process and integrate the deposit data of the three different users to form data from a target, and whether the processing is finished is distinguished by identification information of the data from the target, for example, the identification information of the data from the target after the processing is finished may be 1, and the identification information of the data from the target without the processing is 0, so that when the data from the target is accessed, it is determined whether to read the data from the target based on the identification information of the data from the target, that is, when the identification information of the data from the target shows that the processing is finished, the data from the target is read; when the identification information of the data from the object indicates that the processing is not completed, the data from the object is not read.
In another embodiment of the present invention, when the identification information of the data from the object shows that the processing is completed, the data from the object is read, and then a file corresponding to the target storage medium is generated based on the characteristics of the target storage medium, for example, the target storage medium may be a data analysis system, and according to the analysis purpose and the analysis result, a plurality of target storage media may exist simultaneously, for example, a first target storage medium, a second target storage medium, and a third target storage medium may exist simultaneously, if the three different target storage media all need to use the data from the object, after the data from the object is read, the data from the object generates three files corresponding to the target storage media one by one based on the characteristics of the three different target storage media, respectively a first file, a second file and a third file. For example, the data from the object generates a first file corresponding to the first target storage medium based on characteristics of the first target storage medium; the data from the object generates a second file corresponding to the second target storage medium based on the characteristics of the second target storage medium; generating, by the data from the object, a third file corresponding to the third target storage medium based on the characteristics of the third target storage medium; then, the three files can be unloaded to different corresponding target storage media at the same time, that is, the method provided by the invention only needs to go through a loading process once, namely, even if a plurality of target storage media exist, the data from the object only needs to be loaded once; the loaded data is then generated into different files based on characteristics of different target storage media, and then the different files may be unloaded to the different target storage media simultaneously to maximize transfer efficiency.
In another embodiment provided by the present invention, the characteristic of the target storage medium may be, for example, an IP address, a name, a storage area, and the like of the target storage medium.
In one embodiment provided by the present invention, the accessing data from an object includes,
the data from the subject is accessed at regular intervals. In this embodiment, the data from the object is accessed at regular time intervals, and whether to read the data from the object is determined based on the identification information of the data from the object, in this embodiment, the time of the interval is not particularly limited, and the user may select the interval according to specific needs, for example, the time interval may be 1S, 5S, 10S, or 1 min.
In other embodiments provided by the present invention, the data from the object is processed based on a plurality of sub-data; wherein the determining whether to read the data from the object based on the identification information of the data from the object includes,
judging corresponding identification information generated by the plurality of subdata according to the processing completion condition;
determining whether to read the data from the object based on the identification information.
In this embodiment, the data from the object may be processed by a plurality of sub-data, and the data from the object is formed regardless of whether the plurality of sub-data are processed or not, but only the identification information of the data from the object is different, for example, the identification information of the processed data from the object may be 1, and the identification information of the unprocessed data from the object may be 0, that is, the service end system may generate corresponding identification information based on the processing completion condition of the plurality of sub-data. For example, when the identification information of the data from the object shows that the processing is completed, the data from the object is read; when the identification information of the data from the object indicates that the processing is not completed, the data from the object is not read.
In another embodiment of the present invention, after reading the data from the object, generating a file corresponding to the target storage medium based on the characteristics of the target storage medium includes,
storing characteristics of at least one target storage medium;
and generating files corresponding to the characteristics of each target storage medium one by one with the data from the object respectively based on the characteristics of the target storage medium.
In the embodiment of the present invention, according to the different analysis purpose and the different analysis result, a plurality of target storage media may exist at the same time, for example, a first target storage medium, a second target storage medium, and a third target storage medium may exist at the same time, and if the data from the object needs to be used by all of the three different target storage media at this time, after the data from the object is read, the data from the object generates three files corresponding to the target storage media one by one, which are a first file, a second file, and a third file, respectively, based on the characteristics of the three different target storage media. For example, the data from the object generates a first file corresponding to the first target storage medium based on characteristics of the first target storage medium; the data from the object generates a second file corresponding to the second target storage medium based on the characteristics of the second target storage medium; generating, by the data from the object, a third file corresponding to the third target storage medium based on the characteristics of the third target storage medium; then, the three files can be unloaded to different corresponding target storage media at the same time, that is, the method provided by the invention only needs to go through a loading process once, namely, even if a plurality of target storage media exist, the data from the object only needs to be loaded once; the loaded data is then generated into different files based on characteristics of different target storage media, and then the different files may be unloaded to the different target storage media simultaneously to maximize transfer efficiency.
In another embodiment of the present invention, when there are a plurality of target storage media, the offloading the file to the corresponding target storage media includes,
and unloading the plurality of files to the corresponding target storage media in parallel.
In an embodiment of the present invention, when a plurality of target storage media are provided, the data from the object may generate different files based on characteristics of different target storage media, for example, a first target storage medium, a second target storage medium, and a third target storage medium may exist at the same time, and if all three different target storage media need to use the data from the object, after the data from the object is read, the data from the object generates three files corresponding to the target storage media one by one, which are the first file, the second file, and the third file, based on characteristics of the three different target storage media. By using the method provided by the embodiment of the present invention, the simultaneous transmission of the three files can be realized, that is, the first file is unloaded to the first target storage medium, the second file is unloaded to the second target storage medium, and the third file is unloaded to the third target storage medium at the same time.
Based on the same inventive concept, as shown in fig. 2, a second embodiment of the present invention provides a data interaction apparatus, comprising,
an access module configured to access data from an object;
a processing module configured to determine whether to read the data from the object based on identification information of the data from the object;
a file generation module configured to generate a file corresponding to a target storage medium based on characteristics of the target storage medium after the reading module reads the data from the object;
a file offload module configured to offload the file to a target storage medium corresponding thereto.
In this embodiment, the accessing module is further configured to access the data from the object at regular time intervals.
In one embodiment, the data from the object is processed based on a plurality of subdata; wherein the processing module is further configured to,
judging corresponding identification information generated by the plurality of subdata according to the processing completion condition;
determining whether to read the data from the object based on the identification information.
In another embodiment, the apparatus further comprises a storage module configured to store characteristics of at least one target storage medium;
the file generation module is further configured to,
and generating files corresponding to the characteristics of each target storage medium one by one with the data from the object respectively based on the characteristics of the target storage medium.
In other embodiments, when the target storage medium is multiple, the file unloading module is further configured to unload multiple files to their corresponding target storage medium in parallel.
The above embodiments are only exemplary embodiments of the present invention, and are not intended to limit the present invention, and the scope of the present invention is defined by the claims. Various modifications and equivalents may be made by those skilled in the art within the spirit and scope of the present invention, and such modifications and equivalents should also be considered as falling within the scope of the present invention.