Data communication method of law enforcement recorder

By monitoring the changes in the USB interface device path, generating a unique device identifier, combining block transmission and CRC32 verification algorithm, dynamically adjusting security policies, solving the problem of insufficient access detection and data transmission integrity guarantee of law enforcement recorder equipment, significantly improving the efficiency and security of data communication.

CN120128388AInactive Publication Date: 2025-06-10SHENZHEN SMART POLICE TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510317684.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-06-10
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art has shortcomings in equipment access detection and data transmission integrity guarantee of law enforcement recorders, resulting in equipment conflicts, communication chaos, low transmission efficiency and data loss.

Method used

By monitoring the changes in the USB interface device path, a unique device identifier is generated to achieve accurate access detection; block transmission is used in combination with CRC32 verification algorithm to ensure data transmission integrity; and through password authentication and conflict detection, security policies are dynamically adjusted to improve communication security and reliability.

Benefits of technology

It significantly improves the data communication efficiency and security of law enforcement recorders in multi-device access and high-load scenarios, and solves the problems of inaccurate equipment access detection, insufficient data transmission integrity and insufficient communication security guarantee.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120128388A_ABST
    Figure CN120128388A_ABST
Patent Text Reader

Abstract

The invention discloses a data communication method of a law enforcement recorder, and relates to the technical field of data communication and security, and the method comprises the steps: monitoring the equipment path change of a USB interface, detecting the access or pull-out of the law enforcement recorder, and analyzing a file name to generate a unique equipment identifier; based on the device identifier, setting a communication parameter and sending a device connection verification request, and verifying the device connection verification request to confirm the validity of the communication connection; after the request passes verification, executing standardized instructions of equipment information reading, time synchronization and electric quantity query by adopting a JSON format protocol, and generating a response result of the standardized instructions; according to the method, the unique equipment identifier is generated by monitoring the equipment path change of the USB interface, so that accurate detection of access or pull-out of the law enforcement recorder is realized, the problems of equipment conflict and communication chaos in a traditional method are solved, and the communication stability in a multi-equipment access scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data communication and security, and particularly to a data communication method for a law enforcement recorder. Background Art

[0002] As an important device for recording law enforcement processes, law enforcement recorders have been widely used in the fields of public security, transportation, and urban management. The security and stability of their data transmission are crucial. Existing technologies usually connect to computing devices through USB interfaces and transfer data using file copying or communication protocols. However, these methods have deficiencies in device access detection, connection verification, and data integrity guarantee. Traditional device access detection relies on operating system mounting events and lacks precise parsing of device unique identifiers, resulting in device conflicts or communication chaos when multiple devices are connected. In addition, data transmission methods mostly use whole-file transmission, lacking block transmission and real-time verification mechanisms, with low transmission efficiency and prone to data loss due to interruptions, making it difficult to meet the requirements of law enforcement work for high efficiency and security.

[0003] To address the problems of inaccurate device access detection and insufficient data transmission integrity, the present invention has invented a data communication method for a law enforcement recorder, belonging to the fields of data communication and information security. The present invention realizes precise access detection by listening to changes in the device path of the USB interface and parsing the file name to generate a unique device identifier; adopts block transmission combined with the CRC32 verification algorithm to ensure data transmission integrity; and dynamically adjusts security policies through password authentication and conflict detection to further enhance communication security and reliability. This method significantly improves the data communication efficiency and security of law enforcement recorders in multi-device access and high-load scenarios. Summary of the Invention

[0004] In view of the above existing problems, the present invention is proposed.

[0005] Therefore, the present invention provides a data communication method for a law enforcement recorder to solve the problems of inaccurate device access detection and insufficient guarantee of data transmission integrity.

[0006] To solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, the present invention provides a data communication method for a law enforcement recorder, which includes,

[0008] Detecting the access or removal of the law enforcement recorder by listening to changes in the device path of the USB interface, and parsing the file name to generate a unique device identifier;

[0009] Based on the device identifier, setting communication parameters and sending a device connection verification request, and verifying the validity of the communication connection by verifying the device connection verification request;

[0010] After the request verification is passed, using the JSON format protocol, execute the standardized instructions for device information reading, time synchronization, and power query, and generate the response results of the standardized instructions;

[0011] According to the response results of the standardized instructions, read the video and audio data in the law enforcement recorder through the chunked transfer mechanism, and verify the data integrity by combining the CRC32 check algorithm to generate the data transfer results;

[0012] Based on the data transfer results, verify the initial security status of the data through the password authentication mechanism;

[0013] Based on the initial security status, detect the conflict situation among multiple devices, and adjust the security policy to generate the security verification status;

[0014] Based on the security verification status, end the communication session by closing the communication channel and clearing the resources, and record the communication log.

[0015] As a preferred solution of the data communication method of the law enforcement recorder described in the present invention, wherein: the specific steps of detecting the access or removal of the law enforcement recorder by listening to the change of the device path of the USB interface and parsing the file name to generate a unique device identifier are as follows:

[0016] When the daemon process responsible for listening to the USB interface change starts, perform a comprehensive directory scan, record the status and information of all currently connected devices as the initial reference;

[0017] Continuously listen to the change of the USB interface after startup to respond to the access or removal of the device in real time, and set a period according to the device access frequency to perform a directory scan regularly;

[0018] After each directory scan, compare the file list in the current path with the previous scan result, and extract the newly added files;

[0019] Split the file name by the delimiter, split the file name into the brand model and the unique serial number, then extract the brand model and the unique serial number of the device in turn, and combine the extracted device brand model and unique serial number in a fixed order and standard format to generate the unique device identifier D.

[0020] As a preferred solution of the data communication method of the law enforcement recorder described in the present invention, wherein: the specific steps of setting communication parameters based on the device identifier and sending a device connection verification request to verify the effectiveness of the communication connection by verifying the device connection verification request are as follows:

[0021] During device initialization, generate and set the static key K by using the AES encryption method and store it in the master control end and the law enforcement recorder;

[0022] According to the generated unique device identifier D and the current device access timestamp T 0 and the static key K, using the dynamic communication parameter generation formula, dynamically generate communication parameters. The expression is:

[0023]

[0024] where C represents the dynamically generated communication parameter, H(x) represents the standard hash function, and e represents the base of the natural logarithm;

[0025] After the communication parameters are generated, assemble them as core data into a device connection verification request in JSON format;

[0026] After establishing a communication channel through the USB interface, the master control end sends the device connection verification request to the law enforcement recorder. After receiving the verification request, the law enforcement recorder calculates the verification communication parameters according to the same dynamic communication parameter generation formula

[0027] When then the communication verification passes;

[0028] When then the communication verification fails.

[0029] As a preferred solution of the data communication method of the law enforcement recorder described in the present invention, wherein: after the request verification passes, using the JSON format protocol, execute the standardized instructions of device information reading, time synchronization, and power query, and generate the response result of the standardized instructions. The specific steps are:

[0030] After the communication verification passes, the master control end assembles the standardized instructions in JSON format according to the communication requirements;

[0031] The communication requirements are device information reading, time synchronization, and power query;

[0032] The standardized instructions are instruction type, session identifier, instruction generation timestamp, and check parameters;

[0033] The master control end sends the standardized instructions in JSON format to the law enforcement recorder through the USB interface. After receiving the standardized instructions, the law enforcement recorder uses the built-in JSON parsing library to convert the JSON string into an operable data structure. Through the parsed data structure, the law enforcement recorder can directly access the specified keys to extract the instruction type, session identifier, instruction generation timestamp, and check parameters;

[0034] The law enforcement recorder executes device information reading, time synchronization, and power query according to the instruction type, and generates response data M;

[0035] The law enforcement recorder generates a response data verification value based on the response data M and in combination with a dynamic verification formula. The expression is as follows:

[0036]

[0037] Among them, V represents the verification value of the response data, T 3 represents the timestamp when the law enforcement recorder generates the response data, tan represents the tangent function, and S represents the session identifier;

[0038] The law enforcement recorder assembles the generated response data M and the response data verification value V into a response data packet in JSON format and returns it to the master control end.

[0039] As a preferred solution of the data communication method of the law enforcement recorder described in the present invention, wherein: according to the response result of the standardized instruction, the video and audio data in the law enforcement recorder are read through a block transfer mechanism, and the data integrity is verified in combination with the CRC32 verification algorithm to generate a data transfer result. The specific steps are as follows:

[0040] After receiving the response data packet, the master control end recalculates the verification response data verification value V according to the same dynamic verification formula ′ ;

[0041] When V = V ′ at this time, it indicates that the response data is legal and the operation is successful;

[0042] When V ≠ V ′ at this time, it indicates that the response data is illegal and the operation fails;

[0043] The master control end reads the video and audio data according to the law enforcement requirements and sends a data reading request to the law enforcement recorder;

[0044] The law enforcement requirements are the requirements for the law enforcement agency to access video and audio data for investigation, evidence collection, and review of legal procedures;

[0045] The request is the data type, session identifier, block size, and starting offset;

[0046] After parsing the request, the law enforcement recorder locates the target data file according to the data type and starting offset, accurately locates the corresponding data file in the storage device, and finds the starting position;

[0047] Based on the block size in the request, the target data file is divided into several data blocks. After the law enforcement recorder prepares the data, it returns a confirmation message to the master control end;

[0048] The master control end requests the data blocks in the law enforcement recorder one by one through a loop mechanism and performs verification after receiving the data blocks;

[0049] After all data blocks have passed the verification, the master control end reorganizes the data blocks in sequence according to the offset to generate the target data file G; The master control end performs a global integrity verification on the reorganized data file G, using the CRC32 verification algorithm to generate a data transmission result verification value. The expression is:

[0050]

[0051]

[0052] where U represents the data transmission result verification value, CRC32(G) represents the overall CRC32 verification code of the reorganized data file, and T 4 represents the timestamp when the data transmission is completed;

[0053] Set the range of the global verification value to [U min , U max ;

[0054] where U min represents the minimum allowable global verification value, and U max represents the maximum allowable global verification value;

[0055] When U min ≤ U ≤ U max , it means the file is complete and the transmission is successful;

[0056] When U ≤ U min and U ≥ U max , it means the file is incomplete and the transmission fails.

[0057] As a preferred solution of the data communication method of the law enforcement recorder described in the present invention, wherein: based on the data transmission result, the preliminary security status of the data is verified through a password authentication mechanism. The specific steps are:

[0058] After the master control end completes the data transmission verification, it calculates the preliminary security status using the dynamic password authentication formula. The expression is:

[0059] Q = H((U + T 4 ) / (K + sin(U · T 4 )) + tan(S · log(T 4 + 1)));

[0060] where Q is the preliminary security status, sin(U · T 4 ) is a non - linear confusion function, tan(S · log(T 4 + 1)) is a dynamic session confusion function, and log(T 4 + 1) is the logarithmic operation of the timestamp when the data transmission is completed.

[0061] As a preferred solution of the data communication method of the law enforcement recorder described in the present invention, wherein: based on the preliminary security status, detecting the conflict situation among multiple devices, and adjusting the security policy to generate a security verification status, the specific steps are as follows:

[0062] After the master control end passes the preliminary security status verification, start the conflict detection process, and collect core information from all connected devices in the current environment;

[0063] The core information refers to device identification, session identifier, timestamp at the current detected conflict, preliminary security status, and dynamic communication parameters;

[0064] Based on the core information of all connected devices in the current environment collected, use the conflict detection formula to calculate the conflict detection result, and the expression is:

[0065]

[0066] Among them, ψ represents the conflict detection result, N represents the total number of connected devices in the current environment, D φ represents the identifier of the φ-th device, Q φ represents the preliminary security status of the φ-th device, T 5 represents the timestamp at the current detected conflict, represents the timestamp of the φ-th device at the current conflict detection moment, S φ represents the session identifier of the φ-th device;

[0067] Set the conflict detection result threshold to θ;

[0068] When ψ > θ, there is a conflict and the security policy needs to be adjusted;

[0069] When ψ ≤ θ, there is no conflict and communication continues;

[0070] When the master control end detects a conflict, it is necessary to dynamically adjust the communication parameter C and the session identifier S, and regenerate the security verification status, and the expression is:

[0071]

[0072] Q ξ = H(C γ + Q · tan(T 5 ));

[0073] Among them, C γ represents the adjusted dynamic communication parameter, Q ξ represents the final security verification status, H(D · Q + T 5) represents generating secure communication parameters through a combination of device identification, preliminary security status, and the timestamp when a current detection conflict occurs. sin(S) represents the sine variation introducing a session identifier, ln(ψ + 2) represents a parameter for dynamic adjustment, and H(C γ +Q·tan(T 5 )) represents generating the final security verification status by combining the adjusted communication parameters, preliminary security status, and the timestamp when a current detection conflict occurs;

[0074] After completing the security policy adjustment, the finally generated Q ξ is used as the security verification status.

[0075] As a preferred solution for the data communication method of the law enforcement recorder described in the present invention, wherein: based on the security verification status, by closing the communication channel and clearing resources, the communication session is ended, and the communication log is recorded. The specific steps are as follows:

[0076] The master control end checks the final security verification status Q ξ to determine whether the communication session can end normally, and sets the threshold for security verification as δ;

[0077] When Q ξ > δ, it means that this communication session passes the security verification, allows normal ending, and proceeds to the next step of resource cleaning and log recording;

[0078] When Q ξ ≤ δ, it means that this communication session fails the security verification, and the communication session is forcibly terminated;

[0079] Before the communication channel is closed, the master control end and the law enforcement recorder respectively perform resource cleaning operations;

[0080] After completing the resource cleaning, the master control end and the law enforcement recorder respectively record the communication log;

[0081] After completing the resource cleaning and log recording, the master control end and the law enforcement recorder respectively close the communication channel;

[0082] The master control end and the law enforcement recorder confirm with each other whether they have disconnected the communication channel and completed the resource cleaning;

[0083] When both parties verify successfully, the communication session status is marked as ended;

[0084] When both parties verify unsuccessfully, the communication channel is forcibly closed, resources are cleaned, an abnormal log is recorded, the device abnormal status is marked, and the administrator is notified.

[0085] In a second aspect, the present invention provides a computer device, including a memory and a processor, where the memory stores a computer program, and: when the computer program is executed by the processor, any step of the data communication method of the law enforcement recorder as described in the first aspect of the present invention is implemented.

[0086] In a third aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and: when the computer program is executed by the processor, any step of the data communication method of the law enforcement recorder as described in the first aspect of the present invention is implemented.

[0087] The beneficial effects of the present invention are as follows: by listening to the change of the device path of the USB interface and generating a unique device identifier, the present invention realizes the accurate detection of the access or removal of the law enforcement recorder, solves the problems of device conflict and communication chaos in the traditional method, and improves the communication stability in the scenario of multi-device access. By constructing a dynamic communication parameter generation formula based on the device identifier, timestamp and static key, the device connection verification request is completed, ensuring the legality and security of the communication connection. By adopting the block transfer mechanism and CRC32 check algorithm, the efficiency and integrity of large file data transmission are improved, avoiding data loss or damage; combined with the password authentication and conflict detection mechanism, the security policy is dynamically adjusted to ensure the security management among multiple devices. Overall, the problems of inaccurate device access detection, insufficient data transmission integrity and insufficient communication security guarantee in the prior art are solved, and the stability, security and reliability of the data communication of the law enforcement recorder are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0088] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.

[0089] Figure 1 It is a flowchart of a data communication method of a law enforcement recorder in Embodiment 1.

[0090] Figure 2 It is a schematic diagram of a data communication method of a law enforcement recorder in Embodiment 1. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0091] To make the above objects, features and advantages of the present invention more obvious and understandable, the following detailed description of the specific embodiments of the present invention will be made in conjunction with the drawings in the specification.

[0092] In the following description, many specific details are set forth in order to provide a thorough understanding of the present invention. However, the present invention may be practiced in other ways than those specifically described herein, and those skilled in the art may make similar extensions without departing from the spirit of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.

[0093] Secondly, as used herein, an "embodiment" or "embodiments" refers to specific features, structures, or characteristics that may be included in at least one implementation of the present invention. The appearances of "in an embodiment" in different places in this specification do not all refer to the same embodiment, nor are they separate or alternative embodiments that exclude each other.

[0094] Embodiment 1, referring to Figure 1 and Figure 2 , is the first embodiment of the present invention, which provides a data communication method for a law enforcement recorder, including the following steps:

[0095] S1. By monitoring the change of the device path of the USB interface, detect the access or removal of the law enforcement recorder, and parse the file name to generate a unique device identifier;

[0096] When the daemon process responsible for monitoring the change of the USB interface starts, perform a comprehensive directory scan, record the status and information of all currently connected devices as the initial reference;

[0097] Continuously monitor the change of the USB interface after startup to respond in real time to the access or removal of the device, and set a period according to the device access frequency to perform a directory scan regularly;

[0098] After each directory scan, compare the file list in the current path with the result of the previous scan, and extract the newly added files;

[0099] Split the file name by the delimiter, split the file name into the brand model and the unique serial number, then extract the brand model and the unique serial number of the device in sequence, and combine the extracted device brand model and unique serial number in a fixed order and standard format to generate a unique device identifier D;

[0100] This solves the problems of low accuracy in device access detection and easy occurrence of device conflicts in the prior art, greatly improves the efficiency and stability of device access detection, and lays a foundation for subsequent communication verification and data transmission.

[0101] S2. Based on the device identifier, set communication parameters and send a device connection verification request, and verify the validity of the communication connection by verifying the device connection verification request;

[0102] When the device is initialized, a static key K is generated and set by adopting the AES encryption method, and is stored in the master control terminal and the law enforcement recorder;

[0103] According to the generated unique device identifier D and the current device access timestamp T 0 and the static key K, a dynamic communication parameter generation formula is adopted to dynamically generate communication parameters, and the expression is:

[0104]

[0105] where C represents the dynamically generated communication parameter, H(x) represents the standard hash function, and e represents the base of the natural logarithm;

[0106] After the communication parameters are generated, they are assembled into a device connection verification request in JSON format as the core data. By assigning a unique session identifier to each connection request, it can ensure that the communication requests and responses of multiple devices do not interfere with each other, and avoid communication errors caused by device conflicts;

[0107] After establishing a communication channel through the USB interface, the master control terminal sends the device connection verification request to the law enforcement recorder. After receiving the verification request, the law enforcement recorder calculates the verification communication parameter according to the same dynamic communication parameter generation formula

[0108] When then the communication verification passes;

[0109] When then the communication verification fails;

[0110] It realizes the efficient verification of the legality of device connection, and solves the problem of insufficient communication security caused by the easy cracking of static keys in the prior art;

[0111] Through the dynamic parameter mechanism, the communication verification is more flexible and has stronger protection ability, providing a security guarantee for subsequent instruction transmission.

[0112] S3. After the request verification passes, adopt the JSON format protocol to execute the standardized instructions for device information reading, time synchronization and power query, and generate the response results of the standardized instructions;

[0113] After the communication verification passes, the master control terminal assembles the standardized instructions in JSON format according to the communication requirements;

[0114] The communication requirements are to read device information, synchronize time and query power;

[0115] The standardized instruction consists of an instruction type, a session identifier, an instruction generation timestamp, and a verification parameter (using the dynamically generated communication parameter C as the security verification code for the instruction to ensure the authenticity and integrity of the instruction).

[0116] The master control terminal sends the standardized instruction in JSON format to the law enforcement recorder through the USB interface. After receiving the standardized instruction, the law enforcement recorder uses the built-in JSON parsing library to convert the JSON string into an operable data structure. Through the parsed data structure, the law enforcement recorder can directly access the specified keys to extract the instruction type, session identifier, instruction generation timestamp, and verification parameter.

[0117] The law enforcement recorder executes operations such as reading device information, synchronizing time, and querying battery power according to the instruction type, and generates response data M.

[0118] When the instruction type is to read device information, the response data M returns the device information (device model, serial number, and firmware version).

[0119] When the instruction type is to synchronize time, the response data M synchronizes the device clock and returns a synchronization confirmation.

[0120] When the instruction type is to query battery power, the response data M returns the current battery power information.

[0121] Based on the response data M, the law enforcement recorder generates a response data verification value using a dynamic verification formula to ensure the integrity and security of the response data. The expression is as follows:

[0122]

[0123] Among them, V represents the verification value of the response data, T 3 represents the timestamp when the law enforcement recorder generates the response data, tan represents the tangent function, and S represents the session identifier.

[0124] The law enforcement recorder assembles the generated response data M and the response data verification value V into a response data packet in JSON format and returns it to the master control terminal.

[0125] Through the standardized instruction and the dynamic verification mechanism, the problems of lack of standardization and security in instruction transmission in the existing technology are solved, and the efficiency and reliability of data interaction are improved. Especially in the multi-device concurrent scenario, the JSON format protocol combined with the session identifier effectively avoids instruction chaos and provides technical support for multi-device management.

[0126] S4. According to the response result of the standardized instruction, read the video and audio data in the law enforcement recorder through the block transfer mechanism, and verify the data integrity in combination with the CRC32 verification algorithm to generate a data transmission result.

[0127] After the master control end receives the response data packet, it recalculates the verification response data check value V according to the same dynamic verification formula ′ ;

[0128] When V = V ′ it indicates that the response data is legal and the operation is successful;

[0129] When V ≠ V ′ it indicates that the response data is illegal and the operation fails;

[0130] The master control end reads video and audio data as needed and sends a data reading request to the law enforcement recorder;

[0131] The law enforcement requirement is the requirement for the law enforcement agency to access video and audio data for investigation, evidence collection, and legal procedure review;

[0132] The request is the data type, session identifier, block size, and starting offset;

[0133] After parsing the request, the law enforcement recorder locates the target data file according to the data type and starting offset, accurately locates the corresponding data file in the storage device, and finds the starting position;

[0134] Based on the block size in the request, the target data file is divided into several data blocks. After the law enforcement recorder prepares the data, it returns a confirmation message to the master control end;

[0135] The master control end requests the data blocks in the law enforcement recorder one by one through a loop mechanism. Each request includes the starting offset and block size, and checks the data block after receiving it. A block data verification formula is constructed to verify the integrity of the data block. The expression is:

[0136]

[0137] Among them, represents the integrity verification result of the th data block, which is used to verify whether the data block has been tampered with or a transmission error has occurred, represents the CRC32 checksum of the th data block returned by the law enforcement recorder, represents the timestamp for receiving the th data block, which is used to increase the dynamics of the verification, represents the starting offset of the th data block, represents the length of the th data block, represents the bitwise exclusive OR operation, which is used for the result of mixing the check value and dynamic parameters;

[0138] After all data blocks have passed the verification, the master control end reorganizes the data blocks in sequence according to the offset to generate the target data file G;

[0139]

[0140]

[0141] The master control end performs a global integrity verification on the reorganized data file G, adopts the CRC32 verification algorithm, and generates a data transmission result verification value. The expression is:

[0142] 4 where U represents the data transmission result verification value, CRC32(G) represents the overall CRC32 verification code of the reorganized data file, and T

[0142] represents the timestamp when the data transmission is completed; min , U max ;

[0143] where U min represents the minimum allowable global verification value, and U max represents the maximum allowable global verification value;

[0144] When U min ≤ U ≤ U max , it means the file is complete and the transmission is successful;

[0145] When U ≤ U min and U ≥ U max , it means the file is incomplete and the transmission fails;

[0146] Through the block transmission mechanism, the problem of transmission interruption or data loss caused by network fluctuations during large file transmission is solved;

[0147] Combined with the CRC32 verification algorithm and the dynamic verification formula, it further ensures the integrity and accuracy of data transmission, and effectively avoids the risk of data being tampered with or lost.

[0148] S5. Based on the data transmission result, verify the preliminary security status of the data through the password authentication mechanism;

[0149] After the master control end completes the data transmission verification, it uses the dynamic password authentication formula to calculate the preliminary security status. The expression is:

[0150] Q = H((U + T 4 ) / (K + sin(U · T 4 )) + tan(S · log(T 4 + 1)));

[0151] Among them, Q represents the preliminary security state, indicating the integrity and security of the current data transmission. sin(U·T 4 ) is a non-linear confusion function, which introduces complexity by multiplying the data transmission result verification value by the timestamp when the data transmission is completed, preventing pattern matching attacks. tan(S·log(T 4 +1)) is a dynamic session confusion function, which combines the session identifier with the timestamp when the data transmission is completed to ensure session uniqueness. log(T 4 +1) is the logarithmic operation of the timestamp when the data transmission is completed, which is used to further dynamicize the authentication parameters to ensure that the continuity of the timestamp does not lead to linear growth;

[0152] Through the dynamic password authentication formula, the data transmission result, timestamp and static key are combined to verify the legality and integrity of the data. The introduction of the non-linear confusion function enhances the complexity of the formula, preventing brute force cracking and forgery;

[0153] The verification of the preliminary security state provides a credible premise for subsequent multi-device conflict detection, solves the problem of lack of security verification after data transmission in the prior art, and further improves security.

[0154] S6. Based on the preliminary security state, detect the conflict situation between multiple devices, and adjust the security policy to generate a security verification state;

[0155] After the preliminary security state verification passes, the master control end starts the conflict detection process and collects core information from all connected devices in the current environment;

[0156] The core information refers to the device identifier, session identifier, timestamp when the current conflict is detected, preliminary security state and dynamic communication parameters;

[0157] Through the core information of all connected devices collected in the current environment, use the conflict detection formula to calculate the conflict detection result. The expression is:

[0158]

[0159] Among them, ψ represents the conflict detection result, N represents the total number of connected devices in the current environment, D φ represents the identifier of the φth device, Q φ represents the preliminary security state of the φth device, T 5 represents the timestamp when the current conflict is detected, represents the timestamp of the φth device at the current conflict detection moment, S φ represents the session identifier of the φth device;

[0160] Set the conflict detection result threshold to θ;

[0161] When ψ > θ, there is a conflict and the security policy needs to be adjusted;

[0162] When ψ ≤ θ, there is no conflict and communication can continue;

[0163] When the master control end detects a conflict, it is necessary to dynamically adjust the communication parameter C and the session identifier S, and regenerate the security verification status. The expression is:

[0164]

[0165] Q ξ = H(C γ + Q · tan(T 5 ));

[0166] Among them, C γ represents the adjusted dynamic communication parameter, Q ξ represents the final security verification status, H(D · Q + (T 5 ) represents generating secure communication parameters through the combination of device identification, preliminary security status, and timestamp at the time of current detected conflict, sin(S) represents the sine change introducing the session identifier, ln(ψ + 2) represents the parameter for dynamic adjustment, H(C γ + Q · tan(T 5 )) represents generating the final security verification status by combining the adjusted communication parameter, preliminary security status, and timestamp at the time of current detected conflict;

[0167] After completing the security policy adjustment, the finally generated Q ξ is used as the security verification status;

[0168] It solves the problem of easy communication conflict in a multi-device environment in the prior art; through the dynamic adjustment mechanism, this step ensures the security and stability of communication in a multi-device environment, and provides an efficient solution for multi-device management in complex application scenarios.

[0169] S7. Based on the security verification status, end the communication session by closing the communication channel and clearing resources, and record the communication log;

[0170] The master control end checks the final security verification status Q ξ to determine whether the communication session can end normally, and sets the threshold for security verification as δ;

[0171] When Q ξ > δ, it means that this communication session passes the security verification, allows normal ending, and enters the next step of resource cleaning and log recording;

[0172] When Q ξWhen it is ≤ δ, it indicates that the current communication session fails the security verification, and the communication session is forcibly terminated;

[0173] Before the communication channel is closed, the master control end and the law enforcement recorder respectively perform resource cleaning operations;

[0174] After the resource cleaning is completed, the master control end and the law enforcement recorder respectively record communication logs;

[0175] After the resource cleaning and log recording are completed, the master control end and the law enforcement recorder respectively close the communication channel;

[0176] The master control end and the law enforcement recorder confirm with each other whether the communication channel has been disconnected and the resource cleaning has been completed;

[0177] When both parties are successfully verified, the communication session status is marked as ended;

[0178] When both parties are not successfully verified, the communication channel is forcibly closed, resources are cleaned, abnormal logs are recorded, the device abnormal status is marked, and the administrator is notified;

[0179] It realizes the secure closing of the communication session and resource recycling, solves the problem that resources are not cleared or abnormalities are not recorded in the communication end stage in the prior art, and ensures the stability and traceability of the system operation.

[0180] This embodiment also provides a computer device, which is applicable to the situation of the data communication method of the law enforcement recorder, including: a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions to implement the data communication method of the law enforcement recorder proposed in the above embodiment.

[0181] This computer device can be a terminal. This computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of this computer device is used to provide computing and control capabilities. The memory of this computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of this computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a carrier network, NFC (Near Field Communication), or other technologies. The display screen of this computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of this computer device can be a touch layer covered on the display screen, or a button, a trackball, or a touchpad set on the computer device shell, or an external keyboard, touchpad, or mouse, etc.

[0182] This embodiment also provides a storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the data communication method of the law enforcement recorder as proposed in the above embodiment; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, abbreviated as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, abbreviated as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, abbreviated as EPROM), programmable read-only memory (Programmable Red-Only Memory, abbreviated as PROM), read-only memory (Read-Only Memory, abbreviated as ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0183] In summary, the present invention realizes precise detection of the access or removal of the law enforcement recorder by monitoring the change of the device path of the USB interface and generating a unique device identifier, solves the problems of device conflict and communication chaos in the traditional method, and improves the communication stability in the multi-device access scenario. By constructing a dynamic communication parameter generation formula based on the device identifier, timestamp and static key, the device connection verification request is completed, ensuring the legality and security of the communication connection. The block transfer mechanism and CRC32 checksum algorithm are adopted to improve the efficiency and integrity of large file data transmission, and avoid data loss or damage; combined with the password authentication and conflict detection mechanism, the security policy is dynamically adjusted to ensure the security management among multiple devices. Overall, it solves the problems of inaccurate device access detection, insufficient data transmission integrity and insufficient communication security guarantee in the prior art, and improves the stability, security and reliability of the data communication of the law enforcement recorder.

[0184] Embodiment 2, referring to Table 1, is the second embodiment of the present invention. To further verify the technical solution of the present invention, experimental simulation data of the data communication method of the law enforcement recorder is given.

[0185] In order to verify the innovation and superiority of the present invention in the communication between the law enforcement recorder and the master control end, the experiment is based on simulating the real data interaction of the law enforcement recorder, and a detailed implementation process and comparative test are designed. This experiment is based on the prior art and the technology of the present invention, and focuses on evaluating the performance in aspects such as device access detection, dynamic communication parameter generation, data transmission integrity verification and security verification.

[0186] The preparation stage of this experiment includes setting up the hardware and software environments, and preparing test data and experimental tools. The hardware environment includes a law enforcement recorder (model A1-2023, serial number S12345678) and a master control device (configured with an Intel i7-12700K CPU, 16GB of memory, and a USB 3.0 interface). The law enforcement recorder stores 10 video files (named according to the rule A1-2023-S12345678-FNxx.mp4, and each file is 100MB in size). The software environment is equipped with a test program for monitoring device access, generating dynamic communication parameters, and verifying data integrity. SHA-256 is used as the hash function H(x). The experiment combines the actual usage scenarios of law enforcement recorders to simulate the entire process of device access, data transmission, and communication verification, providing a scientific and accurate test basis for verifying the performance of the present invention.

[0187] Specific implementation process:

[0188] The master control device monitors the changes in the device path of the USB interface. When the law enforcement recorder is connected, the system automatically detects the path change and parses the file name A1-2023-S12345678-FN01.mp4 to extract the brand model (A1-2023) and the unique serial number (S12345678) of the device. By combining the device information, a unique device identifier is generated: D = A1―2023―S12345678.

[0189] The master control device generates dynamic communication parameters based on the device identifier D, the access timestamp T 0 = 1672531200 (0:00:00 on January 1, 2024, UNIX timestamp, unit: seconds), and the static key K = 987654321, according to the formula Dynamic communication parameters are generated.

[0190] The generated communication parameter C is encapsulated into a device connection verification request in JSON format and sent to the law enforcement recorder through the USB interface. The law enforcement recorder calculates the communication parameter and compares it with the C sent by the master control device. When it indicates that the communication verification is passed.

[0191] The master control device sends three standardized instructions: reading device information, synchronizing time, and querying battery power. The law enforcement recorder returns the device information (model A1-2023, serial number S12345678, firmware version V1.0.0), time synchronization confirmation, and battery power (80%). The response data M and the check value V are recorded. When verifying data integrity, the formula is applied to ensure data integrity and security.

[0192] The master control terminal reads the video files in the law enforcement recorder block by block, sets the block size to 10MB, and after receiving each data block, verifies its integrity according to the formula Verify its integrity.

[0193] After all data blocks pass the verification, they are reassembled into a complete file, and the global integrity verification is performed through the formula Perform global integrity verification.

[0194] After the data transmission is completed, use the formula Q = H((U + T 4 ) / (K + sin(U·T 4 )) + tan(S·log(T 4 + 1))) to calculate the preliminary security status Q at the end, and detect multi-device communication conflicts. When the conflict detection result exceeds the threshold, automatically adjust the communication parameter C and the security verification status Q ξ , to ensure communication security.

[0195] Specifically as shown in Table 1 below:

[0196] Table 1 Comparison experimental data table of law enforcement recorder communication and data transmission performance

[0197]

[0198]

[0199] It can be clearly seen from the experimental data that the present invention shows significant advantages in core aspects such as device access detection, dynamic communication parameter generation, data transmission integrity verification, and security verification. The specific analysis is as follows:

[0200] The technology of the present invention only takes 1.2 seconds to complete device access detection and unique identifier generation, while the existing technologies A and B respectively take 2.8 seconds and 3.1 seconds, significantly improving the efficiency by 57% and 61%. This improvement stems from real-time monitoring of device path changes and an efficient file name parsing algorithm.

[0201] The dynamic communication parameter generation time of the technology of the present invention is 0.5 seconds, which is about 69% and 72% higher than that of the existing technologies A and B. This advantage benefits from the optimized design of the formula and the high efficiency of parameter calculation.

[0202] The present invention achieves a 100% communication verification success rate, while the existing technologies A and B are 92% and 85% respectively. This indicates that the dynamic communication parameter generation method and multi-session concurrency support of the present invention can completely avoid communication conflicts and errors, significantly improving the stability of the system.

[0203] The data transmission speed of the present invention reaches 50 MB / s. Compared with the prior arts A (35 MB / s) and B (30 MB / s), it has increased by 43% and 67% respectively. At the same time, the passing rate of the integrity verification of the present invention is 100%, while those of the prior arts A and B are 95% and 90% respectively. This significant advantage indicates that the present invention can effectively ensure high efficiency and security in data transmission.

[0204] Through dynamically adjusting communication parameters and session identifiers, the technology of the present invention can complete conflict detection and adjustment in only 0.8 seconds, while the prior arts A and B respectively require 2.5 seconds and 3.0 seconds. This shows that the present invention has better adaptability in a multi-device environment.

[0205] The experimental results show that the success rate of the security verification of the present invention is 100%, completely avoiding security verification failures caused by conflicts or tampering. The success rates of the prior arts A and B are 85% and 80% respectively. This improvement is attributed to the complexity of the dynamic password generation formula and the perfect design of the security policy.

[0206] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.

Claims

1. A data communication method for a law enforcement recorder, characterized in that: include, By monitoring the device path changes of the USB interface, the law enforcement recorder is detected to be connected or disconnected, and the file name is parsed to generate a unique device identifier; Based on the device identification, communication parameters are set and a device connection verification request is sent, and the validity of the communication connection is confirmed by verifying the device connection verification request; After the request is verified, the JSON format protocol is used to execute standardized instructions for device information reading, time synchronization, and power query, and generate response results for standardized instructions; According to the response results of the standardized instructions, the video and audio data in the law enforcement recorder are read through the block transmission mechanism, and the data integrity is verified by combining the CRC32 check algorithm to generate the data transmission result; Based on the data transmission results, the initial security status of the data is verified through a password authentication mechanism; Based on the preliminary security status, detect conflicts between multiple devices and adjust security policies to generate security verification status; Based on the security verification status, the communication session is ended by closing the communication channel and clearing resources, and the communication log is recorded.

2. The data communication method of the law enforcement recorder as claimed in claim 1, characterized in that: The method detects the access or removal of the law enforcement recorder by monitoring the device path change of the USB interface, and parses the file name to generate a unique device identifier. The specific steps are as follows: When the daemon responsible for monitoring USB interface changes starts, it performs a comprehensive directory scan and records the status and information of all currently connected devices as an initial reference; After startup, it continuously monitors the changes in the USB interface to respond to the connection or removal of devices in real time, and sets a cycle based on the frequency of device connection to perform directory scans regularly; After each directory scan, the file list in the current path is compared with the previous scan result to extract the newly added files; The file name is split by a separator, and the file name is split into a brand model and a unique serial number. The brand model and unique serial number of the device are then extracted in sequence, and the extracted brand model and unique serial number are combined in a fixed order and a standardized format to generate a unique device identifier D.

3. The data communication method of the law enforcement recorder as claimed in claim 2, characterized in that: The specific steps of setting communication parameters and sending a device connection verification request based on the device identification and confirming the validity of the communication connection by verifying the device connection verification request are as follows: When the device is initialized, a static key K is generated and set by using the AES encryption method and stored in the main control terminal and the law enforcement recorder; Based on the generated unique device identifier D and the current device access timestamp T 0 And the static key K, using the dynamic communication parameter generation formula, dynamically generate communication parameters, the expression is: Wherein, C represents a dynamically generated communication parameter, H(x) represents a standard hash function, and e represents the base of the natural logarithm; After the communication parameters are generated, they are assembled into a device connection verification request in JSON format as core data; After establishing a communication channel through the USB interface, the host sends a device connection verification request to the law enforcement recorder. After receiving the verification request, the law enforcement recorder calculates the verification communication parameters according to the same dynamic communication parameter generation formula. when , the communication verification is passed; when , the communication verification fails.

4. The data communication method of the law enforcement recorder as claimed in claim 3, characterized in that: After the request is verified, the JSON format protocol is used to execute the standardized instructions for device information reading, time synchronization and power query, and generate the response results of the standardized instructions. The specific steps are: After the communication verification is passed, the master control end assembles standardized instructions in JSON format according to the communication requirements; The communication requirements are to read device information, synchronize time and power query; The standardized instruction is an instruction type, a session identifier, an instruction generation timestamp, and a verification parameter; The main control end sends standardized commands in JSON format to the law enforcement recorder through the USB interface. After receiving the standardized commands, the law enforcement recorder uses the built-in JSON parsing library to convert the JSON string into an operable data structure. Through the parsed data structure, the law enforcement recorder can directly access the specified key to extract the command type, session identifier, command generation timestamp and verification parameters; The law enforcement recorder reads device information, synchronizes time and power query according to the instruction type, and generates response data M; The law enforcement recorder generates a response data verification value based on the response data M and the dynamic verification formula, and the expression is: Where V represents the check value of the response data, T 3 represents the timestamp of the response data generated by the law enforcement recorder, tan represents the tangent function, and S represents the session identifier; The law enforcement recorder assembles the generated response data M and the response data check value V into a response data packet in JSON format and returns it to the main control end.

5. The data communication method of the law enforcement recorder as claimed in claim 4, characterized in that: According to the response result of the standardized instruction, the video and audio data in the law enforcement recorder are read through the block transmission mechanism, and the data integrity is verified in combination with the CRC32 check algorithm to generate the data transmission result. The specific steps are: After receiving the response data packet, the master end recalculates the verification response data check value V according to the same dynamic check formula ′ ; When V = V ′ , it means the response data is legal and the operation is successful; When V≠V ′ If the response data is invalid, the operation fails. The main control end reads the video and audio data according to law enforcement requirements and sends a data reading request to the law enforcement recorder; The law enforcement needs are the need for law enforcement agencies to access video and audio data for investigation, evidence collection, and review of legal proceedings; The request is a data type, a session identifier, a chunk size, and a starting offset; After the law enforcement recorder parses the request, it locates the target data file according to the data type and starting offset, accurately locates the corresponding data file in the storage device, and finds the starting position; Based on the block size in the request, the target data file is divided into several data blocks. After the law enforcement recorder prepares the data, it returns confirmation information to the main control end; The main control end requests the data blocks in the law enforcement recorder one by one through a loop mechanism, and verifies the data blocks after receiving them; After all data blocks have passed verification, the master end Reassemble data blocks in order Generate target data file G; The master end performs global integrity verification on the reorganized data file G, using the CRC32 check algorithm to generate a data transmission result check value, expressed as: Among them, U represents the checksum of the data transmission result, CRC32(G) represents the overall CRC32 checksum of the reorganized data file, and T 4 Indicates the timestamp when the data transmission is completed; Set the global checksum value range to [U min ,U max ]; Among them, U min Indicates the minimum global checksum value allowed, U max Indicates the maximum allowed global checksum value; When U min ≤U≤U max , it means the file is complete and the transfer is successful; When U≤U min And U ≥ U max , it means the file is incomplete and the transfer fails.

6. The data communication method of the law enforcement recorder as claimed in claim 5, characterized in that: Based on the data transmission result, the initial security status of the data is verified through a password authentication mechanism. The specific steps are as follows: After completing the data transmission verification, the master end uses the dynamic password authentication formula to calculate the initial security status, which is expressed as: Q=H((U+T 4 ) / (K+sin(U·T 4 ))+tan(S·log(T 4 +1))); Among them, Q is the initial safety state, sin(U·T 4 ) is a nonlinear confusion function, tan(S·log(T 4 +1)) is the dynamic session obfuscation function, log(T 4 +1) is the logarithmic operation of the timestamp when the data transmission is completed.

7. The data communication method of the law enforcement recorder as claimed in claim 6, characterized in that: Based on the preliminary security status, the conflicts among multiple devices are detected, and the security policy is adjusted to generate the security verification status. The specific steps are as follows: After the initial security status check is passed, the master starts the conflict detection process to collect core information from all connected devices in the current environment; The core information refers to the device identification, session identifier, timestamp when the current conflict is detected, preliminary security status and dynamic communication parameters; By collecting the core information of all connected devices in the current environment, the conflict detection result is calculated using the conflict detection formula. The expression is: Where ψ represents the conflict detection result, N represents the total number of connected devices in the current environment, and D φ represents the identifier of the φth device, Q φ represents the initial safety status of the φth device, T 5 Indicates the timestamp when the current conflict is detected. Indicates the timestamp of the φth device at the current conflict detection time, S φ The session identifier of the φth device; Set the conflict detection result threshold to θ; When ψ>θ, there is a conflict and the security policy needs to be adjusted; When ψ≤θ, there is no conflict and communication continues; When the master detects a conflict, it needs to dynamically adjust the communication parameter C and session identifier S and regenerate the security verification state, expressed as: Q ξ =H(C γ +Q·tan(T 5 )); Among them, C γ represents the adjusted dynamic communication parameter, Q ξ Indicates the final safety verification status, H(D·Q+T 5 ) indicates that secure communication parameters are generated by combining the device identification, the initial security state and the timestamp of the current conflict detection. sin(S) indicates the sinusoidal change of the session identifier. ln(ψ+2) indicates the dynamic adjustment of parameters. H(C γ +Q·tan(T 5 )) indicates that a final security verification state is generated by combining the adjusted communication parameters, the preliminary security state and the timestamp when the current conflict is detected; After completing the security policy adjustment, the final generated Q ξ As a security verification state.

8. The data communication method of the law enforcement recorder as claimed in claim 7, characterized in that: The specific steps of closing the communication channel and clearing resources, ending the communication session, and recording the communication log based on the security verification status are as follows: The final security verification status Q of the master end ξ Check to determine whether the communication session can be terminated normally, and set the threshold of security verification to δ; When Q ξ When >δ, it means that the communication session has passed the security verification and is allowed to end normally, and enters the next step of resource cleanup and log recording; When Q ξ When ≤δ, it means that the communication session fails the security verification and the communication session is terminated forcibly; Before the communication channel between the main control terminal and the law enforcement recorder is closed, the main control terminal and the law enforcement recorder respectively perform resource cleaning operations; After the resource cleaning is completed, the main control terminal and the law enforcement recorder record the communication logs respectively; After completing resource cleanup and log recording, the main control end and the law enforcement recorder close the communication channel respectively; The main control end and the law enforcement recorder confirm with each other whether the other party has disconnected the communication channel and completed resource cleaning; When both parties are successfully authenticated, the communication session status is marked as ended; When both parties fail to verify, the communication channel is forcibly closed, resources are cleaned up, abnormal logs are recorded, abnormal device status is marked, and the administrator is notified.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the data communication method for the law enforcement recorder according to any one of claims 1 to 8 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the data communication method for a law enforcement recorder according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Automatic detection system and method for optical characteristics of semiconductor laser

    CN121253119A