A method and system for generating a cable route based on encrypted transmission

CN122802261APending Publication Date: 2026-09-22GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611226139.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-13
Publication Date
2026-09-22

AI Technical Summary

Technical Problem

然而,该模式下采集数据需经由不可控的公网链路传输至云端,现有方案普遍缺少对数据来源真实性和完整性的有效验证手段,云端收到的轨迹数据存在被篡改或伪造而不被察觉的风险,当这些不可信的源数据被直接用于路由重建时,所生成的光缆走向可能与现场实际敷设路径严重偏离,而运维人员无法识别这种偏离,后续若依据该路由信息执行故障定位或开挖指导,将直接导致误判和无效作业

Benefits of technology

[0008]本发明实施例通过响应于采集开始信号生成会话标识,并将主密钥和会话标识输入密钥派生函数生成第一会话密钥,能够使每次采集任务拥有独立的会话标识和对应的唯一会话密钥,实现不同采集任务之间的密钥隔离,提高数据传输安全性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122802261A_ABST
    Figure CN122802261A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for generating optical cable routes based on encrypted transmission, belonging to the field of optical cable resource operation and maintenance management. Specifically, it involves: acquiring RFID response frame data collected in the current session, and the corresponding location data; generating a first session key based on a pre-configured master key and the session identifier of the current session; aligning the RFID response frame data and location data by time to obtain first event data; encrypting the first event data according to the first session key to obtain second event data; generating a first verification code for the second event data according to the first session key; and uploading the second event data and the first verification code to a cloud server, so that the cloud server can generate an optical cable route path based on the second event data and the first verification code. Therefore, by implementing this invention, the cloud can actively identify whether the data is authentic and complete, ensuring that the optical cable route path is generated based on trusted source data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of optical cable resource operation and maintenance management, and in particular to an optical cable route generation method and system based on encrypted transmission. Background Technology

[0002] As a crucial physical carrier medium in power communication networks and various communication infrastructures, optical fiber cables are laid in complex environments, widely distributed, and with dispersed maintenance nodes. During the engineering construction, daily inspection, and fault handling of optical fiber cables, maintenance personnel often need to check and record information about each node, marker, and auxiliary equipment along the cable laying path to reconstruct the actual spatial route of the optical fiber cable. This provides basic data support for business scenarios such as resource ledger management, rapid fault location, line operation status analysis, and path visualization. With the continuous expansion of the scale of fiber optic communication networks, traditional route verification methods relying on manual recording, drawing annotations, or experience memory are no longer sufficient to meet the requirements of refined management. There is an urgent need to improve on-site operation efficiency and data accuracy by leveraging automatic identification and digital data collection methods.

[0003] Currently, the industry typically uses handheld RFID terminals in conjunction with GPS positioning modules to read RFID tags deployed along the fiber optic cable route. The tag codes are then associated with coordinate data and uploaded to a backend system to reconstruct the cable path. However, this method requires data to be transmitted to the cloud via an uncontrollable public network link. Existing solutions generally lack effective means to verify the authenticity and integrity of the data source. The trajectory data received in the cloud is at risk of being tampered with or forged without being detected. When this unreliable source data is directly used for route reconstruction, the generated cable route may deviate significantly from the actual on-site laying path. Maintenance personnel cannot identify this deviation, and subsequent fault location or excavation guidance based on this route information will directly lead to misjudgments and ineffective operations. Summary of the Invention

[0004] This invention provides a method and system for generating optical cable routes based on encrypted transmission, which enables the cloud to actively identify whether the data is authentic and complete, ensuring that the optical cable route path is generated based on trusted source data.

[0005] This invention provides a method for generating optical fiber routes based on encrypted transmission, applicable to terminal devices. The optical fiber route generation method includes: Acquire the RFID response frame data collected in the current session, and acquire the positioning data corresponding to the RFID response frame data; Based on the pre-configured master key and the session identifier of the current session, a first session key is generated, and the RFID response frame data and the positioning data are time-aligned to obtain the first event data; The first event data is encrypted using the first session key to obtain the second event data, and a first verification code for the second event data is generated using the first session key. The second event data and the first verification code are uploaded to the cloud server so that the cloud server can generate an optical cable routing path based on the second event data and the first verification code.

[0006] This invention provides a source of raw data for subsequent optical cable routing path generation by acquiring RFID response frame data and corresponding positioning data collected in the current session. By generating a session key based on a pre-configured master key and session identifier, and time-aligning the RFID response frame data and positioning data to obtain event data, the encryption key is uniquely bound to the session. Simultaneously, tag data and spatial location are unified in the time dimension, providing a data foundation for the subsequent generation of optical cable routing paths with spatiotemporal attributes. Encrypting the event data to obtain ciphertext and generating a checksum from the ciphertext provides integrity protection for the ciphertext while protecting data confidentiality. Uploading the ciphertext and checksum to a cloud server allows the cloud server to generate an optical cable routing path based on the second event data and the first checksum, ensuring the credibility of the source data during the optical cable routing path generation process. Compared to existing technologies that cannot verify whether optical cable acquisition data has been tampered with or forged in the cloud, this application enables the cloud to actively identify the authenticity and integrity of the data, ensuring that the optical cable routing path is generated based on credible source data.

[0007] Further, generating the first session key based on the pre-configured master key and the session identifier of the current session includes: In response to the acquisition start signal of the current session, and based on the trigger timestamp of the acquisition start signal and the device identifier, the session identifier is generated; The master key and the session identifier are input into the key derivation function for operation to generate the first session key.

[0008] This invention generates a session identifier in response to a data acquisition start signal, and inputs the master key and session identifier into a key derivation function to generate a first session key. This enables each data acquisition task to have an independent session identifier and a corresponding unique session key, thereby achieving key isolation between different data acquisition tasks and improving data transmission security.

[0009] Further, the step of time-aligning the RFID response frame data and the positioning data to obtain the first event data includes: Obtain the acquisition timestamp of the RFID response frame data, and obtain the positioning timestamp of the positioning data; Based on the collection timestamp and the positioning timestamp of each positioning point in the positioning data, calculate the absolute value of the time difference between each positioning point and the RFID response frame data, and determine the positioning point with the smallest absolute value of the time difference as the target positioning point corresponding to the RFID response frame data; The coordinate data of the target location point is associated with the RFID response frame data to obtain the first event data.

[0010] This invention, by acquiring the timestamps of RFID response frame data and positioning data, determines the positioning point corresponding to the RFID reading based on the time difference between the two and associates the coordinates with the response frame data, thereby achieving the alignment of optical cable tag data and spatial location in the time dimension, providing basic data containing spatiotemporal attributes for subsequent optical cable routing path generation.

[0011] Further, the step of encrypting the first event data according to the first session key to obtain the second event data includes: The first event data is converted into a byte stream in a preset data format, and a random number is generated; Based on the first session key and the random number, an encryption operation is performed on the byte stream to obtain the second event data.

[0012] The embodiments of the present invention convert the first event data into a byte stream of a preset data format and generate a random number. Then, the second event data is obtained by performing encryption operations on the byte stream according to the first session key and the random number. The random number can be used to ensure that the same plaintext produces different ciphertexts in different encryptions, thus preventing replay attacks.

[0013] Further, uploading the second event data and the first verification code to the cloud server includes: The second event data and the first verification code are encapsulated into a target data packet; Write the target data packet into a local cache queue, and mark the target cache record corresponding to the target data packet in the local cache queue as a pending send status; The target data packet is uploaded to the cloud server via a public network communication link; wherein, when a confirmation response is received from the cloud server, the target cache record is updated to the sent status.

[0014] This invention encapsulates ciphertext and checksum into a target data packet, writes it into a local cache queue, marks it as pending transmission, and then uploads it via a public network communication link. Upon receiving a confirmation response from the cloud server, the corresponding cache record is updated to the transmitted status. This enables complete lifecycle management of data packets from encapsulation, queuing, uploading to confirmation under normal network conditions, ensuring reliable data delivery to the cloud.

[0015] Furthermore, when a failure is detected in the public network communication link, newly generated data packets are continuously written into the local cache queue, and the cache records corresponding to each data packet in the local cache queue are marked as pending transmission. When the failure of the public network communication link is eliminated, all data packets with corresponding cache records in the pending transmission state are continuously uploaded to the cloud server in a preset order.

[0016] This invention continuously writes newly generated data packets into a local cache queue when a public network communication link failure is detected, and continuously uploads data packets marked as pending transmission in a preset order after the link is restored. This ensures that data is not lost and the upload order is not disordered under abnormal conditions of unstable network, and ensures that the data sequence received by the cloud server is consistent with the on-site collection order.

[0017] Another embodiment of the present invention provides a method for generating optical fiber routes based on encrypted transmission, applicable to cloud servers, the method comprising: The terminal device receives second event data and a first verification code uploaded by itself. The second event data is obtained by encrypting the first event data using a first session key. The first verification code is generated by the terminal device using the first session key and the second event data. The first session key is generated by the terminal device based on a pre-configured master key and the session identifier of the current session. The first event data is obtained by the terminal device by time-aligning RFID response frame data and location data. The RFID response frame data and the location data are obtained by the terminal device within the current session. Based on the master key and the session identifier, a second session key is generated, and based on the second session key, a second checksum of the second event data is generated. When the first verification code and the second verification code are the same, the second event data is decrypted according to the second session key to obtain the first event data; Based on the first event data, an optical cable routing path is generated.

[0018] This invention receives ciphertext and a first verification code uploaded by a terminal device, generates a second session key based on the same master key and session identifier, and generates a second verification code for the same ciphertext. Decryption is performed only when the first verification code and the second verification code are the same to obtain the plaintext and generate a routing path. This allows the cloud server to actively verify the authenticity and integrity of the data source. Only data that passes the integrity verification can be decrypted and used for subsequent optical cable routing path generation.

[0019] Further, generating the optical cable routing path based on the first event data includes: For any reading in the first event data, the target event identifier corresponding to the reading is compared with each event identifier stored in the cloud database. If the target event identifier is different from each of the event identifiers, the reading is written into the cloud database. Based on the readings written to the cloud database, an optical cable routing path is generated.

[0020] This invention compares the target event identifier of each reading in the first event data with the event identifier in the cloud database. The corresponding reading is only written when the target event identifier does not exist in the database. This avoids the same event data being repeatedly written to the cloud database due to retransmission by the terminal device, retransmission after network outage, or other reasons.

[0021] Further, generating the optical cable routing path based on the readings written to the cloud database includes: The readings written to the cloud database are sorted by time to obtain a spatiotemporal trajectory point sequence; Spatial reconstruction is performed on the spatiotemporal trajectory point sequence to obtain a path segment sequence; According to preset constraints, each path segment in the path segment sequence is spliced ​​together to obtain the optical cable routing path.

[0022] This invention provides a method for obtaining a spatiotemporal trajectory point sequence by sorting the readings written to the cloud database over time, obtaining a path segment sequence by spatial reconstruction, and obtaining an optical cable routing path by splicing the path segments according to preset constraints. This method can convert discrete collection points into continuous optical cable routing paths and achieve accurate restoration of the spatial orientation of optical cables.

[0023] Another embodiment of the present invention provides an optical cable route generation system based on encrypted transmission, comprising: a terminal device for implementing the optical cable route generation method based on encrypted transmission as described in the present invention, and a cloud server for implementing the optical cable route generation method based on encrypted transmission as described in the present invention. Attached Figure Description

[0024] Figure 1 A flowchart illustrating an embodiment of the optical cable route generation method based on encrypted transmission provided by the present invention; Figure 2 A flowchart illustrating another embodiment of the optical cable route generation method based on encrypted transmission provided by the present invention; Figure 3 A schematic diagram of an embodiment of the optical cable routing generation system based on encrypted transmission provided by the present invention; Figure 4 A schematic diagram of the structure of one embodiment of the terminal device provided by the present invention; Figure 5 This is a schematic diagram of the structure of one embodiment of the cloud server provided by the present invention. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0027] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0028] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0029] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0030] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0031] See Figure 1 To address the problem that existing technologies cannot verify whether fiber optic cable data acquisition has been tampered with or forged in the cloud, an embodiment of the present invention provides a fiber optic cable route generation method based on encrypted transmission, applicable to terminal devices. The fiber optic cable route generation method includes steps S101 to S104: Step S101: Obtain the RFID response frame data collected in the current session, and obtain the positioning data corresponding to the RFID response frame data.

[0032] It should be noted that acquiring the RFID response frame data collected in the current session and acquiring the corresponding positioning data means that, in the current acquisition session, the acquisition terminal reads the response frame data of the tags along the optical cable using the RFID all-in-one device, and simultaneously acquires the corresponding spatial coordinate data through the positioning module. These two types of data are collected synchronously and used as the raw input for subsequent optical cable routing path generation. This step differs from the traditional method of manually recording tag codes and coordinates one by one. Through the synchronous triggering of automatic identification and positioning technologies, it provides a data foundation for the digital reconstruction of the optical cable routing path.

[0033] In one embodiment, in response to the start of the current session, the acquisition terminal establishes a communication connection with the RFID all-in-one machine via the TCP protocol and issues a preset inventory command, triggering the RFID all-in-one machine to continuously read the RFID tags deployed along the optical cable. The terminal receives and parses the RFID response frame data returned by the RFID all-in-one machine to obtain EPC information and RSSI information. The EPC information is used to identify the RFID tag object being read, and the RSSI information is used to characterize the signal strength of the corresponding tag.

[0034] Specifically, to improve the reliability of subsequent data processing, the parsing results can be filtered based on preset validity judgment rules. These validity judgment rules include at least: response frame structure integrity verification, checksum verification, and RSSI reasonable range judgment. Data records that fail verification or have abnormal RSSI are discarded and do not participate in subsequent event encapsulation and uploading processes.

[0035] In one embodiment, the acquisition terminal simultaneously reads the positioning data output by the positioning module while receiving RFID response frame data; wherein, the positioning module can be a GPS module, a Beidou positioning module, or other satellite positioning module; the positioning data includes at least longitude, latitude, and positioning timestamp.

[0036] Step S102: Based on the pre-configured master key and the session identifier of the current session, generate a first session key, and perform time alignment on the RFID response frame data and the positioning data to obtain first event data.

[0037] It should be noted that generating a first session key based on the pre-configured master key and the session identifier of the current session, and aligning the RFID response frame data and the positioning data in time to obtain the first event data means that the acquisition terminal generates the first session key through a key derivation function based on the pre-configured master key and the session identifier of the current session, which is used to encrypt and protect the data within the current session. Simultaneously, the acquisition terminal aligns the acquired RFID response frame data and positioning data in the time dimension, matching each tag reading to its corresponding spatial coordinates, forming event data with location information. These two actions together prepare for subsequent data encryption and route generation.

[0038] Preferably, generating the first session key based on the pre-configured master key and the session identifier of the current session includes: In response to the acquisition start signal of the current session, and based on the trigger timestamp of the acquisition start signal and the device identifier, the session identifier is generated; The master key and the session identifier are input into the key derivation function for operation to generate the first session key.

[0039] In one embodiment, a session management mechanism is required to achieve data and key isolation for different acquisition tasks. When the acquisition terminal receives a start signal, it generates a unique session identifier for the current session; when it receives a stop signal or the communication connection is broken, the current session ends.

[0040] Furthermore, the acquisition terminal generates a corresponding first session key based on the pre-constructed master key and session identifier. For example, the master key can be pre-configured as "0xA3F5C19D7B2E8F01" and the session identifier as "S01". The acquisition terminal uses the HMAC-SHA256 algorithm to operate on the master key and session identifier to obtain a 256-bit output value, and then takes the first 128 bits as the first session key "7F3A91C2B6D4E8A1". This key is only valid within the acquisition session corresponding to the current session identifier, thereby realizing the independence of keys between different acquisition sessions, improving the security of data transmission, and reducing the risks caused by cross-session data replay or key reuse.

[0041] Preferably, the step of time-aligning the RFID response frame data and the positioning data to obtain the first event data includes: Obtain the acquisition timestamp of the RFID response frame data, and obtain the positioning timestamp of the positioning data; Based on the collection timestamp and the positioning timestamp of each positioning point in the positioning data, calculate the absolute value of the time difference between each positioning point and the RFID response frame data, and determine the positioning point with the smallest absolute value of the time difference as the target positioning point corresponding to the RFID response frame data; The coordinate data of the target location point is associated with the RFID response frame data to obtain the first event data.

[0042] In one embodiment, the reading in the RFID response frame data can be matched with the nearest location point to obtain the latitude and longitude coordinates corresponding to the reading. If multiple location points exist within a preset time window, the corresponding location can be determined using nearest neighbor matching, linear interpolation, or weighted interpolation. Through the above processing, the acquisition terminal generates first event data containing a session identifier, event identifier, EPC information, RSSI information, latitude and longitude coordinates, and a timestamp; wherein, the event identifier uniquely corresponds to a reading in the RFID response frame data, and can be generated by combining the session identifier, timestamp, device identifier, and an incrementing sequence number, or by other methods that can uniquely identify a single event.

[0043] Step S103: Encrypt the first event data according to the first session key to obtain the second event data, and generate the first verification code of the second event data according to the first session key.

[0044] It should be noted that encrypting the first event data using the first session key to obtain the second event data, and generating the first checksum of the second event data using the first session key, means that the acquisition terminal uses the first session key corresponding to the current session to encrypt the time-aligned first event data to obtain the encrypted second event data; simultaneously, based on the first session key and the second event data, a first checksum is generated using an authentication encryption algorithm. This checksum is used on the cloud side to verify whether the second event data has been tampered with during transmission; that is, only the cloud side, possessing the same session key, can recalculate the matching checksum based on the received second event data. The encryption and checksum generation operations together achieve confidentiality and integrity protection for the event data.

[0045] Preferably, the first event data is converted into a byte stream of a preset data format, and a random number is generated; Based on the first session key and the random number, an encryption operation is performed on the byte stream to obtain the second event data.

[0046] In one embodiment, the first event data is converted into a unified data format, such as JSON or a binary byte stream. The acquisition terminal can group the converted byte stream, where each event identifier corresponds to an independent data record, forming a single group. To meet the input requirements of the encryption algorithm, the byte stream can also be length-aligned, and any insufficient parts can be padded using the PKCS#7 padding rule.

[0047] Furthermore, the byte stream can be encrypted using the GCM mode of the symmetric encryption algorithm AES, and a random number can be generated as an initial vector to ensure encryption randomness. The output ciphertext data is then concatenated with the authentication tag and Base64 encoded to obtain the second event data.

[0048] In one embodiment, the first verification code may be a message authentication code, a digest verification code, or other methods that can verify data integrity.

[0049] Step S104: Upload the second event data and the first verification code to the cloud server so that the cloud server can generate an optical cable routing path based on the second event data and the first verification code.

[0050] It should be noted that uploading the second event data and the first verification code to the cloud server, so that the cloud server can generate an optical cable routing path based on the second event data and the first verification code, means that the acquisition terminal uploads the encrypted second event data and its corresponding first verification code to the cloud server via a public network communication link. After receiving the second event data and the first verification code, the cloud server derives a second session key using the same pre-configured master key and session identifier as the acquisition terminal, recalculates the verification code for the second event data, and compares it with the first verification code to verify whether the data has been tampered with during transmission. After successful verification, the second event data is decrypted to obtain the first event data, and finally, an optical cable routing path is generated based on the first event data. This step, through end-cloud collaborative processing, enables the cloud to generate an optical cable routing path based on source data that has undergone integrity verification, ensuring the reliability of the routing information.

[0051] Preferably, uploading the second event data and the first verification code to the cloud server includes: The second event data and the first verification code are encapsulated into a target data packet; Write the target data packet into a local cache queue, and mark the target cache record corresponding to the target data packet in the local cache queue as a pending send status; The target data packet is uploaded to the cloud server via a public network communication link; wherein, when a confirmation response is received from the cloud server, the target cache record is updated to the sent status.

[0052] In one embodiment, the second event data, the first verification code, and the encrypted version field can be encapsulated together into a target data packet; wherein, the encrypted version field is used to identify the encryption protocol version. To adapt to network fluctuations or temporary network outages that may occur in the field public network environment, a local cache queue needs to be set up on the acquisition terminal. The generated target data packet is written into the local cache queue and marked as pending transmission. The local cache queue can be implemented using an SQLite database, a circular log file, or other persistent data structures. The acquisition terminal can upload the target data packet to the cloud server via a lightweight transmission protocol that supports acknowledgment response and retransmission mechanisms, such as MQTT (Message Queuing Telemetry Transport), through a 4G communication module, a 5G communication module, a Wi-Fi communication module, or other wireless communication methods. The MQTT protocol can be at QoS 1 (Quality of Service level 1) to ensure that the message is delivered at least once. When the acquisition terminal receives an acknowledgment response from the cloud server, it updates the local cache record corresponding to the target data packet to the sent status. By using the method of "first writing to disk locally, then uploading, and confirming that it has been sent", the risk of data loss due to abnormal program exit, network interruption, or device restart can be effectively reduced.

[0053] Preferably, when a failure of the public network communication link is detected, newly generated data packets are continuously written to the local cache queue, and the cache records corresponding to each data packet in the local cache queue are marked as pending transmission. When the failure of the public network communication link is detected to be eliminated, all data packets with the corresponding cache records in the pending transmission state are continuously uploaded to the cloud server in a preset order.

[0054] In one embodiment, when the public network communication link is unavailable, the acquisition terminal continuously writes newly generated data packets into a local cache queue without immediately deleting them. Simultaneously, the network status is periodically checked, and after the network recovers, the data to be sent in the local cache queue is resent sequentially according to a preset order until the local cache queue is empty. The preset order can be the time sequence or the queuing order of the data packets, thereby ensuring that the data packets received by the cloud server are as consistent as possible with the on-site acquisition order. Data packets that have received an acknowledgment response are not retransmitted; data packets that have not received an acknowledgment response remain in the local cache queue and participate in subsequent retries. Through this mechanism, reliable data retransmission and event order guarantee can be achieved in network outage scenarios.

[0055] This invention provides a source of raw data for subsequent optical cable routing path generation by acquiring RFID response frame data and corresponding positioning data collected in the current session. By generating a session key based on a pre-configured master key and session identifier, and time-aligning the RFID response frame data and positioning data to obtain event data, the encryption key is uniquely bound to the session. Simultaneously, tag data and spatial location are unified in the time dimension, providing a data foundation for subsequent generation of optical cable routing paths with spatiotemporal attributes. Encrypting the event data to obtain ciphertext and generating a checksum from the ciphertext provides integrity protection for the ciphertext while protecting data confidentiality. Uploading the ciphertext and checksum to a cloud server allows the cloud server to generate an optical cable routing path based on the second event data and the first checksum, ensuring the credibility of the source data during the optical cable routing path generation process.

[0056] Optionally, in this embodiment of the invention, generating the first session key based on the pre-configured master key and the session identifier of the current session includes: In response to the acquisition start signal of the current session, and based on the trigger timestamp of the acquisition start signal and the device identifier, the session identifier is generated; The master key and the session identifier are input into the key derivation function for operation to generate the first session key.

[0057] This invention generates a session identifier in response to a data acquisition start signal, and inputs the master key and session identifier into a key derivation function to generate a first session key. This enables each data acquisition task to have an independent session identifier and a corresponding unique session key, thereby achieving key isolation between different data acquisition tasks and improving data transmission security.

[0058] Optionally, in this embodiment of the invention, the step of time-aligning the RFID response frame data and the positioning data to obtain the first event data includes: Obtain the acquisition timestamp of the RFID response frame data, and obtain the positioning timestamp of the positioning data; Based on the collection timestamp and the positioning timestamp of each positioning point in the positioning data, calculate the absolute value of the time difference between each positioning point and the RFID response frame data, and determine the positioning point with the smallest absolute value of the time difference as the target positioning point corresponding to the RFID response frame data; The coordinate data of the target location point is associated with the RFID response frame data to obtain the first event data.

[0059] This invention, by acquiring the timestamps of RFID response frame data and positioning data, determines the positioning point corresponding to the RFID reading based on the time difference between the two and associates the coordinates with the response frame data, thereby achieving the alignment of optical cable tag data and spatial location in the time dimension, providing basic data containing spatiotemporal attributes for subsequent optical cable routing path generation.

[0060] Optionally, in this embodiment of the invention, encrypting the first event data according to the first session key to obtain the second event data includes: The first event data is converted into a byte stream in a preset data format, and a random number is generated; Based on the first session key and the random number, an encryption operation is performed on the byte stream to obtain the second event data.

[0061] The embodiments of the present invention convert the first event data into a byte stream of a preset data format and generate a random number. Then, the second event data is obtained by performing encryption operations on the byte stream according to the first session key and the random number. The random number can be used to ensure that the same plaintext produces different ciphertexts in different encryptions, thus preventing replay attacks.

[0062] Optionally, in this embodiment of the invention, uploading the second event data and the first verification code to the cloud server includes: The second event data and the first verification code are encapsulated into a target data packet; Write the target data packet into a local cache queue, and mark the target cache record corresponding to the target data packet in the local cache queue as a pending send status; The target data packet is uploaded to the cloud server via a public network communication link; wherein, when a confirmation response is received from the cloud server, the target cache record is updated to the sent status.

[0063] This invention encapsulates ciphertext and checksum into a target data packet, writes it into a local cache queue, marks it as pending transmission, and then uploads it via a public network communication link. Upon receiving a confirmation response from the cloud server, the corresponding cache record is updated to the transmitted status. This enables complete lifecycle management of data packets from encapsulation, queuing, uploading to confirmation under normal network conditions, ensuring reliable data delivery to the cloud.

[0064] Optionally, in this embodiment of the invention, when a failure of the public network communication link is detected, newly generated data packets are continuously written into the local cache queue, and the cache records corresponding to each data packet in the local cache queue are marked as pending transmission; when the failure of the public network communication link is detected to be eliminated, all data packets with the corresponding cache records in the pending transmission state are continuously uploaded to the cloud server in a preset order.

[0065] This invention continuously writes newly generated data packets into a local cache queue when a public network communication link failure is detected, and continuously uploads data packets marked as pending transmission in a preset order after the link is restored. This ensures that data is not lost and the upload order is not disordered under abnormal conditions of unstable network, and ensures that the data sequence received by the cloud server is consistent with the on-site collection order.

[0066] like Figure 2 As shown, based on the above-described method embodiments, another embodiment of the optical cable route generation method based on encrypted transmission is provided, applicable to cloud servers. The optical cable route generation method includes steps S201 to S204: Step S201: Receive second event data and a first verification code uploaded by the terminal device; wherein, the second event data is obtained by encrypting the first event data according to the first session key by the terminal device; the first verification code is generated by the terminal device according to the first session key and the second event data; the first session key is generated by the terminal device based on a pre-configured master key and the session identifier of the current session; the first event data is obtained by the terminal device by time-aligning RFID response frame data and positioning data; the RFID response frame data and the positioning data are obtained by the terminal device in the current session.

[0067] It should be noted that receiving the second event data and the first verification code uploaded by the terminal device means that the cloud server receives the second event data and the first verification code uploaded by the acquisition terminal through a public network communication link. The second event data is ciphertext data obtained by the acquisition terminal encrypting the first event data using the first session key, and the first verification code is integrity verification information generated by the acquisition terminal based on the same first session key and the ciphertext data. The cloud server uses these two pieces of data as input for subsequent integrity verification and decryption processing.

[0068] Step S202: Generate a second session key based on the master key and the session identifier, and generate a second checksum for the second event data based on the second session key.

[0069] It should be noted that generating a second session key based on the master key and the session identifier, and then generating a second checksum for the second event data based on the second session key, means that the cloud server generates a second session key using the same pre-configured master key and session identifier as the acquisition terminal, employing the same key derivation method as the acquisition terminal, ensuring that the cloud and the terminal hold the same session key. Based on this second session key, the received second event data is recalculated to obtain a second checksum. This second checksum is compared with the first checksum generated by the acquisition terminal to verify whether the second event data has been tampered with or forged during public network transmission, providing a basis for integrity judgment for subsequent decryption processing.

[0070] Step S203: When the first verification code and the second verification code are the same, the second event data is decrypted according to the second session key to obtain the first event data.

[0071] It should be noted that when the first verification code and the second verification code are the same, decrypting the second event data according to the second session key to obtain the first event data means that the cloud server compares its self-generated second verification code with the first verification code uploaded by the collection terminal. If they match, it is determined that the second event data has not been tampered with during transmission and its source is trustworthy. Based on this, the cloud server uses the second session key to perform a decryption operation on the second event data to restore the first event data before encryption. This step uses integrity verification as a prerequisite for decryption, ensuring that only data that passes verification can be decrypted and used for subsequent route generation.

[0072] Step S204: Generate an optical cable routing path based on the first event data.

[0073] It should be noted that, based on the first event data, generating the optical cable routing path means that, after the cloud server decrypts the first event data, it arranges the discrete coordinate points into an ordered trajectory sequence according to the latitude and longitude coordinates and collection timestamps contained in each reading of the first event data, and connects the discrete points into continuous path segments through spatial reconstruction processing. Finally, it splices the path segments according to preset constraints to generate a complete optical cable routing path, which is used for subsequent path display, fault location and operation status monitoring, etc.

[0074] Preferably, generating the optical cable routing path based on the first event data includes: For any reading in the first event data, the target event identifier corresponding to the reading is compared with each event identifier stored in the cloud database. If the target event identifier is different from each of the event identifiers, the reading is written into the cloud database. Based on the readings written to the cloud database, an optical cable routing path is generated.

[0075] In one embodiment, the cloud server uses the event identifier of each reading in the first event data as a unique index to perform the write operation. For the first arrival of an event identifier, the corresponding reading is written to the cloud database; for event identifiers that arrive repeatedly, idempotent processing methods such as ignoring the write or overwriting the update are performed, thereby avoiding the problem of duplicate data entry into the database due to terminal retries, resending, or repeated uploads.

[0076] Preferably, generating the optical cable routing path based on the readings written to the cloud database includes: The readings written to the cloud database are sorted by time to obtain a spatiotemporal trajectory point sequence; Spatial reconstruction is performed on the spatiotemporal trajectory point sequence to obtain a path segment sequence; According to preset constraints, each path segment in the path segment sequence is spliced ​​together to obtain the optical cable routing path.

[0077] In one embodiment, the cloud server groups each reading based on a session identifier and sorts them in ascending order by timestamp within each data group, thereby generating an ordered sequence of spatiotemporal trajectory points. To improve the reliability of the trajectory data, the original trajectory point sequence can be cleaned; wherein, the data cleaning process includes at least anomaly removal based on a spatial distance threshold to remove spatial jump points caused by positioning errors; anomaly detection based on RSSI stability to filter out erroneous matching points caused by signal fluctuations; and constraint detection based on temporal continuity to remove data points with abnormal or missing timestamps.

[0078] Furthermore, after data cleaning is completed, the cloud server performs spatial reconstruction processing on the spatiotemporal trajectory point sequence, converting the discrete latitude and longitude point sequence into a continuous path structure; wherein, the spatial reconstruction processing includes a polyline connection method, a spline interpolation method, or a path fitting method based on the least squares method, so as to achieve smoothing and continuous expression of the trajectory.

[0079] Furthermore, the cloud server combines the optical cable object information corresponding to the EPC information to associate and match the trajectory data of different optical cable tags or different optical cable segments, and splices and corrects adjacent path segments based on spatial proximity constraints and topological continuity constraints, thereby forming a complete optical cable routing path.

[0080] Specifically, the generated optical cable routing paths are stored in the form of node sequences or geometric path structures and used for cloud-based visualization and analysis, including path overlay display, trajectory playback, anomaly point marking, historical path comparison, and operation status monitoring, thereby realizing the digital reconstruction and management of optical cable routing paths.

[0081] This invention receives ciphertext and a first verification code uploaded by a terminal device, generates a second session key based on the same master key and session identifier, and generates a second verification code for the same ciphertext. Decryption is performed only when the first verification code and the second verification code are the same to obtain the plaintext and generate a routing path. This allows the cloud server to actively verify the authenticity and integrity of the data source. Only data that passes the integrity verification can be decrypted and used for subsequent optical cable routing path generation.

[0082] Optionally, in this embodiment of the invention, generating the optical cable routing path based on the first event data includes: For any reading in the first event data, the target event identifier corresponding to the reading is compared with each event identifier stored in the cloud database. If the target event identifier is different from each of the event identifiers, the reading is written into the cloud database. Based on the readings written to the cloud database, an optical cable routing path is generated.

[0083] This invention compares the target event identifier of each reading in the first event data with the event identifier in the cloud database. The corresponding reading is only written when the target event identifier does not exist in the database. This avoids the same event data being repeatedly written to the cloud database due to retransmission by the terminal device, retransmission after network outage, or other reasons.

[0084] Optionally, in this embodiment of the invention, generating the optical cable routing path based on the readings written to the cloud database includes: The readings written to the cloud database are sorted by time to obtain a spatiotemporal trajectory point sequence; Spatial reconstruction is performed on the spatiotemporal trajectory point sequence to obtain a path segment sequence; According to preset constraints, each path segment in the path segment sequence is spliced ​​together to obtain the optical cable routing path.

[0085] This invention provides a method for obtaining a spatiotemporal trajectory point sequence by sorting the readings written to the cloud database over time, obtaining a path segment sequence by spatial reconstruction, and obtaining an optical cable routing path by splicing the path segments according to preset constraints. This method can convert discrete collection points into continuous optical cable routing paths and achieve accurate restoration of the spatial orientation of optical cables.

[0086] like Figure 3As shown, based on the above method embodiments, corresponding system embodiments are provided; An embodiment of the present invention provides an optical cable route generation system based on encrypted transmission, comprising: a terminal device for implementing the optical cable route generation method based on encrypted transmission as described in the present invention, and a cloud server for implementing the optical cable route generation method based on encrypted transmission as described in the present invention.

[0087] like Figure 4 As shown, based on the above system item embodiment, an embodiment of a terminal device is provided, including: a data acquisition module 401, a key generation module 402, a data encryption module 403, and a data upload module 404; The data acquisition module 401 is used to acquire RFID response frame data collected in the current session and acquire the positioning data corresponding to the RFID response frame data. The key generation module 402 is used to generate a first session key based on a pre-configured master key and the session identifier of the current session, and to perform time alignment on the RFID response frame data and the positioning data to obtain first event data; The data encryption module 403 is used to encrypt the first event data according to the first session key to obtain the second event data, and generate a first verification code for the second event data according to the first session key. The data upload module 404 is used to upload the second event data and the first verification code to the cloud server, so that the cloud server can generate an optical cable routing path based on the second event data and the first verification code.

[0088] Optionally, in this embodiment of the invention, the key generation module 402 includes: a session identifier generation submodule and a session key generation submodule; The session identifier generation submodule is used to respond to the acquisition start signal of the current session and generate the session identifier according to the trigger timestamp of the acquisition start signal and the device identifier; The session key generation submodule is used to perform operations on the master key and the session identifier input key derivation function to generate the first session key.

[0089] This invention generates a session identifier in response to a data acquisition start signal, and inputs the master key and session identifier into a key derivation function to generate a first session key. This enables each data acquisition task to have an independent session identifier and a corresponding unique session key, thereby achieving key isolation between different data acquisition tasks and improving data transmission security.

[0090] Optionally, in this embodiment of the invention, the key generation module 402 further includes: a timestamp acquisition submodule, a location point determination submodule, and a data association submodule; The timestamp acquisition submodule is used to acquire the collection timestamp of the RFID response frame data and the positioning timestamp of the positioning data. The location point determination submodule is used to calculate the absolute value of the time difference between each location point and the RFID response frame data based on the collection timestamp and the location timestamp of each location point in the location data, and determine the location point with the smallest absolute value of the time difference as the target location point corresponding to the RFID response frame data. The data association submodule is used to associate the coordinate data of the target positioning point with the RFID response frame data to obtain the first event data.

[0091] This invention, by acquiring the timestamps of RFID response frame data and positioning data, determines the positioning point corresponding to the RFID reading based on the time difference between the two and associates the coordinates with the response frame data, thereby achieving the alignment of optical cable tag data and spatial location in the time dimension, providing basic data containing spatiotemporal attributes for subsequent optical cable routing path generation.

[0092] Optionally, in this embodiment of the invention, the data encryption module 403 includes: a format conversion submodule and a data encryption submodule; The format conversion submodule is used to convert the first event data into a byte stream of a preset data format and generate random numbers; The data encryption submodule is used to perform encryption operations on the byte stream based on the first session key and the random number to obtain the second event data.

[0093] The embodiments of the present invention convert the first event data into a byte stream of a preset data format and generate a random number. Then, the second event data is obtained by performing encryption operations on the byte stream according to the first session key and the random number. The random number can be used to ensure that the same plaintext produces different ciphertexts in different encryptions, thus preventing replay attacks.

[0094] Optionally, in this embodiment of the invention, the data upload module 404 includes: a data encapsulation submodule, a data caching submodule, and a data upload submodule; The data encapsulation submodule is used to encapsulate the second event data and the first verification code into a target data packet; The data caching submodule is used to write the target data packet into a local cache queue and mark the target cache record corresponding to the target data packet in the local cache queue as a pending send status; The data upload submodule is used to upload the target data packet to the cloud server via a public network communication link; wherein, when a confirmation response is received from the cloud server, the target cache record is updated to the sent status.

[0095] This invention encapsulates ciphertext and checksum into a target data packet, writes it into a local cache queue, marks it as pending transmission, and then uploads it via a public network communication link. Upon receiving a confirmation response from the cloud server, the corresponding cache record is updated to the transmitted status. This enables complete lifecycle management of data packets from encapsulation, queuing, uploading to confirmation under normal network conditions, ensuring reliable data delivery to the cloud.

[0096] It is understood that the above-described terminal device embodiments correspond to the method embodiments of the present invention, and can implement the optical cable route generation method based on encrypted transmission provided by any of the above-described method embodiments of the present invention.

[0097] In this embodiment of the invention, the data acquisition module 401 acquires the RFID response frame data and its corresponding positioning data collected in the current session, providing the original data source for subsequent optical cable routing path generation. The key generation module 402 generates a session key based on a pre-configured master key and session identifier, and performs time alignment on the RFID response frame data and positioning data to obtain event data, enabling the encryption key to be uniquely bound to the session, and unifying the tag data and spatial location in the time dimension, providing a data foundation for subsequent generation of optical cable routing paths with spatiotemporal attributes. The data encryption module 403 encrypts the event data to obtain ciphertext and generates a checksum on the ciphertext, providing integrity protection for the ciphertext while protecting data confidentiality. The data upload module 404 uploads the ciphertext and checksum to the cloud server, enabling the cloud server to generate an optical cable routing path based on the second event data and the first checksum, ensuring the credibility of the source data during the optical cable routing path generation process.

[0098] like Figure 5 As shown, based on the above system item embodiment, a cloud server embodiment is provided, including: a data receiving module 501, a verification code generation module 502, a data decryption module 503, and an optical cable routing path generation module 504; The data receiving module 501 is used to receive second event data and a first verification code uploaded by the terminal device; wherein, the second event data is obtained by the terminal device encrypting the first event data according to a first session key; the first verification code is generated by the terminal device according to the first session key and the second event data; the first session key is generated by the terminal device based on a pre-configured master key and the session identifier of the current session; the first event data is obtained by the terminal device by time-aligning RFID response frame data and positioning data; the RFID response frame data and the positioning data are obtained by the terminal device in the current session; The verification code generation module 502 is used to generate a second session key based on the master key and the session identifier, and to generate a second verification code for the second event data based on the second session key. The data decryption module 503 is used to decrypt the second event data according to the second session key when the first verification code and the second verification code are the same, so as to obtain the first event data. The optical cable routing path generation module 504 is used to generate an optical cable routing path based on the first event data.

[0099] Optionally, in this embodiment of the invention, the optical cable routing path generation module 504 includes: an event identifier comparison submodule and an optical cable routing path generation submodule; The event identifier comparison submodule is used to compare the target event identifier corresponding to any reading in the first event data with each event identifier stored in the cloud database. If the target event identifier is different from each of the event identifiers, the reading is written into the cloud database. The optical cable routing path generation submodule is used to generate optical cable routing paths based on the readings written to the cloud database.

[0100] This invention compares the target event identifier of each reading in the first event data with the event identifier in the cloud database. The corresponding reading is only written when the target event identifier does not exist in the database. This avoids the same event data being repeatedly written to the cloud database due to retransmission by the terminal device, retransmission after network outage, or other reasons.

[0101] Optionally, in this embodiment of the invention, the optical cable routing path generation submodule includes: a trajectory point sequence generation unit, a path segment sequence generation unit, and an optical cable routing path generation unit; The trajectory point sequence generation unit is used to sort the readings written to the cloud database by time to obtain a spatiotemporal trajectory point sequence; The path segment sequence generation unit is used to spatially reconstruct the spatiotemporal trajectory point sequence to obtain a path segment sequence. The optical cable routing path generation unit is used to splice each path segment in the path segment sequence according to preset constraints to obtain the optical cable routing path.

[0102] This invention provides a method for obtaining a spatiotemporal trajectory point sequence by sorting the readings written to the cloud database over time, obtaining a path segment sequence by spatial reconstruction, and obtaining an optical cable routing path by splicing the path segments according to preset constraints. This method can convert discrete collection points into continuous optical cable routing paths and achieve accurate restoration of the spatial orientation of optical cables.

[0103] It is understood that the above-described cloud server embodiments correspond to the method embodiments of the present invention, and can implement the optical cable route generation method based on encrypted transmission provided by any of the above-described method embodiments of the present invention.

[0104] This invention receives ciphertext and a first verification code uploaded by a terminal device, generates a second session key based on the same master key and session identifier, and generates a second verification code for the same ciphertext. Decryption is performed only when the first verification code and the second verification code are the same to obtain the plaintext and generate a routing path. This allows the cloud server to actively verify the authenticity and integrity of the data source. Only data that passes the integrity verification can be decrypted and used for subsequent optical cable routing path generation.

[0105] It should be noted that the system embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0106] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for generating optical cable routes based on encrypted transmission, characterized in that, The optical cable route generation method, applicable to terminal equipment, includes: Acquire the RFID response frame data collected in the current session, and acquire the positioning data corresponding to the RFID response frame data; Based on the pre-configured master key and the session identifier of the current session, a first session key is generated, and the RFID response frame data and the positioning data are time-aligned to obtain the first event data; The first event data is encrypted using the first session key to obtain the second event data, and a first verification code for the second event data is generated using the first session key. The second event data and the first verification code are uploaded to the cloud server so that the cloud server can generate an optical cable routing path based on the second event data and the first verification code.

2. The optical cable route generation method based on encrypted transmission as described in claim 1, characterized in that, The generation of the first session key based on the pre-configured master key and the session identifier of the current session includes: In response to the acquisition start signal of the current session, and based on the trigger timestamp of the acquisition start signal and the device identifier, the session identifier is generated; The master key and the session identifier are input into the key derivation function for operation to generate the first session key.

3. The optical cable route generation method based on encrypted transmission as described in claim 1, characterized in that, The step of time-aligning the RFID response frame data and the positioning data to obtain the first event data includes: Obtain the acquisition timestamp of the RFID response frame data, and obtain the positioning timestamp of the positioning data; Based on the collection timestamp and the positioning timestamp of each positioning point in the positioning data, calculate the absolute value of the time difference between each positioning point and the RFID response frame data, and determine the positioning point with the smallest absolute value of the time difference as the target positioning point corresponding to the RFID response frame data; The coordinate data of the target location point is associated with the RFID response frame data to obtain the first event data.

4. The optical cable route generation method based on encrypted transmission as described in claim 1, characterized in that, The step of encrypting the first event data according to the first session key to obtain the second event data includes: The first event data is converted into a byte stream in a preset data format, and a random number is generated; Based on the first session key and the random number, an encryption operation is performed on the byte stream to obtain the second event data.

5. The optical cable route generation method based on encrypted transmission as described in claim 1, characterized in that, Uploading the second event data and the first verification code to the cloud server includes: The second event data and the first verification code are encapsulated into a target data packet; Write the target data packet into a local cache queue, and mark the target cache record corresponding to the target data packet in the local cache queue as a pending send status; The target data packet is uploaded to the cloud server via a public network communication link; wherein, when a confirmation response is received from the cloud server, the target cache record is updated to the sent status.

6. The optical cable route generation method based on encrypted transmission as described in claim 5, characterized in that, When a failure is detected in the public network communication link, newly generated data packets are continuously written to the local cache queue, and the cache records corresponding to each data packet in the local cache queue are marked as pending transmission. When the public network communication link failure is detected and eliminated, all data packets in the corresponding cached state that are in the pending transmission state are continuously uploaded to the cloud server in a preset order.

7. A method for generating optical cable routes based on encrypted transmission, characterized in that, The optical cable route generation method, applicable to cloud servers, includes: The terminal device receives second event data and a first verification code uploaded by itself. The second event data is obtained by encrypting the first event data using a first session key. The first verification code is generated by the terminal device using the first session key and the second event data. The first session key is generated by the terminal device based on a pre-configured master key and the session identifier of the current session. The first event data is obtained by the terminal device by time-aligning RFID response frame data and location data. The RFID response frame data and the location data are obtained by the terminal device within the current session. Based on the master key and the session identifier, a second session key is generated, and based on the second session key, a second checksum of the second event data is generated. When the first verification code and the second verification code are the same, the second event data is decrypted according to the second session key to obtain the first event data; Based on the first event data, an optical cable routing path is generated.

8. The optical cable route generation method based on encrypted transmission as described in claim 7, characterized in that, The step of generating an optical cable routing path based on the first event data includes: For any reading in the first event data, the target event identifier corresponding to the reading is compared with each event identifier stored in the cloud database. If the target event identifier is different from each of the event identifiers, the reading is written into the cloud database. Based on the readings written to the cloud database, an optical cable routing path is generated.

9. The optical cable route generation method based on encrypted transmission as described in claim 8, characterized in that, The step of generating an optical cable routing path based on the readings written to the cloud database includes: The readings written to the cloud database are sorted by time to obtain a spatiotemporal trajectory point sequence; Spatial reconstruction is performed on the spatiotemporal trajectory point sequence to obtain a path segment sequence; According to preset constraints, each path segment in the path segment sequence is spliced ​​together to obtain the optical cable routing path.

10. A fiber optic route generation system based on encrypted transmission, characterized in that, include: A terminal device for implementing the optical cable route generation method based on encrypted transmission as described in any one of claims 1-6, and a cloud server for implementing the optical cable route generation method based on encrypted transmission as described in any one of claims 7-9.