Video processing method and device based on OpenHarmony, electronic equipment and storage medium

Through the video processing method based on OpenHarmony, the networking and encryption of the webcam is used to use star flash technology to solve the problem of no encryption solution for video recording of the webcam, and efficient and secure video data encryption is achieved.

CN120151567APending Publication Date: 2025-06-13HONGHU WANLIAN (JIANGSU) TECH DEV CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510290941.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-11
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

The video data obtained by existing webcam video recordings has no encryption solution and poses security risks. How to improve the security of video has become an urgent problem.

Method used

Through the video processing method based on OpenHarmony, the network camera is networked using star flash technology, and the management node and the terminal node are determined. The management node determines the time mapping relationship based on the time information, generates an initial vector and sends it to the terminal node. The terminal node generates an encrypted cryptographic text based on the initial vector and local information. In response to the shooting command, it determines the target node based on the trigger time, and encrypts the image plain text.

Benefits of technology

Through pre-generated encrypted ciphertext and distributed encryption based on time mapping relationships, the encryption efficiency and security of video data are improved, and the delay in calculating encrypted ciphertext needs to be calculated after triggering the shooting command is avoided, and distributed encryption of plaintext images captured within one day is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120151567A_ABST
    Figure CN120151567A_ABST
Patent Text Reader

Abstract

The invention discloses a video processing method and device based on OpenHarmony, electronic equipment and a storage medium, and relates to a video security encryption technology, the method comprises the following steps: networking a network camera according to a star flash technology, determining a management node and a terminal node, the network camera carrying a SwanLink OS developed based on OpenHarmony; the management node is used for determining a time mapping relation according to the time information, and the time mapping relation represents a mapping relation between the management node or the terminal node and daily time; sending the generated initial vector to a terminal node; the terminal node is used for generating an encrypted ciphertext according to the initial vector and local information; in response to the shooting instruction, determining a target node according to the triggering time of the shooting instruction and the time mapping relationship; and the target node encrypts a shot image plaintext based on a symmetric encryption algorithm according to the encrypted ciphertext and the verification information to obtain an image ciphertext. The security and encryption efficiency of the network camera can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video security encryption technology, and particularly to a video processing method, device, electronic device, and storage medium based on OpenHarmony. Background Art

[0002] With the development of video recording technology, both individuals and enterprises can purchase and use network cameras for video recording, and the network cameras form a camera network through networking.

[0003] Since there is no encryption scheme for the video data obtained by video recording, the video obtained by video recording has security risks. How to improve the security of the video has become an urgent problem to be solved. Summary of the Invention

[0004] The present invention provides a video processing method, device, electronic device, and storage medium based on OpenHarmony to solve the problem of low security of the video recorded by network cameras at present.

[0005] According to one aspect of the present invention, there is provided a video processing method based on OpenHarmony, including:

[0006] Networking the network cameras according to the NearLink technology to determine a management node and a terminal node, where the network cameras are equipped with SwanLinkOS developed based on OpenHarmony;

[0007] The management node is used to determine a time mapping relationship according to time information, where the time mapping relationship represents the mapping relationship between the management node or the terminal node and the daily time; and send the generated initial vector to the terminal node;

[0008] The terminal node is used to generate an encrypted ciphertext according to the initial vector and local information;

[0009] In response to a shooting instruction, determine a target node according to the trigger time of the shooting instruction and the time mapping relationship; the target node encrypts the captured image plaintext based on a symmetric encryption algorithm according to the encrypted ciphertext and verification information to obtain an image ciphertext.

[0010] According to another aspect of the present invention, there is provided a video processing device based on OpenHarmony, including:

[0011] A networking module, configured to network the network cameras according to the NearLink technology to determine a management node and a terminal node, where the network cameras are equipped with SwanLinkOS developed based on OpenHarmony;

[0012] An initial vector processing module, configured to determine a time mapping relationship by the management node according to time information, where the time mapping relationship represents the mapping relationship between the management node or the terminal node and the daily time; and send the generated initial vector to the terminal node;

[0013] A ciphertext calculation module, configured to generate an encrypted ciphertext by the terminal node according to the initial vector and local information;

[0014] A video encryption module, configured to, in response to a shooting instruction, determine a target node according to the trigger time of the shooting instruction and the time mapping relationship; and the target node encrypts the captured image plaintext according to the encrypted ciphertext and verification information based on a symmetric encryption algorithm to obtain an image ciphertext.

[0015] According to another aspect of the present invention, there is provided an electronic device, where the electronic device includes:

[0016] At least one processor; and

[0017] A memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the video processing method based on OpenHarmony according to any embodiment of the present invention.

[0019] According to another aspect of the present invention, there is provided a computer-readable storage medium, where the computer-readable storage medium stores computer instructions, and the computer instructions are used to implement the video processing method based on OpenHarmony according to any embodiment of the present invention when executed by a processor.

[0020] The technical solution of the embodiment of the present invention networks network cameras according to SparkLink technology to determine a management node and terminal nodes; the management node is used to determine a time mapping relationship according to time information, and the time mapping relationship represents the mapping relationship between the management node or the terminal nodes and the daily time; send the generated initial vector to the terminal nodes; the terminal nodes are used to generate an encrypted ciphertext according to the initial vector and local information; in response to a shooting instruction, determine a target node according to the trigger time of the shooting instruction and the time mapping relationship; the target node encrypts the captured image plaintext according to the encrypted ciphertext and verification information based on a symmetric encryption algorithm to obtain an image ciphertext. The technical solution provided by the embodiment of the present invention can, after networking, determine the daily time corresponding to the management node and the terminal nodes according to time information, and pre-generate an encrypted ciphertext. When a shooting instruction is triggered, a target node for encryption is determined according to the trigger time, and the target node encrypts the captured image plaintext according to the pre-generated encrypted ciphertext and the captured image plaintext to obtain an image ciphertext. Since the encrypted ciphertext is pre-computed, after the shooting instruction is triggered, there is no need to compute the encrypted ciphertext, and the pre-computed encrypted ciphertext can be used to encrypt the image plaintext, thereby improving the encryption efficiency. According to the time mapping relationship, the network cameras can be grouped based on time. When a shooting instruction is triggered, the network camera for encryption can be determined according to the time of the captured image plaintext, thereby realizing distributed encryption of the image plaintext captured within a day and further improving the encryption efficiency. By encrypting the image plaintext, the security of the network cameras can be improved.

[0021] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0023] Figure 1 is a schematic diagram of the networking of the network camera provided by the embodiment of the present invention;

[0024] Figure 2 is a schematic diagram of the structure of the network camera provided by the embodiment of the present invention;

[0025] Figure 3 is a schematic flowchart of a video processing method based on OpenHarmony provided by the embodiment of the present invention;

[0026] Figure 4 It is a schematic diagram of the SM4-GCM encryption algorithm provided by an embodiment of the present invention;

[0027] Figure 5 It is a schematic flowchart of the video image encryption and storage process provided by an embodiment of the present invention;

[0028] Figure 6 It is a schematic flowchart of the video playback process provided by an embodiment of the present invention;

[0029] Figure 7 It is a schematic diagram of a video processing method based on OpenHarmony provided by an embodiment of the present invention;

[0030] Figure 8 It is a schematic structural diagram of a video processing device based on OpenHarmony provided by an embodiment of the present invention;

[0031] Figure 9 It is a schematic structural diagram of an electronic device for implementing the video processing method based on OpenHarmony according to an embodiment of the present invention. Detailed implementation manners

[0032] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0033] It should be noted that the terms "including" and "having" in the specification and claims of the present invention and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products or devices.

[0034] With the development of video recording technology, both individuals and enterprises can purchase and use network cameras for video recording, and the network cameras form a camera network through networking. Since there is no encryption solution for the video data obtained by video recording, there are security risks in the recorded videos. How to improve the security of videos has become an urgent problem to be solved.

[0035] To address the issue of video security, if the video frame images captured by a camera are encrypted by the camera itself according to the principle of "whoever captures encrypts", there may be a situation where the video frame images cannot be encrypted in a timely manner due to the limited computing power of the network camera. If an independent computing device is used, such as setting up a dedicated server for encryption on the network side, there will be a problem of privacy leakage where the video frame images are stolen during transmission. Moreover, the transmission of video frame images occupies network bandwidth, additionally consuming computing resources and network resources.

[0036] For projects related to classified protection and the security industry, data security is a strong requirement. There are corresponding requirements for identity authentication, data security, and log auditing. The video processing method based on OpenHarmony provided in the embodiments of the present invention mainly focuses on data security, providing security protection for local data collection, data processing, and data storage of cameras, and optimizing performance on the basis of security protection technologies to ensure high security and high usability.

[0037] SwanLinkOS is a new generation of intelligent industry operating system that is based on OpenHarmony and achieves independent controllability and interconnection by adapting to domestic mainstream chips such as RK3399 and Hi3516.

[0038] SparkLink technology is a new generation of short-range wireless connection technology that integrates the advantages of wireless connection technologies such as Bluetooth and Wi-Fi. Its two mode basic access technologies (SLB) are comparable to Wi-Fi, and its low-power access technology (SLE) is comparable to Bluetooth. The former is suitable for scenarios with high speed, large transmission, and high-quality connections, while the latter meets the requirements of low-power and lightweight connections.

[0039] Trusted Execution Environment (TEE) protects the execution environment of sensitive data and code through hardware isolation. It is usually used to execute security-critical applications or process sensitive data, such as the encryption and verification of image plaintext.

[0040] Trusted Secure Chip (SE), a secure element, complies with the GM / T 0013-2021 Specification for Conformance Testing of Trusted Computing - Trusted Cryptographic Module.

[0041] The embodiments of the present invention provide a video processing method based on OpenHarmony. The SparkLink technology is used to form a network for network cameras locally. After networking, a management node (Grant, G node) and multiple terminal nodes (Terminal, T nodes) are formed, and each node represents a network camera. Figure 1This is a schematic diagram of the network camera networking provided by the embodiments of the present invention. After networking, it includes a management node and terminal nodes. Among them, the management node is a SparkLink G node, which can be used as an authorized node and has the ability to manage a certain number of T nodes. The terminal node is a SparkLink T node, which can be used as a managed node and together with the G node constitutes a communication domain.

[0042] After networking, the encryption time responsible for each network camera and the encryption ciphertext used for encryption are allocated. When the shooting instruction is triggered, the target node responsible for encryption is determined according to the shooting time of the video, and the image plaintext captured by the network camera is encrypted through the encryption ciphertext in the target node to obtain the image ciphertext, so as to realize the distributed encryption and storage of the image plaintext through multiple nodes after networking.

[0043] Figure 2 This is a schematic diagram of the structure of the network camera provided by the embodiments of the present invention, including: a SparkLink physical module, a trusted security chip SE, SwanLinkOS, a SparkLink software protocol and service module.

[0044] Exemplarily, the SparkLink physical module can adopt a SparkLink physical module of the NearLink_DK_WS63 model, which integrates 2.4GHz SoC Wi-Fi to complete the SparkLink access layer BLE (basic access) and SLE (low-power access).

[0045] SwanLinkOS integrates the SparkLink data transmission adaptation layer, the device discovery and real-time stream control basic service layer at the system layer, and provides a TEE trusted execution environment, in which algorithm calculations and data processing run in an isolated secure and trusted execution environment.

[0046] The trusted security chip SE adopts a security chip with national core trusted national secret second-level certification, and passes the GM / T 0013-2021 Trusted Computing - Conformance Testing Specification for Trusted Cryptographic Modules and the GM / T0008-2012 Security Chip Cryptography Detection Criteria. It is used to cooperate with SwanLinkOS to provide functions such as trusted security algorithms and trusted storage.

[0047] The trusted security chip SE is used to store data with a higher security level, such as the encryption ciphertext and other data in the embodiments of the present invention. The trusted execution environment TEE provided by SwanLinkOS can be used for encrypting the image plaintext.

[0048] Figure 3It is a schematic flowchart of a video processing method provided by an embodiment of the present invention. This embodiment is applicable to the situation of encrypting and playing back video images captured by a network camera. This method can be executed by a video processing device based on OpenHarmony. The video processing device based on OpenHarmony can be implemented in the form of hardware and / or software, and the video processing device based on OpenHarmony can be configured in electronic devices such as personal computers and servers. As Figure 3 shown, the method includes:

[0049] S101. Network the network cameras according to the SparkLink technology to determine the management node and the terminal nodes.

[0050] Among them, the network camera is equipped with SwanLinkOS developed based on OpenHarmony.

[0051] The optimal network camera can be selected as the management node according to configuration, performance, and storage, and other network cameras as terminal nodes. Complete the mutual authentication between the management node and the terminal nodes and the establishment of the data transmission channel according to the SparkLink protocol.

[0052] S102. The management node is used to determine the time mapping relationship according to the time information. The time mapping relationship represents the mapping relationship between the management node or the terminal node and the daily time; send the generated initial vector to the terminal nodes.

[0053] Optionally, the management node is used to determine the time mapping relationship according to the time information, which can be implemented in the following way:

[0054] The management node is used to obtain multiple time information according to the counting result of the Counter register; the Counter register counts 24 hours in seconds; determine the time information matched by the management node or the terminal node to obtain the time mapping relationship.

[0055] Divide 24 hours into 86,400 seconds in seconds. According to the total number of nodes after networking, that is, the total number of the management node and the terminal nodes, determine the time for each node to be responsible for encryption to obtain the time mapping relationship.

[0056] The management node obtains the number of nodes N, divides 86,400 by N to get the processing duration of each node, and then obtains the time information matched by each node. Exemplarily, assuming N is 100, then each node is responsible for processing 864 seconds of image data.

[0057] Further, since the management node has more functions than the terminal node, the time information matched by the management node can be less than that of the terminal node, so as to release the resources of the management node for other operations. In the above example, the time information matched by the management node can be 500 seconds, and the remaining 364 seconds can be allocated to the terminal node.

[0058] The above implementation can divide 24 hours of a day into seconds, and then accurately obtain the time mapping relationship.

[0059] After determining the time mapping relationship, the management node generates an Initialization Vector (IV). The management node can generate the initial vector according to a random number. The IV initial vector is synchronized to the terminal node in the form of the User Datagram Protocol (UDP) through the data transmission adaptation layer protocol.

[0060] S103. The terminal node is used to generate an encrypted ciphertext according to the initial vector and local information.

[0061] Optionally, the terminal node is used to generate an encrypted ciphertext according to the initial vector and local information, which can be implemented in the following manner:

[0062] The terminal node is used to perform exclusive OR on the initial vector and the device identifier of the terminal node to obtain an encrypted ciphertext; the terminal node includes a trusted security chip SE carried in the Trusted Execution Environment (TEE), and the terminal node is also used to determine verification information according to the initial vector and the trusted security chip identifier of the terminal node.

[0063] Before the terminal node encrypts the video, it is necessary to derive the final IV vector of its own device, that is, the encrypted ciphertext, from the IV initial vector to ensure that the encrypted ciphertexts of each device are different. The exclusive OR algorithm can be selected as the derivation algorithm. It can be calculated according to the binary bits of each byte of the initial vector data. If the two binary bits are the same, the result is 0; if the two binary bits are different, the result is 1. The advantage is that it is faster than the encryption algorithm in terms of calculation speed, and the randomness is increased by the device identifiers of different terminal nodes. Exclusive OR is one of the conventional derivation algorithms. Optionally, it is not limited to the exclusive OR algorithm, and encryption algorithms such as SM4 and AES can also be used for the derivation of the encrypted ciphertext.

[0064] Optionally, the derived process can be as follows: XOR the device identifier of the terminal node with the IV initial vector to obtain the encrypted ciphertext of this device, ensuring that the IV vectors are different when different devices record videos; use the verification information determined according to the initial vector and the trusted security chip identifier of the terminal node to perform bitwise XOR to obtain the verification information. The verification information (AuthData) can be the additional verification data in the GCM mode, which is used to verify data integrity, thereby ensuring that the authentication data for MAC verification of different devices is also different, improving security.

[0065] Before starting video recording, due to the algorithm characteristics, the ciphertext of Counter is calculated in advance. Exemplarily, there are 24 * 60 * 60 = 86400 seconds in 24 hours. Each second, one Counter is used to encrypt the video data within one second. Corresponding to 86400 Counters (16 bytes, represented by the value of the current second, and the time increases by one second each second to meet the rule of Counter increment in the algorithm). Taking the SM4-GCM mode as an example, a total of 86400 * 16 = 1382400 Bytes of ciphertext are generated.

[0066] Optionally, the encrypted ciphertext of all terminal nodes can be calculated through a preset terminal node. For example, the default storage size in the SE security chip is 128Kbytes, and at least 2 devices are sufficient to support this solution. Therefore, the StarFlash networking service with more than 2 devices can be implemented. After calculating the encrypted ciphertext of all terminal nodes by 2 terminal nodes, the encrypted ciphertext is sent to the corresponding terminal nodes so that the terminal nodes can encrypt the image plaintext according to the received encrypted ciphertext.

[0067] According to the video frame rate, if there are 30 frames per second (perform XOR encryption on video data according to the corresponding frame rate selected for the service), that is, the plaintext of 30 frames of video data corresponding to this second is XORed with the ciphertext of this second's Counter to generate the ciphertext of the corresponding video. Store it in the terminal storage medium or push it to the corresponding platform for storage according to business needs. During decryption, only need to calculate the ciphertext of each second's Counter in the same steps and XOR it with the video ciphertext to obtain the plaintext video stream.

[0068] In this way, each node does not need to calculate the entire process of the GCM mode completely. The distributed devices are responsible for calculating the ciphertext of Counter, and the terminal devices only need to perform XOR operations, greatly improving the ciphertext calculation efficiency.

[0069] Further, after performing XOR on the initial vector and the device identifier of the terminal node to obtain the encrypted ciphertext, it further includes:

[0070] The terminal node stores the encrypted ciphertext in the trusted security chip SE.

[0071] Since the trusted security chip SE provides security guarantees, storing the encrypted ciphertext in the trusted security chip SE can enhance the security of the encrypted ciphertext.

[0072] S104. In response to the shooting instruction, determine the target node according to the triggering time of the shooting instruction and the time mapping relationship; the target node encrypts the captured image plaintext based on the symmetric encryption algorithm according to the encrypted ciphertext and the verification information to obtain an image ciphertext; store the image ciphertext at the target location.

[0073] Optionally, the target node encrypts the captured image plaintext based on the symmetric encryption algorithm according to the encrypted ciphertext and the verification information to obtain an image ciphertext, which can be implemented in the following manner:

[0074] The target node encrypts the captured image plaintext according to the characteristics of the SM4-GCM encryption algorithm based on the encrypted ciphertext to obtain encrypted information; obtains the verification information through the terminal node of the previous second; encrypts according to the encrypted information and the verification information to obtain verification data, and the verification data serves as the verification information of the terminal node of the next second; encrypts the verification data corresponding to the video recording end time according to the length of the verification data and the length of the ciphertext to obtain an image ciphertext.

[0075] Figure 4 Schematic diagram of the SM4-GCM encryption algorithm provided by the embodiment of the present invention. Each Counter corresponds to one second, and the target node can correspond to the encryption of one Counter or multiple Counters. The specific corresponding relationship is determined by the time mapping relationship. In the figure, Counter is a register of a counter for storing the counting result. Every time one second is increased, the counting result of Counter is incremented by one (incr).

[0076] Counter0 can be understood as 00:00:00, that is, 0 o'clock 0 minutes 00 seconds; Counter1 can be understood as 00:00:01, that is, 0 o'clock 0 minutes 01 second. And so on, the last counting result is Counter86399. The end time can be determined according to the video recording end time. The end time corresponds to the Nth second, and at this time, the counting result stored in the register is CounterN.

[0077] Taking Counter1 as an example, the encrypted ciphertext Ek is obtained according to the received initial vector. In response to the shooting instruction, assuming the starting time of the video is 00:00:01, the image obtained at 00:00:01 is sent to the target node corresponding to 00:00:01. The target node performs an exclusive OR operation on the pre-computed encrypted ciphertext Ek and the plaintext (plaintext1) of the image received at 00:00:01 to obtain the encrypted information (ciphertext1) at 00:00:01. An exclusive OR operation is performed on the encrypted information and the verification information (mult H) to obtain the verification data. The verification data is used as the verification information for the next second, 00:00:02, and participates in the calculation of the verification data for 00:00:02. And so on until the end of the video recording. The verification information used every second is the verification data calculated in the previous second. When the video recording ends, the verification parameter is determined according to the length of the verification data (len(A)) and the length of the ciphertext (len(C)). The expression of the verification parameter is len(A)|len(C). The verification data corresponding to the video cut-off time is encrypted according to the verification parameter to obtain the image ciphertext.

[0078] Further, after encrypting the plaintext of the captured image according to the symmetric encryption algorithm based on the encrypted ciphertext and the verification information to obtain the image ciphertext, it further includes:

[0079] If the image ciphertext is stored in the device side, the device block to be stored is determined according to the device list; the pointer of the storage starting position is located, and the mapping address of the flash memory Flash is calculated according to the time information; the image ciphertext is written according to the mapping address.

[0080] Figure 5 It is a schematic flowchart of the video image encryption and storage process provided by the embodiment of the present invention.

[0081] Before step 1, according to the SparkLink protocol, a SSAP connection is established between the SparkLink management node and the terminal node using the device general UUID, a session is created and the key is negotiated, and data transmission is performed through the customSecData service. In addition to the basic SparkLink services, data intercommunication, and control instructions, the following functional interfaces are extended:

[0082] Interface 1: BOOL SetCounterRange(String strRand, ULong ulNodeID, ULong ulRangeStart, ULong ulRangeEnd): Set the range of Counter ciphertext that the node needs to calculate. strRand is used to calculate the IV initial vector and authentication data. It is used for the G node to send the Counter range of the SM4-GCM encryption mode that the corresponding device needs to calculate in advance after discovering the access of the T node. And store the Counter range and its ciphertext calculated by the node numbers within the networking range in the physical flash of the secure and trusted chip SE, without occupying the storage resources of the network camera, and ensure the security of the key parameters of the algorithm.

[0083] Among them: The G node delimits the range of Counter according to the configuration of the devices within the network, notifies all devices to make settings, and also undertakes part of the calculation of the Counter ciphertext. After synchronously setting the Counter range, all devices call the SE chip in the background to calculate the ciphertext and store it in the SE chip. For details, see Figure 5 the encryption process introduction in

[0084] Interface 2: Ulong GetCounterEncNodeIndex(Ulong Counter): Get the node ID that calculates the Counter value. The T node obtains the node ID that calculates the ciphertext of the corresponding Counter from the G node. After the T node obtains it, the mapping relationship is saved and stored in the physical flash of the secure and trusted chip SE, without occupying the storage resources of the network camera, and ensure the security of the key parameters of the algorithm. If there is a record in the SE storage when obtaining again, it will not be obtained again.

[0085] Interface 3: String GetCounterEncDate(Ulong Counter): After obtaining the device node ID that calculates this ciphertext through Interface 2, the corresponding device sends it to the node device to obtain the Counter ciphertext. The device that calculates this Counter obtains the ciphertext calculated in advance from the SE chip and synchronizes it to other devices.

[0086] Step 1: Perform device networking and authentication. The service devices form a SparkLink network, designate the device with the highest configuration, best performance, and largest storage as the management node, and other devices as terminal nodes. Complete device mutual authentication and establish a data transmission channel according to the SparkLink protocol.

[0087] Step 2 performs Counter range division and ciphertext pre-computation. The management node divides the Counter range according to the number of devices N in the network, calls the SetCounterRange interface, and sends the encryption calculation parameters to all terminal node devices for Counter ciphertext pre-computation. The Counter range division is based on 24 hours a day, which is 24 * 60 * 60 = 86,400 seconds. For the video data recorded per second, the corresponding Counter is used for SM4-GCM encryption operation.

[0088] Among them, 86,400 / N is used to calculate the Counter range that each device needs to calculate and synchronize it to each device. In addition to controlling the terminal node devices, the management node also needs to be responsible for the encryption calculation process scheduling and the calculation of a part of the Counter ciphertext. For the algorithm's pre-calculation process, refer to Figure 4 the SM4-GCM encryption process shown.

[0089] Step 3 performs random number update. The management node updates the Rand random number after the successful network formation this time and every day. All devices in the network calculate the IV vector and verification data for SM4-GCM encryption through the Rand random number in step 2. Each device calculates the Counter ciphertext it is responsible for calculating and stores it in the SE of the trusted security chip.

[0090] Step 4 obtains the Counter value. When starting video recording, convert the corresponding Counter value according to the start time of video recording (currently, the Counter is pre-calculated for ciphertext according to 86,400 seconds in a day), and send the GetCounterEncNodeIndex interface to the management node to obtain which device node the corresponding Counter value is calculated on. Store the mapping relationship between the device nodes where the corresponding Counter is stored in the local TEE (Trusted Execution Environment): if the machine is restarted, the mapping relationship is re-synchronized and obtained; during continuous video recording, the mapping relationship of the same Counter does not need to be obtained from the management node again and can be directly obtained from the TEE.

[0091] Step 5 obtains the Counter ciphertext. Obtain the device ID for calculating the Counter through the management node or the mapping relationship. The device that starts video recording obtains the corresponding Counter ciphertext through the StarFlash data channel with the GetCounterEncDate interface.

[0092] Step 6 performs video data encryption. The device that starts video recording, according to the SM4-GCM encryption mode, uses the Counter ciphertext per second to perform exclusive OR encryption with all frames of video data within the corresponding second. After the calculation is completed, calculate the verification code according to the AuthData to complete the encryption operation. For AuthData and the IV vector, refer toFigure 4 The SM4-GCM encryption process shown

[0093] In step 7, ciphertext storage is performed. According to the storage service settings, the corresponding ciphertext is stored in the device-side Flash or TF card, or pushed to the platform side for storage.

[0094] a) If it is pushed to the platform side, it can be directly stored

[0095] b) If it is stored in the device-side Flash or TF card, the MTD device list can be obtained through the cat / proc / mtd command, and the device block to be stored can be selected; the corresponding storage block can be opened through open(MTD_DEVICE, O_WRONLY); the pointer positioning of the storage start position can be performed through lseek(fd, offset, SEEK_SET), where offset is the Flash mapping address calculated through Counter; and the encrypted video can be written through write(fd, data, size). For the calculation of the mapping address between Flash and Counter, refer to the introduction in step 8.

[0096] In step 8, mapping is performed based on the Flash address and the Counter ciphertext. It is known that the total Flash is 512M and the total number of Counters is 86400.

[0097] a) When storing on the device side, the video resolution and bit rate are saved according to the page settings. It can be known that N frames of video are stored in one second, and one frame of video is M bytes in size, that is, the video size stored in one second is M*N bytes. The total number of blocks that can be supported in Flash is totalBlock = 512M * 1024 * 1024 / (M * N) (this formula is used to determine how many seconds of video data can be stored in the Flash memory under specific video resolution and bit rate settings).

[0098] b) In the physical flash, the storage start address is recorded as iStart from the physical position where storage is possible, and the relative address is 0. If totalBlock > 86400, the Flash blocks can store data for more than one day at the same time; if totalBlock <= 86400, the Flash blocks are not sufficient to support one day's Counter grouping and need to be cyclically erased. The general formula for both is iStart + (86400 % totalBlock) * (M * N) * Counter, which is the storage position corresponding to the Counter for the corresponding number of seconds.

[0099] Furthermore, after writing the image ciphertext according to the mapping address, it further includes:

[0100] In response to a playback instruction, determine the playback time according to the playback instruction, calculate the mapped address of the Flash memory according to the playback time; obtain the encrypted image according to the mapped address of the Flash memory;

[0101] According to the decryption algorithm characteristics corresponding to the SM4-GCM encryption algorithm, calculate the encrypted ciphertext according to the playback time; decrypt the encrypted image with the encrypted ciphertext to obtain the plaintext image.

[0102] Figure 6 It is a schematic flow chart of the video playback process provided by the embodiment of the present invention.

[0103] Step 1. The platform side selects a time period for video playback: The video storage is divided into platform-side stored video playback and device-side video playback according to the video storage location.

[0104] Step 2. The platform sends a video acquisition message according to the video storage, and obtains the encrypted video stream from the platform video storage database and the device-side local respectively.

[0105] Step 3. During the process of waiting to pull the video stream on the platform side, according to the characteristics of the SM4-GCM encryption mode, convert the Counter in advance through the playback time, and pre-calculate the Counter ciphertext. And during the process of pulling the video, the Counter ciphertexts of all the videos played back this time can be calculated in multiple threads.

[0106] Step 4. The platform side obtains the playback video from the local database for video stream sending; the device side obtains the physical storage address of the Flash according to iStart+(86400%totalBlock)*(M*N)*Counter, obtains the corresponding video stream, and sends it back to the platform side. In a direct mapping manner, the efficiency of retrieving the storage location is improved.

[0107] Step 5. After receiving the encrypted playback video stream, the platform side completes the remaining SM4-GCM decryption through the pre-calculated Counter ciphertext and the exclusive OR of the pre-ciphertext data. Due to the pre-calculation and multi-process assistance of the decryption process, the decryption rate of the platform side is improved, so as to achieve fast retrieval and playback of the video.

[0108] The technical solution of the embodiment of the present invention networks network cameras according to the SparkLink technology to determine a management node and terminal nodes; the management node is used to determine a time mapping relationship according to time information, and the time mapping relationship represents the mapping relationship between the management node or the terminal nodes and the daily time; send the generated initial vector to the terminal nodes; the terminal nodes are used to generate an encrypted ciphertext according to the initial vector and local information; in response to a shooting instruction, determine a target node according to the trigger time of the shooting instruction and the time mapping relationship; the target node encrypts the captured image plaintext according to the encrypted ciphertext and verification information based on a symmetric encryption algorithm to obtain an image ciphertext. The technical solution provided by the embodiment of the present invention can, after networking, determine the daily time corresponding to the management node and the terminal nodes according to time information, and pre-generate an encrypted ciphertext. When a shooting instruction is triggered, determine the target node for encryption according to the trigger time, and the target node encrypts the captured image plaintext according to the pre-generated encrypted ciphertext and the captured image plaintext to obtain an image ciphertext. Since the encrypted ciphertext is pre-computed, after the shooting instruction is triggered, there is no need to compute the encrypted ciphertext, and the pre-computed encrypted ciphertext can be used to encrypt the image plaintext, thereby improving the encryption efficiency. According to the time mapping relationship, the network cameras can be grouped based on time. When a shooting instruction is triggered, the network camera for encryption can be determined according to the time of the captured image plaintext, thereby realizing distributed encryption of the image plaintext captured within a day and further improving the encryption efficiency. By encrypting the image plaintext, the security of the network cameras can be improved.

[0109] Figure 7 It is a schematic diagram of a video processing method based on OpenHarmony according to an embodiment of the present invention, including:

[0110] Step S201, network network cameras according to the SparkLink technology to determine a management node and terminal nodes.

[0111] Among them, the network camera is equipped with SwanLinkOS developed based on OpenHarmony

[0112] Step S202, the management node is used to obtain a plurality of time information according to the counting result of the Counter register; the Counter register counts 24 hours in seconds; determine the time information matched by the management node or the terminal nodes to obtain a time mapping relationship.

[0113] Step S203, the terminal node is used to perform exclusive OR on the initial vector and the device identifier of the terminal node to obtain an encrypted ciphertext; the terminal node is also used to determine verification information according to the initial vector and the trusted security chip identifier of the terminal node.

[0114] Step S204: The terminal node stores the encrypted ciphertext into the trusted secure element (SE). The verification information is stored into the trusted execution environment (TEE).

[0115] Step S205: In response to a shooting instruction, determine a target node according to the trigger time of the shooting instruction and the time mapping relationship. Based on the characteristics of the SM4-GCM encryption algorithm, the target node encrypts the captured image plaintext according to the encrypted ciphertext to obtain encrypted information; obtains verification information through the terminal node of the previous second; encrypts according to the encrypted information and the verification information to obtain verification data, and the verification data is used as the verification information of the terminal node of the next second; encrypts the verification data corresponding to the video recording end time according to the length of the verification data and the length of the ciphertext to obtain an image ciphertext.

[0116] Step S206: If the image ciphertext is stored to the device side, determine the device block to be stored according to the device list; position the pointer at the storage start position, calculate the mapping address of the flash memory according to the time information; write the image ciphertext according to the mapping address. If the image ciphertext is stored to the platform side, write the image ciphertext to the platform side.

[0117] Step S207: In response to a playback instruction, determine the playback time according to the playback instruction, calculate the mapping address of the flash memory according to the playback time; obtain the image ciphertext according to the mapping address of the flash memory; calculate the encrypted ciphertext according to the playback time according to the decryption algorithm characteristics corresponding to the SM4-GCM encryption algorithm; or obtain the image ciphertext through the platform side.

[0118] Step S208: Decrypt the image ciphertext according to the encrypted ciphertext to obtain the image plaintext.

[0119] The technical solution of the embodiment of the present invention networks network cameras according to SparkLink technology to determine a management node and terminal nodes; the management node is used to determine a time mapping relationship according to time information, where the time mapping relationship represents the mapping relationship between the management node or the terminal nodes and the daily time; send the generated initial vector to the terminal nodes; the terminal nodes are used to generate an encrypted ciphertext according to the initial vector and local information; in response to a shooting instruction, determine a target node according to the trigger time of the shooting instruction and the time mapping relationship; the target node encrypts the captured image plaintext according to the encrypted ciphertext and verification information based on a symmetric encryption algorithm to obtain an image ciphertext. The technical solution provided by the embodiment of the present invention can, after networking, determine the daily time corresponding to the management node and the terminal nodes according to time information, and pre-generate an encrypted ciphertext. When a shooting instruction is triggered, determine the target node for encryption according to the trigger time, and the target node encrypts the captured image plaintext according to the pre-generated encrypted ciphertext and the captured image plaintext to obtain an image ciphertext. Since the encrypted ciphertext is pre-computed, after a shooting instruction is triggered, there is no need to compute the encrypted ciphertext, and the pre-computed encrypted ciphertext can be used to encrypt the image plaintext, thereby improving the encryption efficiency. According to the time mapping relationship, the network cameras can be grouped based on time. When a shooting instruction is triggered, the network camera for encryption can be determined according to the time of the captured image plaintext, thereby realizing distributed encryption of the image plaintext captured within a day and further improving the encryption efficiency. By encrypting the image plaintext, the security of the network cameras can be improved. It is possible to adopt a secure and trusted chip for trusted authentication based on SwanLink OSTEE and a trusted SE environment to ensure the data security of network camera recording and key storage and the secure computing environment of the algorithm. SparkLink-connected devices perform distributed computing of video ciphertexts. Through the characteristics of the GCM encryption mode, the IV vector and authentication data are added with the device SN variable to participate, improving security, pre-computing the feedback bit ciphertext, improving encryption performance, and reducing the computing resource consumption of terminal devices. Through the video recording start time mapping the ciphertext storage address, the platform side pre-computes the feedback bit ciphertext in advance through the feedback bit and the corresponding device SN to achieve fast decryption and playback.

[0120] Figure 8 FIG. is a schematic structural diagram of a video processing device based on OpenHarmony provided by an embodiment of the present invention. This embodiment is applicable to the situation of encrypting and playing back video images captured by network cameras. The video processing device based on OpenHarmony can be implemented in the form of hardware and / or software, and the video processing device based on OpenHarmony can be configured in electronic devices such as personal computers and servers. As Figure 8 shown, the device includes: a networking module 31, an initial vector processing module 32, a ciphertext calculation module 33, and a video encryption module 34.

[0121] The networking module 31 is used to network network cameras according to the SparkLink technology, determine the management node and the terminal node, and the network camera is equipped with SwanLinkOS developed based on OpenHarmony;

[0122] The initial vector processing module 32 is used to determine the time mapping relationship by the management node according to the time information, and the time mapping relationship represents the mapping relationship between the management node or the terminal node and the daily time; send the generated initial vector to the terminal node;

[0123] The ciphertext calculation module 33 is used to generate an encrypted ciphertext by the terminal node according to the initial vector and local information;

[0124] The video encryption module 34 is used to, in response to a shooting instruction, determine the target node according to the trigger time of the shooting instruction and the time mapping relationship; the target node encrypts the captured image plaintext based on the symmetric encryption algorithm according to the encrypted ciphertext and the verification information to obtain an image ciphertext.

[0125] Based on the above embodiments, optionally, the initial vector processing module 32 is used for:

[0126] The management node is used to obtain multiple time information according to the counting result of the Counter register; the Counter register counts 24 hours in seconds;

[0127] Determine the time information matched by the management node or the terminal node to obtain the time mapping relationship.

[0128] Based on the above embodiments, optionally, the ciphertext calculation module 33 is used for:

[0129] The terminal node is used to perform exclusive OR on the initial vector and the device identifier of the terminal node to obtain an encrypted ciphertext;

[0130] The terminal node includes a trusted security chip SE carried in the trusted execution environment TEE, and the terminal node is further used to determine the verification information according to the initial vector and the trusted security chip identifier of the terminal node.

[0131] Based on the above embodiments, optionally, it further includes a secure writing module, which is used to, after performing exclusive OR on the initial vector and the device identifier of the terminal node to obtain an encrypted ciphertext, the terminal node stores the encrypted ciphertext into the trusted security chip.

[0132] Based on the above embodiments, optionally, the video encryption module 34 is used for:

[0133] The target node encrypts the captured image plaintext according to the encryption ciphertext based on the characteristics of the SM4-GCM encryption algorithm to obtain encrypted information;

[0134] Obtain verification information through the terminal node of the previous second; encrypt according to the encrypted information and the verification information to obtain verification data, and the verification data is used as the verification information of the terminal node of the next second;

[0135] Encrypt the verification data corresponding to the video cut-off time according to the verification data length and the ciphertext length to obtain an image ciphertext.

[0136] Based on the above embodiments, optionally, it further includes a device-side writing module, which is used to, after encrypting the captured image plaintext according to the encryption ciphertext and the verification information based on the symmetric encryption algorithm to obtain an image ciphertext, if the image ciphertext is stored on the device side, determine the device block to be stored according to the device list; position the pointer of the storage start position, calculate the mapping address of the flash memory Flash according to the time information; write the image ciphertext according to the mapping address.

[0137] Based on the above embodiments, optionally, it further includes a playback module, which is used to, after writing the image ciphertext according to the mapping address, in response to a playback instruction, determine the playback time according to the playback instruction, calculate the mapping address of the flash memory Flash according to the playback time; obtain the image ciphertext according to the mapping address of the flash memory Flash;

[0138] Calculate the encryption ciphertext according to the playback time according to the characteristics of the decryption algorithm corresponding to the SM4-GCM encryption algorithm; decrypt the image ciphertext according to the encryption ciphertext to obtain the image plaintext.

[0139] The video processing device based on OpenHarmony according to the embodiments of the present invention includes a networking module 31, which is configured to network network cameras according to the NearLink technology, determine a management node and terminal nodes, and the network cameras are equipped with SwanLinkOS developed based on OpenHarmony; an initial vector processing module 32, which is configured to determine a time mapping relationship by the management node according to time information, and the time mapping relationship represents the mapping relationship between the management node or the terminal nodes and the daily time; and send the generated initial vector to the terminal nodes; a ciphertext calculation module 33, which is configured to generate an encrypted ciphertext by the terminal nodes according to the initial vector and local information; a video encryption module 34, which is configured to, in response to a shooting instruction, determine a target node according to the triggering time of the shooting instruction and the time mapping relationship; and the target node encrypts the captured plain image according to the encrypted ciphertext and verification information based on a symmetric encryption algorithm to obtain an image ciphertext. The video processing device based on OpenHarmony provided by the embodiments of the present invention can, after networking, determine the daily time corresponding to the management node and the terminal nodes according to time information, and pre-generate encrypted ciphertexts. When a shooting instruction is triggered, the target node for encryption is determined according to the triggering time, and the target node encrypts the captured plain image according to the pre-generated encrypted ciphertext and the captured plain image to obtain an image ciphertext. Since the encrypted ciphertext is pre-calculated, after the shooting instruction is triggered, there is no need to calculate the encrypted ciphertext, and the pre-calculated encrypted ciphertext can be used to encrypt the plain image, thereby improving the encryption efficiency. According to the time mapping relationship, the network cameras can be grouped based on time. When a shooting instruction is triggered, the network camera for encryption can be determined according to the time of the captured plain image, thereby realizing distributed encryption of the plain images captured within a day and further improving the encryption efficiency. By encrypting the plain image, the security of the network camera can be improved. A secure and trusted chip that adopts trusted authentication can be used based on the SwanLinkOS TEE and the trusted SE environment to ensure the data security of the network camera recording and key storage and the secure computing environment of the algorithm. The NearLink interconnected devices perform distributed computing of the video ciphertext. Through the characteristics of the GCM encryption mode, the device SN variable is added to the IV vector and the authentication data to improve security, and the feedback bit ciphertext is pre-calculated to improve the encryption performance and reduce the consumption of computing resources of the terminal device. The storage address of the ciphertext is mapped by the video recording start time. The platform end pre-calculates the feedback bit ciphertext in advance through the feedback bit and the corresponding device SN to achieve fast decryption and playback.

[0140] The video processing device based on OpenHarmony provided by the embodiments of the present invention can execute the video processing method based on OpenHarmony provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.

[0141] Figure 9This is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0142] As Figure 9 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. The memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.

[0143] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0144] The processor 11 can be various general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the video processing method based on OpenHarmony.

[0145] In some embodiments, the OpenHarmony-based video processing method can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by the processor 11, one or more steps of the above-described OpenHarmony-based video processing method can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the OpenHarmony-based video processing method by any other suitable means (e.g., by means of firmware).

[0146] The various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0147] The computer program for implementing the OpenHarmony-based video processing method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer programs are executed by the processor, the functions / operations specified in the flowchart and / or block diagram are implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0148] The invention embodiment also provides a computer-readable storage medium storing computer instructions for causing a processor to execute an OpenHarmony-based video processing method, the method including:

[0149] Network cameras are networked according to SparkLink technology to determine a management node and terminal nodes. The network cameras are equipped with SwanLinkOS developed based on OpenHarmony.

[0150] The management node is used to determine a time mapping relationship according to time information, where the time mapping relationship represents the mapping relationship between the management node or the terminal nodes and the daily time; and send the generated initial vector to the terminal nodes.

[0151] The terminal nodes are used to generate an encrypted ciphertext according to the initial vector and local information.

[0152] In response to a shooting instruction, determine a target node according to the trigger time of the shooting instruction and the time mapping relationship; the target node encrypts the captured plain image according to the encrypted ciphertext and verification information based on a symmetric encryption algorithm to obtain an image ciphertext; and store the image ciphertext at a target location.

[0153] Based on the above embodiments, optionally, the management node is used to determine a time mapping relationship according to time information, including:

[0154] The management node is used to obtain multiple pieces of time information according to the counting result of a Counter register; the Counter register counts 24 hours in seconds.

[0155] Determine the time information matching the management node or the terminal nodes to obtain the time mapping relationship.

[0156] Based on the above embodiments, optionally, the terminal nodes are used to generate an encrypted ciphertext according to the initial vector and local information, including:

[0157] The terminal nodes are used to perform an exclusive OR operation on the initial vector and the device identifier of the terminal nodes to obtain an encrypted ciphertext.

[0158] The terminal nodes include a trusted security chip SE mounted in a trusted execution environment TEE, and the terminal nodes are also used to determine verification information according to the initial vector and the identifier of the trusted security chip of the terminal nodes.

[0159] Based on the above embodiments, optionally, after performing an exclusive OR operation on the initial vector and the device identifier of the terminal nodes to obtain an encrypted ciphertext, it further includes:

[0160] The terminal nodes store the encrypted ciphertext in the trusted security chip.

[0161] Based on the above embodiments, optionally, the target node encrypts the captured plaintext image according to the encrypted ciphertext and verification information based on a symmetric encryption algorithm to obtain an image ciphertext, including:

[0162] The target node encrypts the captured plaintext image according to the encrypted ciphertext based on the characteristics of the SM4-GCM encryption algorithm to obtain encrypted information;

[0163] Obtain verification information through the terminal node of the previous second; encrypt according to the encrypted information and the verification information to obtain verification data, and use the verification data as the verification information of the terminal node of the next second;

[0164] Encrypt the verification data corresponding to the video cut-off time according to the verification data length and the ciphertext length to obtain an image ciphertext.

[0165] Based on the above embodiments, optionally, after encrypting the captured plaintext image according to the encrypted ciphertext and verification information based on a symmetric encryption algorithm to obtain an image ciphertext, it further includes:

[0166] If the image ciphertext is stored in the device end, determine the device block to be stored according to the device list; position the pointer of the storage start position, calculate the mapping address of the flash memory Flash according to the time information; write the image ciphertext according to the mapping address.

[0167] Based on the above embodiments, optionally, after writing the image ciphertext according to the mapping address, it further includes:

[0168] In response to the playback instruction, determine the playback time according to the playback instruction, calculate the mapping address of the flash memory Flash according to the playback time; obtain the image ciphertext according to the mapping address of the flash memory Flash;

[0169] According to the characteristics of the decryption algorithm corresponding to the SM4-GCM encryption algorithm, calculate the encrypted ciphertext based on the playback time; decrypt the image ciphertext according to the encrypted ciphertext to obtain the image plaintext. In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium may be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0170] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).

[0171] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by any form or medium of digital data communication (e.g., a communication network). Examples of the communication network include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0172] A computing system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The client-server relationship is created by computer programs running on respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.

[0173] It should be understood that various forms of processes shown above can be used, with steps reordered, added or deleted. For example, the steps described in the present invention can be executed in parallel, sequentially or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.

[0174] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A video processing method based on OpenHarmony, characterized in that: include: Networking the network camera according to the Star Flash technology to determine the management node and the terminal node, wherein the network camera is equipped with SwanLinkOS developed based on OpenHarmony; The management node is used to determine a time mapping relationship according to the time information, wherein the time mapping relationship represents a mapping relationship between the management node or the terminal node and the daily time; and send the generated initial vector to the terminal node; The terminal node is used to generate an encrypted ciphertext according to the initial vector and local information; In response to a shooting instruction, a target node is determined according to the trigger time of the shooting instruction and the time mapping relationship; the target node encrypts the shot image plaintext according to the encrypted ciphertext and verification information based on a symmetric encryption algorithm to obtain an image ciphertext; and the image ciphertext is stored in a target location.

2. The method according to claim 1, characterized in that The management node is used to determine the time mapping relationship according to the time information, including: The management node is used to obtain multiple time information according to the counting result of the Counter register; the Counter register counts 24 hours in seconds; Determine the time information matched by the management node or the terminal node and obtain the time mapping relationship.

3. The method according to claim 2, characterized in that The terminal node is used to generate an encrypted ciphertext according to the initial vector and local information, including: The terminal node is used to perform an XOR operation according to the initial vector and the device identifier of the terminal node to obtain an encrypted ciphertext; The terminal node includes a trusted security chip SE mounted in an executable environment TEE, and the terminal node is also used to determine verification information according to the initial vector and the trusted security chip identifier of the terminal node.

4. The method according to claim 3, characterized in that After performing XOR based on the initial vector and the device identifier of the terminal node to obtain the encrypted ciphertext, the method further includes: The terminal node stores the encrypted ciphertext in the trusted security chip.

5. The method according to claim 4, characterized in that The target node encrypts the captured image plaintext according to the encrypted ciphertext and the verification information based on a symmetric encryption algorithm to obtain the image ciphertext, including: The target node encrypts the captured image plaintext according to the encrypted ciphertext based on the SM4-GCM encryption algorithm characteristics to obtain encrypted information; Acquire verification information through the terminal node of the previous second; encrypt according to the encryption information and the verification information to obtain verification data, and the verification data is used as the verification information of the terminal node of the next second; The verification data corresponding to the video recording deadline is encrypted according to the verification data length and the ciphertext length to obtain the image ciphertext.

6. The method according to claim 1, characterized in that After encrypting the captured image plaintext according to the encrypted ciphertext and the verification information based on a symmetric encryption algorithm to obtain the image ciphertext, the method further includes: If the image ciphertext is stored in the device end, the device block to be stored is determined according to the device list; the pointer of the storage start position is located, and the mapping address of the flash memory Flash is calculated according to the time information; and the image ciphertext is written according to the mapping address.

7. The method according to claim 6, characterized in that After writing the image ciphertext according to the mapping address, the method further includes: In response to a playback instruction, determining a playback time according to the playback instruction, calculating a mapping address of a flash memory Flash according to the playback time; and obtaining an image ciphertext according to the mapping address of the flash memory Flash; According to the decryption algorithm characteristics corresponding to the SM4-GCM encryption algorithm, the encrypted ciphertext is calculated according to the playback time; the image ciphertext is decrypted according to the encrypted ciphertext to obtain the image plaintext.

8. A video processing device based on OpenHarmony, characterized in that: include: A networking module, used to network the network camera according to the Star Flash technology and determine the management node and the terminal node. The network camera is equipped with SwanLinkOS developed based on OpenHarmony; An initial vector processing module, configured to determine a time mapping relationship according to time information through the management node, wherein the time mapping relationship represents a mapping relationship between the management node or the terminal node and daily time; and send the generated initial vector to the terminal node; A ciphertext calculation module, used to generate an encrypted ciphertext according to the initial vector and local information through the terminal node; The video encryption module is used to respond to a shooting instruction and determine a target node according to the trigger time of the shooting instruction and the time mapping relationship; the target node encrypts the shot image plaintext according to the encrypted ciphertext and verification information based on a symmetric encryption algorithm to obtain an image ciphertext.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the OpenHarmony-based video processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the OpenHarmony-based video processing method according to any one of claims 1 to 7 when executed.

Citation Information

Cited By

  • Panoramic image rapid splicing method based on star flash wireless communication technology

    CN120725863A