Summary of the invention
For solving the problems of the technologies described above, the embodiment of the present application provides a kind of data processing method and device, and dispose difficulty to reach reduction system, reduce the object of system cost, technical scheme is as follows:
A kind of data processing method, comprising:
Obtain the identification number of data to be stored, generation time and termination time;
When 24 hourly averages are divided into n part, determine the time period belonging to time period belonging to described generation time and described termination time, wherein said n be greater than 1 integer;
Belonging to described generation time, the time period belonging to time period and described termination time, determines section storage time that described data to be stored are corresponding;
Generate the storage file name of identification number and the corresponding numerical value of described section storage time containing described data to be stored;
The file of described storage file name correspondence is set up in storage server;
Described data to be stored are stored in the file of described storage file name correspondence.
Preferably, described belonging to described generation time the time period belonging to time period and described termination time, determine described data to be stored corresponding storage time section process, comprising:
Judge that whether the time period belonging to time period belonging to described generation time and described termination time is adjacent;
If so, determine that section storage time corresponding to described data to be stored is respectively the time period belonging to time period belonging to described generation time and described termination time;
If not, determine that section storage time corresponding to described data to be stored is respectively belonging to described generation time each time period belonging to time period belonging to time period belonging to time period, described termination time and described generation time and described termination time between the time period.
Preferably, described n equals 24.
Preferably, also comprise:
Obtain the identify label number of data to be checked, inquiry initial time and poll-final time;
When 24 hourly averages are divided into described n part, determine the time period belonging to time period belonging to described inquiry initial time and described poll-final time;
Belonging to described inquiry initial time, the time period belonging to time period and described poll-final time, determines the query time section that described data to be checked are corresponding;
The filename mated with the identify label number of described data to be checked and described query time section is searched in storage server;
Described data to be checked are inquired about in the file that described filename is corresponding.
Preferably, described belonging to described inquiry initial time the time period belonging to time period and described poll-final time, determine the process of the query time section that described data to be checked are corresponding, comprising:
Judge that whether the time period belonging to time period belonging to described inquiry initial time and described poll-final time is adjacent;
If so, determine that query time section corresponding to described data to be checked is respectively the time period belonging to time period belonging to described inquiry initial time and described poll-final time;
If not, determine that query time section corresponding to described data to be checked is respectively belonging to described inquiry initial time each time period belonging to time period belonging to time period belonging to time period, described poll-final time and described inquiry initial time and described poll-final time between the time period.
A kind of data processing equipment, comprising:
First acquiring unit, for obtaining the identification number of data to be stored, generation time and termination time;
First determining unit, for when 24 hourly averages are divided into n part, determines the time period belonging to time period belonging to described generation time and described termination time, wherein said n be greater than 1 integer;
Second determining unit, for the time period belonging to time period belonging to described generation time and described termination time, determines section storage time that described data to be stored are corresponding;
Generation unit, for generating the storage file name of identification number containing described data to be stored and the corresponding numerical value of described section storage time;
Set up unit, for setting up the file of described storage file name correspondence in storage server;
Storage unit, for being stored in described data to be stored in the file of described storage file name correspondence.
Preferably, described second determining unit comprises: the first judgment sub-unit, first determines that subelement determined by subelement and second, wherein:
First judgment sub-unit, whether adjacent for judging the time period belonging to time period belonging to described generation time and described termination time, if so, trigger first and determine that subelement determines that section storage time corresponding to described data to be stored is respectively the time period belonging to time period belonging to described generation time and described termination time; If not, trigger second and determine that subelement determines that section storage time corresponding to described data to be stored is respectively belonging to described generation time each time period belonging to time period belonging to time period belonging to time period, described termination time and described generation time and described termination time between the time period.
Preferably, also comprise:
Second acquisition unit, for obtaining identify label number, the inquiry initial time and poll-final time of data to be checked;
3rd determining unit, for when 24 hourly averages are divided into described n part, determines the time period belonging to time period belonging to described inquiry initial time and described poll-final time;
4th determining unit, for the time period belonging to time period belonging to described inquiry initial time and described poll-final time, determines the query time section that described data to be checked are corresponding;
Search unit, for searching the filename mated with the identify label number of described data to be checked and described query time section in storage server;
Query unit, for inquiring about described data to be checked in the file that described filename is corresponding.
Preferably, described 4th determining unit comprises: the second judgment sub-unit, the 3rd determines that subelement determined by subelement and the 4th, wherein:
Second judgment sub-unit, whether adjacent for judging the time period belonging to time period belonging to described inquiry initial time and described poll-final time, if, trigger the 3rd and determine that subelement determines that query time section corresponding to described data to be checked is respectively the time period belonging to time period belonging to described inquiry initial time and described poll-final time, if not, trigger the 4th and determine that subelement determines that query time section corresponding to described data to be checked is respectively the time period belonging to described inquiry initial time, each time period belonging to time period belonging to time period belonging to the described poll-final time and described inquiry initial time and described poll-final time between the time period.
Compared with prior art, the beneficial effect of the application is:
In this application, after the storage file name of the identification number and the corresponding numerical value of section storage time that generate data to be stored, the file of described storage file name correspondence is set up in storage server, achieve using generate storage file name as the memory location index of data to be stored, be stored in storage server.And after the file setting up storage file name correspondence, data to be stored are stored in the file of storage file name correspondence.
Therefore be all stored in storage server by the memory location index of data to be stored and data to be stored in the application, storing process does not need the cooperation of database, because this reducing administration of Account Dept difficulty, decrease system cost.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present application, be clearly and completely described the technical scheme in the embodiment of the present application, obviously, described embodiment is only some embodiments of the present application, instead of whole embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not making the every other embodiment obtained under creative work prerequisite, all belong to the scope of the application's protection.
Embodiment one
In the present embodiment, show a kind of data processing method, refer to Fig. 1, it illustrates a kind of process flow diagram of the data processing method that the application provides, can comprise the following steps:
Step S11: obtain the identification number of data to be stored, generation time and termination time.
In the present embodiment, the identification number of data to be stored is allocated in advance, and the identification number of each data to be stored is unique.
Now illustrate and the generation time of data to be stored and termination time be described, such as, data to be stored are the Video data of video equipment A, video equipment A produces Video data at 8:00, quit work at 9:00, no longer produce Video data, then the generation time of data to be stored is 8:00, and the termination time is 9:00.
Step S12: when 24 hourly averages are divided into n part, determines the time period belonging to time period belonging to described generation time and described termination time.
Wherein said n be greater than 1 integer.
When 24 hourly averages are divided into n part, obtain the time period that n part is different, the time span of each time period is 24/n hour.In the generation time of described data to be stored some time periods in the time period that n part is different, in termination time of described data to be stored some time periods in the time period that n part is different.
Time period belonging to the time period at described generation time place and described generation time, the time period belonging to the time period at described termination time place and described termination time.
Now illustrate to determining that belonging to time period belonging to described generation time and described termination time, the time period is described, such as, n equals 24, be divided into 24 parts by 24 hourly averages, obtain 24 parts of different time periods, be respectively: 0:00-1:00,5:00-6:00,6:00-7:00,7:00-8:00,8:00-9:00,9:00-10:00 ..., 23:00-24:00.Described generation time is 6:15, and the described termination time is 8:31.Because 6:15 is within the 6:00-7:00 time period, therefore the time period belonging to described generation time is 6:00-7:00.Because 8:31 is within the 8:00-9:00 time period, therefore the time period belonging to the described termination time is 8:00-9:00.
Step S13: the time period belonging to time period and described termination time belonging to described generation time, determine section storage time that described data to be stored are corresponding.
Step S14: the storage file name generating identification number and the corresponding numerical value of described section storage time containing described data to be stored.
Now illustrate and the storage file name of the identification number generated containing described data to be stored and the corresponding numerical value of section described storage time is described, such as, the identification number of described data to be stored is TEST, described storage time, section was respectively: 6:00-7:00,7:00-8:00,8:00-9:00, then generate the storage file name with section same number described storage time, the storage file name generated is respectively: TEST_600_700.DAT, TEST_700_800.DAT, TEST_800_900.DAT.
Step S15: the file setting up described storage file name correspondence in storage server.
After the corresponding storage file name of generation, in storage server, set up the file of described storage file name correspondence, achieve the memory location index of described storage file name as described data to be stored, be stored in storage server.
Step S16: described data to be stored are stored in the file of described storage file name correspondence.
After the file set up of described storage file name correspondence, described data to be stored be stored in the file of the correspondence of storage file name described in described storage server, achieve the storage to described data to be stored, whole process does not need the participation of database.
When inquiring about corresponding data, according to corresponding storage file name, data can be found in corresponding file.
In this application, after the storage file name of the identification number and the corresponding numerical value of section storage time that generate data to be stored, the file of described storage file name correspondence is set up in storage server, achieve using generate storage file name as the memory location index of data to be stored, be stored in storage server.And after the file setting up storage file name correspondence, data to be stored are stored in the file of storage file name correspondence.
Therefore be all stored in storage server by the memory location index of data to be stored and data to be stored in the application, storing process does not need the cooperation of database, because this reducing administration of Account Dept difficulty, decrease system cost.
In the present embodiment, the detailed process of step S13 see Fig. 2, can it illustrates a kind of sub-process figure of the data processing method that the application provides, can comprise the following steps:
Step S131: judge that whether the time period belonging to time period belonging to described generation time and described termination time is adjacent.
If the time period is connected belonging to time period belonging to described generation time and described termination time, then perform step S132, otherwise, perform step S133.
Step S132: determine that section storage time corresponding to described data to be stored is respectively the time period belonging to time period belonging to described generation time and described termination time.
Step S133: determine that section storage time corresponding to described data to be stored is respectively belonging to described generation time each time period belonging to time period belonging to time period belonging to time period, described termination time and described generation time and described termination time between the time period.
Now illustrate and the process of step S131 to step S132 is described, such as, when 24 hourly averages are divided into 24 parts, obtain 24 parts of different time periods, be respectively: 0:00-1:00 ..., 5:00-6:00,6:00-7:00,7:00-8:00,8:00-9:00,9:00-10:00,, 23:00-24:00.If described generation time is 6:15, the described termination time is 8:31, then the time period belonging to described generation time is 6:00-7:00, time period belonging to the described termination time is 8:00-9:00, judge that whether 6:00-7:00 and 8:00-9:00 be adjacent, judged result is non-conterminous, then determine that section storage time corresponding to described data to be stored is respectively 6:00-7:00,7:00-8:00,8:00-9:00.
If described generation time is 6:15, the described termination time is 7:30, then the time period belonging to described generation time is 6:00-7:00, time period belonging to the described termination time is 7:00-8:00, judge that whether 6:00-7:00 and 7:00-8:00 be adjacent, judged result is adjacent, then determine that section storage time corresponding to described data to be stored is respectively 6:00-7:00,7:00-8:00.
In the present embodiment, described n can but be not limited to and equal 24.When n equals 24,24 hourly averages are divided into 24 parts, obtain 24 parts of different time periods, the time span of each time period is 60 minutes.
Certainly, described n can but be not limited to and equal 48.When n equals 48,24 hourly averages are divided into 48 parts, obtain 48 parts of different time periods, the time span of each time period is 30 minutes.
It should be noted that, when 24 hourly averages are divided into n part, need with sometime for reference position, reference position can be the integral point moment, also can be the non-integral point moment.
Embodiment two
After the method shown in embodiment one of employing stores data, to the data in access storage server, then the method that the present embodiment can be adopted to provide, refers to Fig. 3, it illustrates the another kind of process flow diagram of the data processing method that the application provides, can comprise the following steps:
Step S31: obtain the identify label number of data to be checked, inquiry initial time and poll-final time.
The inquiry initial time treating data query of now illustrating and poll-final time are described, and such as, data to be checked are the Video data of video data B at 8:00 to 9:00, then the inquiry initial time of data to be checked is 8:00, and the poll-final time is 9:00.
Step S32: when 24 hourly averages are divided into described n part, determines the time period belonging to time period belonging to described inquiry initial time and described poll-final time.
In the present embodiment, described n is identical with the numerical value of the n in step S12 in embodiment one.
When 24 hourly averages are divided into n part, obtain the time period that n part is different, the time span of each time period is 24/n hour.In the inquiry initial time of described data to be checked some time periods in the time period that n part is different, in poll-final time of described data to be checked some time periods in the time period that n part is different.
Time period belonging to the time period at described inquiry initial time place and described inquiry initial time, the time period belonging to the time period at described poll-final time place and described poll-final time.
Now illustrate to determining that belonging to time period belonging to described inquiry initial time and described poll-final time, the time period is described, such as, n equals 24, be divided into 24 parts by 24 hourly averages, obtain 24 parts of different time periods, be respectively: 0:00-1:00,5:00-6:00,6:00-7:00,7:00-8:00,8:00-9:00,9:00-10:00 ..., 23:00-24:00.Described inquiry initial time is 5:15, and the described poll-final time is 7:30.Because 5:15 is within the 5:00-6:00 time period, therefore belonging to described inquiry initial time, the time period is 5:00-6:00.Because 7:30 is within the 7:00-8:00 time period, therefore belonging to the described poll-final time, the time period is 7:00-8:00.
Step S33: the time period belonging to time period and described poll-final time belonging to described inquiry initial time, determine the query time section that described data to be checked are corresponding.
Step S34: search the filename mated with the identify label number of described data to be checked and described query time section in storage server.
Now illustrate and the process of searching the filename mated with the identify label number of described data to be checked and described query time section in storage server is described, such as, query time section corresponding to described data to be checked is 12:00-13:00, the identification number of described data to be checked is TEST, searches the filename TEST_1200_1300.DAT mated with TEST and 12:00-13:00 in storage server.
Step S35: inquire about described data to be checked in the file that described filename is corresponding.
After finding the filename mated with the identify label number of described data to be checked and described query time section, in the file that corresponding filename is corresponding, inquire about described data to be checked.
In the present embodiment, the process of inquiring about data does not need the cooperation of database, when inquiring about, directly can inquire about the file in storage server, not needing Query Database, accelerate inquiry velocity, thus improve query performance.
In the present embodiment, the detailed process of step S33 see Fig. 4, can it illustrates a kind of sub-process figure of the data processing method that the application provides, can comprise the following steps:
Step S331: judge that whether the time period belonging to time period belonging to described inquiry initial time and described poll-final time is adjacent.
If the time period is adjacent belonging to time period belonging to described inquiry initial time and described poll-final time, then perform step S332, otherwise, perform step S333.
Step S332: determine that query time section corresponding to described data to be checked is respectively the time period belonging to time period belonging to described inquiry initial time and described poll-final time.
Step S333: determine that query time section corresponding to described data to be checked is respectively belonging to described inquiry initial time each time period belonging to time period belonging to time period belonging to time period, described poll-final time and described inquiry initial time and described poll-final time between the time period.
Now illustrate and the process of step S331 to step S332 is described, such as, when 24 hourly averages are divided into 24 parts, obtain 24 parts of different time periods, be respectively: 0:00-1:00 ..., 5:00-6:00,6:00-7:00,7:00-8:00,8:00-9:00,9:00-10:00,, 23:00-24:00.If described inquiry initial time is 5:15, the described poll-final time is 7:30, then belonging to described inquiry initial time, the time period is 5:00-6:00, time period belonging to the described poll-final time is 7:00-8:00, judge that whether 5:00-6:00 and 7:00-8:008:00-9:00 be adjacent, judged result is non-conterminous, then determine that the storing queries time period that described data query to be stored is corresponding is respectively 5:00-6:00,6:00-7:00,7:00-8:00.
If described inquiry initial time is 6:30, the described poll-final time is 7:30, then belonging to described inquiry initial time, the time period is 6:00-7:00, time period belonging to the described poll-final time is 7:00-8:00, judge that whether 6:00-7:00 and 7:00-8:00 be adjacent, judged result is adjacent, then determine that query time section corresponding to described data to be checked is respectively 6:00-7:00,7:00-8:00.
Embodiment three
Corresponding with above-described embodiment, this application provides a kind of data processing equipment, refer to Fig. 5, it illustrates a kind of logical organization schematic diagram of the data processing equipment that the application provides, data processing equipment can comprise: the first acquiring unit 51, first determining unit 52, second determining unit 53, generation unit 54, set up unit 55 and storage unit 56.
First acquiring unit 51, for obtaining the identification number of data to be stored, generation time and termination time.
First determining unit 52, for when 24 hourly averages are divided into n part, determines the time period belonging to time period belonging to described generation time and described termination time, wherein said n be greater than 1 integer.
Second determining unit 53, for the time period belonging to time period belonging to described generation time and described termination time, determines section storage time that described data to be stored are corresponding.
Generation unit 54, for generating the storage file name of identification number containing described data to be stored and the corresponding numerical value of described section storage time.
Set up unit 55, for setting up the file of described storage file name correspondence in storage server.
Storage unit 56, for being stored in described data to be stored in the file of described storage file name correspondence.
In the present embodiment, the concrete structure of the second determining unit 53 can see Fig. 6, and the second determining unit 53 comprises: the first judgment sub-unit 531, first determines that subelement 533 determined by subelement 532 and second.
First judgment sub-unit 531, whether adjacent for judging the time period belonging to time period belonging to described generation time and described termination time, if so, trigger first and determine that subelement 532 determines that section storage time corresponding to described data to be stored is respectively the time period belonging to time period belonging to described generation time and described termination time; If not, trigger second and determine that subelement 533 determines that section storage time corresponding to described data to be stored is respectively belonging to described generation time each time period belonging to time period belonging to time period belonging to time period, described termination time and described generation time and described termination time between the time period.
Embodiment four
In the present embodiment, show another data processing equipment, refer to Fig. 7, the basis of the data processing equipment shown in Fig. 5 also comprises: second acquisition unit 71, the 3rd determining unit 72, the 4th determining unit 73, search unit 74 and query unit 75.
Second acquisition unit 71, for obtaining identify label number, the inquiry initial time and poll-final time of data to be checked.
3rd determining unit 72, for when 24 hourly averages are divided into described n part, determines the time period belonging to time period belonging to described inquiry initial time and described poll-final time.
4th determining unit 73, for the time period belonging to time period belonging to described inquiry initial time and described poll-final time, determines the query time section that described data to be checked are corresponding.
Search unit 74, for searching the filename mated with the identify label number of described data to be checked and described query time section in storage server.
Query unit 75, for inquiring about described data to be checked in the file that described filename is corresponding.
In the present embodiment, the concrete structure of the 4th determining unit 73 refers to Fig. 8, and the 4th determining unit 73 comprises: the second judgment sub-unit 731, the 3rd determines that subelement 733 determined by subelement 732 and the 4th.
Second judgment sub-unit 731, whether adjacent for judging the time period belonging to time period belonging to described inquiry initial time and described poll-final time, if, trigger the 3rd and determine that subelement 732 determines that query time section corresponding to described data to be checked is respectively the time period belonging to time period belonging to described inquiry initial time and described poll-final time, if not, trigger the 4th and determine that subelement 733 determines that query time section corresponding to described data to be checked is respectively the time period belonging to described inquiry initial time, each time period belonging to time period belonging to time period belonging to the described poll-final time and described inquiry initial time and described poll-final time between the time period.
It should be noted that, each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar part mutually see.For device class embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
Finally, also it should be noted that, in this article, the such as relational terms of first and second grades and so on is only used for an entity or operation to separate with another entity or operational zone, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment comprising described key element and also there is other identical element.
For convenience of description, various unit is divided into describe respectively with function when describing above device.Certainly, the function of each unit can be realized in same or multiple software and/or hardware when implementing the application.
As seen through the above description of the embodiments, those skilled in the art can be well understood to the mode that the application can add required general hardware platform by software and realizes.Based on such understanding, the technical scheme of the application can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product can be stored in storage medium, as ROM/RAM, magnetic disc, CD etc., comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform the method described in some part of each embodiment of the application or embodiment.
A kind of data processing method provided the application above and device are described in detail, apply specific case herein to set forth the principle of the application and embodiment, the explanation of above embodiment is just for helping method and the core concept thereof of understanding the application; Meanwhile, for one of ordinary skill in the art, according to the thought of the application, all will change in specific embodiments and applications, in sum, this description should not be construed as the restriction to the application.