Data transmission method and electronic equipment

By introducing a fast-starting first and second operating systems into wearable smart devices, and combining them with a double buffer and handshake signal mechanism, image data transmission is optimized, solving the problem of high latency in image recognition functions in smart devices and improving the user experience.

CN121908129APending Publication Date: 2026-04-21LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LENOVO (BEIJING) LTD
Filing Date
2025-12-30
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

The image recognition function in wearable smart devices has a large latency, resulting in a poor user experience.

Method used

Introducing a first operating system and a second operating system into electronic devices, the first operating system quickly boots up to acquire image data, while the second operating system transmits the image data upon completion, combining a double buffer and handshake signal mechanism to optimize data transmission.

Benefits of technology

It shortens image acquisition and processing time and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121908129A_ABST
    Figure CN121908129A_ABST
Patent Text Reader

Abstract

The invention provides a data transmission method and electronic equipment. The method comprises the following steps: in response to a photographing trigger signal for an image acquisition module in the electronic equipment, starting and running a first operating system and a second operating system in an image processor; the starting time of the first operating system is shorter than that of the second operating system; acquiring image data acquired by the image acquisition module in response to the photographing trigger signal by using the first operating system; transmitting the image data to a target communication module in the electronic equipment by using the second operating system; the target communication module is used for sending the image data to the target device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data transmission technology, and more particularly to a data transmission method and an electronic device. Background Technology

[0002] Current wearable smart devices are equipped with cameras. These devices take photos locally, then transmit the images to a cloud-based image recognition database via a mobile phone or other communication device. Finally, the recognition results from the database are fed back to the smart device in audio and video format via the communication device. This process is time-consuming, resulting in significant latency for users when using the intelligent recognition functions of wearable smart devices, leading to a poor user experience. Summary of the Invention

[0003] This application provides a data transmission method, an electronic device, a computer-readable storage medium, and a computer program product.

[0004] The technical solution of this application embodiment is implemented as follows: In a first aspect, embodiments of this application provide a data transmission method applied to a target intelligent agent in an electronic device, the method comprising: In response to a photo-taking trigger signal from the image acquisition module in the electronic device, the first operating system and the second operating system in the image processor are started and run; the startup time of the first operating system is shorter than the startup time of the second operating system. Using the first operating system, image data acquired by the image acquisition module in response to the photo-taking trigger signal is obtained; Using a second operating system, image data is transmitted to a target communication module in an electronic device; the target communication module is used to send image data to the target device.

[0005] Secondly, embodiments of this application provide an electronic device, which includes an image acquisition module, an image processor, and a target communication module; The image acquisition module is used to acquire image data in response to the photo-taking trigger signal; An image processor is used to respond to a photo-taking trigger signal to start and run a first operating system and a second operating system in the image processor; the startup time of the first operating system is shorter than the startup time of the second operating system; image data is acquired using the first operating system; and image data is transmitted to a target communication module in an electronic device using the second operating system. The target communication module is used to send image data to the target device.

[0006] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the data transmission method provided in embodiments of this application when executed by a processor.

[0007] Fourthly, embodiments of this application provide a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, they implement the data transmission method provided in embodiments of this application. Attached Figure Description

[0008] Figure 1 This is a flowchart illustrating a data transmission method provided in an embodiment of this application; Figure 2 This is a schematic diagram of a sub-image transmission process provided in an embodiment of this application; Figure 3 This is a flowchart illustrating a data transmission method provided in an embodiment of this application. Figure 2 ; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application; Figure 6 This is a flowchart of a Bluetooth image transmission process provided in an embodiment of this application; Figure 7 This is a schematic diagram of a transmission path provided in an embodiment of this application; Figure 8 This is a schematic diagram of the entire process of image recognition and transmission provided in an embodiment of this application; Figure 9 This is a schematic diagram of the hardware entity of an electronic device provided in an embodiment of this application. Detailed Implementation

[0009] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0010] To address the issue of high latency in intelligent photo recognition technologies, which leads to a poor user experience with smart devices, this application provides a data transmission method applied to the image processor of an electronic device. Exemplarily, the electronic device includes, but is not limited to, smartphones, tablets, wearable devices, personal computers (PCs), netbooks, etc., and the implementation form of this application is not fixed or limited.

[0011] In this embodiment, the image processor can start the first and second operating systems installed inside the electronic device when it receives a photo-taking trigger signal. After the first operating system starts up first, it uses the first operating system to acquire image data acquired by the image acquisition module. After the second operating system starts up, it uses the second operating system to send the image data to the target device through the target communication module. Since the startup time of the first operating system is short, the image processor does not have to wait for the second operating system, which is the main system, to start up before acquiring image data. This can save the time for the image acquisition module to acquire images and the time for the image processor to acquire image data, thereby shortening the latency of the electronic device using the photo recognition function to a certain extent and improving the user experience.

[0012] The technical solution of this application will be described in detail below with reference to embodiments, such as... Figure 1 As shown, this data transmission method can be implemented through steps S101 to S103: Step S101: In response to the photo capture trigger signal of the image acquisition module in the electronic device, the first operating system and the second operating system in the image processor are started and run; the startup time of the first operating system is less than the startup time of the second operating system.

[0013] In embodiments of this application, the electronic device can be a wearable smart terminal device, such as a smartwatch, smart bracelet, tablet computer, smart glasses, smart helmet, or other device with shooting capabilities. The electronic device may include an image acquisition module and an image signal processor (ISP). The image acquisition module can be used to acquire optical images, such as various cameras or webcams; the image processor can be used to receive and process the images acquired by the image acquisition module. The image processor can run a first operating system and a second operating system, ensuring that the boot time of the first operating system is shorter than that of the second operating system. For example, the first operating system can be a proprietary Rtos system, which can be customized by the user; the second operating system can be a commonly used operating system for smart terminal devices, such as Linux or Ubuntu.

[0014] In traditional single-operating system solutions, when a photo-taking action is triggered, the electronic device needs to wake up the main operating system before starting the photo-taking action, completing image uploading and recognition. Because the main operating system has a long startup time, this results in a significant latency in photo recognition. Therefore, this embodiment adds a user-customized Rtos system or other first operating system to the electronic device. This allows image capture to be performed using the first operating system, which has a shorter startup time, when a photo-taking action is triggered, thereby shortening the overall photo recognition process.

[0015] In the embodiments of this application, for power saving purposes, if the electronic device is not in use, the first and second operating systems within the electronic device will be in a dormant state. At this time, if the image acquisition module in the electronic device receives a photo-taking trigger signal (which can be generated by the user or by other devices capable of controlling the electronic device), the image processor can respond to the photo-taking trigger signal and start running the first and second operating systems within the image processor. User-triggered triggering can include the user pressing the photo button or trigger button on the electronic device; triggering by other devices capable of controlling the electronic device can include the user operating a control device such as a mobile phone connected to the electronic device, thereby sending a trigger signal to the electronic device.

[0016] Step S102: Using the first operating system, acquire the image data acquired by the image acquisition module in response to the photo-taking trigger signal.

[0017] In the embodiments of this application, the first operating system has a shorter startup time, therefore, it can be used only to execute basic functions within the electronic device, such as taking pictures, using a flashlight, a calculator, a guide, etc. After the image processor starts the first and second operating systems simultaneously, the first operating system will start up first because its startup time is shorter than that of the second operating system. At this time, the second operating system is still starting up. The image processor can use the first operating system to control the image acquisition module to perform image acquisition in response to the picture trigger signal, thereby obtaining image data. Afterward, the image processor can acquire the aforementioned image data.

[0018] In one possible embodiment, if the duration of the photo-taking trigger signal is long (i.e., the duration is longer than the minimum acquisition interval of the image acquisition module), the image processor can control the image acquisition module to continuously acquire images at the minimum acquisition interval, thereby obtaining multiple image data.

[0019] In another possible embodiment, the image processor can control the image acquisition module to acquire images and obtain image data immediately when the first operating system starts up, or it can control the image acquisition module to acquire images and obtain image data at any time during the time interval between when the first operating system has finished starting up and the second operating system has not finished starting up.

[0020] Step S103: Using the second operating system, image data is transmitted to the target communication module in the electronic device; the target communication module is used to send image data to the target device.

[0021] In embodiments of this application, the electronic device may further include a target communication module, which enables the electronic device to communicate with other devices. For example, the target module may be a Bluetooth module, a Wi-Fi module, or a wired interface. The second operating system is the main operating system of the electronic device, capable of implementing all functions of the electronic device, such as device communication, information transmission, and media playback. After the second operating system starts, the image processor can use the second operating system to send previously acquired image data to the target communication module. Subsequently, image data can be sent to the target device through the target communication module. The target device may be a device equipped with communication capabilities, such as a mobile phone, computer, or personal digital assistant device. After receiving the image data, the user can manually upload the image data to a large model for recognition; alternatively, the target device may have a photo recognition application installed, which can automatically upload the received image data to the large model associated with the application for image recognition. After receiving the image data, the target device can upload the image data to the large model corresponding to the photo recognition application for recognition.

[0022] Based on the embodiments disclosed in this application, the image processor can start a first operating system such as the Rtos proprietary system and a second operating system such as the Linux or Ubuntu operating system installed inside the electronic device when it receives a photo-taking trigger signal. After the first operating system starts up, it uses the first operating system to acquire image data acquired by the image acquisition module. After the second operating system starts up, it uses the second operating system to send the image data to the target device through a target communication module such as a Bluetooth module, a WIFI module, or a wired interface. Since the startup time of the first operating system is short, the image processor does not need to wait for the second operating system, which is the main system, to start up before acquiring image data. This can save the time for the image acquisition module such as the camera to acquire images and the time for the image processor to acquire image data, thereby shortening the latency of the electronic device's photo recognition function to a certain extent. If the image processor immediately controls the image acquisition module to acquire images and obtain image data when the first operating system starts up, the latency of photo recognition can be minimized, further improving the user experience.

[0023] In some embodiments, step S103 can be implemented through steps S131 to S134: Step S131: Store the first frame image in the first buffer; the first frame image is a portion of the image data.

[0024] In embodiments of this application, image data may include multiple frames of images; wherein, a portion of the image data may refer to one frame or multiple frames of images in the image data.

[0025] In the embodiments of this application, for the sake of data integrity, during data transmission, the data to be transmitted is first forwarded to a buffer, and then transmitted from the buffer to the target location all at once. Traditional transmission schemes only contain one buffer. In this case, when transmitting large amounts of data, the data can only be processed in blocks. A portion of the data is stored in the buffer, and then the data in the buffer is transmitted to the target location, and then new data is stored in the buffer again. This results in an discontinuous transmission process for large amounts of data, requiring frequent establishment of communication connections between the buffer and the target location. This frequent establishment of communication connections wastes a significant amount of transmission time. Therefore, to save transmission time, the embodiments of this application can divide the storage space of the electronic device (the corresponding hardware is usually a high-speed cache storage space, such as solid-state drive cache, L1, L2, L3 cache inside an image processor, etc.) into a first buffer and a second buffer. The cache space of the first buffer and the cache space of the second buffer can be the same or different. Both the first buffer and the second buffer can be used to store image data. Considering that the electronic device may capture multiple images before the second operating system is fully booted, the image processor can also store the image data in permanent storage space (such as memory, hard disk, etc.) in the electronic device after acquiring the image data. After the transmission is initiated, the image processor can read the image data from the storage space and transmit it.

[0026] In the embodiments of this application, during the process of the electronic device sending image data to the target module, the image processor can first obtain the first frame image captured earlier from the image data, and then store the first frame image in the first buffer. Specifically, if the image data has already been stored in the permanent storage space of the electronic device, the image processor can read the first frame image from the image data stored in the permanent storage space; if the image data is not stored in the permanent storage space, the image processor can directly forward the first frame image from the image data to the first buffer.

[0027] Step S132: Transmit the first frame image in the first buffer to the target communication module.

[0028] In the embodiments of this application, after the first frame image has been completely stored in the first buffer, the first frame image can be sent to the target communication module to transmit the first frame image in the first buffer to the target communication module. Both the first buffer and the target communication module are internal hardware or part of the hardware of the electronic device. Therefore, data transmission between the first buffer and the target communication module can be carried out through wired communication methods (such as Serial Peripheral Interface (SPI), hardwired, or Universal Serial Bus (USB)).

[0029] In step S133, during the transmission of the first frame image to the target communication module, the second frame image is stored in the second buffer; the second frame image is a portion of the image data.

[0030] In the embodiments of this application, after the first frame image in the first buffer begins transmission, the second frame image following the first frame image can be obtained from the image data, and then the second frame image is stored in the second buffer. To save time, the second frame image can be read as soon as the first frame image in the first buffer begins transmission, and then stored in the second buffer after reading is complete. Typically, the time for storing the image in the buffer can be less than the time for the image to be transmitted to the target communication module. Therefore, when the first frame image transmission is complete, the second frame image is already fully stored in the second buffer.

[0031] Step S134: After the first frame image is transmitted, the second frame image in the second buffer is transmitted to the target communication module.

[0032] In the embodiments of this application, after the first frame image transmission is completed, the transmission of the second frame image previously stored in the second buffer to the target communication module can begin immediately. The implementation details of the second frame image transmission can be found in the embodiment of step S132, and will not be repeated here.

[0033] In some embodiments, when the second frame of the image in the second buffer begins transmission, the first buffer will not contain any image data. If a third frame of the image data still exists, it can be stored in the first buffer when or after the second frame begins transmission, forming a "one-store-one-transmission" cyclic transmission mode between the first and second buffers. To reduce technical design complexity, a preferred approach is to store the third frame of the image in the first buffer when the second frame begins transmission. When all image data has been processed, the cyclic mode can be stopped, and the actions of "storing the image in the first / second buffer" and "transmitting the image to the target communication module" are no longer performed.

[0034] Based on the above embodiments disclosed in this application, during the process of transmitting image data to the target communication module, a "one-to-one" interactive loop transmission mode can be formed using the first buffer and the second buffer. Compared with the traditional technical solution of transmitting a single image from the buffer to the communication module and then storing the next image in the buffer, the transmission time of batch image data can be greatly reduced and the transmission process can be accelerated.

[0035] In some embodiments, step S132 can be achieved through steps A1 to A5: Step A1: Split the first frame image in the first buffer into multiple sub-images.

[0036] In the embodiments of this application, the storage space of the electronic device may also include a third buffer and a fourth buffer. The size of the third buffer and the fourth buffer can be set arbitrarily. However, in order to reduce the difficulty of technical design, the size of the third buffer and the fourth buffer can be the same. In order not to occupy too much storage space, the third buffer and the fourth buffer can be set to an appropriate space size, such as both being set to 4KB or 8KB.

[0037] In the embodiments of this application, when transmitting the first frame image in the first buffer, the first frame image can be split into multiple sub-images, each with the same data size. The splitting can be done according to a preset data size or a preset number, but the data size of the resulting sub-images must be less than or equal to the buffer space size of the third or fourth buffer. For example, the preset number can be set to 20, 30, etc.; when the space size of the third buffer is 4KB, the preset data size can be set to 4KB.

[0038] Step A2: Store the first sub-image from the first buffer to the third buffer among multiple sub-images.

[0039] In the embodiments of this application, similar to the first and second buffers, the third and fourth buffers can also form a "one-store-one-transfer" cyclic transmission mode. A first sub-image can be selected from multiple sub-images and then stored from the first buffer to the third buffer. Theoretically, the first sub-image can be any sub-image among the multiple sub-images, but to reduce technical design complexity, the first sub-image can be the very beginning of the image data before the first frame image is split. Here, image data is usually stored in memory in encoded form. When splitting the image, the encoded image data is usually split directly. Therefore, the "very beginning" referred to here means that the encoding of the first sub-image is the very beginning of the encoding of the first frame image.

[0040] Step A3: Transmit the first sub-image in the third buffer to the target communication module.

[0041] In the embodiments of this application, after the first sub-image is completely stored in the third buffer, the first sub-image can be transmitted from the third buffer to the target communication module. Specifically, if a serial peripheral interface is used for transmission, the chip select signal can be pulled down using the serial peripheral interface transmission protocol to start the transmission operation; if a wireless transmission method is used, the image processor can first send a handshake signal to the target communication module. If the image processor and the target communication module successfully handshake, the transmission operation can begin.

[0042] In step A4, during the transmission of the first sub-image, the second sub-image among the multiple sub-images is stored in the fourth buffer.

[0043] In embodiments of this application, after the first sub-image begins transmission, the image processor can store the second sub-image from among multiple sub-images into a fourth buffer. The second sub-image can be the image data portion following the first sub-image before the first frame image is split, or it can be any other arbitrary portion.

[0044] Step A5: After the first sub-image is transmitted, the second sub-image in the fourth buffer is transmitted to the target communication module.

[0045] In the embodiments of this application, after the first sub-image is transmitted, the image processor can begin transmitting the second sub-image from the fourth buffer to the target communication module. Simultaneously, the image processor can also store the third sub-image from multiple sub-images into the third buffer to form a cyclic transmission process. Once all sub-images have been transmitted, the transmission of the first frame image can be considered complete.

[0046] For example, such as Figure 2 As shown, Figure 2 This is a schematic diagram illustrating a sub-image transmission process provided in an embodiment of this application. The transmission of multiple sub-images of a single frame can be performed according to... Figure 2 The process is carried out accordingly. Figure 2This demonstrates a transmission process using a Serial Peripheral Interface (SPI). First, when the image processor begins SPI transmission, step S21 initializes the SPI transmission link. After initialization, step S22 uses Direct Memory Access (DMA) technology to configure the SPI transmission parameters and divide the image into two buffers, BufferA and BufferB, to store the sub-images corresponding to the MJPEG format image. After configuration, step S23 pulls the Chip Select (CS) signal low to notify the image processor to begin data transmission. Then, using DMA, the sub-images in BufferA are transmitted, while other sub-images are stored in BufferB. After the sub-images in BufferA are transmitted, step S25 executes a completion interrupt using DMA technology. Next, step S26 uses DMA technology to begin transmitting the sub-image data in BufferB. After the sub-images in BufferB are transmitted, step S27 executes a completion interrupt using DMA technology. Then, step S28 determines whether all sub-images of the MJPEG image have been transmitted. When all sub-images have been transmitted, step S29 can be used to raise the chip select signal and send the transmission end signal EOF to the target communication module.

[0047] Based on the above embodiments disclosed in this application, a dual-buffer "one-store-one-transmit" mechanism can be used to complete the transmission of a single frame image, which can shorten the transmission time of a single frame image. During the transmission process, a single frame of data can be transmitted at once without having to cyclically switch between interruption and start of the transmission protocol. Instead, it is executed only once during the transmission of a single frame image, thereby further shortening the transmission time of a single frame image.

[0048] In some embodiments, step A3 can be achieved through steps A31 and A32: Step A31: During the storage process of the first sub-image from the first buffer to the third buffer, determine the remaining buffer space of the third buffer.

[0049] In the embodiments of this application, the first sub-image may include multiple sub-images. In order to maximize the amount of data transmitted in one transmission of the third buffer (i.e., as close as possible to the upper limit of the space of the third buffer), during the storage process of the first sub-image from the first buffer to the third buffer, the remaining buffer space of the third buffer can be determined in real time to determine whether the third buffer can still store new sub-images.

[0050] Step A32: If the remaining buffer space is less than the data size of the smallest sub-image among the multiple sub-images, the first sub-image in the third buffer is transmitted to the target communication module.

[0051] In the embodiments of this application, if the remaining buffer space is less than the data amount of the smallest sub-image among multiple sub-images, it can be considered that the third buffer can no longer store more sub-images. At this time, the storage of sub-images into the third buffer can be stopped. After that, the image processor can start transmitting the first sub-image in the third buffer to the target communication module.

[0052] Based on the above embodiments disclosed in this application, a "one-store-one-transmit" cyclic transmission method formed by the third and fourth buffers can be used to transmit a single frame image during transmission. Compared with the traditional transmission process, the preparation time for the transmission of sub-images of the frame image can be shortened, thereby reducing the transmission time of a single frame image to a certain extent and improving the transmission efficiency of a single frame image.

[0053] In some embodiments, step S132 may further include steps A6 and A7: Step A6: Send a first handshake signal to the target communication module; the first handshake signal is used to notify the target communication module to receive data.

[0054] In the embodiments of this application, a handshake signal is a control mechanism used in communication or electronic systems to coordinate data transmission between two devices. Its core purpose is to ensure that the sender and receiver reach an agreement before formal communication begins, thereby guaranteeing the reliability, synchronization, and integrity of data transmission. For example, in RS-232 communication, the following signal lines are commonly used to implement hardware flow control: RTS (Request To Send): The sender requests to send data; CTS (Clear To Send): The receiver responds "can send". The sender only begins transmission when CTS is valid (i.e., the CTS signal is received by the sender), which is a typical handshake signal mechanism.

[0055] In the embodiments of this application, the communication between the image processor and the target communication module can adopt a handshake mechanism. When the image processor is ready to start transmission, it can first send a first handshake signal to the target communication module to notify the target communication module to be ready to receive data, thus completing the communication handshake between the target communication module and the image processor.

[0056] It should be noted that this step can be performed before step A1.

[0057] Step A7: If multiple sub-images of the first frame are transmitted to the target communication module, a second handshake signal is sent to the target communication module; the second handshake signal is used to notify the target communication module that the data transmission is complete.

[0058] In the embodiments of this application, if multiple sub-images of the first frame image are transmitted to the target communication module through the third buffer and the fourth buffer, the image processor can send a second handshake signal to the target communication module to notify the target communication module that the data transmission is complete, thereby causing the target communication module to stop receiving data.

[0059] It should be noted that this step can be performed after step A5.

[0060] Based on the embodiments disclosed in this application, the image processor can send a first handshake signal to the target communication module before the transmission of a single frame image begins, so that the target communication module can start receiving data, and can send a second handshake signal to the target communication module after the transmission of the single frame image is completed, so that the target communication module can stop receiving data. The above process can ensure that the target communication module can always receive the complete single frame image, which can improve the transmission stability, transmission reliability and data integrity of single frame image data to a certain extent. At the same time, the above method only needs to establish the communication transmission timing between the buffer and the target communication module once when transmitting a single frame image, which can avoid the situation of establishing the timing once for each part of data transmission. Since each establishment of the communication transmission timing consumes a certain amount of time, the above method can shorten the transmission time of single frame image data to a certain extent.

[0061] Based on the above implementation method, refer to Figure 3 , Figure 3 This is a flowchart illustrating a data transmission method provided in an embodiment of this application. Figure 2 ,based on Figure 1 The method may further include steps S201 and S202: Step S201: In response to the processing operation on the image data, determine the processing type of the processing operation; the processing type is used to characterize the user's processing intention on the image data.

[0062] In the embodiments of this application, the processing type of the processing operation refers to the user's processing intention for the image data. For example, the processing intention could be "image recognition" or "image storage." Different processing types correspond to different processing operations. Therefore, the image processor can determine the processing type of the processing operation in response to the processing operation on the image data.

[0063] For example, if a user sends image data directly to a target device without using the recognition function in their electronic device, the processing operation is image storage, and the processing type is storage type. If a user sends data to a target device through the recognition function in their electronic device, the processing operation is image recognition, and the processing type is image recognition type.

[0064] Step S202: Based on the processing type of the processing operation, determine the target communication module from at least two communication modules contained in the electronic device.

[0065] In embodiments of this application, the electronic device may include at least two different types of communication modules (different types refer to different transmission protocols and / or transmission methods), such as a Bluetooth module and a WIFI module. These at least two communication modules can be adaptively selected based on the processing type of the processing operation to determine the target communication module. For example, if the processing intent is image recognition, it indicates that the amount of data transmitted in the image is small. In this case, a communication module with a smaller batch data transmission volume but a higher single-frame image transmission speed can be used as the target communication module, such as a Bluetooth module. If the processing intent is image storage, and the amount of data transmitted in the image is large, it is assumed that the user's timeliness requirement for data transmission is not high. Therefore, a communication module with a larger batch data transmission volume but a lower single-frame image transmission speed can be used as the target communication module, such as a WIFI module.

[0066] It should be noted that if the processing intent is image storage and the image data volume is small, a communication module with a small batch data volume but a high single-frame image transmission speed can be used as the target communication module; alternatively, when the processing intent is image storage, regardless of the image data volume, a communication module with a large batch data volume but a low single-frame image transmission speed can be used as the target communication module.

[0067] Based on the embodiments disclosed in this application, a matching target communication module can be determined from multiple communication modules included in the electronic device according to different processing operations of the user on image data. This can improve the matching degree between the target communication module and the processing operation on image data to a certain extent, and improve the utilization efficiency of the target communication module.

[0068] In some embodiments, step S202 may include: Step S221: If the processing type of the processing operation is used to characterize the stored image data, the first communication module is determined as the target communication module.

[0069] In the embodiments of this application, since electronic devices have different application scenarios when transmitting images (such as image recognition, image storage, etc.), these application scenarios have different timeliness requirements and different data transmission volumes. Therefore, two communication modules can be set in the electronic device, namely a first communication module and a second communication module. The data transmission bandwidth of the second communication module is less than that of the first communication module, and the data transmission speed of the second communication module for a single frame image is greater than that of the first communication module. That is, the transmission performance of the second communication module in batch data transmission is lower than that of the first communication module, but the performance of the second communication module in small data volume transmission is higher than that of the first communication module. If the processing type of the image data processing operation represents the storage of image data, it can be considered that the user's timeliness requirement is not high in this scenario, and the first communication module can be determined as the target communication module. The first communication module can be a communication module with a large data transmission bandwidth but a low data transmission speed for a single frame image, such as a WIFI module.

[0070] Step S222: If the processing type of the processing operation is used to characterize image recognition processing of image data, the second communication module is determined as the target communication module; the data transmission bandwidth of the second communication module is less than the data transmission bandwidth of the first communication module, and the data transmission speed of the second communication module for a single frame image is greater than the data transmission speed of the first communication module for a single frame image.

[0071] In the embodiments of this application, if the above processing type represents image recognition of image data, it can be assumed that the user has high timeliness requirements in this scenario. In this case, the second communication module can be determined as the target communication module. For example, the second communication module can be a Bluetooth module. In this way, the electronic device can automatically select the communication module with the fastest transmission rate in scenarios with different timeliness requirements, thereby shortening the data transmission time and improving transmission efficiency in any application scenario.

[0072] Based on the above embodiments disclosed in this application, a first communication module with a larger bandwidth can be used as the target communication module when storing image data, and a second communication module with a smaller bandwidth can be used as the target communication module when recognizing images. This can improve the accuracy of the selection of the target communication module and the matching degree with the current processing operation to a certain extent. It can automatically select the communication module with the fastest transmission rate in scenarios with different time requirements, thereby shortening the data transmission time and improving the transmission efficiency in any application scenario.

[0073] In some embodiments, based on the above implementation, step 103 may further include steps S135 to S136: Step S135: Determine the startup status of the second operating system.

[0074] In the embodiments of this application, the startup process of the second operating system can be divided into multiple stages. Taking the Linux system as an example, its startup process can be divided into startup stages such as Bootloader loading, kernel loading, random access disk loading, and module driver loading. The next stage will only begin loading after one stage is completed. For example, the Bootloader must be loaded before the kernel is loaded; random access disk loading can only begin after the kernel is loaded. The loading state of each stage can be used as the startup state of the second operating system. For example, when the kernel is loaded, the startup state of the Linux system is "kernel loading complete".

[0075] Step S136: If the startup state indicates that the second operating system is in the target state, the second operating system is used to send image data to the second communication module in the electronic device; wherein, the target state indicates that a communication link has been established between the image processor and the second communication module, and the driver of the first communication module in the second operating system has not been successfully loaded; the data transmission bandwidth of the second communication module is less than the data transmission bandwidth of the first communication module, and the data transmission speed of the second communication module for a single frame image is greater than the data transmission speed of the first communication module for a single frame image.

[0076] In the embodiments of this application, the state of the second operating system can change in real time during the startup process. If the startup state of the second operating system indicates that a communication link has been established between the image processor and the second communication module, and the driver for the first communication module in the second operating system has not been successfully loaded, then the second communication module in the electronic device is available, while the first communication module is unavailable. Therefore, image data can be sent to the second communication module in the electronic device using the second operating system. Between the first and second communication modules in the electronic device, the data transmission bandwidth of the second communication module is less than that of the first communication module, and the data transmission speed of the second communication module for a single frame image is greater than that of the first communication module for a single frame image.

[0077] Based on the above embodiments disclosed in this application, the image processor can send image data to the second communication module using the second operating system when the second communication module is available and the first communication module is unavailable. Compared with the traditional transmission scheme that waits for the second operating system to fully start before performing the transmission, the time between acquiring the image and transmitting the image can be further shortened, which can improve the timeliness of electronic devices when performing the photo recognition function to a certain extent and further enhance the user experience.

[0078] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4The electronic device 400 may include: an image acquisition module 401, an image processor 402, and a target communication module 403; wherein, Image acquisition module 401 is used to acquire image data in response to a photo-taking trigger signal; Image processor 402 is used to start and run a first operating system and a second operating system in the image processor in response to a photo-taking trigger signal; the startup time of the first operating system is shorter than the startup time of the second operating system; image data is acquired using the first operating system; and image data is transmitted to a target communication module in the electronic device using the second operating system. The target communication module 403 is used to send image data to the target device.

[0079] In some embodiments, the target communication module 403 is a Bluetooth module; the Bluetooth module includes a Bluetooth control module and a Bluetooth communication module; wherein... Image processor 402 is used to transmit image data to Bluetooth control module in response to image recognition operations on image data, using a second operating system; The Bluetooth control module is used to extract features from image data to obtain image features; The Bluetooth communication module is used to send image features to the target device.

[0080] In the embodiments of this application, considering the large data volume of a single frame image and the relatively long transmission time, image transmission in image recognition scenarios is often performed via Bluetooth modules. Since the data volume of image feature data is typically smaller than the data volume of the image itself, a Bluetooth module with data processing capabilities can be used to reduce the data transmission volume of the Bluetooth module. This Bluetooth module can include a Bluetooth control module and a Bluetooth communication module. The Bluetooth control module can deploy a lightweight feature extraction model to perform image feature extraction, data forwarding, and other data processing operations on the captured image data. The Bluetooth communication module can receive data sent by the Bluetooth control module and transmit the data to other devices via Bluetooth. Therefore, by first performing image feature extraction in the Bluetooth module and then only transmitting the image feature data, the time required to send the image features to the target device can be reduced to a certain extent.

[0081] In some embodiments, the electronic device includes a first buffer and a second buffer; the image processor is further configured to: The first frame image is stored in the first buffer; the first frame image is a portion of the image data; the first frame image in the first buffer is transmitted to the target communication module; during the transmission of the first frame image to the target communication module, the second frame image is stored in the second buffer; the second frame image is a portion of the image data; after the transmission of the first frame image is completed, the second frame image in the second buffer is transmitted to the target communication module.

[0082] In some embodiments, the electronic device further includes a third buffer and a fourth buffer; the image processor is further configured to: The first frame image in the first buffer is split into multiple sub-images; the first sub-image in the multiple sub-images is stored from the first buffer to the third buffer; the first sub-image in the third buffer is transmitted to the target communication module; during the transmission of the first sub-image, the second sub-image in the multiple sub-images is stored in the fourth buffer; after the transmission of the first sub-image is completed, the second sub-image in the fourth buffer is transmitted to the target communication module.

[0083] In some embodiments, the image processor is further configured to: A first handshake signal is sent to the target communication module; the first handshake signal is used to notify the target communication module to receive data; if multiple sub-images of the first frame image are transmitted to the target communication module, a second handshake signal is sent to the target communication module; the second handshake signal is used to notify the target communication module that the data transmission is complete.

[0084] In some embodiments, the image processor is further configured to: In response to a processing operation on image data, the processing type of the processing operation is determined; the processing type is used to characterize the user's processing intent on the image data; based on the processing type of the processing operation, a target communication module is determined from at least two communication modules contained in the electronic device.

[0085] In some embodiments, determining a target communication module from at least two communication modules included in an electronic device based on the processing type of the processing operation includes: If the processing type of the processing operation is used to characterize the storage of image data, the first communication module is determined as the target communication module; if the processing type of the processing operation is used to characterize the image data to perform image recognition processing, the second communication module is determined as the target communication module; the data transmission bandwidth of the second communication module is less than the data transmission bandwidth of the first communication module, and the data transmission speed of the second communication module for a single frame image is greater than the data transmission speed of the first communication module for a single frame image.

[0086] In some embodiments, the image processor is further configured to: Determine the startup state of the second operating system; if the startup state indicates that the second operating system is in the target state, use the second operating system to send image data to the second communication module in the electronic device; wherein, the target state indicates that a communication link has been established between the image processor and the second communication module, and the driver of the first communication module in the second operating system has not been successfully loaded; the data transmission bandwidth of the second communication module is less than the data transmission bandwidth of the first communication module, and the data transmission speed of the second communication module for a single frame image is greater than the data transmission speed of the first communication module for a single frame image.

[0087] In some embodiments, the image processor is further configured to: During the storage process of the first sub-image from the first buffer to the third buffer, the remaining buffer space of the third buffer is determined; if the remaining buffer space is less than the data size of the smallest sub-image among the multiple sub-images, the first sub-image in the third buffer is transmitted to the target communication module.

[0088] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between them, while their similarities or commonalities can be referred to interchangeably. The descriptions of the above embodiments of the device, storage medium, computer program, and computer program product are similar to the descriptions of the above method embodiments and have similar beneficial effects. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0089] This application also provides an image processing system, including: a first electronic device and a second electronic device; wherein the first electronic device includes an image acquisition module, an image processor, and a target communication module; wherein, The image acquisition module is used to acquire image data in response to the photo-taking trigger signal; An image processor is used to respond to a photo-taking trigger signal to start and run a first operating system and a second operating system in the image processor; the startup time of the first operating system is shorter than the startup time of the second operating system; image data is acquired using the first operating system; and image data is transmitted to a target communication module in an electronic device using the second operating system. The target communication module is used to send image data to the second electronic device; The second electronic device is used to receive image data.

[0090] In the embodiments of this application, the first electronic device may be a wearable smart terminal device, such as a smartwatch, smart bracelet, tablet computer, smart glasses, smart helmet, or other device with a shooting function. Figure 4The first electronic device is shown. The second electronic device can be a more powerful device such as a mobile phone or computer. After receiving the image data, the second electronic device can use a large language model to perform image recognition on the image data, obtain the recognition result, and then transmit the recognition result to the first electronic device for display to the user.

[0091] The following describes the application of the data transmission method provided in the embodiments of this application in a real-world scenario.

[0092] Currently, there are already AI-powered smart terminal devices with cameras that can take photos locally, transmit them in real-time to a cloud-based large-scale model for recognition, and then feed the results back to the device in audio and video format. In this process, the device triggers the photo capture; after compression, the photo is transmitted to the mobile phone via Wi-Fi or Bluetooth, or, if it has a built-in SIM card, directly to the cloud-based large-scale model. The cloud-based model then recognizes the image and sends relevant information back to the device via Wi-Fi, Bluetooth, or 4G (4th Generation Mobile Communication Technology). The device then displays the image or outputs audio through its speaker to interact with the user. While this approach, using local photography and accessing the large-scale model API through photo recognition applications, enables the application of large-scale models on the local device, the overall latency is significant, resulting in a poor user experience.

[0093] The main reasons for the poor user experience include: 1) Devices that connect directly to the network via Subscriber Identity Module (SIM), 4G, etc., require the hardware to have an Android system, identification applications, and Application Programming Interface (API) access, which needs to be implemented locally on the device side. This poses a significant challenge to system power consumption, battery capacity, heat dissipation, and weight, making them unsuitable for long-term wear or outdoor use; while Wi-Fi transmission has the advantage of fast transmission speed, generally Wi-Fi 5. The theoretical maximum single-antenna speed is 433Mbps (54MB / s). Considering environmental interference and antenna efficiency, it can generally reach speeds above 30MB / s. Image transmission takes about 3ms. However, because the power consumption of the WIFI module is relatively high when it is turned on, wearable devices are usually powered off when their functions are not in use. When they are needed, powering on and loading the system driver takes time. Generally, the Linux driver takes 2-3 seconds to load. Then, a WIFI backlink is established (the device is set to AP or P2P mode). The backlink time depends on environmental interference and the distance between the device and the phone, generally about 1-2 seconds. Large model recognition will have some deviation depending on the image content, with an average recognition time of about 3 seconds. Thus, the overall recognition time is about 8-10 seconds, which is unacceptable to users.

[0094] In the embodiments of this application, to address the aforementioned problems, this application proposes to utilize Bluetooth transmission to decompose and optimize each image transmission process, achieving Bluetooth image transmission within 2 seconds while ensuring image quality that can be accurately recognized by the large model API. Combined with the large model's average 3-second recognition feedback time, the time from user capture to receiving feedback is controlled to approximately 5 seconds, improving the user experience of using the large model for image recognition. The main technical principles behind this implementation are as follows: The hardware architecture of the electronic device (which can be various wearable products, such as bracelets, pendants, glasses, etc.) adopts a dual-system hardware architecture: the Bluetooth master controller uses the RTOS system (RTOS is an operating system specifically designed to meet real-time requirements. It can complete the response, processing and feedback of external events within a specified time. Its core objectives are determinism (predictable system behavior) and timeliness (task execution does not time out)). The image signal processor adopts an RTOS+Linux dual-system architecture to achieve fast startup of the whole device. When taking a picture, after RTOS starts up quickly, it quickly captures the first picture within 2-3 frames, completes compression, and then waits for the Linux system to start up before establishing a connection with the Bluetooth master controller to complete the image transmission.

[0095] One hardware structure of the aforementioned electronic device is as follows: Figure 5As shown. The electronic device may include at least an image processor 501, a Bluetooth controller 502, a camera 503, a Wi-Fi module 504, touch buttons 505, a speaker 506, and a battery 507. The battery 507 can power the other hardware. When a user takes a photo using the electronic device, they press the device's touch button 505. At this time, both the Bluetooth master controller 502 and the image processor 501 are in standby mode. Therefore, the image processor needs to quickly capture the first image at the moment the user presses the shutter button. However, since the image processor normally runs on a Linux system, its startup time is relatively long, which cannot meet this requirement. Therefore, this application adds an RTOS operating system to the image processor to achieve fast startup. After the touch button 505 is triggered, the camera 503 captures an image. Then, after the image processor's Linux system starts up, it will stretch, crop, and compress the captured image before transmitting it to the Bluetooth master controller 502. Pressing the touch button 505 also wakes up the RTOS system in the Bluetooth master controller 502. After the RTOS system in the image processor 501 starts up, the RTOS system in the Bluetooth master controller 502 also starts up. After the image processor processes the image and transmits it, the Bluetooth master controller 502 will transmit the photo to the mobile phone via Bluetooth. After the WIFI module 504 is loaded, photos can also be transferred to the mobile phone via the WIFI module. In this process, the image processor 501 does not need to wait for Linux to fully boot before performing image capture and image transfer. Instead, it first performs image capture by booting the faster Rtos system. After the Linux system boots, it directly performs the transfer, thus saving the time of capturing images in the entire photo recognition process, thereby shortening the overall time consumption of the photo recognition process.

[0096] Figure 6This is a flowchart illustrating a Bluetooth image transmission process provided in an embodiment of this application. In step S601, when the trigger button (or a trigger device with memory function) of the electronic device is pressed for the first time, the process proceeds to step S602, where the image processor powers on and captures an image. Then, in step S603, the electronic device can receive the user's voice information via the microphone for natural language interaction; or it can directly proceed to step S604, where the user can press the trigger button again to take a picture. In this case, the process proceeds to step S605, where the image processor transmits the image to the Bluetooth master controller via SPI. Then, in step S606, the Bluetooth master controller transmits the image to the mobile phone via Bluetooth at a transmission rate of 2Mbps. Then, in step S607, the mobile phone uses a large model for image recognition and finally, using the Bluetooth audio transmission model protocol, in step S608, the information is fed back to the device via the Bluetooth module. Finally, in step S609, the image processor enters standby mode. When the trigger button is pressed again, the image processor captures the image again and completes the transmission. In this process, the system power-on takes 12ms; DDR loading takes 13ms; IPL loading takes 26ms; RTK loading takes 131ms; RTK initialization takes 133ms; RTK loading IQ file takes 212ms; first frame encoding takes 200ms; Linux system starts loading kernel1, taking 212ms; kernel loading takes 417ms; kernel initialization takes 443ms; random access memory decompression takes 540ms; Wi-Fi driver loading takes 561ms; and mobile application startup takes 1200ms.

[0097] Figure 7 This is a schematic diagram of a transmission path provided in an embodiment of this application. Figure 7 exist Figure 6 Based on the previous method, only the handshake between the ISP and the Bluetooth master controller was added; therefore, its execution process will not be detailed here. This application employs a dual-buffer "one-to-one" cyclic transmission method for SPI transmission, which can reduce the single-image transmission time from 2.5 seconds to 0.16 seconds. Regarding system startup time, due to the adoption of a dual-system mode, the time from image capture to the start of transmission is reduced from approximately 540ms to approximately 315ms. Therefore, the total time is reduced by approximately 2.59 seconds.

[0098] Table 1 below shows the differences between single-system and dual-system image recognition: Table 1

[0099] In Table 1, the first frame capture time for a single system is ≥1.5s; users may perceive a noticeable black screen; in terms of image integrity, the boot moment may be missed; and in terms of system reliability, if Linux crashes, no images can be captured. The first frame capture time for a dual-system system is <100ms (completed by the RTOS); in terms of user perception, there is a picture immediately upon boot; in terms of image integrity, the first frame is captured; and in terms of system reliability, the RTOS runs independently, making it more reliable.

[0100] Figure 8 This is a schematic diagram illustrating the entire process of image recognition and transmission provided in this application embodiment. When the trigger button of the electronic device is pressed, the dual systems power on, with the Rtos system and the Linux system starting simultaneously. After the Rtos system starts up first, it can initialize the peripherals of the electronic device. After initialization, the camera interface parameters can be configured. After configuration, the Rtos system can capture an image frame and store it in DDR. Simultaneously, the Linux system can load the bootloader. After the bootloader loads, it can load the Linux system kernel, followed by the random access memory. After the memory is loaded, the Linux system begins loading various functional modules (such as the encoder and the WIFI module). After the encoder is loaded, the Linux system can read the image frames in the DDR and transmit them to the Bluetooth module via SPI through a double-buffered, one-to-one-transmission loop transmission mechanism, and then transmit them to the mobile phone via Bluetooth. While forwarding images, the encoder can also query new image frames at certain time intervals and store the queried image frames in the DDR. During the initial transmission of SPI, the WIFI module is in a loading state. Once the WIFI module is loaded, it can be started, allowing the Linux system to transmit the image to the WIFI module via a double-buffered, one-to-one loop transmission mechanism, and then transmit the image to the mobile phone via the WIFI module.

[0101] The specific steps are as follows: 1. System Power-On: After the device is powered on, it begins hardware self-testing and initialization to ensure that all hardware modules are in normal working condition.

[0102] This step lays the foundation for subsequent operations and ensures that the system can run stably.

[0103] 2. RTOS Boot: The Real-Time Operating System (RTOS) boots up, responsible for task scheduling and resource management, ensuring the system can respond to external events and data processing needs in real time. The rapid boot and efficient operation of the RTOS are crucial for guaranteeing system real-time performance.

[0104] 3. Peripheral Initialization: The RTOS initializes and configures the peripherals in the system, including GPIO, DMA controllers, timers, etc., to ensure that these peripherals can function properly and support subsequent data processing and transmission. Proper peripheral configuration can improve the overall performance and stability of the system.

[0105] 4. Configure the camera interface: Configure camera interface parameters such as resolution, frame rate, and color format according to application requirements to capture high-quality image data. Correct camera configuration is a prerequisite for obtaining clear and accurate images.

[0106] 5. Capture a single image frame: Capture a single image frame of the current scene using the configured camera interface. Ensure the integrity and quality of the image data for subsequent processing and analysis.

[0107] 6. Store in DDR: Store the captured image data in Dynamic Random Access Memory (DDR) for fast access and processing. Choose an appropriate storage region and method to ensure efficient data access.

[0108] 7. New Frame Query: At regular intervals, the system checks the DDR for new image frames to maintain the continuity and real-time performance of the image stream. This timed query mechanism ensures timely detection and processing of new image frames, preventing data loss or delays.

[0109] 8. Transmission Encoding Compression: The image data stored in DDR is transmitted to an encoder running on the Linux system for compression processing, generating MJPEG image files suitable for transmission and storage. Efficient encoding algorithms can reduce data volume, improve transmission efficiency, and increase storage space utilization.

[0110] 9. Encoder: Encodes image data to generate MJPEG format image files, maintaining good visual quality and a small file size. Appropriate encoding parameters and algorithms are selected to ensure the encoded image quality meets application requirements.

[0111] 10. One-to-one storage and one-to-transmission loop transmission A double-buffering mechanism is employed to alternately transmit MJPEG image data from the current frame and the next frame, reducing waiting time and improving transmission efficiency. (Rtos can be proprietary and customized, thus allowing for optimization of SPI transmission.) The detailed transmission process is as follows: 1) Initialize the double buffer: Prepare two independent buffers (denoted as Bufferping and Bufferpong), each pre-allocated enough space to store a single frame of MJPEG data.

[0112] 2) First frame data processing: After the first frame of MJPEG image is encoded, it is first written to the buffer; at the same time, SPI transmission is started to send the first frame data in the buffer to the Bluetooth master control chip.

[0113] 3) The second frame of data is transmitted in parallel: During the transmission of the first frame of data via SPI, the second frame of MJPEG image is directly encoded and written to Bufferpong without waiting for the transmission to complete (the second frame is written by utilizing the time difference of transmission to avoid idle waiting).

[0114] 4) Dual buffer alternating switching: After the first frame (Buffering) is transmitted, the SPI transmission of the second frame (Buffering) is started immediately; at the same time, the third frame (if it exists) can be written to the idle Buffering, and so on, to realize the parallel pipeline operation of "one frame transmission, one frame writing".

[0115] A well-designed double buffering mechanism ensures the continuity and stability of data transmission.

[0116] 11. SPI Transmission: Single MJPEG image data is transmitted to the Bluetooth master controller chip (Bluetooth master) via the SPI bus for subsequent processing. SPI transmission parameters, such as clock frequency and data mode, are optimized to improve transmission speed and reliability.

[0117] 12. Bluetooth Master Controller: The Bluetooth master controller chip processes the received MJPEG image data, extracting key information or features (the Bluetooth master controller can either directly send the image data to the mobile phone, or it can first extract the image features from the image data and then send the image features to the mobile phone, which can improve the recognition efficiency of large models). This ensures that the Bluetooth master controller chip can complete the image recognition task efficiently and accurately.

[0118] 13. Wi-Fi Transmission: Multiple MJPEG image data are batch transmitted to a remote server or cloud for further processing and storage via Wi-Fi. The path from front-end image capture and processing to transmission to the main control unit via SPI is the same. Bluetooth is used because it offers faster wake-up and reconnection speeds, and image quality requirements are not high when performing image recognition. However, Wi-Fi transmission is used when transmitting a large number of images locally to a computer for backup, where the data volume is large and timeliness is not critical.

[0119] Optimize Wi-Fi connection parameters, such as channel selection and transmission rate, to improve network transmission performance and reliability.

[0120] 14. Linux Boot: Boots the Linux operating system, providing a higher level of software support and feature expansion. A stable boot and operation of the Linux system is fundamental to implementing complex applications.

[0121] 15. Bootloader: Loads and executes the bootloader program, guiding the subsequent kernel boot process. Ensures that the bootloader can load correctly and boot the kernel.

[0122] 16. Loading the kernel: The bootloader loads the Linux kernel into memory and jumps to the kernel entry address to begin execution. This ensures that the kernel can boot normally and initialize the core system functions.

[0123] 17. Load ramdisk: Load the initial RAM disk (initramfs), providing a temporary file system and necessary drivers. Ensure the system can find the required drivers and tools on the RAM disk to support the subsequent system boot process.

[0124] 18. Load Modules: Load necessary kernel modules, such as the Wi-Fi driver and file system driver. Ensure that all necessary kernel modules are loaded correctly and function properly.

[0125] 19. WiFi Loading: Loads and initializes the WiFi device driver, establishing a WiFi connection. Ensures the WiFi device is functioning correctly and successfully connects to the target network.

[0126] 20. Start Wi-Fi: Enable the Wi-Fi service, allowing the system to communicate with the mobile phone via Wi-Fi. Ensure the Wi-Fi service runs stably to support subsequent data transmission needs.

[0127] Furthermore, the SPI transmission protocol can be optimized in this embodiment, as shown in Table 2 below: Table 2

[0128] The optimization content in Table 2 is explained as follows: 1. Increase buffer size: Transmit more data at once, reducing the number of cycles of "CS low → data transmission → CS high", thereby reducing the number of chip select (CS) switching. For example, a small buffer needs to send small data packets frequently, requiring a complete handshake each time (CS low → high → low → high); a large buffer can send a large amount of data at once, requiring only one handshake to complete the entire transmission.

[0129] Since each CS switch consumes t_CSS (chirped spread spectrum time) + t_CSH (timeout) time (usually ≥200ns), frequent switching will significantly accumulate latency. Therefore, reducing the number of cycles of "CS low → data transmission → CS high" can reduce latency.

[0130] Because standard SPI may have intervals after each byte transmission, these intervals accumulate and significantly increase the total time. A large buffer allows for continuous data stream transmission, eliminating inter-byte waits. With a small buffer, the CPU needs to frequently respond to interrupts, constantly filling / reading individual bytes, resulting in high context switching overhead and low transmission efficiency. A large buffer, with a high threshold (e.g., 8 bytes), only triggers interrupts when the FIFO (First In, First Out) is full / empty. The CPU can write / read large amounts of data at once, reducing interrupt frequency. Combined with DMA (Direct Memory Access), it achieves data transmission with zero CPU intervention. A large buffer also supports longer data block transmissions, extending the SS (Silent Signal) low-level time, reducing the number of SS signal transitions, mitigating signal integrity issues (ringing, noise), providing more sufficient data preparation time for slave devices, and avoiding "empty frame" errors.

[0131] If the large buffer is double-buffered, while one buffer is transmitting, the other buffer can prepare the next batch of data in parallel, thus achieving a seamless "transmission-preparation-transmission" process and completely eliminating handshake gaps.

[0132] 2. The essence of SPI transmission time is "total number of transmitted bits ÷ SPI clock frequency". With a fixed number of bits, the higher the frequency, the less time is required.

[0133] 3. The core value of DMA (Direct Memory Access) is to bypass the CPU and directly complete the data transfer between peripherals (SPI) and memory, fundamentally eliminating the CPU's "wait + context switching + byte-by-byte processing" overhead in polling / interrupt mode, realizing "seamless continuity" of SPI transmission, and ultimately reducing the total transmission time and improving throughput.

[0134] The essence of SPI transmission is either "data from memory → SPI transmit register" (write) or "SPI receive register → memory" (read), with serial shifting completed in conjunction with the SPI clock. In polling / interrupt mode, this process relies entirely on CPU intervention, resulting in a significant bottleneck. The DMA controller is a CPU-independent hardware module that can be pre-configured with "data source address (memory), target address (SPI register), transfer length, and trigger conditions (such as an empty SPI transmit register)". It then autonomously completes data transfer, only notifying the CPU after the entire batch of data transfers is complete. Its optimization logic can be broken down into five dimensions: completely freeing up the CPU and eliminating "wait + context switching" overhead; eliminating "intermediate links" in data transfer and reducing clock cycle consumption; achieving "gap-free continuous" SPI clocking, increasing the effective transfer rate; collaborating with SPIFIFO to further amplify throughput advantages; and hardware-level timing matching to reduce timing redundancy overhead.

[0135] The SPI protocol requires that the "setup time (t_SU)" and "hold time (t_H)" of the data meet the minimum values. The latency of CPU software operations (such as writing to the SPI register) is unstable. In order to avoid timing errors, extra redundant time is usually reserved. The hardware operation latency of DMA is fixed and extremely small (only a few clock cycles), which can accurately match the timing requirements of SPI. There is no need to reserve redundant time, further compressing the total transmission time.

[0136] 4. The essence of SPI transmission time is "total number of transmitted bits ÷ SPI clock frequency," while protocol overhead (redundant commands / addresses, frame identifiers, redundancy checks, etc.) is "meaningless bit overhead"—these bits do not carry actual business data but occupy SPI clock cycles and increase device parsing latency. Simplifying the frame structure, removing redundant fields, and adopting a "pure data stream" mode are key to directly shortening the total transmission time by reducing the amount of invalid bit transmission, eliminating parsing latency, and increasing the proportion of valid data, while maximizing the utilization of the SPI clock. Reducing protocol overhead mainly includes the following aspects: removing redundant commands / addresses to reduce the transmission of "repeated invalid bits"; simplifying the frame structure to eliminate redundant identifiers such as frame headers / tails / padding; removing redundancy checks / status interactions to reduce "non-data interaction" overhead; utilizing the "continuous transmission" characteristic of pure data streams to eliminate inter-frame parsing latency; and maximizing the proportion of valid data to fully utilize the high-speed SPI clock bandwidth.

[0137] 5. The SPI chip select (CS) signal is the "communication switch" between master and slave devices. Each transmission requires a complete process of "CS low (selected) → data transmission → CS high (released)". However, CS switching itself has fixed timing overhead, and frequent switching will disrupt the continuity of transmission. The core logic of "batch transmission + reduced CS switching" is to merge scattered small data packets into a single large data block, replace "multiple CS switching" with "one CS switching", completely eliminate the redundant time caused by switching, and at the same time achieve continuous operation of the SPI clock, ultimately significantly shortening the total transmission time.

[0138] Thus, by optimizing SPI transmission as described above, the transmission time of SPI can be further reduced.

[0139] It should be noted that, in the embodiments of this application, if the above-described data transmission method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the related technology, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware, software, or firmware, or any combination of hardware, software, and firmware.

[0140] This application provides another electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements some or all of the steps in the above-described method.

[0141] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements some or all of the steps in the above-described method. The computer-readable storage medium can be transient or non-transient.

[0142] This application provides a computer program including computer-readable code. When the computer-readable code runs in an electronic device, the processor in the electronic device executes some or all of the steps in the above-described method.

[0143] This application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements some or all of the steps in the above-described method. This computer program product can be implemented specifically through hardware, software, or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium; in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.

[0144] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between them, while their similarities or commonalities can be referred to interchangeably. The descriptions of the above embodiments of the device, storage medium, computer program, and computer program product are similar to the descriptions of the above method embodiments and have similar beneficial effects. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0145] Figure 9 This is a hardware entity diagram of an electronic device provided in an embodiment of this application, such as... Figure 9 As shown, the hardware entity of the electronic device 900 includes a processor 901 and a memory 902, wherein the memory 902 stores a computer program that can run on the processor 901, and the processor 901 executes the program to implement the steps in the method of any of the above embodiments.

[0146] The memory 902 stores computer programs that can run on the processor. The memory 902 is configured to store instructions and applications that can be executed by the processor 901. It can also cache data to be processed or already processed (e.g., image data, audio data, voice communication data and video communication data) in the processor 901 and various modules in the electronic device 900. It can be implemented by flash memory or random access memory (RAM).

[0147] The processor 901 executes the program to implement the data transmission method steps described above. The processor 901 typically controls the overall operation of the electronic device 900.

[0148] This application provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps of the data transmission method as described in any of the above embodiments.

[0149] It should be noted that the descriptions of the storage medium and device embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0150] The aforementioned processor can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), Controller, Microcontroller, and Microprocessor. It is understood that other electronic devices can also implement the functions of the aforementioned processor, and this application does not specifically limit the specific implementation.

[0151] The aforementioned computer storage media / memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; or it can be various terminals that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0152] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above steps / processes do not imply a sequential order of execution; the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above embodiments of this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0153] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0154] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0155] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0156] Furthermore, in the various embodiments of this application, all functional units can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units. Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.

[0157] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence or the part that contributes to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, magnetic disks, or optical disks.

[0158] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A data transmission method applied to an image processor in an electronic device; the method comprising: In response to a photo-taking trigger signal from the image acquisition module in the electronic device, the first operating system and the second operating system in the image processor are started and run; The boot time of the first operating system is shorter than the boot time of the second operating system; Using the first operating system, image data acquired by the image acquisition module in response to the photo-taking trigger signal is obtained; The second operating system is used to transmit the image data to the target communication module in the electronic device; the target communication module is used to send the image data to the target device.

2. The method according to claim 1, wherein the electronic device includes a first buffer and a second buffer; the step of transmitting the image data to the target communication module in the electronic device includes: Store the first frame image into the first buffer; The first frame image is a portion of the image data; Transmit the first frame image in the first buffer to the target communication module; During the transmission of the first frame image to the target communication module, the second frame image is stored in the second buffer; the second frame image is a portion of the image data. After the first frame image is transmitted, the second frame image in the second buffer is transmitted to the target communication module.

3. The method according to claim 2, wherein the electronic device further comprises a third buffer and a fourth buffer; the step of transmitting the first frame image in the first buffer to the target communication module comprises: The first frame image in the first buffer is split into multiple sub-images; The first sub-image among the plurality of sub-images is stored from the first buffer to the third buffer; The first sub-image in the third buffer is transmitted to the target communication module; During the transmission of the first sub-image, the second sub-image among the plurality of sub-images is stored in the fourth buffer; After the first sub-image is transmitted, the second sub-image in the fourth buffer is transmitted to the target communication module.

4. The method according to claim 3, further comprising: Send a first handshake signal to the target communication module; The first handshake signal is used to notify the target communication module to receive data; If multiple sub-images of the first frame are transmitted to the target communication module, a second handshake signal is sent to the target communication module; the second handshake signal is used to notify the target communication module that the data transmission is complete.

5. The method according to claim 1, further comprising: In response to a processing operation on the image data, determine the processing type of the processing operation; The processing type is used to characterize the user's processing intention for the image data; Based on the processing type of the processing operation, a target communication module is determined from at least two communication modules contained in the electronic device.

6. The method of claim 5, wherein determining the target communication module from at least two communication modules included in the electronic device based on the processing type of the processing operation comprises: If the processing type of the processing operation is used to characterize the storage of the image data, the first communication module is determined as the target communication module; If the processing type of the processing operation is used to characterize image recognition processing of the image data, the second communication module is determined as the target communication module; the data transmission bandwidth of the second communication module is less than the data transmission bandwidth of the first communication module, and the data transmission speed of the second communication module for a single frame image is greater than the data transmission speed of the first communication module for a single frame image.

7. The method according to any one of claims 1 to 6, wherein transmitting the image data to the target communication module in the electronic device using the second operating system comprises: Determine the boot status of the second operating system; If the startup state indicates that the second operating system is in the target state, the image data is sent to the second communication module in the electronic device using the second operating system; The target state indicates that a communication link has been established between the image processor and the second communication module, and the driver for the first communication module in the second operating system has not been successfully loaded. The data transmission bandwidth of the second communication module is less than that of the first communication module, and the data transmission speed of the second communication module for a single frame image is greater than that of the first communication module for a single frame image.

8. The method according to claim 3, wherein transmitting the first sub-image in the third buffer to the target communication module comprises: During the storage process of the first sub-image from the first buffer to the third buffer, the remaining cache space of the third buffer is determined; If the remaining buffer space is less than the data size of the smallest sub-image among the plurality of sub-images, the first sub-image in the third buffer is transmitted to the target communication module.

9. An electronic device, the electronic device comprising an image acquisition module, an image processor, and a target communication module; The image acquisition module is used to acquire image data in response to a photo-taking trigger signal; The image processor is configured to start and run a first operating system and a second operating system in response to the image capture trigger signal; the startup time of the first operating system is shorter than the startup time of the second operating system. The image data is acquired using the first operating system; the image data is then transmitted to a target communication module in the electronic device using the second operating system. The target communication module is used to send the image data to the target device.

10. The electronic device according to claim 9, wherein the target communication module is a Bluetooth module; the Bluetooth module includes a Bluetooth control module and a Bluetooth communication module; wherein, The image processor is configured to transmit the image data to the Bluetooth control module in response to an image recognition operation on the image data, using the second operating system. The Bluetooth control module is used to extract features from the image data to obtain image features; The Bluetooth communication module is used to send the image features to the target device.