A method and system for generating a sample delivery relationship of an environmental monitoring sample based on dynamic programming
By using dynamic programming to determine the sample delivery relationships for environmental monitoring, the problem of irrational delivery relationships was solved, resulting in cost savings and improved testing efficiency.
Patent Information
- Application Number
- CN202411538455.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-10-31
AI Technical Summary
The existing environmental monitoring sample delivery system is flawed, which may lead to testing errors and wasted costs, and fails to effectively improve testing efficiency.
A dynamic programming-based approach is used to obtain initial information, determine the initial testing relationship, and determine the final testing relationship through an optimization process. This includes obtaining information such as the monitoring indicators, quantity, monitoring site location, and laboratory testing capabilities of environmental monitoring samples, and dynamically selecting testing laboratories to optimize testing costs.
This approach achieves a reasonable testing relationship and cost savings, thereby improving the testing efficiency of environmental samples.
Smart Images

Figure CN119417158B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and more specifically, to a method and system for generating the test relationship of environmental monitoring samples based on dynamic programming. Background Technology
[0002] Environmental development is receiving increasing attention, and more and more people are calling for environmental protection. Environmental protection typically involves the collection and testing of environmental monitoring samples. Reasonable sample collection is fundamental to obtaining accurate test results. Collectors need to determine monitoring points based on the monitoring objectives and the characteristics of the monitored objects. For example, for atmospheric environmental monitoring, monitoring points should be set up at different altitudes and in different functional zones based on the distribution characteristics of different pollutants. After collecting environmental data, samples need to be sent for testing. Analyzing the data from environmental monitoring samples sent over a period of time can reveal trends in environmental quality. This helps the government formulate environmental plans and policies. For example, by analyzing the data on heavy metal content in water bodies in a certain area over many years, and finding that the content of certain heavy metals is increasing, the government can formulate targeted water pollution prevention and control plans and strengthen the supervision of enterprises involving heavy metals. However, in current testing relationships, there are often fixed relationships, such as sending a particular environmental monitoring sample to a testing agency that regularly tests it. This often overlooks problems in the testing process, such as whether the cost is reasonable and whether the testing agency still has the appropriate testing capabilities. This can lead to monitoring errors and reduce monitoring efficiency.
[0003] Therefore, how to provide a more reasonable method for generating test-submission relationships has become an urgent problem to be solved in this field. Summary of the Invention
[0004] This application proposes a method for generating the sample delivery relationship of environmental monitoring based on dynamic programming, including the following steps: obtaining initialization information; determining the initial delivery relationship based on the initialization information; optimizing the initial delivery relationship to determine the final delivery relationship; and archiving the initial and final delivery relationships.
[0005] The dynamic programming-based method for generating environmental monitoring sample delivery relationships described above obtains initialization information including the types and quantities of monitoring indicators for environmental monitoring samples, the location of monitoring stations, the laboratory testing capabilities corresponding to the monitoring stations, and the number of laboratories.
[0006] The dynamic programming-based method for generating environmental monitoring sample delivery relationships, as described above, includes monitoring stations including but not limited to air monitoring stations and water quality monitoring stations. Air monitoring stations monitor sulfur dioxide, nitrogen oxides, and particulate matter in the air; water quality monitoring stations monitor chemical oxygen demand, biochemical oxygen demand, and heavy metal ion content in water bodies.
[0007] The method for generating the sample submission relationship for environmental monitoring based on dynamic programming, as described above, includes the following sub-steps to determine the initial submission relationship based on initialization information: determining one or more laboratories corresponding to each site; determining whether one or more laboratories have testing capabilities; if one or more laboratories have testing capabilities, determining the initial submission relationship between the laboratories and the monitoring sites; if one or more laboratories do not have testing capabilities, re-determining the laboratories corresponding to the monitoring sites.
[0008] As described above, in the method for generating the delivery relationship of environmental monitoring samples based on dynamic programming, during the monitoring process at a monitoring station, one or more monitoring stations send the acquired environmental monitoring samples to a designated laboratory for testing. The relationship between the environmental monitoring sample and the designated laboratory is then defined as the delivery relationship.
[0009] A dynamic programming-based environmental monitoring sample delivery relationship generation system specifically includes: an acquisition unit, an initial delivery relationship determination unit, a final delivery relationship determination unit, and an archiving unit; the acquisition unit acquires initialization information; the initial delivery relationship determination unit determines the initial delivery relationship based on the initialization information; the final delivery relationship determination unit optimizes the initial delivery relationship and determines the final delivery relationship; and the archiving unit archives the initial delivery relationship and the final delivery relationship.
[0010] As described above, the environmental monitoring sample delivery relationship generation system based on dynamic programming acquires initial information including the types and quantities of monitoring indicators for environmental monitoring samples, the location of monitoring stations, the laboratory testing capabilities corresponding to the monitoring stations, and the number of laboratories.
[0011] The environmental monitoring sample delivery relationship generation system based on dynamic programming as described above is characterized in that the monitoring stations acquired by the acquisition unit include, but are not limited to, atmospheric monitoring stations and water quality monitoring stations; atmospheric monitoring stations monitor sulfur dioxide, nitrogen oxides, and particulate matter in the air; and water quality monitoring stations monitor chemical oxygen demand, biochemical oxygen demand, and heavy metal ion content in water bodies.
[0012] The environmental monitoring sample delivery relationship generation system based on dynamic programming described above includes the following sub-steps for determining the initial delivery relationship based on initialization information: determining one or more laboratories corresponding to each site; determining whether one or more laboratories have testing capabilities; if one or more laboratories have testing capabilities, determining the initial delivery relationship between the laboratories and the monitoring sites; if one or more laboratories do not have testing capabilities, re-determining the laboratories corresponding to the monitoring sites.
[0013] As described above, in the environmental monitoring sample delivery relationship generation system based on dynamic programming, during the monitoring process of the monitoring stations acquired by the acquisition unit, one or more monitoring stations send the acquired environmental monitoring samples to a designated laboratory for testing. Then, the relationship between the environmental monitoring sample and the designated laboratory is the delivery relationship.
[0014] This application has the following beneficial effects:
[0015] This application enables dynamic planning of the delivery relationships for environmental monitoring samples, determining the initial and final delivery relationships, providing multiple selectable delivery relationships, and allowing for autonomous or automatic selection of delivery relationships. This makes the determination of delivery relationships more reasonable and also saves costs through automatic selection of delivery relationships, thereby improving the detection efficiency of environmental monitoring samples. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0017] Figure 1 This is a flowchart of a method for generating the sample delivery relationship for environmental monitoring based on dynamic programming, according to an embodiment of this application.
[0018] Figure 2 This is a schematic diagram of the internal structure of the environmental monitoring sample delivery relationship generation system based on dynamic programming, according to an embodiment of this application. Detailed Implementation
[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0020] Example 1
[0021] like Figure 1 As shown, this embodiment provides a method for generating the sample delivery relationship for environmental monitoring based on dynamic programming, specifically including the following steps:
[0022] Step S110: Obtain initialization information.
[0023] The initialization information obtained includes the types and quantities of monitoring indicators for environmental monitoring samples, the location of monitoring stations, the testing capabilities of the laboratories corresponding to the monitoring stations, and the number of laboratories.
[0024] The monitoring stations include, but are not limited to, air monitoring stations and water quality monitoring stations. Air monitoring stations can monitor the concentration of pollutants such as sulfur dioxide, nitrogen oxides, and particulate matter (such as PM2.5 and PM10) in the air. Water quality monitoring stations can detect indicators such as chemical oxygen demand (COD), biochemical oxygen demand (BOD), and heavy metal ion content in water bodies.
[0025] The monitoring stations are capable of monitoring environmental samples. During the monitoring process, one or more monitoring stations send the acquired environmental monitoring samples to a designated laboratory for testing. The monitoring stations and the designated laboratory are in a corresponding relationship, and the relationship between the environmental monitoring samples and the corresponding laboratories is a delivery relationship. Through the delivery relationship, environmental monitoring samples can be sent to the corresponding laboratories for testing when they are acquired.
[0026] It is understandable that there are multiple monitoring stations during monitoring, and all of these stations conduct environmental monitoring. Therefore, the data collected by these stations are sent to the corresponding laboratories for testing, and thus each monitoring station has a corresponding laboratory.
[0027] Step S120: Determine the initial test relationship based on the initialization information.
[0028] Specifically, the initial testing relationship is one or more laboratories corresponding to one or more sites. Before determining the initial testing relationship, it is necessary to determine whether the one or more laboratories have testing capabilities. If only one laboratory has testing capabilities, then the one or more monitoring sites and that one laboratory have an initial testing relationship. If two laboratories have testing capabilities, then the one or more sites and those two laboratories have an initial testing relationship.
[0029] Based on the above, step S120 includes the following sub-steps:
[0030] Step S1201: Identify one or more laboratories corresponding to each site.
[0031] Step S1202: Determine whether one or more laboratories have testing capabilities.
[0032] If one or more laboratories have testing capabilities, proceed to step S1203; if none of the laboratories have testing capabilities, proceed to step S1204.
[0033] Specifically, testing capability refers to whether the laboratory has the ability to test environmental monitoring samples. If the laboratory can still test the submitted samples, it is considered to have testing capability. If the laboratory is currently fully loaded and cannot accept additional environmental monitoring samples for testing, it is considered to lack testing capability.
[0034] Step S1203: Determine the initial test delivery relationship between the laboratory and the monitoring site.
[0035] If one or more laboratories have testing capabilities, then the one or more laboratories and the one or more monitoring sites are the initial testing partners.
[0036] As an example, Laboratory 1 and Laboratory 2 are the corresponding laboratories of monitoring sites 1 and 2. Both Laboratory 1 and Laboratory 2 have monitoring capabilities, so Laboratory 1 and Laboratory 2 have an initial testing relationship with monitoring sites 1 and 2. If Laboratory 1 has monitoring capabilities, then Laboratory 1 has an initial testing relationship with monitoring sites 1 and 2.
[0037] Step S1204: Re-determine the laboratory corresponding to the monitoring site.
[0038] If none of the laboratories corresponding to the site have testing capabilities, then a new laboratory should be selected for the monitoring of the one or more monitoring sites.
[0039] Step S130: Optimize the initial test submission relationship and determine the final test submission relationship.
[0040] The steps described above establish an initial testing relationship between one or more monitoring stations and their corresponding laboratories. However, in this scenario, the question arises of which laboratory a monitoring station should send its environmental samples to for testing. Automatically selecting all laboratories would waste testing capacity. Manually selecting a laboratory might lead to an unreasonable choice without knowing its remaining testing capacity, such as when the number of samples or the computational demands are too high, and the selected laboratory's remaining computational capacity is insufficient to process the samples. Therefore, a re-planning of the testing relationship is necessary to determine the optimal relationship, minimizing testing costs, improving monitoring efficiency at the monitoring stations, and reducing laboratory testing costs.
[0041] Based on the above, step S130 includes the following sub-steps:
[0042] Step S1301: Divide the testing phase.
[0043] Since there may be multiple monitoring stations, the submission of environmental monitoring samples by each monitoring station is defined as a stage. For example, the submission of environmental monitoring samples by monitoring station 1 is the first stage, the submission of environmental monitoring samples by monitoring station 2 is the second stage, and so on, determining multiple submission stages.
[0044] Step S1302: Based on the divided stages, determine the specific status of one or more laboratories in the initial testing relationship under each stage.
[0045] The specific status refers to the remaining testing capacity of one or more laboratories in the initial testing relationship and the accumulated testing costs at each stage.
[0046] The detection capacity refers to how many specific indicators of samples can still be detected, and the cumulative testing cost is the sum of transportation costs and testing costs.
[0047] The specific state can be represented as S = (n1, n2, ... nx, C), where n1, n2, ... nx represent the remaining testing capacity of laboratories 1 to x, and C represents the cumulative testing cost.
[0048] Step S1303: After determining the specific state, determine the initial decision.
[0049] The initial decision is to decide which laboratory to send the environmental monitoring samples to, for example, to laboratory 1 or laboratory 2.
[0050] Step S1304: Analyze the initial decision and the specific circumstances of one or more laboratories, optimize the initial testing relationship, and determine the final testing relationship.
[0051] The analysis of the initial decision and the specific circumstances of one or more laboratories includes determining the transfer equation based on the initial decision and the specific circumstances of one or more laboratories.
[0052] S i Defined as the state of the i-th stage, d i For the initial decision in the i-th stage, the state transition equation is: From the current state S i According to decision d i How to transition to the next state S i+1 If a sample with specific indicators is sent to a laboratory, the laboratory's remaining testing capacity will decrease accordingly, and the cumulative cost will increase based on the transportation and testing costs of the sample to the laboratory. The transfer equation can then be expressed as S... i+1 =T(S) i ,di ), where T represents the transfer function.
[0053] Define the optimal value function as f i (S i He indicated that from state S i The minimum cost from the start to the last stage is represented by the recursive relation as follows:
[0054]
[0055] Where r(S) i ,d i f represents the testing cost for making a decision under the given state. i+1 The function representing the (i+1)th stage, d i This is the initial decision for the i-th stage.
[0056] The optimal value function for the final stage is calculated by directly calculating the optimal value for each state based on the cost of sending environmental monitoring samples to various laboratories for the final stage.
[0057] Starting from the penultimate stage, the optimal value function for each state in each stage is calculated based on the recursive relationship between the state transition equation and the optimal value function. Calculating the optimal value for each state in each stage requires iterating through all possible decisions, i.e., iterating through all the selected testing laboratories.
[0058] After calculating the optimal value function for all stages, starting from the first stage, the complete testing relationship is determined based on the optimal decision for each stage (the decision that minimizes the optimal value function).
[0059] For example, if there are 3 monitoring stations and 2 laboratories capable of sending samples, then S = (n1, n2, C). At any stage, if the initial decision d is to send to laboratory 1, assuming that sending one environmental monitoring sample consumes 1 unit of testing capacity, then S = (n1-1, n2, C + c1), where c1 represents the cost of sending to laboratory 1. If the initial decision d is to send to laboratory 2, then S = (n1, n2-1, C + c2), where c1 represents the cost of sending to laboratory 2. After processing at all 3 monitoring stations, the minimum cost of sending samples under all possible conditions is calculated. Then, working backward, the optimal value function after processing at the second monitoring station is calculated. Finally, the optimal sending relationship for the second monitoring station is calculated to minimize the cumulative cost of sending samples.
[0060] The optimal testing relationship is the one that minimizes the cumulative testing cost. For example, if sending environmental monitoring samples to laboratory 1 by one or more monitoring stations minimizes the testing cost, then given that laboratory 1 and laboratory 2 are the initial testing relationship, environmental monitoring samples and laboratory 1 are selected as the final testing relationship.
[0061] Step S140: Archive the initial and final test submission relationships.
[0062] The generated initial and final submission relationships are stored separately. This allows for automatic retrieval of the submission relationships for subsequent active or automatic selection.
[0063] As an example, after obtaining environmental testing samples, one can actively choose to have the laboratory in the initial testing relationship conduct the testing, or set it to automatically prioritize having the laboratory in the final testing relationship conduct the environmental testing samples.
[0064] As another embodiment, the laboratory in the automatic final testing relationship is given priority to test the environmental test samples. When the automatic selection fails, the active selection is then performed.
[0065] This allows for the creation of virtual storage nodes to archive initial and final testing relationships. When a request for environmental testing samples is received, the corresponding testing relationship is retrieved based on the selection results of active and passive choices. After obtaining the corresponding testing laboratory, the environmental testing samples are sent to that laboratory for testing.
[0066] Based on the above, step S140 specifically includes the following sub-steps:
[0067] Step S1401: Create virtual initial nodes and virtual final nodes to store the initial and final test relationships, respectively.
[0068] Both the virtual initial node and the virtual final node are virtual storage nodes, which can store the input data and retrieve the data at the location of the virtual storage node when reading the data.
[0069] Specifically, the virtual initial node stores the initial test relationship, and the virtual final node stores the final test relationship.
[0070] Step S1402: Perform storage determination based on the virtual initial node and the virtual final node.
[0071] After creating virtual initial nodes and virtual final nodes, it cannot be guaranteed whether other data has been stored during the operation of the node. Therefore, it is necessary to perform storage judgment on virtual initial nodes and virtual final nodes to determine whether they can be called normally when it is necessary to store the test relationship.
[0072] Specifically, the conditions for determining whether a virtual initial node or a virtual final node can be invoked are as follows:
[0073]
[0074] Where i = B indicates whether data exists in the virtual initial node (or virtual final node). If data i exists in the virtual initial node (or virtual final node), then B = 1; if data i does not exist in the virtual initial node (or virtual final node), then B = 0. i p represents the amount of data stored in the virtual initial node (or virtual final node), F represents the maximum storage capacity in the virtual initial node (or virtual final node), and p represents the maximum storage capacity in the virtual initial node (or virtual final node). q This indicates the amount of data occupied by the initial test relationship q (or the final test relationship q), and U represents a pre-set specified threshold.
[0075] The pre-set threshold U can be set according to the maximum capacity of the virtual initial node or the virtual final node. The larger the maximum capacity, the larger the threshold should be, and vice versa. The specific value is not set here.
[0076] If the virtual initial node or virtual final node meets the above requirements, it is considered that the virtual initial node or virtual final node can be called. If it does not meet the requirements, it is considered that it cannot be called. Then, the virtual initial node or virtual final node is recreated until the virtual initial node or virtual final node can meet the above requirements.
[0077] Step S1403: After completing the storage judgment, obtain the test request and perform the corresponding test relationship according to the test request.
[0078] If the obtained request is to actively select a test relationship, then the corresponding test relationship will be read from either the virtual initial node or the virtual final node according to the specific needs.
[0079] If no signal is received to actively select a test relationship, it is assumed that an active selection of a test relationship is required, and the final test relationship is read from the virtual final node.
[0080] Example 2
[0081] like Figure 2As shown, this embodiment provides a dynamic programming-based environmental monitoring sample delivery relationship generation system, which specifically includes: an acquisition unit 210, an initial delivery relationship determination unit 220, a final delivery relationship determination unit 230, and an archiving unit 240.
[0082] Unit 210 acquires initialization information.
[0083] Specifically, the initialization information obtained includes the types and quantities of monitoring indicators for environmental monitoring samples, the location of monitoring stations, the testing capabilities of the laboratories corresponding to the monitoring stations, and the number of laboratories.
[0084] The monitoring stations include, but are not limited to, air monitoring stations and water quality monitoring stations. Air monitoring stations can measure the concentration of pollutants such as sulfur dioxide, nitrogen oxides, and particulate matter (such as PM2.5 and PM10) in the air. Water quality monitoring stations can detect indicators such as chemical oxygen demand (COD), biochemical oxygen demand (BOD), and heavy metal ion content in water bodies.
[0085] The monitoring stations are capable of monitoring environmental samples. During the testing process, one or more monitoring stations send the acquired environmental monitoring samples to a designated laboratory for testing. The one or more monitoring stations and the designated laboratory are in a corresponding relationship, and the relationship between the environmental monitoring samples and the corresponding laboratory is a sending-for-test relationship.
[0086] It is understandable that there are multiple monitoring stations during monitoring, and all of these stations conduct environmental monitoring. Therefore, the data collected by these stations are sent to the corresponding laboratories for testing, and thus each monitoring station has a corresponding laboratory.
[0087] The initial test relationship determination unit 220 determines the initial test relationship based on the initialization information.
[0088] Specifically, the initial testing relationship is one or more laboratories corresponding to one or more sites. Before determining the initial testing relationship, it is necessary to determine whether the one or more laboratories have testing capabilities. If only one laboratory has testing capabilities, then the one or more monitoring sites and that one laboratory have an initial testing relationship. If two laboratories have testing capabilities, then the one or more sites and those two laboratories have an initial testing relationship.
[0089] Based on the above, the initial test relationship determination unit 220 includes the following sub-modules: laboratory determination module, judgment module, initial test relationship determination module, and re-determination module.
[0090] The laboratory identification module identifies one or more laboratories corresponding to each site.
[0091] The judgment module determines whether one or more laboratories have testing capabilities.
[0092] Specifically, if one or more laboratories have testing capabilities, the initial test relationship determination module is executed; if one or more laboratories do not have testing capabilities, the re-determination module is executed.
[0093] Specifically, testing capability refers to whether the laboratory has the ability to test environmental monitoring samples. If the laboratory can still test the submitted samples, it is considered to have testing capability. If the laboratory is currently fully loaded and cannot accept additional environmental monitoring samples for testing, it is considered to lack testing capability.
[0094] The initial test relationship determination module determines the initial test relationship between the laboratory and the monitoring site.
[0095] Specifically, if one or more laboratories have testing capabilities, then the one or more laboratories and the one or more monitoring sites are the initial testing partners.
[0096] As an example, Laboratory 1 and Laboratory 2 are the corresponding laboratories of monitoring sites 1 and 2. Both Laboratory 1 and Laboratory 2 have monitoring capabilities, so Laboratory 1 and Laboratory 2 have an initial testing relationship with monitoring sites 1 and 2. If Laboratory 1 has monitoring capabilities, then Laboratory 1 has an initial testing relationship with monitoring sites 1 and 2.
[0097] The module redetermines the laboratory corresponding to the monitoring site.
[0098] If none of the laboratories corresponding to the site have testing capabilities, then a new laboratory should be selected for the monitoring of the one or more monitoring sites.
[0099] The final test delivery relationship determination unit 230 optimizes the initial test delivery relationship and determines the final test delivery relationship.
[0100] The above establishes the initial sample delivery relationship between one or more monitoring stations and their corresponding one or more laboratories. However, in this scenario, the question arises as to which laboratory a monitoring station should send its environmental samples to for testing. Automatically selecting all laboratories would waste their testing capacity. Manually selecting a laboratory might lead to an unreasonable choice without knowing its remaining testing capacity, such as when the number of samples or the computational demands are too high, and the selected laboratory's remaining computational capacity is insufficient to process the samples. Therefore, it is necessary to re-plan the sample delivery relationship to determine the optimal one, minimizing delivery costs, improving monitoring efficiency at the monitoring stations, and reducing laboratory testing costs.
[0101] Based on the above, the final test relationship determination unit 230 includes the following sub-modules: division module, specific state determination module, initial decision determination module, and final test relationship determination module.
[0102] The testing phase is divided into modules.
[0103] Specifically, since there may be multiple monitoring stations, the submission of environmental monitoring samples by each monitoring station is defined as a stage. For example, the submission of environmental monitoring samples by monitoring station 1 is the first stage, the submission of environmental monitoring samples by monitoring station 2 is the second stage, and so on, thus determining multiple submission stages.
[0104] The specific status determination module determines the specific status of one or more laboratories in the initial testing relationship under each stage, based on the divided stages.
[0105] Specifically, the specific status refers to the remaining testing capacity of one or more laboratories in the initial testing relationship at each stage, as well as the accumulated testing costs. Testing capacity refers to how many more samples of specific indicators can be tested, and accumulated testing costs are the sum of transportation costs and testing costs.
[0106] The specific state can be represented as S = (n1, n2, ... nx, C), where n1, n2, ... nx represent the remaining testing capacity of laboratories 1 to x, and C represents the cumulative testing cost.
[0107] The initial decision determination module determines the initial decision.
[0108] The initial decision is to decide which laboratory to send the environmental monitoring samples to, for example, to laboratory 1 or laboratory 2.
[0109] The final submission relationship determination module analyzes the initial decision and the specific circumstances of one or more laboratories, optimizes the initial submission relationship, and determines the final submission relationship.
[0110] Specifically, the analysis of the initial decision and the specific circumstances of one or more laboratories includes determining the transfer equation based on the initial decision and the specific circumstances of one or more laboratories.
[0111] S i Defined as the state of the i-th stage, d i For the initial decision in the i-th stage, the state transition equation is: From the current state S i According to decision d i How to transition to the next state S i+1If a sample with specific indicators is sent to a laboratory, the laboratory's remaining testing capacity will decrease accordingly, and the cumulative cost will increase based on the transportation and testing costs of the sample to the laboratory. The transfer equation can then be expressed as S... i+1 =T(S) i ,d i ), where T represents the transfer function.
[0112] Define the optimal value function as f i (S i He indicated that from state S i The minimum cost from the start to the last stage is represented by the recursive relation as follows:
[0113]
[0114] Where r(S) i ,d i f represents the testing cost for making a decision under the given state. i+1 The function representing the (i+1)th stage, d i This is the initial decision for the i-th stage.
[0115] The optimal value function for the final stage is calculated by directly calculating the optimal value for each state based on the cost of sending environmental monitoring samples to various laboratories for the final stage.
[0116] Starting from the penultimate stage, the optimal value function for each state in each stage is calculated based on the recursive relationship between the state transition equation and the optimal value function. Calculating the optimal value for each state in each stage requires iterating through all possible decisions, i.e., iterating through all the selected testing laboratories.
[0117] After calculating the optimal value function for all stages, starting from the first stage, the complete testing relationship is determined based on the optimal decision for each stage (the decision that minimizes the optimal value function).
[0118] For example, if there are 3 monitoring stations and 2 laboratories capable of sending samples, then S = (n1, n2, C). At any stage, if the initial decision d is to send to laboratory 1, assuming that sending one environmental monitoring sample consumes 1 unit of testing capacity, then S = (n1-1, n2, C + c1), where c1 represents the cost of sending to laboratory 1. If the initial decision d is to send to laboratory 2, then S = (n1, n2-1, C + c2), where c1 represents the cost of sending to laboratory 2. After processing at all 3 monitoring stations, the minimum cost of sending samples under all possible conditions is calculated. Then, working backward, the optimal value function after processing at the second monitoring station is calculated. Finally, the optimal sending relationship for the second monitoring station is calculated to minimize the cumulative cost of sending samples.
[0119] The optimal testing relationship is the one that minimizes the cumulative testing cost. For example, if sending environmental monitoring samples to laboratory 1 by one or more monitoring stations minimizes the testing cost, then given that laboratory 1 and laboratory 2 are the initial testing relationship, environmental monitoring samples and laboratory 1 are selected as the final testing relationship.
[0120] Archive unit 240 archives the initial and final test relationships.
[0121] The generated initial and final submission relationships are stored separately. This allows for automatic retrieval of the submission relationships for subsequent active or automatic selection.
[0122] As an example, after obtaining environmental testing samples, one can actively choose to have the laboratory in the initial testing relationship conduct the testing, or set it to automatically prioritize having the laboratory in the final testing relationship conduct the environmental testing samples.
[0123] As another embodiment, the laboratory in the automatic final testing relationship is given priority to test the environmental test samples. When the automatic selection fails, the active selection is then performed.
[0124] This allows for the creation of virtual storage nodes to archive initial and final testing relationships. When a request for environmental testing samples is received, the corresponding testing relationship is retrieved based on the selection results of active and passive choices. After obtaining the corresponding testing laboratory, the environmental testing samples are sent to that laboratory for testing.
[0125] Based on the above, the archiving unit 240 specifically includes the following sub-modules: creation module and storage judgment module.
[0126] The creation module creates virtual initial nodes and virtual final nodes to store the initial and final test relationships, respectively.
[0127] Specifically, both the virtual initial node and the virtual final node are virtual storage nodes, capable of storing input data and retrieving data from their respective locations. The virtual initial node stores the initial test-submission relationship, and the virtual final node stores the final test-submission relationship.
[0128] The storage determination module makes storage determination based on the virtual initial node and the virtual final node.
[0129] Specifically, after creating virtual initial nodes and virtual final nodes, it cannot be guaranteed whether other data has been stored during the operation of the node. Therefore, it is necessary to perform storage judgment on virtual initial nodes and virtual final nodes to determine whether they can be called normally when it is necessary to store the test relationship.
[0130] Specifically, the conditions for determining whether a virtual initial node or a virtual final node can be invoked are as follows:
[0131]
[0132] Where i = B indicates whether data exists in the virtual initial node (or virtual final node). If data i exists in the virtual initial node (or virtual final node), then B = 1; if data i does not exist in the virtual initial node (or virtual final node), then B = 0. i p represents the amount of data stored in the virtual initial node (or virtual final node), F represents the maximum storage capacity in the virtual initial node (or virtual final node), and p represents the maximum storage capacity in the virtual initial node (or virtual final node). q This indicates the amount of data occupied by the initial test relationship q (or the final test relationship q), and U represents a pre-set specified threshold.
[0133] The pre-set threshold U can be set according to the maximum capacity of the virtual initial node or the virtual final node. The larger the maximum capacity, the larger the threshold should be, and vice versa. The specific value is not set here.
[0134] If the virtual initial node or virtual final node meets the above requirements, it is considered that the virtual initial node or virtual final node can be called. If it does not meet the requirements, it is considered that it cannot be called. Then, the virtual initial node or virtual final node is recreated until the virtual initial node or virtual final node can meet the above requirements.
[0135] After completing the storage judgment, the test request is obtained, the corresponding test relationship is obtained according to the test request, and the environmental test sample is sent for testing according to the corresponding test relationship.
[0136] If the obtained request is to actively select a testing relationship, then the corresponding testing relationship will be read from either the virtual initial node or the virtual final node according to the specific needs, and the environmental testing samples will be sent for testing according to the testing relationship.
[0137] If no signal is received to actively select the test relationship, it is considered that it is necessary to actively select the test relationship. The final test relationship is then read from the virtual final node, and the environmental test samples are sent for testing according to the test relationship.
[0138] This application also provides a computer storage medium storing computer instructions, which, when invoked, are used to execute the dynamic programming-based method for generating the delivery relationship of environmental monitoring samples.
[0139] The embodiments disclosed in this invention provide a computer-readable storage medium storing computer program instructions. When the computer program instructions are executed on a computer, the computer executes the above-described method for generating the delivery relationship of environmental monitoring samples based on dynamic programming.
[0140] This invention provides a processor for processing the above-described method for generating the delivery relationship of environmental monitoring samples based on dynamic programming.
[0141] In this embodiment of the invention, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0142] The various methods, steps, and logic diagrams disclosed in the embodiments of this invention can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The processor reads information from the storage medium and, in conjunction with its hardware, completes the steps of the above methods.
[0143] The storage medium can be memory, such as volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
[0144] The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EEPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM).
[0145] This application has the following beneficial effects:
[0146] This application enables dynamic planning of the delivery relationships for environmental monitoring samples, determining the initial and final delivery relationships, providing multiple selectable delivery relationships, and allowing for autonomous or automatic selection of delivery relationships. This makes the determination of delivery relationships more reasonable and also saves costs through automatic selection of delivery relationships, thereby improving the detection efficiency of environmental monitoring samples.
[0147] Although the examples referenced in this application are described for illustrative purposes only and not for limiting the scope of this application, changes, additions and / or deletions to the implementation may be made without departing from the scope of this application.
[0148] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for generating the sample delivery relationship for environmental monitoring based on dynamic programming, characterized in that, Includes the following steps: Obtain initialization information; the obtained initialization information includes the types and quantities of monitoring indicators for environmental monitoring samples, the location of monitoring stations, the testing capabilities of the laboratories corresponding to the monitoring stations, and the number of laboratories. The initial testing relationship is determined based on the initialization information. This determination includes the following sub-steps: identifying one or more laboratories corresponding to each site; determining whether one or more laboratories have testing capabilities; if one or more laboratories have testing capabilities, determining the initial testing relationship between the laboratories and the monitoring sites; if one or more laboratories do not have testing capabilities, re-determining the laboratories corresponding to the monitoring sites. Optimize the initial test submission relationship and determine the final test submission relationship; Archive the initial and final test submission relationships; Optimizing the initial submission relationship and determining the final submission relationship includes the following sub-steps: Divide the testing phase into stages; Based on the divided stages, determine the specific status of one or more laboratories in the initial testing relationship under each stage; the specific status is represented as S=(n1,n2,...nx,C), where n1,n2,...nx represent the remaining testing capacity of laboratory 1 to laboratory x, and C represents the cumulative testing cost; After determining the specific state, the initial decision is made; The initial decision and the specific circumstances of one or more laboratories are analyzed to optimize the initial testing relationship and determine the final testing relationship; S i Defined as the state of the i-th stage, d i For the initial decision in the i-th stage, the state transition equation is: From the current state S i According to decision d i How to transition to the next state? The recurrence relation is expressed as T represents the transfer function; Define the optimal value function as f i (S i ), indicating that from state S i The minimum cost from the start to the last stage is represented by the recursive relation as follows: ; in This represents the testing cost for making a decision under the given conditions. The function representing the (i+1)th stage, d i This is the initial decision for the i-th stage; The optimal value function for the last stage is calculated by directly calculating the optimal value for each state based on the cost of sending environmental monitoring samples to various laboratories. Starting from the penultimate stage, the optimal value function for each state in each stage is calculated based on the recursive relationship between the state transition equation and the optimal value function. When calculating the optimal value for each state in each stage, all laboratory selections are iterated. After calculating the optimal value function for all stages, the complete testing relationship is determined based on the optimal decision for each stage, starting from the first stage. Archiving the initial and final test submission relationships includes the following sub-steps: Create virtual initial nodes and virtual final nodes to store the initial and final test delivery relationships, respectively; Storage is determined based on the virtual initial node and the virtual final node; After completing the storage judgment, obtain the test request and establish the corresponding test relationship based on the test request; The storage determination based on the virtual initial node and the virtual final node includes determining whether the virtual initial node or the virtual final node can be invoked; The conditions under which a virtual initial node can be invoked are: ; in, This indicates whether data exists in the virtual initial node. If data i exists in the virtual initial node, then B=1; otherwise, B=0. This indicates the amount of data stored in the virtual initial node, where F represents the maximum storage capacity in the virtual initial node. This indicates the amount of data occupied by the initial test relationship q, and U represents the pre-set specified threshold.
2. The method for generating the sample delivery relationship for environmental monitoring based on dynamic programming as described in claim 1, characterized in that, The monitoring stations include air monitoring stations and water quality monitoring stations; Atmospheric monitoring stations monitor sulfur dioxide, nitrogen oxides, and particulate matter in the air; water quality monitoring stations monitor chemical oxygen demand, biochemical oxygen demand, and heavy metal ion content in water bodies.
3. The method for generating the sample delivery relationship for environmental monitoring based on dynamic programming as described in claim 2, characterized in that, During the monitoring process at a monitoring station, if one or more monitoring stations send the environmental monitoring samples they acquire to a designated laboratory for testing, then the relationship between the environmental monitoring sample and the designated laboratory is called a sending-for-test relationship.
4. A system for generating the sample delivery relationship for environmental monitoring based on dynamic programming, characterized in that, Specifically, it includes: The unit includes an acquisition unit, an initial test-submission relationship determination unit, a final test-submission relationship determination unit, and an archiving unit. The acquisition unit retrieves initialization information; The initialization information obtained includes the types and quantities of monitoring indicators for environmental monitoring samples, the location of monitoring stations, the testing capabilities of the laboratories corresponding to the monitoring stations, and the number of laboratories. The initial testing relationship determination unit determines the initial testing relationship based on the initialization information. The determination of the initial testing relationship based on the initialization information includes the following sub-steps: determining one or more laboratories corresponding to each site; determining whether one or more laboratories have testing capabilities; if one or more laboratories have testing capabilities, determining the initial testing relationship between the laboratories and the monitoring sites; if one or more laboratories do not have testing capabilities, re-determining the laboratories corresponding to the monitoring sites. The final test delivery relationship determination unit optimizes the initial test delivery relationship and determines the final test delivery relationship; The archiving unit archives the initial and final test submission relationships; The final test delivery relationship determination unit optimizes the initial test delivery relationship and determines the final test delivery relationship, including the following sub-steps: Divide the testing phase into stages; Based on the divided stages, determine the specific status of one or more laboratories in the initial testing relationship under each stage; the specific status is represented as S=(n1,n2,...nx,C), where n1,n2,...nx represent the remaining testing capacity of laboratory 1 to laboratory x, and C represents the cumulative testing cost; After determining the specific state, the initial decision is made; The initial decision and the specific circumstances of one or more laboratories are analyzed to optimize the initial testing relationship and determine the final testing relationship; S i Defined as the state of the i-th stage, d i For the initial decision in the i-th stage, the state transition equation is: From the current state S i According to decision d i How to transition to the next state S i+1 The recurrence relation is expressed as T represents the transfer function; Define the optimal value function as f i (S i ), indicating that from state S i The minimum cost from the start to the last stage is represented by the recursive relation as follows: ; in This represents the testing cost for making a decision under the given conditions. The function representing the (i+1)th stage, d i This is the initial decision for the i-th stage; The optimal value function for the last stage is calculated by directly calculating the optimal value for each state based on the cost of sending environmental monitoring samples to various laboratories. Starting from the penultimate stage, the optimal value function for each state in each stage is calculated based on the recursive relationship between the state transition equation and the optimal value function. When calculating the optimal value for each state in each stage, all laboratory selections are iterated. After calculating the optimal value function for all stages, the complete testing relationship is determined based on the optimal decision for each stage, starting from the first stage. Archiving the initial and final test submission relationships includes the following sub-steps: Create virtual initial nodes and virtual final nodes to store the initial and final test delivery relationships, respectively; Storage is determined based on the virtual initial node and the virtual final node; After completing the storage judgment, obtain the test request and establish the corresponding test relationship based on the test request; The storage determination based on the virtual initial node and the virtual final node includes determining whether the virtual initial node or the virtual final node can be invoked; The conditions under which a virtual initial node can be invoked are: ; in, This indicates whether data exists in the virtual initial node. If data i exists in the virtual initial node, then B=1; otherwise, B=0. This indicates the amount of data stored in the virtual initial node, where F represents the maximum storage capacity in the virtual initial node. This indicates the amount of data occupied by the initial test relationship q, and U represents the pre-set specified threshold.
5. The environmental monitoring sample delivery relationship generation system based on dynamic programming as described in claim 4, characterized in that, The monitoring stations acquired by the acquisition unit include air monitoring stations and water quality monitoring stations; Atmospheric monitoring stations monitor sulfur dioxide, nitrogen oxides, and particulate matter in the air; water quality monitoring stations monitor chemical oxygen demand, biochemical oxygen demand, and heavy metal ion content in water bodies.
6. The environmental monitoring sample delivery relationship generation system based on dynamic programming as described in claim 5, characterized in that, During the monitoring process of the monitoring stations acquired by the acquisition unit, if one or more monitoring stations send the acquired environmental monitoring samples to a designated laboratory for testing, then the relationship between the environmental monitoring sample and the designated laboratory is a sending-for-test relationship.
Citation Information
Patent Citations
Laboratory sample delivery and proxy system
CN115301310A
Work order allocation correction method, device and system
CN115713189A