Water meter transmission method and system based on fragment encryption communication
By using fragment-based encryption communication methods in smart water meters, splitting and combining key segments, the problem of simple passwords and high leakage risks in smart water meters communication encryption methods is solved, and higher information security and communication security are achieved.
Patent Information
- Application Number
- CN202510176707.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-06-10
AI Technical Summary
The communication encryption method of smart water meters has problems such as simple passwords and infrequent updates or modifications by users, resulting in password leakage or interceptance, resulting in poor communication confidentiality.
Using a method based on fragment encryption communication, by obtaining the communication direction, splitting the encryption key or decryption key into several fragments, and storing it in the water meter, randomly generating a combination of fragments to dynamically generate a limited key for encryption and decryption of transmission information.
The information security and confidentiality of water meter communication is improved, and the difficulty of stealing and deciphering is increased by randomly splitting and combining key segments, ensuring the security of the communication process.
Smart Images

Figure CN120128914A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of water meter communication, and in particular, to a water meter transmission method and system based on fragment encryption communication. Background Art
[0002] Intelligent water meters that combine low-power wide-area networks for real-time water flow collection and wireless transmission will gradually replace traditional water meters. This solution will solve the problems of low accuracy and low efficiency commonly existing in traditional meter reading methods. The NB-IoT technology has strong coverage, strong penetration, low cost, low power consumption, and wide coverage. NB-IoT also supports a large number of connections and has stable data transmission, and is often applied to the scenario of intelligent water meters that transmit a small amount of data at a time.
[0003] The data security of intelligent water meters is an important link to ensure the effective protection of user information and water usage data. Currently, common Bluetooth security protocols or wifi encryption protocols are used to encrypt the communication between the terminal and the intelligent water meter. The above encryption methods all set passwords composed of multiple digits to encrypt the transmitted information. However, in actual use, the encryption passwords of the above encryption methods are generally relatively simple, and because users often do not update or modify the passwords frequently, the passwords are easily leaked or intercepted and stolen, resulting in poor communication confidentiality in water meter communication. Summary of the Invention
[0004] In order to improve the information security and confidentiality during water meter communication, this application provides a water meter transmission method and system based on fragment encryption communication.
[0005] In a first aspect, this application provides a water meter transmission method based on fragment encryption communication, adopting the following technical solution: A water meter transmission method based on fragment encryption communication includes the following steps: Obtain the communication direction, and select an encryption key in a preset encryption string or select a decryption key in a preset decryption string. There is no association between the encryption string and the decryption string. The communication direction includes a first direction from the terminal to the water meter and a second direction from the water meter to the terminal; Based on the communication direction, split the encryption key to obtain a number of encryption key fragments or split the decryption key to obtain a number of decryption key fragments, and distribute the split encryption key fragments or decryption key fragments to each water meter for storage; Randomly generate a fragment combination formula, and based on the fragment combination formula, select a corresponding number of the encryption key fragments to generate a matching limited decryption key or select a corresponding number of the decryption key fragments based on the fragment combination formula to generate a matching limited encryption key, and distribute the limited encryption key or the limited decryption key to the terminal; Select the defined encryption key based on the communication direction to encrypt the transmission information and decrypt the transmission information with the decryption key segment, or select to encrypt the transmission information with the encryption key segment and decrypt the transmission information with the corresponding defined decryption key based on the communication direction.
[0006] In some of these embodiments, obtaining the communication direction and selecting the encryption key from a preset encryption string or the decryption key from a preset decryption string includes the following steps: Obtain a number of key strings uploaded and divide the number of key strings into two groups; Select the encryption key from one of the groups of key strings to integrate into the encryption string, and select the decryption key from the other group of key strings to integrate into the decryption string; When the communication direction is the first direction, randomly select one of the decryption keys from the decryption string by random rolling; When the communication direction is the second direction, randomly select one of the encryption keys from the encryption string by random rolling.
[0007] In some of these embodiments, splitting the encryption key or the decryption key based on the communication direction and separately distributing the split number of encryption key segments or decryption key segments to each of the water meters for storage includes the following steps: Obtain the number of currently online water meters; If the communication direction is the first direction, split the decryption key into a number of decryption key segments not greater than the number of water meters; Randomly distribute the number of decryption key segments to each of the water meters, and add trap key segments to the water meters that have not been assigned decryption key segments; Back up the split number of decryption key segments and the trap key segments to a high-authority server; If the communication direction is the second direction, split the encryption key into a number of encryption key segments not greater than the number of water meters; Randomly distribute the number of encryption key segments to each water meter, and add trap key segments to the water meters that have not been assigned encryption key segments; Back up the split number of encryption key segments and the trap key segments to a high-authority server.
[0008] In some of these embodiments, randomly generating a fragment combination includes the following steps: Generate a random number of fragment grids and randomly insert the water meter numbers corresponding to different water meters into the fragment grids; Randomly adjust the order of each of the segment cells, where the order of the segment cells represents a specified encryption and decryption order.
[0009] In some of these embodiments, based on the segment combination, select a corresponding number of the encryption key segments to generate a matching defined decryption key or based on the segment combination, select a corresponding number of the decryption key segments to generate a matching defined encryption key, including the following steps: In the server, select the encryption key segment or the decryption key segment corresponding to the water meter in each of the segment cells and add it to the segment cell; If the water meter corresponds to the trap key segment, retain the segment cell and set it to zero, and add a transmission abort instruction to the segment cell; Generate the defined decryption key or the defined encryption key for the segment combination through reverse analysis.
[0010] In some of these embodiments, based on the communication direction, select the defined encryption key to encrypt the transmission information and decrypt the transmission information through the decryption key segments, including the following steps: When the communication direction is the first direction, the terminal encrypts the transmission information based on the defined encryption key; Rotate the transmission information to each of the water meters in sequence based on the order of the segment cells and decrypt the defined encryption key through the decryption key segment corresponding to the water meter, where the decryption key segment corresponding to the water meter includes the decryption key segment on the current water meter and the backup of the decryption key segment corresponding to the water meter stored in the server; When the last segment cell in the defined encryption key is decrypted, the water meter corresponding to the segment cell distributes the decrypted transmission information to all other water meters.
[0011] In some of these embodiments, based on the communication direction, select to encrypt the transmission information through the encryption key segments and decrypt the transmission information through the corresponding defined decryption key, including the following steps: When the communication direction is the second direction, each water meter encrypts the transmission information based on its own corresponding encryption key segment; Select the encryption key segments corresponding to each water meter in sequence based on the order of the segment cells to perform associated mapping with the defined decryption key, where the encryption key segment corresponding to the water meter includes the encryption key segment on the current water meter and the backup of the encryption key segment corresponding to the water meter stored in the server; After all the fragment grids in the defined decryption key are associated and mapped, the terminal distributes the mapping result to each of the transmission messages to replace the encrypted key fragments, and decrypts each of the transmission messages based on the defined decryption key.
[0012] In some of these embodiments, when decrypting the transmission message, the following steps are further included: If the corresponding fragment grid is the trap key fragment, ignore this fragment grid and continue to decrypt the next fragment grid.
[0013] In some of these embodiments, when decrypting the transmission message, the following steps are further included: If the trap key fragment in the fragment grid is decrypted, trigger the transmission abort instruction in the fragment grid to interrupt the decryption and transmission of the transmission signal and generate an exception alarm.
[0014] In a second aspect, the present application provides a water meter transmission system based on fragment encryption communication, adopting the following technical solution: A water meter transmission system based on fragment encryption communication includes a terminal, a plurality of water meters communicatively connected to the terminal, and a server. Among them, The server includes: A key string storage module for storing a preset uploaded encryption string containing a plurality of encryption keys and a decryption string containing a plurality of decryption keys, where there is no association between the encryption string and the decryption string; An encryption and decryption key selection module for obtaining the communication direction and selecting the encryption key from the preset encryption string or selecting the decryption key from the preset decryption string, where the communication direction includes a first direction from the terminal to the water meter and a second direction from the water meter to the terminal; A key splitting module for splitting the encryption key based on the communication direction to obtain a plurality of encrypted key fragments or splitting the decryption key to obtain a plurality of decrypted key fragments; A defined key generation module for randomly generating a fragment combination type, and based on the fragment combination type, selecting corresponding several of the encrypted key fragments to generate a matching defined decryption key or selecting corresponding several of the decrypted key fragments to generate a matching defined encryption key, and distributing the defined encryption key or the defined decryption key to the terminal; The water meter includes: A key distributed storage module for distributing the split several encrypted key fragments or several decrypted key fragments to each of the water meters for storage; Both the terminal and the water meter include: An encryption and decryption module, configured to select the defined encryption key based on the communication direction to encrypt the transmission information and decrypt the transmission information with the decryption key fragment, or select to encrypt the transmission information with the encryption key fragment based on the communication direction and decrypt the transmission information with the corresponding defined decryption key.
[0015] Through the technical method provided by the embodiments of the present application, the following effects exist: First, there are preset encryption strings and decryption strings with a password book function. There is no association between them, and they are only used to provide encryption and decryption key references for each water meter-terminal communication. The provided keys will be split into several key fragments and sent to the water meter. Before each communication transmission, the combination method of key fragments in each communication will be randomly generated based on the fragment combination method. At the same time, the defined key for the corresponding single communication will be dynamically generated according to the result of the random combination of key fragments. When decrypting, only when the defined key and the key fragments form a combined match can the corresponding communication be realized. In this way, the security of the water meter communication process is improved through the randomly split key fragments and the randomly combined defined keys. When part of the transmission information is stolen, since only key fragments exist on it, it cannot be decrypted; and if all the transmission information is stolen, because the combination method of each key fragment in this communication is randomly generated, the difficulty of combined decryption and cracking will also be greatly improved; and if the encryption string and the decryption string are stolen and leaked, since they are only used to provide key samples, and the combination of each key fragment in the actual transmission is randomly generated based on the fragment combination method, they cannot be cracked and decrypted either. Description of the Drawings
[0016] Figure 1 It is a schematic diagram of the steps of a water meter transmission method based on fragment encryption communication provided by the embodiments of the present application.
[0017] Figure 2 It is a schematic diagram of the module connection of a water meter transmission system based on fragment encryption communication provided by the embodiments of the present application. Detailed Embodiments
[0018] To more clearly understand the purpose, technical solution, and advantages of this application, the following describes and explains this application in conjunction with the accompanying drawings and embodiments. However, those of ordinary skill in the art should understand that this application can be implemented without these details. In some cases, to avoid unnecessary descriptions from obscuring various aspects of this application, well-known methods, processes, systems, components, and / or circuits that have been described at a higher level will not be elaborated further. For those of ordinary skill in the art, it is obvious that various changes can be made to the disclosed embodiments of this application, and without departing from the principles and scope of this application, the general principles defined in this application can be applied to other embodiments and application scenarios. Therefore, this application is not limited to the illustrated embodiments, but conforms to the broadest scope consistent with the scope claimed in this application.
[0019] It should be noted here that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation to the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0020] In the description of this application, the meaning of "several" is one or more, the meaning of "multiple" is more than two, and understandings such as "greater than", "less than", "exceeding", etc. do not include the recited number, and understandings such as "above", "below", "within", etc. include the recited number. If there is a description of "first", "second", etc., it is only used to distinguish technical features and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features or implicitly indicating the sequence relationship of the indicated technical features.
[0021] In the description of this application, descriptions with reference to terms such as "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this application. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a combined manner.
[0022] The embodiments of this application disclose a water meter transmission method based on fragment encryption communication.
[0023] As Figure 1 shown, a water meter transmission method based on fragment encryption communication includes the following steps: S100, obtain the communication direction, select an encryption key from a preset encryption string or select a decryption key from a preset decryption string, and there is no association between the encryption string and the decryption string.
[0024] The communication directions include a first direction from the terminal to the water meter and a second direction from the water meter to the terminal. Different communication directions are characterized by different senders and receivers of the transmitted information. In the current technology, generally only the transmitted information between the water meter and the terminal is encrypted, while in this application, two-way encrypted communication is achieved.
[0025] There is no association between the set encryption string and the decryption string, which is characterized in that the decryption keys corresponding to the encryption keys in the encryption string will not appear in the decryption string, and the encryption keys corresponding to the decryption keys in the decryption string will not appear in the encryption string either.
[0026] Based on the different communication directions, select any one encryption key or any one decryption key.
[0027] S200, split the encryption key based on the communication direction to obtain several encryption key fragments or split the decryption key to obtain several decryption key fragments, and distribute the several split encryption key fragments or several decryption key fragments to each water meter for storage.
[0028] After selecting the encryption key or the decryption key, split the encryption key or the decryption key to obtain several key fragments, and at the same time distribute the several split key fragments to each water meter.
[0029] Among them, whether the split is the encryption key or the decryption key, the split key fragments will be distributed to the water meter for separate storage.
[0030] S300, randomly generate a fragment combination formula, and based on the fragment combination formula, select the corresponding several encryption key fragments to generate a matching limited decryption key or select the corresponding several decryption key fragments to generate a matching limited encryption key, and distribute the limited encryption key or the limited decryption key to the terminal.
[0031] The fragment combination formula is characterized as randomly generated, and is used to determine the selected key fragments and the combination order of the selected several key fragments. Select several split key fragments through the fragment combination formula and combine them according to the randomly obtained order requirements. The combined key combination is characterized as the new encryption key or the new decryption key corresponding to this transmission task. At the same time, based on the newly randomly combined encryption key or decryption key, reverse deduce the corresponding limited decryption key or limited encryption key in this transmission task.
[0032] The limited decryption key or the limited encryption key are uniformly distributed to the terminal and stored.
[0033] The S400 selects a qualified encryption key to encrypt the transmitted information based on the communication direction and decrypts the transmitted information with a decryption key segment, or encrypts the transmitted information with an encryption key segment based on the communication direction and decrypts the transmitted information with the corresponding qualified decryption key.
[0034] Based on the communication direction, it is selected whether to encrypt the transmitted information with a qualified encryption key or with an encryption key segment, depending on whether the key segment or the qualified key is stored in the object that issues the transmitted information.
[0035] According to the communication direction, after obtaining the encrypted transmitted information, it is further selected whether to decrypt with a qualified decryption key or with a decryption key segment according to the encryption method.
[0036] It should be noted that the qualified decryption key cannot decrypt the transmitted information corresponding to a single encryption key segment, and a single decryption key segment cannot completely decrypt the transmitted information encrypted by the qualified encryption key.
[0037] By the above method, first, an encrypted string and a decrypted string with a password book function are preset. There is no association between the two, and they are only used to provide encryption and decryption key references for each water meter-terminal communication. The provided keys will be split into several key segments and sent to the water meter. Before each communication transmission, the key segment combination method in each communication will be randomly generated based on the segment combination type. At the same time, the qualified key corresponding to the single communication will be dynamically generated according to the result of the random combination of the key segments. When decrypting, only when the qualified key and the key segment form a combined match can the corresponding communication be realized. In this way, the security in the water meter communication process is improved through the randomly split key segments and the randomly combined qualified keys. When part of the transmitted information is stolen, since only key segments exist on it, it cannot be decrypted; if all the transmitted information is stolen, because the combination method of each key segment in this communication is randomly generated, the difficulty of combined decryption and cracking will also be greatly improved; if the encrypted string and the decrypted string are stolen and leaked, since they are only used to provide key samples, and the combination of each key segment in the actual transmission is randomly generated based on the segment combination type, they cannot be cracked and decrypted either.
[0038] In some other embodiments, obtaining the communication direction and selecting an encryption key in the preset encrypted string or a decryption key in the preset decrypted string includes the following steps: S110, obtaining a plurality of uploaded key strings and dividing the plurality of key strings into two groups.
[0039] The key string is a key combination set by the staff in advance and uploaded for encryption and corresponding decryption.
[0040] Divide the key string into two groups. The division method can be random division or can be done by selecting in sequence.
[0041] S120, Select the encryption keys in one group of the key strings to integrate into an encryption string, and select the decryption keys in the other group of the key strings to integrate into a decryption string.
[0042] After dividing the key string, select all the encryption keys in one group of the key strings and discard all the decryption keys therein, select all the decryption keys in the other group of the key strings and discard all the encryption keys therein.
[0043] Integrate the selected encryption keys and decryption keys respectively to obtain an encryption string and a decryption string. After such selection, there is no encryption and decryption association between the encryption string and the decryption string.
[0044] S130, When the communication direction is the first direction, randomly select a decryption key from the decryption string by random rolling.
[0045] When the communication direction is the first direction, it means that the terminal encrypts the transmitted information and sends it to the water meter for decryption. Therefore, as the decryption party, the water meter needs to store the key segments for decryption respectively. So at this time, it is necessary to select the decryption key from the decryption string and split it.
[0046] The selection method of the decryption key adopts the random rolling method. Random rolling means placing a number of decryption keys in the roller for rotation, and selecting the decryption key at the selected node according to the rotation result.
[0047] S140, When the communication direction is the second direction, randomly select an encryption key from the encryption string by random rolling.
[0048] When the communication direction is the second direction, it means that each water meter encrypts the transmitted information and sends it to the water meter for decryption. Therefore, as the encryption party, the water meter needs to store the encryption segments for encryption respectively. So at this time, it is necessary to select the encryption key from the encryption string and split it.
[0049] The selection method of the encryption key is the same as that of the decryption key.
[0050] In some other embodiments, based on the communication direction, split the encryption key or the decryption key, and distribute the split several encryption key segments or several decryption key segments to each water meter for storage respectively, including the following steps: S210, Obtain the number of currently online water meters.
[0051] Online means a water meter connected to the terminal and in a working state.
[0052] S220, if the communication direction is the first direction, split the decryption key into several decryption key segments not greater than the number of water meters.
[0053] S230, randomly distribute several decryption key segments to the water meters, and add trap key segments to the water meters that have not been assigned decryption key segments.
[0054] S240, back up several split decryption key segments and trap key segments to a high-authority server.
[0055] S250, if the communication direction is the second direction, split the encryption key into several encryption key segments not greater than the number of water meters.
[0056] S260, randomly distribute several encryption key segments to each water meter, and add trap key segments to the water meters that have not been assigned encryption key segments.
[0057] S270, back up several split encryption key segments and trap key segments to a high-authority server.
[0058] Based on the communication direction, select to split the decryption key or the encryption key. The number of split key segments is not greater than the number of water meters. Because when it is greater than the number of water meters, some key segments cannot be distributed, which may cause the subsequent randomly generated segment combinations to not be able to select valid key segments.
[0059] Randomly distribute the split key segments to each water meter for storage. When the number of key segments is less than the number of water meters, some water meters cannot obtain key segments. At this time, trap key segments will be added to these water meters. The trap key segments are random number segments irrelevant to the encryption and decryption processes. They do not perform corresponding encryption and decryption operations subsequently, but are used as a backup countermeasure in the case of the transmission signal being stolen and deciphered.
[0060] At the same time, after splitting the key, several split encryption key segments are backed up in the server and stored in the corresponding storage unit in the server.
[0061] Because in most cases, the communication network status of each water meter is different, and when each water meter communicates with the terminal, the transmission information may arrive at different times. Then, when encrypting and decrypting the transmission information subsequently, when there is a time difference in the transmission information of multiple water meters, it is necessary to select the key segments backed up in the storage unit in the server according to the specific situation to achieve the combination of key segments.
[0062] Meanwhile, the overall permissions of the server are relatively high. Since the key string and the backup key fragments are stored on it and are also used to generate the fragment combination, its permissions correspondingly only work when there is a communication task, and only personnel with relatively high permissions from the enterprise management side can use it for viewing and processing.
[0063] In some other embodiments, generating the fragment combination includes the following steps: S310, generate a random number of fragment grids, and randomly insert the water meter numbers corresponding to different water meters into the fragment grids.
[0064] Each fragment grid is used to place encrypted key fragments or decrypted key fragments subsequently. Before placement, the fragment grid is first used to randomly place the numbers corresponding to different water meters.
[0065] S311, randomly adjust the order of each fragment grid. The order of the fragment grids represents the specified encryption and decryption order.
[0066] Adjust the order of each fragment grid. The order of the fragment grids is used to formulate and confirm the subsequent decryption or encryption order. For example, when decrypting subsequently, the decryption order of each decrypted key fragment needs to be carried out in sequence according to the specified order of the fragment grids. If the encryption or decryption order is incorrect, it is still considered that the decryption key is incorrect.
[0067] The fragment combination is mainly used to generate subsequent limited decryption keys or limited encryption keys, and both the limited decryption keys and limited encryption keys are sent to the terminal. Therefore, the generation of the fragment combination and the distribution of the limited keys can be realized at the enterprise side where the terminal is located, and there is no communication between the water meter side. Therefore, the possibility of being stolen and intercepted is relatively low, further improving security.
[0068] In some other embodiments, selecting corresponding several encrypted key fragments based on the fragment combination to generate a matching limited decryption key or selecting corresponding several decrypted key fragments based on the fragment combination to generate a matching limited encryption key includes the following steps: S320, select the encrypted key fragments or decrypted key fragments corresponding to the water meters in each fragment grid in the server and add them to the fragment grid.
[0069] S321, if there is a trap key fragment corresponding to the water meter, retain the fragment grid and set it to zero, and add a transmission abort instruction to the fragment grid.
[0070] S322, generate a limited decryption key or a limited encryption key for the fragment combination through reverse analysis.
[0071] Select the corresponding water meter according to the water meter number corresponding to each segment cell, and obtain the encrypted key segment or decrypted key segment stored corresponding to the water meter number in the server and put it into the segment cell. If the trap key segment is stored on the corresponding water meter in a certain segment cell, keep the segment cell but do not place the trap key segment in the segment cell. Instead, set the segment cell to zero and add a transmission abort instruction.
[0072] It should be noted that the transmission abort instruction in this segment cell is a confidentiality identifier, which can only be known by the enterprise side. When the segment combination is stolen or intercepted, it still displays the corresponding information of the trap key segment.
[0073] When combining each key segment based on the segment combination, a new key combination will be obtained. This key combination is characterized as the encryption key or decryption key that is randomly combined by the encrypted key segment or decrypted key segment in the current transmission and individually matches this transmission task.
[0074] Analyze the combined key through the reverse analysis method of the asymmetric key in the existing technology to obtain the limited decryption key or limited encryption key corresponding to the random combination of the encrypted key segment or decrypted key segment.
[0075] In some other embodiments, select a limited encryption key based on the communication direction to encrypt the transmission information and decrypt the transmission information through the decryption key segment, including the following steps: S410, when the communication direction is the first direction, the terminal encrypts the transmission information based on the limited encryption key.
[0076] S411, rotate the transmission information to each water meter in turn based on the order of the segment cells and decrypt the limited encryption key through the decryption key segment corresponding to the water meter. Among them, the decryption key segment corresponding to the water meter includes the decryption key segment on the current water meter and the backup of the decryption key segment corresponding to the water meter stored in the server.
[0077] S412, when the decryption of the last segment cell in the limited encryption key is completed, the water meter corresponding to this segment cell distributes the decrypted transmission information to all other water meters.
[0078] When the communication direction is the first direction, the terminal is the transmission information sender (encrypting party), and the water meter is the transmission information receiver (decrypting party). Therefore, the terminal uses the limited encryption key for encryption during encryption, and the water meter uses the decryption key segment for decryption during decryption.
[0079] The transmission data received by each water meter is encrypted based on a complete qualified encryption key. Each water meter alone cannot decrypt this transmission data. Instead, it is necessary to decrypt the qualified encryption key by sequentially selecting the corresponding decryption key segments of the water meters based on the order of the segment grids.
[0080] Therefore, the encrypted transmission information needs to be decrypted by one by one decryption key segments corresponding to different water meters respectively. The decryption order needs to strictly follow the correct water meter end and be decrypted in the correct order. Only when the last segment grid of the qualified encryption key is decrypted completely, the overall decryption work of this transmission information is considered completed.
[0081] Since the transmission information from the terminal to each water meter is generally the same meter reading instruction information, the water meter corresponding to the last step of decryption can directly forward this transmission information to all other water meters.
[0082] It should be noted that due to the different response times of each water meter to the transmission information in different communication network situations, each water meter may not be able to obtain and decrypt the transmission information simultaneously.
[0083] Therefore, when the communication network state is relatively complex and multiple water meters cannot decrypt the transmission information simultaneously, the water meter that first obtains the transmission information will obtain other required decryption key segments from the server with a backup of the decryption key segments and decrypt each segment grid sequentially according to the order of the segment grids. When the overall communication network information state is good, the response time difference between multiple water meters to the transmission information is small. At this time, after waiting for all water meters to obtain the transmission information, the transmission information can be rotated to each water meter respectively and the transmission information can be decrypted based on the decryption key segments stored on the water meter where the current transmission information is located.
[0084] In some other embodiments, after the last segment grid of the qualified encryption key is decrypted completely, a combination of multiple decryption key segments can be obtained based on whether each water meter is selected for decryption and the selected order. This combination is the complete decryption key corresponding to the qualified encryption key. The water meter that completes the last decryption step can send the complete decryption key to each water meter, so that each water meter replaces the currently stored decryption key segments with the complete decryption key and decrypts the transmission information with the complete decryption key.
[0085] In some other embodiments, based on the communication direction, encrypting the transmission information with an encryption key segment and decrypting the transmission information with a corresponding qualified decryption key includes the following steps: S420, when the communication direction is the second direction, each water meter encrypts the transmission information based on its corresponding encryption key segment.
[0086] S421. Select the encryption key segments corresponding to each water meter in sequence based on the fragment lattice to perform an associated mapping with the defined decryption key. Among them, the encryption key segment corresponding to the water meter includes the encryption key segment on the current water meter and the backup of the encryption key segments corresponding to each water meter stored in the server.
[0087] S422. When all the fragment lattices in the defined decryption key are associated and mapped, the terminal sends the mapping result to each piece of transmission information to replace each encryption key segment, and decrypts each piece of transmission information based on the defined decryption key.
[0088] When the communication direction is the second direction, the terminal is the receiver (decryption party) of the transmission information, and the water meter is the sender (encryption party) of the transmission information. Therefore, the water meter uses the encryption key segment during encryption, and the terminal uses the defined decryption key during decryption.
[0089] The transmission data sent by each water meter is encrypted through the encryption key segment. The defined decryption key in the terminal cannot decrypt each encryption key segment alone, but needs to select the corresponding water meter in sequence according to the order of the fragment lattice, obtain the encryption key segments of each water meter, and map them to each fragment lattice on the defined decryption key in sequence. When all the fragment lattices are mapped, multiple matching encryption key segments will form a complete mapping result, and this mapping result is expressed as the encryption key corresponding to the defined decryption key. In this way, the defined decryption key can decrypt this mapping result.
[0090] Send the mapping result to each piece of transmission information to replace all the encryption key segments with this mapping result, and decrypt the transmission result through the defined decryption key.
[0091] It should be noted that the encryption and decryption processes in the second direction are the same as those in the first direction. For the transmission information transmitted by each water meter to the terminal under different communication networks, there is a time difference in the terminal's reception, and the terminal often cannot obtain all the transmission information sent by all water meters at the same time.
[0092] Therefore, when the network state is relatively complex, the terminal cannot obtain all the transmission information sent by all the water meters with which it is communicatively connected at the same time, so it cannot obtain the encryption key segments corresponding to each water meter in all the transmission information. Therefore, at this time, the terminal needs to obtain the remaining other required encryption key segments from the server with the backup of the encryption key segments, and map the encryption key segments to each fragment lattice in sequence according to the order of the fragment lattice.
[0093] When the overall communication network state is good, the time difference in the terminal's acquisition of the transmission information sent by each water meter is small. At this time, it can wait until all the transmission information is acquired, and then select the encryption key segments corresponding to the transmission information sent by the matching water meters and perform the mapping respectively.
[0094] If there are errors in the mapping position or mapping order of the encrypted key segments during mapping, the decryption will fail.
[0095] In some other embodiments, when decrypting the transmitted information, the following steps are further included: S500, if the corresponding segment cell in the segment grid is a trap key segment, ignore this segment cell and continue to decrypt the next segment cell.
[0096] During the decryption process, if the corresponding segment cell is a trap key segment, regardless of whether it is the first direction or the second direction, the decryption process of this segment cell will be skipped, and the decryption of the segment cell behind this segment cell will continue.
[0097] That is, in the first direction, it is specified that the encrypted key will not be decrypted by the water meter corresponding to the trap key segment, but will be skipped and sent to the next water meter. In the second direction, during the associated mapping, the segment cell corresponding to the trap key segment will not be mapped.
[0098] In some other embodiments, when decrypting the transmitted information, the following steps are further included: S510, if the trap key segment in the segment cell is decrypted, trigger the transmission abort instruction in the segment cell to interrupt the decryption and transmission of the transmitted information and generate an exception alarm.
[0099] The trap key segment is used as a backup solution to prevent interception and decryption. It does not participate in the encryption and decryption process of the transmitted information in this application, but only serves as the interception and decryption processing of the transmitted information. When the key segment on it is decrypted, it is considered that the transmitted information has been intercepted and decrypted. Since the interceptor cannot know the specific segment combination and which key segment belongs to the trap key segment, generally, it will decrypt each key segment. Then, at this time, the transmission of all transmitted information will be aborted and an exception alarm will be generated.
[0100] As Figure 2 shown, an embodiment of the present application also discloses a water meter transmission system based on segment encryption communication, including a terminal, a plurality of water meters communicatively connected to the terminal, and a server. Among them, The server includes: A key string storage module, used to store an encrypted string containing a plurality of encryption keys and a decryption string containing a plurality of decryption keys uploaded in advance, where there is no association between the encrypted string and the decryption string; An encryption and decryption key selection module, used to obtain the communication direction and select the encryption key from the preset encrypted string or select the decryption key from the preset decryption string. The communication direction includes a first direction from the terminal to the water meter and a second direction from the water meter to the terminal; A key splitting module, configured to split the encryption key based on the communication direction to obtain a plurality of encryption key segments or split the decryption key to obtain a plurality of decryption key segments; A limited key generation module, configured to randomly generate a segment combination formula, and select a corresponding plurality of the encryption key segments based on the segment combination formula to generate a matching limited decryption key, or select a corresponding plurality of the decryption key segments based on the segment combination formula to generate a matching limited encryption key, and send the limited encryption key or the limited decryption key to the terminal; The water meter includes: A key distribution module, configured to respectively send the plurality of split encryption key segments or the plurality of decryption key segments to each of the water meters for storage; Both the terminal and the water meter include: An encryption / decryption module, configured to select the limited encryption key based on the communication direction to encrypt the transmission information and decrypt the transmission information through the decryption key segments, or select to encrypt the transmission information through the encryption key segments based on the communication direction and decrypt the transmission information through the corresponding limited decryption key.
[0101] The implementation principle is as follows: First, there are preset encryption strings and decryption strings with password book functions. There is no association between them, and they are only used to provide encryption and decryption key references for each water meter-terminal communication. The provided keys will be split into several key segments and sent to the water meters. Before each communication transmission, a key segment combination method for each communication will be randomly generated based on the segment combination formula. At the same time, a limited key corresponding to a single communication will be dynamically generated according to the result of the random combination of the key segments. When decrypting, only when the limited key and the key segments form a combined match can the corresponding communication be realized. In this way, the security of the water meter communication process is improved through the randomly split key segments and the randomly combined limited keys. When some transmission information is stolen, since only key segments exist on it, it cannot be decrypted; and if all the transmission information is stolen, because the combination method of each key segment in this communication is randomly generated, the difficulty of combined decryption and cracking will also be greatly increased; and if the encryption string and the decryption string are stolen and leaked, since they are only used to provide key samples and the combination of each key segment in actual transmission is randomly generated based on the segment combination formula, they cannot be cracked and decrypted either.
[0102] It should be understood that although the steps in the flowchart of the accompanying drawings are displayed in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit and can be executed in other orders.
[0103] The above are all preferred embodiments of the present application, and do not limit the protection scope of the present application accordingly. Therefore, all equivalent changes made according to the structure, shape, and principle of the present application shall be covered within the protection scope of the present application.
Claims
1. A water meter transmission method based on fragment encryption communication, characterized in that: The following steps are involved: Acquire a communication direction, select an encryption key from a preset encryption string or select a decryption key from a preset decryption string, wherein there is no association between the encryption string and the decryption string, and the communication direction includes a first direction from the terminal to the water meter and a second direction from the water meter to the terminal; Splitting the encryption key based on the communication direction to obtain a plurality of encryption key fragments or splitting the decryption key to obtain a plurality of decryption key fragments, and sending the split plurality of encryption key fragments or the plurality of decryption key fragments to each of the water meters for storage; Randomly generate a fragment combination formula, and select corresponding several encryption key fragments based on the fragment combination formula to generate a matching limited decryption key or select corresponding several decryption key fragments based on the fragment combination formula to generate a matching limited encryption key, and send the limited encryption key or the limited decryption key to the terminal; The defined encryption key is selected based on the communication direction to encrypt the transmission information and decrypt the transmission information by the decryption key fragment, or the transmission information is selected based on the communication direction to encrypt the transmission information by the encryption key fragment and decrypt the transmission information by the corresponding defined decryption key.
2. The water meter transmission method based on fragment encryption communication according to claim 1 is characterized in that: Acquiring the communication direction, selecting an encryption key from a preset encryption string or selecting a decryption key from a preset decryption string, comprises the following steps: Obtaining a plurality of uploaded key strings, and dividing the plurality of key strings into two groups; Selecting the encryption key in one of the key strings to be integrated into the encryption string, and selecting the decryption key in another key string to be integrated into the decryption string; When the communication direction is the first direction, a decryption key is randomly selected in the decryption string by random rolling. When the communication direction is the second direction, one of the encryption keys is randomly selected from the encryption string by random rolling.
3. The water meter transmission method based on fragment encryption communication according to claim 1 is characterized in that: The encryption key or the decryption key is split based on the communication direction, and the split encryption key fragments or the decryption key fragments are respectively sent to each water meter for storage, including the following steps: Obtain the number of water meters currently online; If the communication direction is the first direction, splitting the decryption key into a number of decryption key fragments no greater than the number of water meters; Randomly distribute a number of the decryption key fragments to each of the water meters, and add a trap key fragment to the water meter to which the decryption key fragment is not allocated; Backing up the split decryption key fragments and the trap key fragments to a high-authority server; If the communication direction is the second direction, splitting the encryption key into a number of encryption key fragments no greater than the number of water meters; Randomly distribute a number of the encryption key fragments to each water meter, and add a trap key fragment to the water meter to which the encryption key fragment is not allocated; The split encryption key fragments and the trap key fragments are backed up to a server with high authority.
4. The water meter transmission method based on fragment encryption communication according to claim 3 is characterized in that: Randomly generate a fragment combination, including the following steps: Generate a random number of segment grids, and randomly insert water meter numbers corresponding to different water meters into the segment grids; The order of each of the segment grids is randomly adjusted, and the order of the segment grids represents a prescribed encryption and decryption order.
5. The water meter transmission method based on fragment encryption communication according to claim 4 is characterized in that: Selecting corresponding several encryption key fragments based on the fragment combination to generate a matching limited decryption key or selecting corresponding several decryption key fragments based on the fragment combination to generate a matching limited encryption key comprises the following steps: Selecting, in the server, the encryption key fragment or the decryption key fragment corresponding to the water meter in each of the fragment grids and adding the fragment to the fragment grid; If the water meter corresponds to the trap key fragment, the fragment grid is retained and set to zero, and a transmission stop instruction is added to the fragment grid; The limited decryption key or the limited encryption key for the fragment combination is generated through reverse analysis.
6. The water meter transmission method based on fragment encryption communication according to claim 4 is characterized in that: Selecting the limited encryption key based on the communication direction to encrypt the transmission information and decrypting the transmission information by the decryption key fragment comprises the following steps: When the communication direction is the first direction, the terminal encrypts the transmission information based on the limited encryption key; The transmission information is sequentially transferred to each of the water meters based on the order of the fragment grid, and the limited encryption key is decrypted through the decryption key fragment corresponding to the water meter, wherein the decryption key fragment corresponding to the water meter includes the decryption key fragment currently on the water meter and a backup of the decryption key fragment corresponding to the water meter stored in the server; When the last fragment cell in the limited encryption key is decrypted, the water meter corresponding to the fragment cell distributes the decrypted transmission information to all other water meters.
7. The water meter transmission method based on fragment encryption communication according to claim 4 is characterized in that: Selecting to encrypt the transmission information by the encryption key fragment and decrypt the transmission information by the corresponding limited decryption key based on the communication direction includes the following steps: When the communication direction is the second direction, each of the water meters encrypts the transmission information based on the encryption key fragment corresponding to itself; Selecting the encryption key fragments corresponding to each water meter in sequence based on the order of the fragment grid to associate and map with the limited decryption key, wherein the encryption key fragments corresponding to the water meter include the encryption key fragments currently on the water meter and the backup of the encryption key fragments corresponding to the water meter stored in the server; When all the fragments in the limited decryption key are associated and mapped, the terminal sends the mapping result to each transmission information to replace the encryption key fragment, and decrypts each transmission information based on the limited decryption key.
8. The water meter transmission method based on fragment encryption communication according to claim 5 is characterized in that: When decrypting the transmission information, the following steps are also included: If the fragment corresponds to the trap key fragment, the fragment is ignored and the decryption is continued on the next fragment.
9. The water meter transmission method based on fragment encryption communication according to claim 8 is characterized in that: When decrypting the transmission information, the following steps are also included: If the trap key segment in the segment grid is decrypted, the transmission stop instruction in the segment grid is triggered to interrupt the decryption and transmission of the transmission signal and generate an abnormal alarm.
10. A water meter transmission system based on fragment encryption communication, characterized in that: It includes a terminal, several water meters connected to the terminal for communication, and a server, wherein: The server includes: A key string storage module, used to store a preset uploaded encrypted string containing a plurality of encryption keys and a decrypted string containing a plurality of decryption keys, wherein there is no association between the encrypted string and the decrypted string; An encryption and decryption key selection module, used to obtain a communication direction and select the encryption key from a preset encryption string or select the decryption key from a preset decryption string, wherein the communication direction includes a first direction from the terminal to the water meter and a second direction from the water meter to the terminal; A key splitting module, configured to split the encryption key based on the communication direction to obtain a plurality of encryption key fragments or split the decryption key to obtain a plurality of decryption key fragments; a restricted key generation module, configured to randomly generate a fragment combination, and select corresponding multiple encryption key fragments based on the fragment combination to generate a matching restricted decryption key, or select corresponding multiple decryption key fragments based on the fragment combination to generate a matching restricted encryption key, and send the restricted encryption key or the restricted decryption key to the terminal; The water meter includes: A key storage module, used for sending the split encryption key fragments or the decryption key fragments to each water meter for storage; The terminal and the water meter both include: An encryption / decryption module is used to select the limited encryption key based on the communication direction to encrypt the transmission information and decrypt the transmission information through the decryption key fragment, or to select to encrypt the transmission information through the encryption key fragment based on the communication direction and decrypt the transmission information through the corresponding limited decryption key.