A method, device, electronic device and storage medium for generating water sample code

Coding water sample data through a mapping relationship that matches the database solves the problem of data inconsistency caused by differences in recording habits and achieves standardized coding and efficient traceability of water samples.

CN118394832BActive Publication Date: 2024-10-11SHENZHEN WATER GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410865522.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2024-10-11
Estimated Expiration
2044-07-01

AI Technical Summary

Technical Problem

The existing water sample recording method results in inconsistent data recording due to differences in staff's professional background and recording habits, which increases the complexity of data integration and the diversification of similar data encoding forms, hindering the unified processing of data and the traceability of water samples.

Method used

By determining that the detection data of the target water sample matches the database, the preset mapping relationship is used for data coding to generate a unified coding sequence. If there is no match, coding is performed according to the mapping relationship with the highest similarity to ensure that the data is converted into standardized coding.

Benefits of technology

It achieves standardized coding of water sample data from different sources and formats, simplifies subsequent queries and traceability, improves the consistency and accuracy of data records, and reduces the complexity of analysis and processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118394832B_ABST
    Figure CN118394832B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of water sample detection, and in particular to a method, device, electronic device and storage medium for generating a water sample code, the method comprising: determining first detection data of a target water sample; in response to the first detection data matching a first detection database, encoding the first detection data based on a first mapping relationship to obtain a first coding sequence of the target water sample; in response to the first detection data not matching the first detection database, encoding the first detection data based on a second mapping relationship to obtain a second coding sequence of the target water sample; determining the sample code of the target water sample based on the first coding sequence or the second coding sequence, effectively solving the data processing problem caused by differences in staff levels and diverse data recording habits, improving the consistency and accuracy of data recording, and making the analysis and processing of water samples more efficient and convenient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of water sample processing, and in particular to a method, device, electronic device and storage medium for generating a water sample code. Background Art

[0002] Water quality testing plays a vital role in protecting human health and safety, maintaining natural ecological balance, and promoting sustainable development. This testing process is not only directly related to the safety of our daily water use, but also has a profound impact on the state of the ecological environment and the long-term planning of social economy. In order to ensure accurate and reliable water quality data, the water samples collected by each unit must undergo a series of rigorous testing procedures.

[0003] The collection of water samples runs through every aspect from daily life to industrial production, and constitutes the basis of water quality testing. Given the differences in test items, the corresponding test processes and methods will also change to adapt to different test needs. This flexibility not only reflects the diversity of testing technologies, but also ensures that we can adopt corresponding testing strategies for specific water quality issues. At the same time, in order to ensure the traceability of data, it is crucial to keep a detailed record of each water sample and its testing process. This will not only improve the overall efficiency of water quality testing, but also provide strong support for subsequent data analysis.

[0004] Although relevant standards and specifications for water sample recording already exist, in practice, differences in professional background, experience, and recording habits of staff lead to confusion in data recording methods. This inconsistency not only increases the complexity of data integration, but also leads to a diversification of coding forms for similar data, which seriously hinders the unified processing and analysis of data. In addition, this recording method also makes it difficult to trace the source of water samples, greatly hindering the smooth progress of subsequent analysis and research work. Summary of the invention

[0005] In order to overcome the deficiencies of the prior art, the present application provides a method, device, electronic device and storage medium for generating water sample codes, which can improve the efficiency of water sample recording.

[0006] The technical means adopted by the present invention to solve its technical problems are: a method for generating a water sample code, the improvement of which lies in that it includes: determining the first detection data of a target water sample; in response to the first detection data matching a first database, data encoding the first detection data based on a first mapping relationship to obtain a first coding sequence of the target water sample; the first database includes multiple data mapping relationships, and the first mapping relationship is a mapping relationship in the first database that matches the first detection data; in response to the first detection data not matching the first database, data encoding the first detection data based on a second mapping relationship to obtain a second coding sequence of the target water sample; the second mapping relationship is the mapping relationship in the first database with the highest similarity to the first detection data; and determining the sample code of the target water sample based on the first coding sequence or the second coding sequence.

[0007] After determining the first detection data of the target water sample as described in the above technical solution, the method also includes: determining a first detection data type of the first detection data; determining multiple second detection data types corresponding to each data mapping relationship in the first database; if there is a data type that is the same as the first detection data type among the multiple second detection data types, it is determined that the first detection data matches the first database; if there is no data type that is the same as the first detection data type among the multiple second detection data types, it is determined that the first detection data does not match the first database.

[0008] Before the first detection data is encoded based on the second mapping relationship to obtain the second coding sequence of the target water sample described in the above technical solution, the method also includes: converting the first detection data into a first vector, the dimension of the first vector is consistent with the number of data types of the detection data of the water sample; determining the data mapping feature vector corresponding to each data mapping relationship in the first database; calculating the similarity between the first vector and the data mapping feature vector corresponding to each data mapping relationship, and obtaining multiple similarities; selecting the data mapping relationship corresponding to the highest similarity as the second mapping relationship.

[0009] In the above technical solution, the first detection data includes multiple categories of second detection data; the data encoding of the first detection data based on the first mapping relationship to determine the first coding sequence includes: data mapping the multiple categories of second detection data respectively based on the first mapping relationship to obtain multiple first standard data; data encoding the multiple first standard data based on the first coding rule to obtain the first coding sequence.

[0010] After determining the sample code of the target water sample based on the first coding sequence or the second coding sequence as described in the above technical solution, the method also includes: in response to a received trigger instruction, determining the request authority corresponding to the trigger instruction, and displaying the detection information of the target water sample corresponding to the request authority, wherein the trigger instruction is a code scanning instruction of the target person.

[0011] The trigger instruction in the above technical solution includes first permission information and second permission information; determining the request permission corresponding to the trigger instruction and displaying the detection information of the target water sample corresponding to the request permission includes: in response to the trigger instruction including the first permission information, displaying the detection information of the first quantity of the target water sample; in response to the trigger instruction including the second permission information, displaying the detection information of the second quantity of the target water sample; the first quantity is greater than the second quantity.

[0012] In the above technical solution, the first detection data includes at least one of the sampling information, ownership information, detection information and process information of the target water sample; the sampling information includes at least one of the sampling personnel information, sampling location information, sampling time information and sample collection time information; the ownership information includes multi-level detection agency information; the detection information includes the detection result information of each level of the detection agency and at least one of the detection result information of each type of detection item; the process information includes multiple processing process information of the target water sample.

[0013] The technical means adopted by the present invention to solve its technical problems are: a water sample code generation device, including: a data acquisition module, used to determine the first detection data of the target water sample; a first mapping module, used to respond to the first detection data matching with the first database, and encode the first detection data based on the first mapping relationship to obtain the first coding sequence of the target water sample; the first database includes multiple data mapping relationships, and the first mapping relationship is the mapping relationship in the first database that matches the first detection data; the second mapping module is used to respond to the first detection data not matching with the first database, and encode the first detection data based on the second mapping relationship to obtain the second coding sequence of the target water sample; the second mapping relationship is the mapping relationship in the first database with the highest similarity to the first detection data; the data coding module is used to determine the sample code of the target water sample based on the first coding sequence or the second coding sequence.

[0014] The technical means adopted by the present invention to solve its technical problem is: an electronic device, comprising: a memory for storing a computer program; a processor for executing the computer program to implement the steps of the water sample code generation method as described above.

[0015] The technical means adopted by the present invention to solve its technical problem is: a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the water sample code generation method as described above is implemented.

[0016] The beneficial effect of the present invention is that the detection data of the target water sample is compared with the first database. If the two match, the detection data (i.e., the first detection data) is converted into a first coding sequence of a unified format according to a preset first mapping relationship; if the comparison result shows a mismatch, the detection data is converted into a second coding sequence according to a second mapping relationship.

[0017] This conversion method ensures that water sample data from different sources and in different formats can be converted into standardized coding sequences, namely the first coding sequence or the second coding sequence. Afterwards, these coding sequences will be used to generate sample codes for the corresponding water samples, which greatly simplifies the subsequent query work of personnel at all levels and realizes the traceability of data. It effectively solves the data processing problems caused by differences in staff levels and diverse data recording habits, improves the consistency and accuracy of data records, and makes the analysis and processing of water samples more efficient and convenient. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A flow chart of a method for generating a water sample provided by an embodiment of the present invention;

[0019] Figure 2 A flow chart of another method for generating a water sample provided by an embodiment of the present invention;

[0020] Figure 3 A flow chart of a method for generating a water sample provided by an embodiment of the present invention;

[0021] Figure 4 A method flow chart of step 40 provided in an embodiment of the present invention;

[0022] Figure 5 A method flow chart of step 50 provided in an embodiment of the present invention;

[0023] Figure 6 A structural block diagram of a water sample generating device provided by an embodiment of the present invention;

[0024] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0025] The present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0026] The following will clearly and completely describe the concept, specific structure and technical effects of the present invention in combination with the embodiments and drawings, so as to fully understand the purpose, characteristics and effects of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, other embodiments obtained by technicians in this field without creative work are all within the scope of protection of the present invention. In addition, all the connection / connection relationships involved in the patent do not refer to the direct connection of components, but refer to the formation of a better connection structure by adding or reducing connection accessories according to the specific implementation situation. The various technical features in the invention can be combined interchangeably without conflicting with each other.

[0027] As mentioned above, the existing water sample records have a variety of data recording methods due to the different professional backgrounds, work experience and recording habits of the staff. This not only increases the difficulty of data integration, but also makes it possible for the same type of data to use different coding forms, seriously hindering the unified processing and analysis of data.

[0028] Therefore, the present application provides a method for generating a water sample code, such as Figure 1 As shown, the method comprises the following steps:

[0029] Step 10: determine the first detection data of the target water sample.

[0030] The target water sample is a water sample sampled in a target area, and the target area may include water plants, factories, lakes and other water areas. After obtaining the target water sample, the target water sample needs to be tested. The test may involve multiple tests by multiple testing agencies, and the test data is of various types and needs to be recorded.

[0031] Specifically, the physical and chemical properties of the target water samples need to be tested.

[0032] Optionally, the physical property may include at least one of temperature, color, transparency, turbidity, smell and taste, and residue.

[0033] Optionally, the chemical property may include at least one of the detection of metal compounds, the detection of non-metallic inorganic substances, the detection of organic compounds, and the detection of specific chemical indicators.

[0034] For example, the detection of metal compounds may include the detection of heavy metals such as mercury, cadmium, chromium, lead, etc.; the detection of non-metallic inorganic substances may include the detection of cyanide, sulfide, nitrite, etc.; the detection of organic compounds may include the detection of oils, phenolic compounds, organic pesticides, etc.; the detection of specific chemical indicators may include the detection of pH value, dissolved oxygen, conductivity, oxidation-reduction potential (ORP), etc.

[0035] Specifically, the first detection data includes at least one of sampling information, attribution information, detection information and process information of the target water sample.

[0036] The sampling information includes at least one of the sampling personnel information, sampling location information, sampling time information and sampling time information. For example, the sampling personnel information may include information such as name and rank, and the sampling location information may include information such as location name, longitude and latitude. The sampling time information may include sampling time, environmental information during sampling, etc.

[0037] The attribution information includes multi-level testing agency information. For example, the multi-level testing agencies may include water plant laboratories, central laboratories, enterprise-level laboratories, and company headquarters, etc. Alternatively, it may include a primary testing agency, a secondary testing agency, and a tertiary testing structure, and each level of testing agency may test water samples.

[0038] The detection information includes at least one of the detection result information of each level of detection agency and the detection result information of each type of detection item.

[0039] The process information includes multiple processing process information of the target water sample.

[0040] In one possible implementation, Figure 2 As shown, after determining the first detection data of the target water sample, the method further includes:

[0041] Step 11: Determine the first detection data type of the first detection data.

[0042] Wherein, the first detection data type includes at least one of the temperature, color, transparency, turbidity, smell and taste, residue, metal compound detection, non-metallic inorganic detection, organic compound detection and specific chemical index detection as mentioned above.

[0043] Step 12: Determine a plurality of second detection data types corresponding to each data mapping relationship in the first database.

[0044] The first database includes a plurality of data mapping relationships constructed based on historical detection records, and the second detection data type includes but is not limited to the first detection data type listed above.

[0045] Step 13: If there is a data type that is the same as the first detection data type among the plurality of second detection data types, it is determined that the first detection data matches the first database.

[0046] Step 14: If the same data type as the first detection data type does not exist in the plurality of second detection data types, it is determined that the first detection data does not match the first database.

[0047] Through the above embodiments, by judging whether there is second detection data of the same type as the first detection data in the first database, a preliminary detection is performed on the first detection data, and a data mapping relationship of the first detection data is determined from a plurality of data mapping relationships.

[0048] Step 20: In response to the first detection data matching the first database, data encoding is performed on the first detection data based on a first mapping relationship to obtain a first encoding sequence of the target water sample.

[0049] In an embodiment of the present application, the first database includes multiple data mapping relationships, each data mapping relationship corresponds to a data conversion rule, and different data conversion rules can convert corresponding data into corresponding standard data.

[0050] In an exemplary embodiment, the first detection data may include time information related to the target water sample, but different personnel have different recording habits and may use different recording methods.

[0051] For example: The first staff member records the sampling time of the target water sample as: March 5, 2024.

[0052] The second staff member recorded the detection time of a certain item of the target water sample as: 2024.4.9.

[0053] The third staff member recorded the upload time of the target water sample as: May 4, 24.

[0054] The first database includes a data mapping relationship for date conversion. Based on the data mapping relationship, the sampling time record can be converted to the standard 20240305, the project detection time record can be converted to the standard 20240409, and the upload time can be converted to the standard 20240504.

[0055] This embodiment converts different times into a unified form, which is beneficial to subsequent data processing.

[0056] The embodiment of the present application can extract key features for representing data attributes from the first detection data, and each data mapping relationship can correspond to a mapping feature. The extracted key features of the first detection data are matched with the mapping features of each mapping relationship respectively. When there is a mapping feature matching the key feature, it can be determined that the first detection data matches the first database, and the corresponding data mapping relationship is selected as the first mapping relationship.

[0057] Specifically, whether the first detection data matches the first database can be determined by respectively calculating the matching degree between the key features of the first detection data and each mapping feature in the first database. When the matching degree is greater than the first matching degree, it indicates that there exists a first detection data mapping relationship in the first database that can perform data conversion on the first detection data; when the matching degree is less than the first matching degree, it indicates that there does not exist a first detection data mapping relationship in the first database that can perform data conversion on the first detection data.

[0058] The first detection data can be encoded based on the first mapping relationship to obtain a first encoding sequence corresponding to the first detection data. The first encoding sequence is used to represent a standard encoding sequence corresponding to the first detection data.

[0059] Step 30: In response to the first detection data not matching the first database, data encoding is performed on the first detection data based on a second mapping relationship to obtain a second encoding sequence of the target water sample.

[0060] When the first detection data does not match the first database, a data mapping relationship with the highest similarity that can be used to perform data conversion on the first detection data can be selected from the first database as the second mapping relationship.

[0061] The first detection data can be encoded based on the second mapping relationship to obtain a second encoding sequence corresponding to the second detection data. The second encoding sequence is used to represent a standard encoding sequence corresponding to the first detection data.

[0062] After obtaining the second coding sequence, the embodiment of the present application can also verify the second coding sequence in combination with the historical database to determine whether the second coding sequence conforms to the standard conversion data corresponding to the first detection data.

[0063] Step 40: determine the sample code of the target water sample based on the first coding sequence or the second coding sequence.

[0064] Optionally, after obtaining the first coding sequence, the first coding sequence can be converted into a sample code corresponding to the target water sample by a unified first coding rule. The sample code can be expressed in the form of a two-dimensional code or a coding sequence, which can be selected according to actual conditions.

[0065] Alternatively, after obtaining the second coding sequence, the second coding sequence may be converted into a sample code corresponding to the target water sample using a unified second coding rule.

[0066] Alternatively, after obtaining the first coding sequence, the first coding sequence can be input into the first neural network to obtain the sample coding of the target water sample. The first neural network can be trained based on the first detection data set. The first detection data set can include multiple historical first coding sequences and sample coding corresponding to each historical first coding sequence.

[0067] Alternatively, after obtaining the second coding sequence, the second coding sequence can be input into a second neural network to obtain a sample code of the target water sample. The second neural network can be trained based on a second detection data set. The second detection data set can include multiple historical second coding sequences and sample codes corresponding to each historical second coding sequence.

[0068] The disclosed embodiment matches the monitoring data of the target water sample with the first database, and when the two match, the first detection data is converted into a first coding sequence according to a first mapping relationship. When the two do not match, the first detection data is converted into a second coding sequence according to a second mapping relationship.

[0069] Through the above conversion method, different water sample data can be converted into a unified form of coding sequence, and then the sample code of the corresponding water sample is generated according to the first coding sequence or the second coding sequence. It is convenient for subsequent personnel at all levels to query and achieve traceability, which solves the problem of subsequent analysis and processing difficulties caused by different levels of various staff and different data recording habits, and improves the efficiency of water sample traceability.

[0070] In one possible implementation, Figure 3 As shown, before step 30, the water sample code generation method may also include:

[0071] Step 21: convert the first detection data into a first vector, wherein the dimension of the first vector is consistent with the number of data types of the detection data of the water sample.

[0072] In this embodiment, the first detection data may include M types of detection data, and each type of detection data corresponds to a vector dimension. Therefore, through vector conversion, the first detection data can be converted into an M-dimensional first vector.

[0073] Step 22: determine the data mapping feature vector corresponding to each data mapping relationship in the first database.

[0074] In this embodiment, the first database may include multiple data mapping relationships, and each data mapping relationship may correspond to a specific data mapping feature vector.

[0075] Step 23, calculating the similarities between the first vector and the data mapping feature vectors corresponding to each data mapping relationship, to obtain a plurality of first similarities.

[0076] The first formula may be used to calculate the similarities between the first vector and the data mapping feature vectors corresponding to each data mapping relationship, thereby obtaining a plurality of first similarities.

[0077] The first formula includes:

[0078] Among them, P j represents the first similarity between the first vector and the jth data mapping feature vector, A represents the first feature vector, B j represents the jth data mapping feature vector, M0 represents a preset constant, and M0 is a constant greater than zero.

[0079] Step 24: Select the data mapping relationship corresponding to the maximum first similarity as the second mapping relationship.

[0080] After calculating and obtaining a plurality of first similarities, the data mapping relationship corresponding to the maximum first similarity may be selected as the second mapping relationship, and then the first detection data may be encoded based on the second mapping relationship to obtain a second encoding sequence.

[0081] A high first similarity indicates that the first vector and the data mapping relationship are relatively matched, and using the data mapping relationship to perform data encoding on the first detection data can ensure the reliability of the conversion of the first detection data.

[0082] The embodiment of the present application determines the second detection data mapping relationship through similarity calculation, ensuring that the first detection data can be converted into a standard coding sequence, which is helpful for subsequent data processing and analysis.

[0083] In a possible implementation, the first detection data includes multiple types of second detection data, such as Figure 4 As shown, step 40 may include the following steps:

[0084] Step 401: perform data mapping on the multiple types of second detection data based on the first mapping relationship to obtain multiple first standard data.

[0085] In this embodiment, the first detection data may include multiple types of second detection data. For example, the first detection data may include sampling data and detection data of the target water sample.

[0086] The first mapping relationship may include multiple types of data conversion rules, each type of data conversion rule may be used to convert a type of second detection data, and the second detection data may be converted into corresponding first standard data, so that multiple first standard data may be obtained in the end.

[0087] After obtaining a plurality of first standard data, each first standard data may be encoded using a first encoding rule to obtain a first encoding sequence.

[0088] Step 402: Encode the plurality of first standard data based on a first encoding rule to obtain the first encoding sequence.

[0089] Optionally, the first encoding rule may include one or more of ASCII encoding, Unicode encoding, Hex encoding, Base64 encoding, and Base58 encoding. Alternatively, other data encoding rules may also be included, which are not specifically limited here.

[0090] The embodiment of the present application can improve data processing efficiency by first converting different types of data into the same type of data, and then converting the data into a unified first coding sequence using a unified coding rule.

[0091] In a possible implementation, after step 40, the water sample encoding method may further include the following steps:

[0092] Step 50: In response to the received trigger instruction, determine the request authority corresponding to the trigger instruction, and display the detection information of the target water sample corresponding to the request authority.

[0093] Among them, the trigger instruction is a code scanning instruction of the target person.

[0094] In this embodiment, water sample testing usually involves multiple levels of testing agencies. In order to avoid leaks, staff members of different levels of testing agencies may have different permissions, and each staff member can only query the water sample testing data corresponding to his or her own permissions.

[0095] Specifically, the trigger instruction includes the first permission information and the second permission information, such as Figure 5 As shown, the step 50 may include the following steps;

[0096] Step 501: When the trigger instruction includes first authority information, detection information of a first quantity of target water samples is displayed.

[0097] Step 502: When the trigger instruction includes second authority information, display detection information of a second quantity of target water samples.

[0098] Wherein, the first quantity is greater than the second quantity.

[0099] In an exemplary embodiment, the multi-stage detection mechanism may include a primary detection mechanism, a secondary detection mechanism, and a tertiary detection mechanism.

[0100] Among them, the third-level testing agency is a subordinate testing agency of the second-level testing agency, and the second-level testing agency is a subordinate testing agency of the first-level testing agency.

[0101] The first staff member belongs to the first-level testing agency, the second staff member belongs to the second-level testing agency, and the third staff member belongs to the third-level testing agency.

[0102] When the first staff member issues a trigger instruction, this embodiment can identify the request authority in the trigger instruction, corresponding to the first request authority, and at this time all the information of the target water sample can be displayed.

[0103] When the second staff member issues a trigger instruction, this embodiment can identify the request authority in the trigger instruction, corresponding to the second request authority, and at this time, partial information of the target water sample can be displayed.

[0104] When the third staff member issues a trigger instruction, this embodiment can identify the request authority in the trigger instruction, corresponding to the third request authority, and at this time a small amount of information of the target water sample can be displayed.

[0105] The first staff member's query displayed the most information, the second staff member's query displayed a medium amount of information, and the third staff member's query displayed the least information.

[0106] The embodiment of the present application can improve the reliability of water sample data storage and avoid leakage by identifying the permission information in the trigger instruction and then displaying different detection information of the water sample according to different permission information.

[0107] It should be understood that, although the various steps in the above-mentioned flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above-mentioned flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0108] The following is an embodiment of the device of the present application, which can be used to execute the method for generating water sample code involved in the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the method embodiment of the method for generating water sample code involved in the present application.

[0109] See also Figure 6The present application provides a water sample code generation device 60, including: a data acquisition module 601, a first mapping module 602, a second mapping module 603, and a data encoding module 604.

[0110] The data acquisition module 601 is used to determine the first detection data of the target water sample.

[0111] The first mapping module 602 is used to encode the first detection data based on a first mapping relationship in response to the first detection data matching the first database to obtain a first coding sequence of the target water sample; the first database includes multiple data mapping relationships, and the first mapping relationship is a mapping relationship in the first database that matches the first detection data.

[0112] The second mapping module 603 is used to encode the first detection data based on a second mapping relationship in response to the first detection data not matching the first database, so as to obtain a second coding sequence of the target water sample; the second mapping relationship is the mapping relationship in the first database with the highest similarity to the first detection data.

[0113] The data encoding module 604 is used to determine the sample code of the target water sample based on the first encoding sequence or the second encoding sequence.

[0114] It should be noted that the water sample code generation device provided in the above embodiment only uses the division of the above functional modules as an example when generating water sample codes. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the water sample code generation device will be divided into different functional modules to complete all or part of the functions described above. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0115] In addition, the water sample code generation device and the water sample code generation method provided in the above embodiments belong to the same concept, and the specific manner in which each module performs the operation has been described in detail in the method embodiment and will not be repeated here.

[0116] See also Figure 7 In an embodiment of the present application, an electronic device 4000 is provided, and the electronic device 4000 may be a water sample detector.

[0117] exist Figure 7In the embodiment, the data interaction between the processor 4001 and the memory 4003 can be realized through at least one communication bus 4002. The communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0118] Optionally, the electronic device 4000 may further include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.

[0119] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc. The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program instructions or codes in the form of instructions or data structures and can be accessed by the electronic device 400, but is not limited to this.

[0120] The memory 4003 stores program instructions or codes, and the processor 4001 can read the program instructions or codes stored in the memory 4003 through the communication bus 4002 .

[0121] When the program instructions or codes are executed by the processor 4001, the water sample code generation method in the above-mentioned embodiments is implemented.

[0122] In addition, a storage medium is provided in an embodiment of the present application, on which program instructions or codes are stored, and the program instructions or codes are loaded and executed by a processor to implement the water sample code generation method as described above.

[0123] A computer program product is provided in an embodiment of the present application. The computer program product includes program instructions or codes. The program instructions or codes are stored in a storage medium. The processor of the electronic device reads the program instructions or codes from the storage medium, loads and executes the program instructions or codes, so that the electronic device implements the water sample code generation method as described above.

[0124] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.

Claims

1. A method for generating a water sample code, characterized in that: The following steps are involved: Determine first detection data of the target water sample; determining a first detection data type of the first detection data; Determine a plurality of second detection data types corresponding to each data mapping relationship in the first database; If there is a data type that is the same as the first detection data type among the plurality of second detection data types, determining that the first detection data matches the first database includes: Extracting key features for representing data attributes from the first detection data, and matching the extracted key features of the first detection data with mapping features of each mapping relationship respectively; When there is a mapping feature matching the key feature, it can be determined that the first detection data matches the first database, and the corresponding data mapping relationship is selected as the first mapping relationship; If there is no data type identical to the first detection data type among the plurality of second detection data types, determining that the first detection data does not match the first database; Converting the first detection data into a first vector, wherein the dimension of the first vector is consistent with the number of data types of the detection data of the water sample; Determine a data mapping feature vector corresponding to each data mapping relationship in the first database; Calculating similarities between the first vector and the data mapping feature vectors corresponding to each data mapping relationship to obtain multiple similarities; Select the data mapping relationship corresponding to the highest similarity as the second mapping relationship; In response to the first detection data matching the first database, the first detection data is data encoded based on a first mapping relationship to obtain a first coding sequence of the target water sample; the first database includes a plurality of data mapping relationships, and the first mapping relationship is a mapping relationship in the first database that matches the first detection data; In response to the first detection data not matching the first database, encoding the first detection data based on a second mapping relationship to obtain a second coding sequence of the target water sample; the second mapping relationship is a mapping relationship in the first database with the highest similarity to the first detection data; The sample code of the target water sample is determined based on the first coding sequence or the second coding sequence.

2. The method for generating water sample code according to claim 1, characterized in that: Before encoding the first detection data based on the second mapping relationship to obtain a second encoding sequence of the target water sample, the method further includes: Converting the first detection data into a first vector, wherein the dimension of the first vector is consistent with the number of data types of the detection data of the water sample; Determine a data mapping feature vector corresponding to each data mapping relationship in the first database; Calculating similarities between the first vector and the data mapping feature vectors corresponding to each data mapping relationship to obtain multiple similarities; The data mapping relationship corresponding to the highest similarity is selected as the second mapping relationship.

3. The method for generating water sample code according to claim 1, characterized in that: After determining the sample code of the target water sample based on the first coding sequence or the second coding sequence, the method further includes: In response to the received trigger instruction, the request authority corresponding to the trigger instruction is determined, and the detection information of the target water sample corresponding to the request authority is displayed, and the trigger instruction is a code scanning instruction of the target person.

4. The method for generating water sample code according to claim 3, characterized in that: The trigger instruction includes first permission information and second permission information; the determining the request permission corresponding to the trigger instruction and displaying the detection information of the target water sample corresponding to the request permission includes: In response to the trigger instruction including the first authority information, displaying detection information of a first quantity of the target water sample; In response to the trigger instruction including second authority information, detection information of a second quantity of the target water sample is displayed; the first quantity is greater than the second quantity.

5. The method for generating water sample code according to claim 1, characterized in that: The first detection data includes At least one of sampling information, attribution information, detection information and process information of the target water sample; The sampling information includes at least one of sampling personnel information, sampling location information, sampling time information and sample collection time information; The attribution information includes multi-level testing agency information; The detection information includes at least one of the detection result information of each level of detection agency and the detection result information of each type of detection item; The process information includes a plurality of processing process information of the target water sample.

6. A water sample code generation device, characterized in that: include: A data acquisition module, used to determine first detection data of a target water sample; A data matching module, used to determine a first detection data type of the first detection data; Determine a plurality of second detection data types corresponding to each data mapping relationship in the first database; If there is a data type that is the same as the first detection data type among the plurality of second detection data types, determining that the first detection data matches the first database includes: Extracting key features for representing data attributes from the first detection data, and matching the extracted key features of the first detection data with mapping features of each mapping relationship respectively; When there is a mapping feature matching the key feature, it can be determined that the first detection data matches the first database, and the corresponding data mapping relationship is selected as the first mapping relationship; If there is no data type identical to the first detection data type among the plurality of second detection data types, determining that the first detection data does not match the first database; Converting the first detection data into a first vector, wherein the dimension of the first vector is consistent with the number of data types of the detection data of the water sample; Determine a data mapping feature vector corresponding to each data mapping relationship in the first database; Calculating similarities between the first vector and the data mapping feature vectors corresponding to each data mapping relationship to obtain multiple similarities; Select the data mapping relationship corresponding to the highest similarity as the second mapping relationship; A first mapping module is used for, in response to the first detection data being matched with the first database, encoding the first detection data based on a first mapping relationship to obtain a first coding sequence of the target water sample; the first database includes a plurality of data mapping relationships, and the first mapping relationship is a mapping relationship in the first database that matches the first detection data; a second mapping module, configured to, in response to the first detection data not matching the first database, encode the first detection data based on a second mapping relationship to obtain a second coding sequence of the target water sample; the second mapping relationship being the mapping relationship in the first database having the highest similarity to the first detection data; A data encoding module is used to determine the sample code of the target water sample based on the first encoding sequence or the second encoding sequence.

7. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the steps of the water sample code generation method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the water sample code generation method according to any one of claims 1 to 5 is implemented.