CN115083615A - Method and device for chain type parallel statistics of number of patients in multi-center treatment - Google Patents
Method and device for chain type parallel statistics of number of patients in multi-center treatment Download PDFInfo
- Publication number
- CN115083615A CN115083615A CN202210854341.XA CN202210854341A CN115083615A CN 115083615 A CN115083615 A CN 115083615A CN 202210854341 A CN202210854341 A CN 202210854341A CN 115083615 A CN115083615 A CN 115083615A
- Authority
- CN
- China
- Prior art keywords
- label
- intersection
- calculation
- header
- patients
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 53
- 238000004364 calculation method Methods 0.000 claims abstract description 80
- 238000012545 processing Methods 0.000 claims abstract description 12
- 230000006870 function Effects 0.000 claims description 11
- 230000008569 process Effects 0.000 claims description 8
- 230000011218 segmentation Effects 0.000 claims description 5
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 238000002372 labelling Methods 0.000 claims description 2
- 230000009466 transformation Effects 0.000 claims description 2
- 241000554155 Andes Species 0.000 claims 2
- 238000010586 diagram Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 229960001948 caffeine Drugs 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000003745 diagnosis Methods 0.000 description 1
- 201000010099 disease Diseases 0.000 description 1
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- RFHAOTPXVQNOHP-UHFFFAOYSA-N fluconazole Chemical compound C1=NC=NN1CC(C=1C(=CC(F)=CC=1)F)(O)CN1C=NC=N1 RFHAOTPXVQNOHP-UHFFFAOYSA-N 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- RYYVLZVUVIJVGH-UHFFFAOYSA-N trimethylxanthine Natural products CN1C(=O)N(C)C(=O)C2=C1N=CN2C RYYVLZVUVIJVGH-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16H—HEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
- G16H50/00—ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
- G16H50/70—ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for mining of medical data, e.g. analysing previous cases of other patients
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2462—Approximate or statistical queries
Landscapes
- Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Public Health (AREA)
- General Engineering & Computer Science (AREA)
- Medical Informatics (AREA)
- Probability & Statistics with Applications (AREA)
- Computational Linguistics (AREA)
- Biomedical Technology (AREA)
- Fuzzy Systems (AREA)
- Pathology (AREA)
- Mathematical Physics (AREA)
- Epidemiology (AREA)
- General Health & Medical Sciences (AREA)
- Primary Health Care (AREA)
- Medical Treatment And Welfare Office Work (AREA)
Abstract
The invention discloses a method and a device for counting the number of patients in multi-center visit in a chained parallel manner, wherein a hospital set and a patient main index set of each hospital are firstly constructed, and the patient main index set is converted into a bitmap set; then constructing a state ladder table, wherein labels in the table represent names corresponding to the main indexes of the patients in the hospital; the state value range in the state ladder table is divided into-1, 0 and 1; -1 means in the beginning of the calculation, 0 means initialization, 1 means completion of the calculation; performing 'bitwise and' calculation on a point of which the intersection element of the header tag and the table side tag is 0, performing neglect processing on a point of which the intersection element is-1, and directly skipping the calculation of the next point on the point of which the intersection element is 1; and calculating the number of 1 in the finished state ladder table, namely the number of intersection sets of the patient treatment records in the hospital combination. The invention utilizes the method of solving the quantity of the intersection elements of the set sequence intersection full combination in a multithread chain manner, thereby greatly improving the efficiency of the whole calculation.
Description
Technical Field
The invention relates to the technical field of medical data calculation, in particular to a method and a device for counting the number of patients in multi-center treatment based on chain type parallel statistics.
Background
In the field of medical data statistics, statistics on the relationship of complete combinations of different data sets is often required. For example, when a plurality of hospitals in a certain city are subjected to patient main index establishment, the diagnosis and treatment tracks of patients and the hospitals in which the patients have seen the diseases respectively can be obtained. Macroscopically, the intersection of patients among hospitals and the like are required to be seen, the intersection of the number of the same patients among the hospitals, the three-three intersection and the like are roughly counted to obtain a tree statistical graph and the like. In the conventional method, the number of intersection sets of the data sets in the full combination is solved, and small-scale data can be quickly obtained after being solved; for large-scale data, the conventional method for repeatedly calculating is time-consuming and labor-consuming, and results cannot be efficiently obtained; the existing method, for example, scf (single Cardinality filter) can roughly find the upper limit of the set intersection, but cannot accurately obtain the result, and if the number of intersections of the set needs to be accurately and efficiently obtained, other ways need to be found.
Therefore, the invention provides a method for calculating the complete combination intersection of the data sets based on the chain parallel markers. The efficient new method aims to solve the problem that the number of the full-combination intersections is solved in parallel by using the chain records under the condition of full combination of a plurality of data sets.
Disclosure of Invention
The invention aims to provide a method and a device for counting the number of patients in multi-center visit in a chained parallel manner aiming at the defects of the prior art, wherein for urban medical data statistics, a patient index is often required to be established to mark the unique identities of the patients in different hospitals, and meanwhile, the statistics of the number of overlapping visits among different hospitals can be carried out according to the main index of the patients, which has important significance on regional number statistics and the number trend of visits, so that the invention provides a method for efficiently and quickly solving the number of overlapping visits among the hospitals with different numbers.
The purpose of the invention is realized by the following technical scheme: a method for counting the number of patients in multi-center clinic in a chain-type parallel manner comprises the following steps:
(1) constructing a hospital set and a patient main index set of each hospital, and converting the patient main index set into a bitmap set;
(2) constructing a state trapezoidal table, wherein a table head label recorder _ list is a hospital combined label table, and the initial value isRespectively representing name labels corresponding to the main indexes of the patients in the hospital, and the initial set of the side labels in the column list is(ii) a The elements in the tag of the tag header areThe elements of the table side tag are(ii) a Hospital combined results labeling(ii) a The state value range in the state ladder table is divided into-1, 0 and 1; -1 means start in computation, 0 means initialization, wait in computation, 1 means computation completion;
(3) setting the bitmap calculation result of the intersection set corresponding to the new label obtained by combining the header label and the side label as reorder _ map, and setting the key as the combination of the header label and the side labelValue is obtained by performing 'bitwise and' operation on the digit group corresponding to the head label and the digit group corresponding to the side labelA corresponding new bit array;
(4) setting result _ map for storing the number of intersection elements, and key is the combination of the table head label and the table side labelValue is the number of intersection elements of the main index set of the patients in the hospital corresponding to the head label and the side label;
(5) scanning the state ladder table line by line, carrying out 'bitwise and' calculation on a point with a head table label and a table side label intersection element of 0, carrying out neglect processing on a point with an intersection element of-1, and directly skipping the calculation of the next point on the point with the intersection element of 1; for the point with the intersection element of 0, acquiring the bit array values corresponding to the header label and the side label from the reorder _ map, and if the bit array values corresponding to the header label and the side label exist, acquiring the bit array values corresponding to the side label and the side label, and acquiring the bit array values corresponding to the header label and the side label from the reorder _ mapPut into the header label reorder _ list and at the same time will placeAndsetting the intersection point element at the corresponding position in the state trapezoidal table as-1; setting the intersection point element to be 1 after the calculation is finished, putting the calculation result into a result _ map, and finally adding a row of labels on the surface sideAdding 1 to the length of the corresponding array compared with the length of the previous line; repeating the step until the state ladder table does not increase labels any more and the elements in the table are all 1; the final set sequence intersection full-combination intersection element number of the stored key-value pairs in the relut _ map, namely the number of patient visit record intersections in the hospital combination.
Further, in step (1), a hospital set is constructedN denotes the number of hospitals for the setPatient master index set for the ith hospital in (1)To aEach patient primary index in (1) is a bounded positive integer, that is, the same upper and lower limits exist on the numerical value of the character string of the patient primary index, so that the set obtained by conversion can be obtainedThe corresponding bitmap set isI.e. byThe main index information of the patient existing inCorresponding position markers in (1).
Further, in the step (2), recording the header labelAnd a front labelNew label obtained by combinationThe result of the binding is labeledIs shown byIntersection sequence formed by hospital patient main index sequence corresponding to each label。
Further, in the step (5), for the combination of the head label and the side labelIf, ifThe same as either the header or the side tab, indicating that the value for this position has been calculated, is directly marked 1 in the state ladder table at the corresponding position.
Further, in the step (5), for the combination of the head label and the side labelAnd if the record _ list is different from the header label and the side label, checking whether the record _ list exists or notIf the cross point element of the corresponding position of the header label and the table side label in the state trapezoidal table is set to be 1, which indicates that the calculation is already carried out; otherwise, checking first, acquiring whether the digit array values corresponding to the header tag and the side tag exist from the reorder _ map, if not, stopping calculation, and if so, performing subsequent calculation.
Further, in step (5), the headBit is recorded as a headerThe digit group corresponding to the label, sideBit represents the table side labelCorresponding digit array, defining function h (head bit, side bit) to express the number of elements 'according to bit and' back element 1 in head bit and side bit, putting the calculation result inIn result _ map, key isValue = h (header bit, sideBit); generated in the middle of the calculationCorresponding new bit array headBit&The sideBit is put into the reorder _ map with key ofValue is header bit& sideBit。
Further, in the step (5), the bitmap is equally divided into m segments according to the segmentation rule of the bitmap for splicing, so that the relationship is obtained;It is shown that the splicing operation is performed,indicates the kth segment headerA digit group corresponding to the label;
the same can be obtained,Table side label for indicating k-th segmentCorresponding bit array for arbitraryAnd withBoth should be a collection of equal number elements, and then the relationship:
due to the fact thatAndthe number of elements is the same, and the headBit and sideBit are both divided into m segments, so further conversion can obtain:
this header bit&The result of sideBit is converted into a solutionThe number of (1); assuming that the patient main index sequence corresponding to the headBit is headEMPISet and the patient main index sequence corresponding to the sideBit is sideEMPISet after multiple calculations, the method can be obtainedIn practice it is shown inThe hospitals corresponding to the formed sequence all have the number of patients who have been recorded; thus, it is possible to provideThe results of (a) are expressed as: h (header, sideBit), further expressed according to the method of segmentation h (header, sideBit) as:that is:
for the segmented bit array of m segments of bitwise and operation, the multithreading technology is utilized to carry out parallel execution after one-time splitting, and each thread executes corresponding calculation once corresponding to m threadsM thread pairsPerforming segmented parallel 'bitwise and' calculation to obtain bit array intersectionThe number of 1 in, i.e. meansThereby obtaining the number of intersection elements inThe hospitals corresponding to the formed sequence all have the number of patients who have been recorded.
setting upConverting the andeRes sequence into a Long type of longRes, wherein the andeRes represents that the headBit and the sideBit are divided into m sections, and the kth section is subjected to one-time bitwise comparison and calculation to obtain a digit group; long represents 64-bit Long integer data, and longRes represents a value after andRes is converted into Long integer data; definition function solvingIn (1) ofThe number is count, and when longRes is not equal to 0, the initial setting isIterative computation,Representing the result of the i-th calculation 1 in the same time as a shift right operation for longRes, i.e. shift right operation,Representing the value converted into long integer data at the i-th calculation untilWhen 0, obtainedIs thatThe number of (1).
In a second aspect, the invention further provides a device for chain-type parallel statistics of the number of patients in multi-center visits, which comprises a memory and one or more processors, wherein the memory stores executable codes, and the processors execute the executable codes to realize the method for chain-type parallel statistics of the number of patients in multi-center visits.
In a third aspect, the present invention further provides a computer readable storage medium, on which a program is stored, which when executed by a processor, implements the method for chain parallel statistics of the number of patients in a multi-center visit.
The invention has the beneficial effects that: for the field of the existing medical data calculation, for a scientific research calculation service platform, particularly for counting the number of patients who see the patient based on the common existence of the patients among multiple hospitals, the conventional solution method for solving the number of the intersection elements of the set sequence intersection full combination consumes time and labor, has high requirements on calculation host hardware for the condition of large data volume, and can not effectively utilize the obtained results to carry out iterative chain solution; the invention provides a method for decomposing a task into a plurality of irrelevant small tasks for calculation after a set sequence bit is digitalized, finally combining the results of the small tasks to obtain the calculation result of an original task, recording the calculation state by utilizing a dynamic trapezoidal table, and then fully utilizing the multi-core characteristic of a host machine to carry out multithreading chain type solution on the quantity of intersection elements of a set sequence intersection full combination, so that the efficiency of the whole calculation is greatly improved.
Drawings
Fig. 1 is a schematic diagram of a ladder status table (ladder _ status _ table) according to the present invention.
Fig. 2 is a flow chart of a method according to the present invention.
FIG. 3 is a schematic diagram of a ladder table structure according to an embodiment of the present invention.
FIG. 4 is a diagram illustrating the end of trapezoidal table calculation according to an embodiment of the present invention.
FIG. 5 is a block diagram of a chain type device for counting the number of patients in a multi-center clinic.
Detailed Description
The following description will explain embodiments of the present invention in further detail with reference to the accompanying drawings.
As shown in fig. 1 and 2, the present invention provides a method for counting the number of patients in a multi-center visit in a chain-type parallel manner; the method is used for counting the patient visit times based on the common patient visits among multiple hospitals.
Description of original problems: defining a sequence of setsHere, theRepresenting a set of hospitals to be solved, whereinThe set containsEqual n sequences for arbitrary,Setting up patient statistical information of n hospitals,a main index set for indicating the patients in the ith hospitalIs represented in a setThe j-th element in (1) is denoted as:and indicates the main index information of the jth patient at the ith hospital. For any oneSet to a finite integer, i.e. there is a LOW _ LIMITHIGH _ LIMIT, LOW _ LIMIT and HIGH _ LIMIT denote for sets respectivelyAny element of (1)Both have the same upper and lower limits; for all set sequencesAndthe intersection combination of (a) can be expressed as:whereinRepresenting intersections in the patient primary index set sequences of the ith hospital and the jth hospital; for theIn the combined intersection of the patient main indexes of any two hospitals, the number of intersection elements can be expressed as follows:whereinTo representAnd withIs also the number of elements in the intersection in the patient primary index set sequence representing the ith hospital and the jth hospital, forThe number of the intersection combinations of the main index sequences of two patients in middle-sized hospitals is(ii) a Similar available definitionsThe sum of intersection elements in the intersection of the main index sets of patients in the three hospitals in China is as follows:to aThe number of the intersection combinations of the main index sequences of the patients in the three hospitals is(ii) a By analogy, the following can be known:the number of the intersection combinations of the n main index sequences of the patients in the hospital is。
For the original problem, the original problem can be finally converted into a main index sequence set of every two patients to solve intersection so as to obtain a result; therefore, when solving the intersection of the main index sequence sets of two patients, the intersection of the sets needs to be solved by considering another way because the data set is too large and the time consumption for solving the intersection of the sets is certain; for theAny set of (2)Each element in the known set has an upper and lower bound range; in this case, therefore, the case of intersection of the two sets can be transformed into a fast solution with the binary bitmap sequence, while since the ranges of the elements in the two patient primary index sequences are the same, a relationship can be obtained: is provided for the aboveAny two of the sequencesAndif, ifAndwherein any element has the same upper and lower limits, then for any elementThen, thenThe upper and lower LIMITs of (1) are limited to the ranges of LOW _ LIMIT and HIGH _ LIMIT. Master index sequence for patientAnd patient master index sequenceRespectively defining the bitmap sets corresponding to the bitmap setsAndfor example, for eachThe elements therein can be uniformly converted into a long queue of HIGH _ LIMIT-LOW _ LIMIT bit arrays forExpressed as the first in the array-a value bit 1 for the position of LOW LIMIT; initializationAndfor binary 0, setAndthe elements present in (1) are thenAndthe corresponding position is set as 1; thus, forCan be equivalently converted intoAndafter performing the bit-wise AND operation, performAndafter a 'bitwise AND' operation, statisticsThe number of binary 1 s can be expressed as:;
the following describes a chain parallel computing set sequenceThe method for the quantity of the elements in the intersection of the full-combination intersection defines the sequence combination label of the intersection element quantity calculation intersection sequence, the sequence combination label is recorded as a record _ list, and the elements in the list are arranged according to the lexicographic order; initially, the initial element in the list isThe tags of the sequences (note: the tags are the names of the sequences and the corresponding variables in the program) are described asSimultaneously constructing a state ladder table, wherein a header element is reorder _ list, and a column list side tag is initiallyThe function of the track _ status _ table is as follows: recording new label obtained by combining header and side labelRepresenting the intersection sequence of the sequence components corresponding to a single tag(Note: at least the intersection of 2 sequences and at most the intersection of n sequences). the value in the transactional _ status _ table is-1, 0, 1; -1 means in starting the calculation, 0 means initialization and 1 means completion of the calculation. Setting the state values in the transactional _ status _ table to be 0 at the beginning, indicating that the calculation is not started and waiting for the calculation; defining function h (header, sideBit) represents the number of elements 'bitwise and' next element 1 in header and sideBit, and also represents the pair of header corresponding sequence and sideBitThe number of elements in the intersection of the corresponding sequences; in practice, the first calculation is that the headBit and sideBit areA hospital patient master index sequence of (1), and thus is represented at the time of first calculationIn hospitalsThe number of patients who have been treated by the hospital is calculated in multiple rounds, the number of intersection elements of the main index sequences of the patients in multiple hospitals is represented, and the actual meaning is the number of the patients who have been treated by the hospitals;
meanwhile, setting a bitmap calculation result map of an intersection set corresponding to a new label obtained by combining the header element label and the side element label as reorder _ map, setting key as the combination of the header label and the side label (the label name is a value after being sorted according to the lexicographic order), and setting value as a value after the corresponding set is subjected to digit array; initially, the value in reorder _ map is:
{
};
meanwhile, result _ map is set, key is a combination of the head tag and the side tag (a value obtained by sorting tag names according to a lexicographic order), and value is the number of intersection elements of sets corresponding to the head tag and the side tag, namely, the number of people who have the recorded visit in the hospital sequence corresponding to the combination of the head tag and the side tag.
Setting thread pool threeadPool, the idle thread in the thread pool starts to scan the trapezoid _ status _ table line by line, and when the intersection point element of the table head element label and the table side element label is 0, the idle thread in the thread pool starts to calculate: first, the head element label and the side element label are combined to form a dictionary sequence(tag name without duplication, obtaining a lexicographically ordered string of tag names), if obtainedThe same as one of the header element label or the side element label, which indicates that the value is already calculated, the value is directly marked as 1; for example: the meter head label isThe table side label isTags due to the combination of two tags are reordered intoThus indicating that no calculations have been made.
If obtained, isThe element label of the head table and the element label of the side table are different, and whether the recorder _ list exists or not is checkedIf yes, setting the intersection point element of the head element label and the side element label as 1 to indicate that the calculation is already carried out; such as header label bondingThe set of table side labels isIf, ifDue to combination to obtainIf the reorder _ list exists, the calculation is not carried out, which indicates that the value is already calculated by other calculation threads; otherwise, checking first, acquiring the digit array value corresponding to the header tag and the side tag from the reorder _ map, and if the digit array value does not exist, stopping calculation; if both the two are existed, the headBit is recorded as the digit group corresponding to the head label, the sideBit represents the digit group corresponding to the side label, and the headBit is aligned&Calculating and setting sideBit,value = headBit &sideBit; meanwhile, the calculation result is put into the result _ map as keyValue = h (headBit, sideBit); after the above two steps are completed, thePutting the calculation result into reorder _ list, setting the intersection element of the head element label and the side element label as 1 to represent that the calculation is finished, and simultaneously adding a row at the last of the track _ status _ table, namely, the side column label is formed byBecome intoAnd adding 1 to the length of the corresponding array compared with the length of the last line.
The aforementioned function h (header, sideBit) represents the number of elements 'bitwise and' next element 1 in the header and sideBit, and also representsThe number of elements in the intersection of (1) is actually expressed asIn hospitalsNumber of patients the hospital visits. Since it is equally divided into m segments for the headBit, then it is availableCan be obtained by the same principleFor anyAndboth should be a collection of equal number elements, and thus the relationship:
due to the fact thatAndthe number of elements is the same and both headBit and sideBit are divided into m segments, so further transformation can be obtained:to this point, the headBit&The result of sideBit can be converted into a solutionThe number of (1) s; assuming that the patient's main index sequence corresponding to the headBit is headEMPISet and the patient's main index sequence corresponding to the sideBit is sideEMPISet after multiple calculations, the patient's main index sequence can be obtainedIn practice it is shown inThe hospitals corresponding to the formed sequence all have the number of patients who have been recorded; thus, it is possible to provideThe results of (a) can be expressed according to the above formula:method of segmentation further according to the aboveCan be expressed as:that is:
for this relationship, for m segments of the 'bitwise and' fractional bit array of operations, the parallel execution can be performed by splitting once using a multi-line technique, corresponding to m threads, each thread performing a corresponding calculation onceM thread pairsPerforming segmented parallel 'bitwise and' calculation to obtain the intersection of digit groupsThe number of 1 in (i.e. means)The number of intersection elements of (2), thereby obtainingHospitals corresponding to the formed sequence all have the number of patients who have undergone the treatment record, so that the total time consumption can be reduced to about 1/m of the original calculation time consumption.
setting upConverting the andeRes sequence into a Long type of longRes, wherein the andeRes represents that the headBit and the sideBit are divided into m sections, and the kth section is subjected to one-time bitwise comparison and calculation to obtain a digit group; long represents 64-bit Long integer data, and longRes represents a value after andRes is converted into Long integer data; definition function solvingThe number of 1 in is count, when longRes is not equal to 0, it is set initiallyIterative computation,Indicating the result of the i-th calculation 1 in the same time as a shift right operation for longRes, i.e. shift right operation,Representing the value converted into long integer data at the i-th calculation untilWhen 0, obtainedIs thatThe number of 1's, thus noting that the function of 1's in the bit array is(ii) a Can be quickly solved within constant time complexity through displacement operationAs a result of (1).
If the intersection element of the table head element label and the table side element label is-1If yes, performing neglect processing to indicate that the execution is in progress and the execution does not need to be repeated; if the condition that the intersection element of the head element label and the side element label is 1 is met, the calculation of the next point is directly skipped, the current point is calculated, and the calculation is not needed.
So far, after one scanning, the calculation process is completed, a new transactional _ status _ table is obtained, and the process is continuously repeated in the threadPool until the number of elements in the reorder _ list is equal toMeanwhile, when the element in the transactional _ status _ table does not have an element in the 0 state, all computations are completed, and the final set sequence intersection full-combination intersection element number of the key-value pairs stored in the restart _ map is the key in the restart _ mapValue is a pair of equations according to the above calculationAndthe value obtained by performing h (header, sideBit) calculation on the corresponding digit group header and sideBit in the reorder _ map is also shownAndthe number of intersection sets of the patient visit records in the corresponding hospital combination. The calculation is completed when all the elements in the trapezoidal _ status _ table are 1, and statistical data of the overlapping number of visits among all different hospitals is also obtained.
One embodiment of the present invention is as follows:
thus can be used forAll have the same upper LIMITs, i.e., LOW _ LIMIT = 1, HIGH _ LIMIT = 20;representing the number of people in any two hospitals who have had correction records for common patients,indicates that any three hospitals have had a doctorThe number of people recorded;,(ii) a InitializationWhereinAre respectively asThe tag name of (1).
Meanwhile, a state ladder table is constructed, the head element is reorder _ list, and the side label initial set of the column list isAs shown in fig. 3;
setting reorder _ map as:
{
}
result _ map is initialized to null;
the calculation is carried out according to the method of the invention, and finally the following can be obtained:
{
}
at the end of the calculation, the transactional _ status _ table is as shown in fig. 4;
result _ map is:
{
}
shown in the hospitalAndthe number of people who have been recorded is 5, and the patients are in hospitalsAnd withThe number of people who have had a recording of medical treatment is 3, and the patients are in hospitalsAnd withThe number of people who have had a record of treatment is 2 in、、The number of people who have had a record of treatment is 2.
Corresponding to the embodiment of the method for counting the number of the patients in the multi-center clinic in parallel in the chained mode, the invention also provides an embodiment of a device for counting the number of the patients in the multi-center clinic in the chained mode in parallel.
Referring to fig. 5, an apparatus for performing chain-based parallel statistics on the number of patients in a multi-center visit according to an embodiment of the present invention includes a memory and one or more processors, where the memory stores executable code, and the processors execute the executable code to implement the method for performing chain-based parallel statistics on the number of patients in a multi-center visit according to the above embodiment.
The embodiment of the device for chain parallel statistics of the number of patients in multi-center treatment can be applied to any equipment with data processing capability, such as computers and the like. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and as a logical device, the device is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for running through the processor of any device with data processing capability. From a hardware aspect, as shown in fig. 5, a hardware structure diagram of any device with data processing capability where the apparatus for chain-type parallel statistics of the number of patients in multi-center visits according to the present invention is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 5, in an embodiment, any device with data processing capability where the apparatus is located may also include other hardware according to the actual function of the any device with data processing capability, which is not described again.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the invention. One of ordinary skill in the art can understand and implement it without inventive effort.
The embodiment of the invention also provides a computer readable storage medium, which stores a program, and when the program is executed by a processor, the method for chain parallel statistics of the number of patients in multi-center visit in the above embodiment is realized.
The computer readable storage medium may be an internal storage unit, such as a hard disk or a memory, of any data processing capability device described in any of the foregoing embodiments. The computer readable storage medium may also be any external storage device of a device with data processing capabilities, such as a plug-in hard disk, a Smart Media Card (SMC), an SD Card, a Flash memory Card (Flash Card), etc. provided on the device. Further, the computer readable storage medium may include both an internal storage unit and an external storage device of any data processing capable device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the arbitrary data processing-capable device, and may also be used for temporarily storing data that has been output or is to be output.
The foregoing is only a preferred embodiment of the present invention, and although the present invention has been disclosed in the preferred embodiments, it is not intended to limit the present invention. Those skilled in the art can make numerous possible variations and modifications to the present teachings, or modify equivalent embodiments to equivalent variations, without departing from the scope of the present teachings, using the methods and techniques disclosed above. For example, the structure for the state table may be selected as other data structures than a ladder table; meanwhile, the storage of the combined tags is not limited to the above list or map method, and the execution of a different method for the state selection of the parallel computing process may be classified as an operation similar to the above idea. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention are within the scope of the technical solution of the present invention, unless the technical essence of the present invention is not departed from the content of the technical solution of the present invention.
Claims (10)
1. A method for counting the number of patients in multi-center clinic in a chain-type parallel manner is characterized by comprising the following steps:
(1) constructing a hospital set and a patient main index set of each hospital, and converting the patient main index set into a bitmap set;
(2) constructing a state trapezoidal table, wherein a table head label recorder _ list is a hospital combined label table, and the initial value isRespectively representing name labels corresponding to the main indexes of the patients in the hospital, and the initial set of the side labels of the column list is(ii) a The elements in the tag of the tag header areThe elements of the table side tag are(ii) a Hospital combined results labeling(ii) a The state value range in the state ladder table is divided into-1, 0 and 1; -1 means start in computation, 0 means initialization, wait in computation, 1 means computation completion;
(3) setting the bitmap calculation result of the intersection set corresponding to the new label obtained by combining the header label and the side label as reorder _ map, and setting the key as the combination of the header label and the side labelValue is obtained by performing 'bitwise and' operation on the digit group corresponding to the head label and the digit group corresponding to the side labelA corresponding new bit array;
(4) setting result _ map for storing the number of intersection elements, and key is the combination of the table head label and the table side labelValue is the number of intersection elements of the main index set of the patients in the hospital corresponding to the head label and the side label;
(5) scanning the state ladder table line by line, carrying out 'bitwise and' calculation on a point with a head table label and a table side label intersection element of 0, carrying out neglect processing on a point with an intersection element of-1, and directly skipping the calculation of the next point on the point with the intersection element of 1; for the point with the intersection element of 0, acquiring the bit array values corresponding to the header label and the side label from the reorder _ map, and if the bit array values corresponding to the header label and the side label exist, acquiring the bit array values corresponding to the side label and the side label, and acquiring the bit array values corresponding to the header label and the side label from the reorder _ mapPut into the header label reorder _ list and simultaneously place the header label into the listAndsetting the intersection point element at the corresponding position in the state trapezoidal table as-1; setting the intersection point element to be 1 after the calculation is finished, putting the calculation result into a result _ map, and finally adding a row of labels on the surface sideAdding 1 to the length of the corresponding array compared with the length of the previous line; repeating the step until the state ladder table is not added with labels and the elements in the table are all 1; the final set sequence intersection full-combination intersection element number of the stored key-value pairs in the restut _ map, namely the patient visit record intersection in the hospital combinationThe number of sets.
2. The method of claim 1, wherein in step (1), the hospital group is constructedN denotes the number of hospitals for the setPatient master index set for the ith hospital in (1)To aEach patient primary index in (1) is a bounded positive integer, that is, the same upper and lower limits exist on the numerical value of the character string of the patient primary index, so that the set obtained by conversion can be obtainedThe corresponding bitmap set isI.e. byThe patient primary index information is present inCorresponding position markers in (1).
4. The method of claim 1, wherein in step (5), the combination of the head label and the side label is used for counting the number of patients in the multi-center clinicIf, ifThe same as either the header or the side tab, indicating that the value for this position has been calculated, is directly marked 1 in the state ladder table at the corresponding position.
5. The method of claim 1, wherein in step (5), the combination of the head label and the side label is used for counting the number of patients in the multi-center clinicAnd if the record _ list is different from the header label and the side label, checking whether the record _ list exists or notIf the calculated position is not 1, the corresponding position intersection point element of the header label and the side label in the state trapezoid table is set to be 1, which indicates that the calculation is already carried out; otherwise, checking first, acquiring whether the digit array values corresponding to the header tag and the side tag exist from the reorder _ map, if not, stopping calculation, and if so, performing subsequent calculation.
6. The method of claim 1, wherein in step (5), the headBit is recorded as the headerThe digit group corresponding to the label, sideBit represents the table side labelCorresponding digit group, defining function h (head bit, side bit) to represent the number of elements 'bit and' back element 1 in head bit and side bit, putting the calculation result into result _ map, and key isValue = h (header bit, sideBit); generated in the middle of the calculationCorresponding new bit array headBit&The sideBit is put into the reorder _ map, and key isValue is header bit& sideBit。
7. The method of claim 1, wherein in the step (5), the bitmap is divided into m segments according to the segmentation rule of the bitmapSplicing is performed, thereby obtaining a relation;It is shown that the splicing operation is performed,indicates the kth segment headerA digit group corresponding to the label;
the same can be obtained,Table side label for indicating k-th segmentCorresponding bit array for arbitraryAndboth should be a collection of equal number elements, and thus the relationship:
due to the fact thatAndthe number of elements is the same and both headBit and sideBit are divided into m segments, so further transformation can be obtained:
this header bit&The result of sideBit is converted into a solutionThe number of (1); assuming that the patient main index sequence corresponding to the headBit is headEMPISet and the patient main index sequence corresponding to the sideBit is sideEMPISet after multiple calculations, the patient main index sequence can be obtainedIn practice it is shown inThe hospitals corresponding to the formed sequence all have the number of patients who have been recorded; thus, it is possible to provideThe results of (a) are expressed as: h (header, sideBit), further expressed according to the method of segmentation h (header, sideBit) as:that is:
for the segmented bit array of m segments of bitwise and operation, the multithreading technology is utilized to carry out parallel execution after one-time splitting, and each thread executes corresponding calculation once corresponding to m threadsM thread pairsPerforming segmented parallel 'bitwise and' calculation to obtain bit array intersectionThe number of 1 in, i.e. meansThereby obtaining the number of intersection elements ofThe hospitals corresponding to the formed sequence all have the number of patients who have been recorded.
8. The method of claim 7, wherein the patient is treated with a plurality of chain-based parallel statisticsThe calculation process of (2) is as follows:
setting upConverting the andes sequence into a Long type of longRes, wherein the andes indicates that the headBit and the sideBit are divided into m sections, and the kth section is subjected to bitwise comparison once and a digit group obtained after calculation; long represents 64-bit Long integer data, and longRes represents a value after andRes is converted into Long integer data; definition function solvingThe number of 1 in is count, when longRes is not equal to 0, it is set initiallyIterative computation,Representing the result of the i-th calculation1 in the same time as a shift right operation for longRes, i.e. shift right operation,Representing the value converted into long integer data at the i-th calculation untilWhen 0, obtainedIs thatThe number of (1).
9. A device for chain-based parallel counting of the number of patients in a multi-center visit, comprising a memory and one or more processors, the memory having stored therein executable code, wherein the processors, when executing the executable code, implement the method for chain-based parallel counting of the number of patients in a multi-center visit according to any one of claims 1 to 8.
10. A computer-readable storage medium, on which a program is stored which, when being executed by a processor, carries out a method of chain parallel statistics multi-center visit of a patient population as set forth in any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210854341.XA CN115083615B (en) | 2022-07-20 | 2022-07-20 | Method and device for chain type parallel statistics of number of patients in multi-center treatment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210854341.XA CN115083615B (en) | 2022-07-20 | 2022-07-20 | Method and device for chain type parallel statistics of number of patients in multi-center treatment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115083615A true CN115083615A (en) | 2022-09-20 |
CN115083615B CN115083615B (en) | 2022-12-06 |
Family
ID=83260422
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210854341.XA Active CN115083615B (en) | 2022-07-20 | 2022-07-20 | Method and device for chain type parallel statistics of number of patients in multi-center treatment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115083615B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150213463A1 (en) * | 2014-01-27 | 2015-07-30 | Umbel Corporation | Systems and Methods of Generating and Using a Bitmap Index |
US9607104B1 (en) * | 2016-04-29 | 2017-03-28 | Umbel Corporation | Systems and methods of using a bitmap index to determine bicliques |
CN107368699A (en) * | 2017-09-19 | 2017-11-21 | 强岳昭 | A kind of hospital admission rate Forecasting Methodology based on existing consultation rate information |
CN110727960A (en) * | 2019-10-16 | 2020-01-24 | 卓尔智联(武汉)研究院有限公司 | Data intersection solving device and method based on privacy protection and readable storage medium |
CN111199800A (en) * | 2018-11-16 | 2020-05-26 | 广州天鹏计算机科技有限公司 | Data processing method and device for patient main index information |
WO2021086257A1 (en) * | 2019-11-01 | 2021-05-06 | Starcounter Ab | System and method for relational database query answering and optimization based on natural algebra of k-relations |
CN113111063A (en) * | 2021-03-31 | 2021-07-13 | 中电健康云科技有限公司 | Medical patient main index discovery method applied to multiple data sources |
CN113934895A (en) * | 2021-09-29 | 2022-01-14 | 浪潮云信息技术股份公司 | Method for assisting in establishing patient main index |
CN114595215A (en) * | 2022-03-10 | 2022-06-07 | 神策网络科技(北京)有限公司 | Data processing method and device, electronic equipment and storage medium |
-
2022
- 2022-07-20 CN CN202210854341.XA patent/CN115083615B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150213463A1 (en) * | 2014-01-27 | 2015-07-30 | Umbel Corporation | Systems and Methods of Generating and Using a Bitmap Index |
US9607104B1 (en) * | 2016-04-29 | 2017-03-28 | Umbel Corporation | Systems and methods of using a bitmap index to determine bicliques |
CN107368699A (en) * | 2017-09-19 | 2017-11-21 | 强岳昭 | A kind of hospital admission rate Forecasting Methodology based on existing consultation rate information |
CN111199800A (en) * | 2018-11-16 | 2020-05-26 | 广州天鹏计算机科技有限公司 | Data processing method and device for patient main index information |
CN110727960A (en) * | 2019-10-16 | 2020-01-24 | 卓尔智联(武汉)研究院有限公司 | Data intersection solving device and method based on privacy protection and readable storage medium |
WO2021086257A1 (en) * | 2019-11-01 | 2021-05-06 | Starcounter Ab | System and method for relational database query answering and optimization based on natural algebra of k-relations |
CN113111063A (en) * | 2021-03-31 | 2021-07-13 | 中电健康云科技有限公司 | Medical patient main index discovery method applied to multiple data sources |
CN113934895A (en) * | 2021-09-29 | 2022-01-14 | 浪潮云信息技术股份公司 | Method for assisting in establishing patient main index |
CN114595215A (en) * | 2022-03-10 | 2022-06-07 | 神策网络科技(北京)有限公司 | Data processing method and device, electronic equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
曾强生: "概念格属性约简算法研究", 《中国优秀硕士学位论文全文数据库》 * |
Also Published As
Publication number | Publication date |
---|---|
CN115083615B (en) | 2022-12-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Myers | The fragment assembly string graph | |
US11841839B1 (en) | Preprocessing and imputing method for structural data | |
Li et al. | Wham: a high-throughput sequence alignment method | |
JP4912646B2 (en) | Gene transcript mapping method and system | |
CN115146865A (en) | Task optimization method based on artificial intelligence and related equipment | |
CN110516810A (en) | A kind of processing method, device, storage medium and the electronic device of quantum program | |
WO2024045989A1 (en) | Graph network data set processing method and apparatus, electronic device, program, and medium | |
Li et al. | A real linear and parallel multiple longest common subsequences (MLCS) algorithm | |
CN103761298B (en) | Distributed-architecture-based entity matching method | |
CN112395401B (en) | Self-adaptive negative sample pair sampling method and device, electronic equipment and storage medium | |
CN115083615B (en) | Method and device for chain type parallel statistics of number of patients in multi-center treatment | |
CN106802787A (en) | MapReduce optimization methods based on GPU sequences | |
CN112949778A (en) | Intelligent contract classification method and system based on locality sensitive hashing and electronic equipment | |
CN111190896B (en) | Data processing method, device, storage medium and computer equipment | |
CN111522730A (en) | Program testing method and device, computer device and computer readable medium | |
US20070239794A1 (en) | Method and system for updating logical information in databases | |
US11482304B2 (en) | Alignment methods, devices and systems | |
CN115114297A (en) | Data lightweight storage and search method and device, electronic equipment and storage medium | |
CN108304467A (en) | For matched method between text | |
US20230012602A1 (en) | String similarity determination | |
CN115169360A (en) | User intention identification method based on artificial intelligence and related equipment | |
CN114579468A (en) | Source item selection software defect prediction method based on semantic metric value | |
CN108897787B (en) | SIMD instruction-based set intersection method and device in graph database | |
CN111737740A (en) | Multi-party sequence data issuing method and system meeting difference privacy | |
CN103793623B (en) | Base sequence recombination system and method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |