Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a method for evaluating the epidemic infection risk of regions and individuals.
The purpose of the invention is realized by the following technical scheme:
an epidemic infection risk assessment method, comprising:
s11, acquiring the mobile terminal number or the identity card number of the patient according to epidemic situation data provided by Weijian committee, and acquiring the track information corresponding to the patient from the operator track interface according to the mobile terminal number or the identity card number;
s12, extracting the base station track from the track information of the patient, and obtaining the passing mode of the patient when the patient passes through the base station through a passing mode judgment algorithm;
s13, acquiring the time of the patient getting in and out of the base station according to the base station track, and carrying out time slice segmentation on the time of the patient getting in and out of the base station according to preset time slices;
s14, counting the number of people who pass in and out of the same time slice of the same passing mode of the base station within the preset time, multiplying the number of people in the same passing mode by the corresponding weight to obtain the risk value of each passing mode, and adding the risk values of all the passing modes of the base station to obtain the epidemic infection risk degree of the base station, thereby realizing the epidemic infection risk assessment of the region.
Preferably, the passing modes in the step 12 comprise home, office, residence, walking and riding; the passing mode of the patient when passing through the base station is obtained through the passing mode judgment algorithm and is as follows: if delta t > is alpha, the track is judged as the home; if alpha >. DELTA.t > beta and the time range is at night, the track is judged as being at home; if alpha >. DELTA.t > beta and the time range is in the daytime, the track is judged as office work; if beta > delta t > is x, the track is judged to be resident; if x > delta t > is delta, the track is judged to be walking; if the situations are not met, judging the track as a bus; wherein, Δ t is the time difference in and out of the base station calculated according to the track of the base station, and is counted in seconds; α represents a threshold value of the residence time at home, [ β, α ] represents a range of residence time at home or at work, [ χ, β) is a threshold value of the residence time at residence, and [ δ, χ) is a threshold value of the walking residence time.
Preferably, step S13 includes:
s131, dividing the time of 24 hours a day into different time periods according to time segmentation granularity, wherein the segmentation granularity is counted in seconds from 0 to 86400;
s132, converting the time stamp of the time when the patient enters and exits the base station into a character string format of 'year, month, day, minute and second', and segmenting the character string of 'year, month, day, minute and second' according to the formats of 'year, month, day' and 'hour, minute and second';
s133, supplementing the segmented 'year, month and day' part into 'xxxx: xx: xx00:00: 00', converting the segmented 'year, month and day' part into a timestamp format, converting the 'hour, minute and second' part, namely 'xx: xx: xx: xx' into corresponding seconds, and adding the corresponding timestamps of 'xxxx: xx: xx00: 00';
s134, comparing the seconds of minutes and seconds corresponding to the time of the patient entering and exiting the base station with the time period segmented in the step S131, finding the time period interval to which the entering and exiting time belongs, replacing the entering time with the starting time of the time period interval to which the entering time belongs, and replacing the leaving time with the ending time of the time period interval to which the leaving time belongs;
s135, adding the replaced start time and end time with the converted time stamps of the corresponding 'xxxx: xx: xx00:00: 00' respectively to obtain the time stamp finally corresponding to the time when the patient enters and exits the base station;
and S136, segmenting the time of the patient entering and exiting the base station according to the segmentation granularity by the corresponding timestamp finally.
Preferably, the steps S13 and S14 further include: the number of the patients in different time slices and different passing modes of the same base station is updated, and the method specifically comprises the following steps: traversing a new base station track time slice passing mode list of the patient, sequentially comparing the number of the passing modes with the number of the patient base station time slices in the database, if the number of the base stations, the time slices and the passing modes are the same, adding 1 to the corresponding number of the people, and if the number of the passing modes is not the same, adding the base station record.
Preferably, step 14 is specifically: traversing the updated base station time slice passing mode person number list, taking out the base station number and the time slice, traversing all base station time slice passing mode person number lists in the database, taking out all records with the same updated base station number and the time slice, calculating the risk value recorded by each base station time slice passing mode according to the passing mode and the number of the persons, calculating the home risk value as the patient number alpha, the office risk value as the patient number beta, the resident risk value as the patient number chi, the walking risk value as the patient number delta, the riding risk value as the patient number epsilon, and adding the risk values of different passing modes corresponding to the base station and the time slice to obtain the risk degree of the base station time slice.
Preferably, step S14 is followed by: the epidemic situation infection risk assessment method for the individual to be assessed specifically comprises the following steps:
s15, determining whether the person to be evaluated is a patient, if not, executing the step S16;
s16, matching the base station track of the individual to be evaluated, and sequencing the base stations entering and exiting according to the base station track and the entering time;
s17, taking out the track of the personal base station to be evaluated, wherein the traffic mode is the track of the bus; judging whether the riding track of the patient is overlapped with the riding track of the patient or not; if yes, giving a risk value to the base station weighted risk degree of the individual to be evaluated, and executing step S19; if not, go to step S18;
s18, acquiring a single base station track of the person to be evaluated from the base station tracks, matching the risk degree of each time period in the base station through the time of the person to be evaluated entering and leaving the base station, and accumulating to obtain the risk degree of the person to be evaluated passing the base station;
and S19, if the risk value obtained in the step S17 or the risk degree obtained in the step S18 is larger than a preset threshold value, determining that the personal epidemic infection risk blacklist is to be evaluated.
Preferably, the step of determining whether the riding track of the patient coincides with the riding track of the patient in the step S18 includes:
s181, screening out base stations through which each patient passes, grouping the base station tracks according to the patients, and sequencing the base station tracks of each patient according to the entry time;
s182, obtaining the base station track information of the patient;
s183, taking out the base station track information in the preset window of the patient;
s184, judging whether the base station track information in the window of the patient is continuous; if not, the initial base station moves one backward, and step S183 is executed; if yes, go to step S185;
s185, matching the track of the personal base station to be evaluated with the continuous track of the base station in the patient window, and checking whether the continuous track of the personal base station to be evaluated is matched with the track of the personal base station to be evaluated in the window; if not, the initial base station moves one backward, and step S183 is executed; if yes, judging that the person to be evaluated has an accompanying relationship with the patient.
Preferably, the base station track information of the patient is [ S1, S2, S3,.., Sn,.., Sm ], where Sn represents information contained in the nth base station that the patient passes through, and the information is the base station number of the base station and the time when the patient passes in and out of the base station.
Preferably, the mobile terminal number is a mobile phone number.
Compared with the prior art, the invention has the following advantages:
according to the invention, patient information is obtained from Wei-Jian-Wei in each region, the track information of the patient is obtained by using the mobile phone number of the patient, time slice division and pass mode judgment are carried out according to the track information of the patient, the number of people in the same pass mode in the time slices of the base station is counted, the infection risk values of each base station in each time slice are calculated, and the risk values are dynamically updated along with the track change of the patient. According to the invention, the user track information is obtained through the mobile phone number of the common user and is matched with the patient track information, so that the infection risk value of the common user is obtained, the risk value is changed along with the change of the user track and the patient track, the automatic evaluation of the epidemic infection risk of the region and the individual is finally realized, the evaluation basis is more, and the evaluation result is accurate.
Detailed Description
The invention is further illustrated by the following figures and examples.
Referring to fig. 1-3, a method for assessing epidemic infection risk, comprising:
s11, acquiring the mobile terminal number or the identity card number of the patient according to epidemic situation data provided by Weijian committee, and acquiring the track information corresponding to the patient from the operator track interface according to the mobile terminal number or the identity card number; in this embodiment, the mobile terminal number is a mobile phone number.
S12, extracting the base station track from the track information of the patient, and obtaining the passing mode of the patient when the patient passes through the base station through a passing mode judgment algorithm; the passing mode comprises home, office, residence, walking and riding; the passing mode of the patient when passing through the base station is obtained through the passing mode judgment algorithm and is as follows: if delta t > is alpha, the track is judged as the home; if alpha >. DELTA.t > beta and the time range is at night, the track is judged as being at home; if alpha >. DELTA.t > beta and the time range is in the daytime, the track is judged as office work; if beta > delta t > is x, the track is judged to be resident; if x > delta t > is delta, the track is judged to be walking; if the situations are not met, judging the track as a bus;
wherein, Δ t is the time difference in and out of the base station calculated according to the track of the base station, and is counted in seconds; α represents a threshold value of the residence time at home, such as 12h, [ β, α ] represents a range of residence times at home or at work, such as [8h,12h ], [ χ, β) is a threshold value of residence time at residence, and [ δ, χ) is a threshold value of walking residence time.
S13, acquiring the time of the patient getting in and out of the base station according to the base station track, and carrying out time slice segmentation on the time of the patient getting in and out of the base station according to preset time slices; specifically, step S13 includes:
s131, dividing the time of 24 hours a day into different time periods according to time segmentation granularity, wherein the segmentation granularity is counted in seconds from 0 to 86400;
s132, converting the time stamp of the time when the patient enters and exits the base station into a character string format of 'year, month, day, minute and second', and segmenting the character string of 'year, month, day, minute and second' according to the formats of 'year, month, day' and 'hour, minute and second';
s133, supplementing the segmented 'year, month and day' part into 'xxxx: xx: xx00:00: 00', converting the segmented 'year, month and day' part into a timestamp format, converting the 'hour, minute and second' part, namely 'xx: xx: xx: xx' into corresponding seconds, and adding the corresponding timestamps of 'xxxx: xx: xx00: 00';
s134, comparing the seconds of minutes and seconds corresponding to the time of the patient entering and exiting the base station with the time period segmented in the step S131, finding the time period interval to which the entering and exiting time belongs, replacing the entering time with the starting time of the time period interval to which the entering time belongs, and replacing the leaving time with the ending time of the time period interval to which the leaving time belongs;
s135, adding the replaced start time and end time with the converted time stamps of the corresponding 'xxxx: xx: xx00:00: 00' to obtain the time stamp finally corresponding to the time when the patient enters and exits the base station;
and S136, segmenting the time of the patient entering and exiting the base station according to the segmentation granularity by the corresponding timestamp finally.
Such as: the time slices are divided starting from 00:00:00 for 1 day, assuming a particle size of 10min, so that 24 hours for 1 day can be divided into time slices [0,600], [600,1200], … [85800,86400 ].
The timestamp 1580533390 entering the base station is converted into a "year-month-day-hour: minutes: seconds" format of 2020-02-0113: 03:10, which divides 2020-02-0113: 03:10 into two parts 2020-02-0100: 00:00 and 13:03:10 in sum.
2020-02-0100: 00:00 is converted into a time stamp 1580486400 according to the difference with 1970-01-0108: 00:00, 13:03:10 is converted into 46990 according to the difference with 00:00:00, 46990 is converted into a time slice interval of [46800,47400], and the time stamp of 2020-02-0100: 00:00 is added to be converted into [1580533200,1580533800 ].
The timestamp 1580551390 leaving the base station is converted to a "year-month-day hour: minutes: seconds" format of 2020-02-0118: 03:10, which splits 2020-02-0118: 03:10 into a sum of two parts 2020-02-0100: 00:00 and 18:03: 10.
2020-02-0100: 00:00 is converted into a time stamp 1580486400 according to the difference value with 1970-01-0108: 00:00, 18:03:10 is converted into 64990 according to the difference value with 00:00:00, 64990 is converted into a time slice interval of [64800,65400], the time stamp of 2020-02-0100: 00:00 is added into the time slice interval, and the time slice interval is converted into [1580551200,1580551800]
Therefore, the time interval for entering and exiting the base station can be divided into time slices of [1580533200,1580533800], [1580533800,1580534400], … [1580551200,1580551800], since the time stamp of the beginning of the time transition of entering the base station is 1580533200, the time stamp of the end of the time transition of leaving the base station is 1580551800, and the granularity of the time interval division is 10 min.
Further, the steps between S13 and S14 further include: the number of the patients in different time slices and different passing modes of the same base station is updated, and the method specifically comprises the following steps: traversing a new base station track time slice passing mode list of the patient, sequentially comparing the number of the passing modes with the number of the patient base station time slices in the database, if the number of the base stations, the time slices and the passing modes are the same, adding 1 to the corresponding number of the people, and if the number of the passing modes is not the same, adding the base station record.
S14, counting the number of people who pass in and out of the same time slice of the same passing mode of the base station within the preset time, multiplying the number of people in the same passing mode by the corresponding weight to obtain the risk value of each passing mode, and adding the risk values of all the passing modes of the base station to obtain the epidemic infection risk degree of the base station, thereby realizing the epidemic infection risk assessment of the region. Specifically, step S14 specifically includes:
traversing the updated base station time slice passing mode person number list, taking out the base station number and the time slice, traversing all base station time slice passing mode person number lists in the database, taking out all records with the same updated base station number and the time slice, calculating the risk value recorded by each base station time slice passing mode according to the passing mode and the number of the persons, calculating the home risk value as the patient number alpha, the office risk value as the patient number beta, the resident risk value as the patient number chi, the walking risk value as the patient number delta, the riding risk value as the patient number epsilon, and adding the risk values of different passing modes corresponding to the base station and the time slice to obtain the risk degree of the base station time slice.
In this embodiment, step S14 is followed by: the epidemic situation infection risk assessment method for the individual to be assessed specifically comprises the following steps:
s15, determining whether the person to be evaluated is a patient, if not, executing the step S16; if yes, directly returning to the blacklist. The person (user) to be evaluated can directly input the user information, and then whether the person to be evaluated is a patient can be determined.
S16, matching the base station track of the individual to be evaluated, and sequencing the base stations entering and exiting according to the base station track and the entering time;
s17, taking out the track of the personal base station to be evaluated, wherein the traffic mode is the track of the bus; judging whether the riding track of the patient is overlapped with the riding track of the patient or not; if yes, giving a risk value to the base station weighted risk degree of the individual to be evaluated, and executing step S19; if not, go to step S18;
s18, acquiring a single base station track of the person to be evaluated from the base station tracks, matching the risk degree of each time period in the base station through the time of the person to be evaluated entering and leaving the base station, and accumulating to obtain the risk degree of the person to be evaluated passing the base station; specifically, in the step S18, if it is determined that the riding track of the patient coincides with the riding track of the patient, the riding track of the patient is matched with the riding track of the inquirer, and the specific matching process includes:
s181, screening out base stations through which each patient passes by the bus, grouping the base station tracks according to the patients (mobile phone numbers), and sequencing the base station tracks of each patient according to the entry time;
s182, obtaining the base station track information of the patient; if the information of the patient is not traversed, the individual to be evaluated has no accompanying relationship with all the patients.
S183, taking out the base station track information in the preset window of the patient; if the number of base stations in the window is not enough, the process returns to step S182. The information of the base station track of the patient is [ S1, S2, S3, wherein Sn denotes information contained in the nth base station through which the patient passes, and the information is the base station number of the base station and the time for the patient to get in and out of the base station. If the window size is 3, the base station trajectory information in the patient window is [ S1, S2, S3 ].
S184, judging whether the base station track information in the window of the patient is continuous; if not, the initial base station moves one backward, and step S183 is executed; if yes, go to step S185; for example, if the information of the base station trajectory in the window of the patient is [ S1, S2, S3], it is necessary to determine whether the time when the patient leaves the base station S1 is consistent with the time when the patient enters the base station S2, if so, the base stations S1 and S2 are consecutive, and similarly, it is determined whether the base stations S2 and S3 are consecutive. If one of the two is not continuous, the judgment is continued by taking [ S2, S3, S4], and the like.
S185, matching the track of the personal base station to be evaluated with the continuous track of the base station in the patient window, and checking whether the continuous track of the personal base station to be evaluated is matched with the track of the personal base station to be evaluated in the window; if not, the initial base station moves one backward, and step S183 is executed; if yes, judging that the person to be evaluated has an accompanying relationship with the patient. For example, the continuous patient trajectories screened in the step 4 are [ S1, S2, S3], the patient trajectories are matched with the user trajectories, and if 3 trajectories which are consistent with the base station numbers of [ S1, S2, S3] and have continuous in-out time appear in the user trajectories, the accompanying relationship is judged.
And S19, if the risk value obtained in the step S17 or the risk degree obtained in the step S18 is larger than a preset threshold value, determining that the personal epidemic infection risk blacklist is to be evaluated. And if the risk value obtained in the step S17 or the risk degree obtained in the step S18 is smaller than a preset threshold value, determining that the individual to be evaluated is infected with the epidemic situation risk white list. After step S19, the determination result is returned to generate the two-dimensional code, and the user acquires the determination result from the two-dimensional code.
In summary, the present invention includes information acquisition, base station risk level generation, and risk level query (individual risk level assessment). In the information acquisition part, patient information is mainly obtained from health and fitness committees in various regions, and a user base station track is obtained from a mobile phone operator. And in the base station risk degree generating part, the base station time slice risk degree is obtained through the patient information generated in the last part and the user base station track. And in the risk degree inquiry part, acquiring the base station track of the user by using the mobile phone number input by the user, and respectively matching the base station track with the patient information, the base station time slice risk degree and the patient base station passing mode, thereby evaluating the infection risk of the inquirer. The invention has multiple evaluation bases, and the automatic evaluation of infection risks can be realized in areas and individuals.
The above-mentioned embodiments are preferred embodiments of the present invention, and the present invention is not limited thereto, and any other modifications or equivalent substitutions that do not depart from the technical spirit of the present invention are included in the scope of the present invention.