Data type variation detection method, device, computer equipment and medium
By updating the classification model on the server side and combining the information entropy and variance calculation methods, the problems of low efficiency and accuracy in data type variation detection are solved, timely virus-carrying information detection in medical scenarios is achieved, and the reliability of the digital medical platform is improved.
Patent Information
- Application Number
- CN202310713654.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-15
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2043-06-15
AI Technical Summary
In existing technologies, the efficiency and accuracy of data type variation detection are low, especially when the artificial intelligence model cannot obtain complete training data. It is difficult to detect data type variation in a timely manner, resulting in insufficient efficiency and accuracy in detecting virus-carrying information in medical scenarios.
By updating the basic classification model on the server side, using data from multiple clients for federated learning, an updated classification model is generated, and combined with information entropy and variance calculation of classification probability, early warning information is generated to detect data type variations.
It improves the accuracy and efficiency of data type mutation detection, enables timely detection of mutated virus-carrying information, and enhances the reliability of the digital medical platform.
Smart Images

Figure CN116662904B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital medical technology, and in particular to a method, device, computer equipment and medium for detecting data type variation. Background Art
[0002] With the development of artificial intelligence technology, data type recognition tasks based on artificial intelligence models have been widely used in digital medical platforms. Digital medical platforms can support functions such as disease auxiliary diagnosis, health management, and remote consultation, thereby improving the efficiency of medical institutions and facilitating residents' medical treatment.
[0003] Data type identification tasks can be applied to scenarios such as virus-carrying information classification within digital medical platforms, thereby accurately classifying virus-carrying information, such as the classification of new coronavirus strains. However, the intelligent model used for data type identification can currently only predict the most likely data category for the input data. If the input data mutates, it still needs to be detected through manual observation and analysis.
[0004] However, manual observation and analysis consumes significant human resources and has low detection efficiency, making it difficult to generate timely detection information to serve as early warnings. Furthermore, in scenarios with high privacy requirements, intelligent models often lack access to comprehensive training data, resulting in low accuracy in data type recognition based on intelligent models. Consequently, variant detection lacks sufficient reliable reference data, resulting in low efficiency and accuracy in data type variant detection. Therefore, improving the accuracy and efficiency of data type variant detection has become an urgent issue. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a method, apparatus, computer device, and medium for detecting data type variations to address the problem of low efficiency and accuracy in detecting data type variations.
[0006] In a first aspect, an embodiment of the present invention provides a method for detecting a variation in a data type, the method comprising:
[0007] Sending N first detection data acquired in a first target time period and their corresponding data types to a server including a basic classification model, where N is an integer greater than zero;
[0008] Receiving an updated classification model sent by the server, where the updated classification model is obtained by the server by updating the basic classification model according to all first detection data and corresponding data types provided by each client;
[0009] inputting at least two second detection data acquired in the second target time period into the updated classification model for category prediction, and outputting the predicted type and classification probability of the corresponding second detection data;
[0010] Calculate the information entropy of all data types to obtain the first information entropy, and calculate the information entropy of all prediction types to obtain the second information entropy;
[0011] When the difference between the second information entropy and the first information entropy is greater than a preset information entropy threshold, the variance of all classification probabilities is calculated. If the variance is greater than the preset variance threshold, a warning message is generated. The warning message is used to express that the type of the second detection data has mutated.
[0012] In a second aspect, an embodiment of the present invention provides a data type variation detection device, the variation detection device comprising:
[0013] A data sending module, configured to send N first detection data acquired in a first target time period and their corresponding data types to a server including a basic classification model, where N is an integer greater than zero;
[0014] a model receiving module, configured to receive an updated classification model sent by the server, wherein the updated classification model is obtained by the server by updating the basic classification model based on all first detection data and corresponding data types provided by each client;
[0015] A category prediction module, configured to input the at least two second detection data acquired in the second target time period into the updated classification model for category prediction, and output a predicted type and a classification probability of the corresponding second detection data;
[0016] An information entropy calculation module is used to calculate the information entropy of all data types to obtain a first information entropy, and calculate the information entropy of all prediction types to obtain a second information entropy;
[0017] The variation warning module is used to calculate the variance of all classification probabilities when the difference between the second information entropy and the first information entropy is greater than a preset information entropy threshold. If the variance is greater than the preset variance threshold, a warning message is generated. The warning message is used to express that the type of the second detection data has mutated.
[0018] In a third aspect, an embodiment of the present invention provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the variation detection method as described in the first aspect is implemented.
[0019] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the variation detection method as described in the first aspect is implemented.
[0020] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0021] N first detection data and their corresponding data types acquired during a first target time period are sent to a server comprising a basic classification model. An updated classification model is received from the server. The updated classification model is obtained by updating the basic classification model based on all first detection data and their corresponding data types provided by each client. At least two second detection data acquired during a second target time period are respectively input into the updated classification model for category prediction. The predicted type and classification probability of the corresponding second detection data are output. The information entropy of all data types is calculated to obtain a first information entropy. The information entropy of all predicted types is calculated to obtain a second information entropy. When the difference between the second information entropy and the first information entropy is greater than a preset information entropy threshold, the variance of all classification probabilities is calculated. If the variance is greater than the preset variance threshold, an early warning message is generated. The early warning message indicates that the type of the second detection data has mutated. The server combines data from multiple clients to perform model updates, thereby increasing the classification accuracy of the updated classification model. Based on information entropy comparison, abnormalities in the client's local detection data are determined, facilitating timely discovery of mutated data types and issuing early warnings, thereby improving the accuracy and efficiency of data type mutation detection. This allows for timely detection of mutated virus-carrying information in medical scenarios, thereby improving the reliability of the digital medical platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0023] Figure 1 This is a schematic diagram of an application environment of a data type variation detection method provided in the first embodiment of the present invention;
[0024] Figure 2 This is a flow chart of a method for detecting a variation in a data type provided in the first embodiment of the present invention;
[0025] Figure 3 This is a schematic diagram of the structure of a data type variation detection device provided in the second embodiment of the present invention;
[0026] Figure 4 This is a structural diagram of a computer device provided in Example 3 of the present invention. DETAILED DESCRIPTION
[0027] In the following description, specific details such as particular system structures and techniques are provided for purposes of illustration, not limitation, to facilitate a thorough understanding of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
[0028] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0029] It will also be understood that the term "and / or" used in the present description and appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0030] As used in the present specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0031] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0032] References to "one embodiment" or "some embodiments" in the present specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present invention. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0033] Embodiments of the present invention can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.
[0034] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0035] It should be understood that the order of execution of the steps in the following embodiments does not necessarily mean the order in which they are executed. The order in which each process is executed should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0036] In order to illustrate the technical solution of the present invention, specific embodiments are provided below.
[0037] A data type variation detection method provided in the first embodiment of the present invention can be applied to Figure 1 The application environment in which the client communicates with the server. The client includes but is not limited to computer devices such as PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud terminal devices, and personal digital assistants (PDAs). The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0038] The client and server can be deployed in the digital medical platform, which can support functions such as auxiliary disease diagnosis, health management, and remote consultation, thereby improving the efficiency of medical institutions and facilitating residents' medical treatment. The client can provide data type variation detection tasks to conduct timely detection of mutations such as virus-carrying information and strain types in medical scenarios, thereby improving the efficiency of data type detection.
[0039] See also Figure 2 , is a flow chart of a method for detecting a variation of a data type provided by the first embodiment of the present invention. The above-mentioned variation detection method can be applied to Figure 1 The client in the joint system belongs to a joint system, which may include a server and multiple clients. The computer device corresponding to the client communicates with the server to send the first detection data of the client and its corresponding data type to the server to provide training data for the server to train the basic classification model. The computer device corresponding to the client receives the updated classification model sent by the server. The updated classification model may refer to an updated classification model. Figure 2 As shown, the variation detection method may include the following steps:
[0040] Step S201: Send N first detection data acquired in a first target time period and their corresponding data types to a server including a basic classification model.
[0041] Among them, the first target time period can be used to determine the time period for collecting data, N is an integer greater than zero, the first detection data can refer to the detection data to be used as training data, and the data type corresponding to the first detection data can refer to the data category to which the first detection data belongs. In this embodiment, the virus-carrying information category is taken as an example. Specifically, the strain type of the new coronavirus is used as the data category to which the first detection data belongs. The strain type can include alpha, beta, delta, and omicron strain types. Accordingly, the first detection data at this time can be the nucleic acid detection data of the new coronavirus.
[0042] The server may refer to a central server in a joint system. In the joint system, the central server communicates with multiple clients separately, but the multiple clients do not communicate with each other to ensure the privacy of local data. The basic classification model may refer to a classification model to be updated, and the classification model to be updated may be a pre-trained classification model.
[0043] Specifically, in this embodiment, the server should be a trusted server, that is, each client can trust the server to protect the privacy of its local data.
[0044] When each client collects data locally, the same first target time period may be used. For example, the unit of data collection may be days, and the first target time period may be from 0:00 to 24:00 every day.
[0045] In one embodiment, the first target time periods used by each client may be different. For example, the first target time period of client A is from 0:00 to 24:00 every day, and the first target time period of client B is Monday and Tuesday of each week, etc. However, it should be noted that regardless of whether the first target time periods are the same, each client should send the collected data to the server before the receiving deadline set by the server. For example, the receiving deadline can be set to Friday of each week.
[0046] The above step of sending the N first detection data and their corresponding data types obtained in the first target time period to the server containing the basic classification model can send local data to the server in the form of multiple clients, thereby providing the server with sufficiently rich data for training the basic classification model, improving the classification accuracy of the trained updated classification model, and effectively protecting the privacy of local data.
[0047] Step S202: receiving the updated classification model sent by the server.
[0048] The updated classification model is obtained by the server updating the basic classification model according to all first detection data and corresponding data types provided by each client.
[0049] Specifically, the server uses a received first detection data and its corresponding data type as a group of training samples and their labels, and combines all groups of training samples and their labels to train the basic classification model deployed by the server. The loss function used in the training can be a cross-entropy loss function. It should be noted that the basic classification model can refer to a pre-trained classification model, that is, each time the server is updated, the pre-trained classification model is used as the basic classification model.
[0050] In one embodiment, the server can use the last updated classification model as the basic classification model. In this case, each update can retain a portion of the learned knowledge and learn the knowledge of all group training samples and labels at the time of the update.
[0051] In one embodiment, the client can also train the classification model installed locally on the client. The local classification model of the client can be a pre-trained classification model or an updated classification model sent by the server during the last update. The client uses all local first detection data and their corresponding data types as local training samples and their corresponding labels to train the local classification model. The training loss function can still use the cross-entropy loss function. After the local classification model training is completed, the client directly sends the model parameters of the local classification model to the server. The server integrates the model parameters of the local classification models provided by multiple clients to obtain the model parameters of the updated classification model, and then distributes the model parameters of the updated classification model to each client, thereby further improving the privacy of the client's local data. That is, only the local client can know the specific content of the local data, and other clients and the server cannot obtain the specific content of the local data, but the model parameters of the updated classification model provided by the server can learn knowledge of the local data of multiple clients.
[0052] Optionally, updating the base classification model includes:
[0053] Get the basic model parameters of the basic classification model;
[0054] Update the basic model parameters according to all the first detection data provided by each client and their corresponding data types to obtain updated model parameters;
[0055] The basic model parameters and the updated model parameters are added together, and the added result is determined to be the target model parameters. The basic classification model is configured according to the target model parameters to obtain the updated classification model.
[0056] Among them, the basic model parameters can refer to the model parameters of the basic classification model, the updated model parameters can be used to represent the knowledge learned based on all the first detection data provided by each client and their corresponding data types, and the target model parameters can be used to configure the classification model to obtain an updated classification model.
[0057] Specifically, the calculation method of the basic model parameters and the updated model parameters may also include mean calculation, weighted sum calculation, weighted mean calculation, etc., with the calculation results being used as the target model parameters.
[0058] After the server configures the basic classification using the target model parameters, it needs to distribute the target model parameters to each client so that the client can configure the local classification model.
[0059] Optionally, the basic model parameters are updated according to all first detection data provided by each client and their corresponding data types, and the updated model parameters include:
[0060] Counting the total amount of all first detection data provided by all clients, and for any client, updating the basic model parameters according to all the first detection data provided by the client and their corresponding data types to obtain first sub-model parameters;
[0061] Counting the first quantity of all first detection data provided by the client, and comparing the first quantity with the total quantity to obtain a reference weight corresponding to the client;
[0062] Multiplying the first sub-model parameter and the reference weight, and determining the multiplication result as the weighted sub-model parameter;
[0063] Traverse all clients, obtain weighted sub-model parameters corresponding to the clients, add all weighted sub-model parameters, and determine the addition result as the updated model parameter.
[0064] The total number may refer to the sum of all first detection data received by the server during the update time period, and the update time period may refer to the time range between the last update time and the current update time of the server.
[0065] The first sub-model parameter may refer to the result of updating the basic model parameter based on the data provided by a single client, the first quantity may refer to the total number of first detection data provided by a single client during the update time period, the reference weight may be used to characterize the contribution of a single client to the amount of data used for updating, and the weighted sub-model parameter may be used to characterize the modified sub-model parameter after the first sub-model parameter is combined with the contribution of the corresponding client.
[0066] Specifically, the larger the reference weight is, the more data the corresponding client provides for the current update. Accordingly, the knowledge learned based on the data provided by the client should have a greater influence when updating the classification model. Therefore, the product of the reference weight and the first sub-model parameter of the corresponding client is used as the weighted sub-model parameter. It should be noted that the parameter calculation method of all weighted sub-models can also include mean calculation, etc.
[0067] The above step of receiving the updated classification model sent by the server enables the client to obtain the updated classification model after the server performs federated learning, thereby deploying a classification model with stronger generalization ability and higher accuracy for each client, thereby improving the accuracy of subsequent type predictions.
[0068] Step S203 : Inputting at least two second detection data acquired in the second target time period into the updated classification model respectively for category prediction, and outputting the predicted type and classification probability of the corresponding second detection data.
[0069] Among them, the second target time period can also be used to determine the time period for collecting data, but it should be noted that the starting time of the second target time period should be later than the end time of the first target time period, that is, all second detection data collected in the second target time period are predicted by the updated classification model. The second detection data may refer to the local detection data collected by the client in the second target time period, the prediction type may refer to the prediction result of the updated classification model corresponding to the second detection data, the classification probability may refer to the probability that the corresponding second detection data belongs to the predicted type, and the prediction type may belong to any data type.
[0070] Optionally, at least two second detection data acquired in the second target time period are respectively input into the updated classification model for category prediction, and outputting the prediction type and classification probability of the corresponding second detection data includes:
[0071] For any second detection data, input the second detection data into the updated classification model to perform category prediction, and output the prediction probabilities of the second detection data corresponding to M preset categories, where M is an integer greater than zero;
[0072] Determine the maximum value among all predicted probabilities as the classification probability of the second detection data, and use the preset type corresponding to the classification probability as the predicted type of the second detection data;
[0073] All second detection data are traversed to obtain the predicted type and classification probability corresponding to the second detection data.
[0074] The preset type may correspond to the data type, that is, one preset type has a corresponding data type, and M may be used to represent the number of all data types.
[0075] Specifically, the classification model is updated to predict that the second detection data input belongs to the prediction values of different preset types respectively. The M prediction values output by a single second detection data are normalized by a normalized exponential function respectively, and the normalized result is determined to be the prediction probability of the second detection data corresponding to each preset type. It should be noted that the sum of the prediction probabilities of the second detection data corresponding to all preset types is 1.
[0076] If a predicted probability is the maximum value among all predicted probabilities, it means that the possibility that the input second detection data belongs to the preset type corresponding to the predicted probability is the greatest, and the maximum value is used as the classification probability of the second detection data.
[0077] Step S204 , calculating the information entropy of all data types to obtain a first information entropy, and calculating the information entropy of all prediction types to obtain a second information entropy.
[0078] The first information entropy can be used to characterize the uncertainty of the data type corresponding to all the first detection data, and the second information entropy can be used to characterize the uncertainty of the prediction type corresponding to all the second detection data.
[0079] Optionally, calculating the information entropy of all data types to obtain the first information entropy includes:
[0080] Counting the number of first detection data belonging to each data type among the N first detection data, comparing the number of the corresponding data type with N, and determining the ratio as a first reference probability of the corresponding data type;
[0081] The first information entropy is calculated based on the first reference probabilities corresponding to all data types and the information entropy function.
[0082] Among them, the first reference probability can be used to characterize the probability that any first detection data belongs to the corresponding data type. This probability is a statistical probability, that is, it can be understood as the probability that any first detection data selected from all the first detection data belongs to the corresponding data type.
[0083] Specifically, the calculation formula of the first information entropy can be expressed as:
[0084]
[0085] Wherein, H(X) may refer to the first information entropy of the data type corresponding to all first detection data, x m It can refer to the mth data type, where M is the total number of data types, p(x m ) may refer to the first reference probability of the m-th data type.
[0086] Optionally, calculating the information entropy of all prediction types to obtain the second information entropy includes:
[0087] Counting the number of second detection data belonging to each prediction type among all the second detection data, comparing the number of the corresponding prediction type with the total number of all the second detection data, and determining the ratio as a second reference probability of the corresponding prediction type;
[0088] The second information entropy is calculated based on the second reference probabilities corresponding to all prediction types and the information entropy function.
[0089] Among them, the second reference probability can be used to characterize the probability that any second detection data belongs to the corresponding prediction type. This probability is also a statistical probability, that is, it can be understood as the probability that any second detection data from all the second detection data belongs to the corresponding prediction type.
[0090] Specifically, the calculation formula of the first information entropy can be expressed as:
[0091]
[0092] Among them, H(Y) can refer to the second information entropy of all second detection data corresponding to the prediction type, y m It can refer to the mth prediction type. The total number of prediction types is the same as the total number of data types, which is also M. p(y m ) may refer to the second reference probability of the m-th prediction type.
[0093] The above steps of calculating the information entropy of all data types to obtain the first information entropy, calculating the information entropy of all predicted types to obtain the second information entropy, characterize the uncertainty of the data types corresponding to all first detection data and the uncertainty of the predicted types corresponding to all second detection data through information entropy, so that the change in the uncertainty can be quantified, which facilitates the subsequent analysis of local data mutations based on the first information entropy and the second information entropy, and improves the accuracy of data type mutation detection.
[0094] Step S205 , when the difference between the second information entropy and the first information entropy is greater than a preset information entropy threshold, the variance of all classification probabilities is calculated, and if the variance is greater than the preset variance threshold, a warning message is generated.
[0095] Among them, the warning information is used to express the variation of the type of the second detection data, the variance can characterize the stability of all classification probabilities, and the information entropy threshold can be used to judge whether the information entropy has changed significantly. The significant change is usually due to the abnormality of the data type, which leads to an abnormal increase in the detection data under a certain data type. The variance threshold can be used to judge whether the deviation between the classification probabilities is too large. The deviation between the classification probabilities is usually caused by the small classification probability of some detection data. The small classification probability indicates that the classification model may not have learned the knowledge of this type of detection data during training, and only assigned it to the corresponding prediction type due to the limitation of the classification task.
[0096] Specifically, after calculating the difference between the second information entropy and the first information entropy, the absolute value of the difference can be calculated, and the absolute value calculation result can be compared with the preset information entropy threshold. If the absolute value calculation result is greater than the preset information entropy threshold, in this embodiment, the information entropy threshold can be set to 0.2. The implementer can adjust the information entropy threshold according to actual conditions, indicating that the amount of information contained in the detection data collected locally by the client has changed significantly. The reason for the significant change is that in addition to the first detection data that conforms to the original distribution, there are other first detection data, and these other first detection data do not have corresponding data types in the classification model, resulting in the classification model misclassifying these other first detection data into known data types when performing the classification task, resulting in a significant change in information entropy.
[0097] The process of calculating the variance of all classification probabilities and comparing the variance with the variance threshold can be considered as a verification step, that is, by comparing the difference between the second information entropy and the first information entropy with the preset information entropy threshold, it is determined that there may be a data type anomaly, and by comparing the variance with the variance threshold, it is further determined whether it is a data type anomaly.
[0098] Since the updated classification model is updated dynamically, the default updated classification model can learn the knowledge of the detection data in a timely manner, that is, for detection data of known data types, the updated classification model can output a classification probability close to 1. If detection data of abnormal data types appear, the updated classification model can still output the classification probability, but the classification probability will be smaller at this time, for example, the classification probability is 0.5. At this time, the detection data of the abnormal data type is only more likely to belong to the predicted type than other data types. Therefore, the variance of the classification probability can be used to determine whether such detection data exists.
[0099] Optionally, after detecting that the difference between the second information entropy and the first information entropy is greater than a preset information entropy threshold, the method further includes:
[0100] For any data type, obtain the proportion of all first detection data belonging to the data type in the N first detection data to obtain a first ratio;
[0101] Obtaining a proportion of each second detection data item belonging to the same prediction type as the data type in all second detection data items to obtain a second ratio;
[0102] Taking the difference between the second ratio and the first ratio as the new ratio of the data type, traverse all data types to obtain the new ratio of the corresponding data type, and determine the data type corresponding to the maximum value of the new ratio as the target type;
[0103] Accordingly, the variance of all classification probabilities is calculated. If the variance is greater than the preset variance threshold, a warning message is generated including:
[0104] The variance of the classification probabilities corresponding to all second detection data belonging to the target type is calculated, and if the variance is greater than a preset variance threshold, a warning message is generated.
[0105] The first ratio may be used to characterize the proportion of first detection data of the corresponding data type in all first detection data, and the first ratio may be used to characterize the proportion of second detection data of the corresponding prediction type in all second detection data.
[0106] The newly added ratio may be used to characterize the degree of change in the amount of detection data of the corresponding data type, and the target type may refer to the data type that is most likely to contain abnormal detection data.
[0107] Specifically, the data type corresponding to the maximum value of the newly added ratio is the data type with the largest degree of change in the corresponding detection data volume, and this data type is more likely to contain detection data of an abnormal data type.
[0108] In one embodiment, the top K data types with the largest new addition ratios may be determined as target types, and the variance corresponding to each target type may be calculated respectively, and then compared with the variance threshold to avoid omissions. In this embodiment, the variance threshold may be set to 5.
[0109] Accordingly, after determining the target type, the presence of test data of abnormal data types can be detected only by the variance change of the classification probability corresponding to the target type, thereby effectively reducing the amount of calculation and improving the calculation efficiency and detection efficiency.
[0110] In this embodiment, the server combines the data of multiple clients to update the model, so that the classification accuracy of the updated classification model is higher. According to the information entropy comparison, it is determined that the local detection data of the client has abnormal conditions, which facilitates the timely discovery of mutated data types and early warning, thereby improving the accuracy and efficiency of data type mutation detection, so that mutated virus-carrying information can be detected in a timely manner in medical scenarios, and the reliability of the digital medical platform is improved.
[0111] Corresponding to the data type variation detection method of the above embodiment, Figure 3The following is a block diagram of a data type variation detection device provided in a second embodiment of the present invention. The variation detection device is applied to a client, which is part of a joint system. The joint system may include a server and multiple clients. The computer device corresponding to the client communicates with the server to send the client's local first detection data and its corresponding data type to the server, providing training data for the server to train a basic classification model. The computer device corresponding to the client receives an updated classification model sent by the server. The updated classification model may refer to an updated classification model. For ease of explanation, only the portions relevant to the embodiment of the present invention are shown.
[0112] See also Figure 3 , the variation detection device comprises:
[0113] A data sending module 31 is configured to send N first detection data acquired in a first target time period and their corresponding data types to a server including a basic classification model, where N is an integer greater than zero;
[0114] The model receiving module 32 is configured to receive an updated classification model sent by the server, where the updated classification model is obtained by the server by updating the basic classification model based on all first detection data and their corresponding data types provided by each client;
[0115] A category prediction module 33 is configured to input the at least two second detection data acquired in the second target time period into the updated classification model for category prediction, and output a predicted type and a classification probability of the corresponding second detection data;
[0116] An information entropy calculation module 34 is configured to calculate the information entropy of all data types to obtain a first information entropy, and calculate the information entropy of all prediction types to obtain a second information entropy;
[0117] The variation warning module 35 is used to calculate the variance of all classification probabilities when the difference between the second information entropy and the first information entropy is greater than a preset information entropy threshold. If the variance is greater than the preset variance threshold, a warning message is generated. The warning message is used to express that the type of the second detection data has mutated.
[0118] Optionally, the variation detection device further includes:
[0119] A parameter acquisition module is used to obtain basic model parameters of the basic classification model;
[0120] A model updating module, configured to update basic model parameters according to all first detection data and corresponding data types provided by each client, to obtain updated model parameters;
[0121] The parameter configuration module is used to add the basic model parameters and the updated model parameters, determine the addition result as the target model parameters, configure the basic classification model according to the target model parameters, and obtain the updated classification model.
[0122] Optionally, the model updating module includes:
[0123] a sub-parameter acquisition unit, configured to count the total amount of all first detection data provided by all clients, and for any client, update the basic model parameters according to all the first detection data provided by the client and their corresponding data types to obtain first sub-model parameters;
[0124] A weight calculation unit, configured to count a first quantity of all first detection data provided by the client, and compare the first quantity with the total quantity to obtain a reference weight corresponding to the client;
[0125] a parameter weighting unit, configured to multiply the first sub-model parameter and the reference weight, and determine the multiplication result as the weighted sub-model parameter;
[0126] The parameter determination unit is used to traverse all clients, obtain weighted sub-model parameters corresponding to the clients, add all weighted sub-model parameters, and determine the addition result as the updated model parameter.
[0127] Optionally, the category prediction module 33 includes:
[0128] a probability prediction unit, configured to input the second detection data into the updated classification model for category prediction for any second detection data, and output prediction probabilities of the second detection data corresponding to M preset categories, where M is an integer greater than zero;
[0129] a type determination unit, configured to determine a maximum value among all predicted probabilities as a classification probability of the second detection data, and use a preset type corresponding to the classification probability as the predicted type of the second detection data;
[0130] The data traversal unit is used to traverse all the second detection data to obtain the prediction type and classification probability of the corresponding second detection data.
[0131] Optionally, the information entropy calculation module 34 includes:
[0132] a first probability calculation unit, configured to count the number of first detection data belonging to each data type in the N first detection data, compare the number of the corresponding data type with N, and determine the ratio as a first reference probability of the corresponding data type;
[0133] The first information entropy calculation unit is used to calculate the first information entropy according to the first reference probabilities corresponding to all data types and the information entropy function.
[0134] Optionally, the information entropy calculation module 34 includes:
[0135] a second probability calculation unit, configured to count the number of second detection data belonging to each prediction type among all the second detection data, compare the number of the corresponding prediction type with the total number of all the second detection data, and determine the ratio as a second reference probability of the corresponding prediction type;
[0136] The second information entropy calculation unit is used to calculate the second information entropy according to the second reference probabilities corresponding to all prediction types and the information entropy function.
[0137] Optionally, the variation detection device further includes:
[0138] A first ratio calculation module is configured to obtain, for any data type, a proportion of all first detection data belonging to the data type in N first detection data to obtain a first ratio;
[0139] A second ratio calculation module is used to obtain a proportion of each second detection data belonging to the same prediction type as the data type in all the second detection data to obtain a second ratio;
[0140] a target type determination module, configured to use the difference between the second ratio and the first ratio as the new ratio of the data type, traverse all data types, obtain the new ratio of the corresponding data type, and determine the data type corresponding to the maximum value of the new ratio as the target type;
[0141] Accordingly, the above-mentioned mutation warning module 35 includes:
[0142] The variance calculation unit is used to calculate the variance of the classification probabilities corresponding to all the second detection data belonging to the target type, and generate warning information if the variance is greater than a preset variance threshold.
[0143] It should be noted that the information interaction, execution process, etc. between the above-mentioned modules and units are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0144] Figure 4 This is a schematic diagram of the structure of a computer device provided in the third embodiment of the present invention. Figure 4 As shown, the computer device of this embodiment includes: at least one processor ( Figure 4 Only one is shown), a memory, and a computer program stored in the memory and executable on at least one processor, wherein when the processor executes the computer program, the steps of any of the above-mentioned variant detection method embodiments are implemented.
[0145] The computer device may include, but is not limited to, a processor and a memory. It will be understood by those skilled in the art that Figure 4 The above is merely an example of a computer device and does not constitute a limitation on the computer device. The computer device may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include a network interface, a display screen, and an input device.
[0146] The processor may be a CPU, or other general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. A general-purpose processor may be a microprocessor, or any conventional processor.
[0147] The memory includes a readable storage medium, an internal memory, etc., wherein the internal memory can be the memory of a computer device, and the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The readable storage medium can be the hard disk of the computer device, and in other embodiments, it can also be an external storage device of the computer device, for example, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Furthermore, the memory can also include both the internal storage unit of the computer device and the external storage device. The memory is used to store the operating system, application programs, boot loaders (BootLoader), data, and other programs, such as the program code of the computer program. The memory can also be used to temporarily store data that has been output or is about to be output.
[0148] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, it can implement the steps of the above-mentioned method embodiment. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include at least: any entity or device capable of carrying computer program code, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0149] The present invention may implement all or part of the processes in the above-mentioned method embodiments, and may also be completed through a computer program product. When the computer program product runs on a computer device, the computer device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0150] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0151] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0152] In the embodiments provided by the present invention, it should be understood that the disclosed apparatus / computer equipment and methods can be implemented in other ways. For example, the apparatus / computer equipment embodiments described above are merely illustrative. For example, the division of modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0153] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0154] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.
Claims
1. A method for detecting variation of data types, characterized in that: The method is used for a client in a joint system, the joint system also including a server, and the variation detection method includes: Sending N first detection data acquired in a first target time period and their corresponding data types to a server including a basic classification model, where N is an integer greater than zero; Receiving an updated classification model sent by the server, where the updated classification model is obtained by the server by updating the basic classification model according to all first detection data provided by each client and their corresponding data types; inputting at least two second detection data acquired in the second target time period into the updated classification model for category prediction, and outputting the predicted type and classification probability of the corresponding second detection data; Calculate the information entropy of all data types to obtain the first information entropy, and calculate the information entropy of all prediction types to obtain the second information entropy; When the difference between the second information entropy and the first information entropy is greater than a preset information entropy threshold, the variance of all classification probabilities is calculated. If the variance is greater than the preset variance threshold, a warning message is generated. The warning message is used to express that the type of the second detection data has mutated.
2. The variation detection method according to claim 1, wherein: The updating of the basic classification model includes: Obtaining basic model parameters of the basic classification model; updating the basic model parameters according to all the first detection data provided by the respective clients and their corresponding data types to obtain updated model parameters; The basic model parameters and the updated model parameters are added together, and the added result is determined to be the target model parameters. The basic classification model is configured according to the target model parameters to obtain the updated classification model.
3. The variation detection method according to claim 2, wherein: The updating of the basic model parameters according to all the first detection data provided by the respective clients and their corresponding data types to obtain updated model parameters includes: Counting the total amount of all first detection data provided by all clients, and for any client, updating the basic model parameters according to all the first detection data provided by the client and their corresponding data types to obtain first sub-model parameters; Counting a first quantity of all first detection data provided by the client, and comparing the first quantity with the total quantity to obtain a reference weight corresponding to the client; multiplying the first sub-model parameter and the reference weight to determine the multiplication result as the weighted sub-model parameter; Traverse all clients to obtain weighted sub-model parameters corresponding to the clients, add all weighted sub-model parameters, and determine the addition result as the updated model parameter.
4. The variation detection method according to claim 1, wherein: The step of inputting the at least two second detection data acquired in the second target time period into the updated classification model for category prediction, and outputting the prediction type and classification probability of the corresponding second detection data includes: For any second detection data, input the second detection data into the updated classification model to perform category prediction, and output the prediction probabilities of the second detection data corresponding to M preset categories, where M is an integer greater than zero; Determine a maximum value among all predicted probabilities as the classification probability of the second detection data, and use a preset type corresponding to the classification probability as the predicted type of the second detection data; All second detection data are traversed to obtain the predicted type and classification probability of the corresponding second detection data.
5. The variation detection method according to claim 1, wherein: Calculating the information entropy of all data types to obtain the first information entropy includes: Among the N first detection data, the number of first detection data belonging to each data type is counted, and the ratio of the number of the corresponding data type to N is compared to determine a first reference probability of the corresponding data type; The first information entropy is calculated based on the first reference probabilities corresponding to all data types and the information entropy function.
6. The variation detection method according to claim 1, wherein: Calculating the information entropy of all prediction types to obtain the second information entropy includes: Counting the number of second detection data belonging to each prediction type among all the second detection data, comparing the number of the corresponding prediction type with the total number of all the second detection data, and determining the ratio as a second reference probability of the corresponding prediction type; The second information entropy is calculated based on the second reference probabilities corresponding to all prediction types and the information entropy function.
7. The variation detection method according to any one of claims 1 to 6, characterized in that: After detecting that the difference between the second information entropy and the first information entropy is greater than a preset information entropy threshold, the method further includes: For any data type, obtaining a proportion of all first detection data belonging to the data type in the N first detection data to obtain a first ratio; Obtaining a proportion of each second detection data belonging to the same prediction type as the data type in all second detection data to obtain a second ratio; Taking the difference between the second ratio and the first ratio as the new ratio of the data type, traversing all data types to obtain the new ratios of corresponding data types, and determining the data type corresponding to the maximum value of the new ratio as the target type; Accordingly, the calculation of the variance of all classification probabilities, if the variance is greater than a preset variance threshold, generating warning information includes: The variance of the classification probabilities corresponding to all the second detection data belonging to the target type is calculated, and if the variance is greater than a preset variance threshold, the warning information is generated.
8. A data type variation detection device, characterized in that: The variation detection device comprises: A data sending module, configured to send N first detection data acquired in a first target time period and their corresponding data types to a server including a basic classification model, where N is an integer greater than zero; a model receiving module, configured to receive an updated classification model sent by the server, wherein the updated classification model is obtained by the server by updating the basic classification model based on all first detection data and corresponding data types provided by each client; A category prediction module, configured to input the at least two second detection data acquired in the second target time period into the updated classification model for category prediction, and output a predicted type and a classification probability of the corresponding second detection data; An information entropy calculation module is used to calculate the information entropy of all data types to obtain a first information entropy, and calculate the information entropy of all prediction types to obtain a second information entropy; The variation warning module is used to calculate the variance of all classification probabilities when the difference between the second information entropy and the first information entropy is greater than a preset information entropy threshold. If the variance is greater than the preset variance threshold, a warning message is generated. The warning message is used to express that the type of the second detection data has mutated.
9. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the variation detection method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the variation detection method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Network attack detection method, device and equipment and storage medium
CN109951491A
User screening method, related device and storage medium
CN114820085A