Shooting control method and apparatus

CN122934047APending Publication Date: 2026-10-16艾酷软件技术(上海)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611202992.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-10
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0004]本申请实施例的目的是提供一种拍摄控制方法及其装置,能够解决拍摄效率低下的问题

Benefits of technology

[0011] In this embodiment, the attribute information of the magnetic accessory is first obtained, then a first shooting intention is determined based on the attribute information, followed by the generation of first shooting control information including the camera's working state and shooting parameters based on the first shooting intention, and finally, at least one camera is controlled to perform a shooting task based on the first shooting control information. The electronic device can automatically complete the entire process from intention recognition to parameter configuration to shooting execution after the magnetic accessory is connected, without requiring the user to manually enter the settings menu to configure camera parameters item by item. This allows the electronic device to promptly enter a shooting state matching the magnetic accessory, improving shooting efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122934047A_ABST
    Figure CN122934047A_ABST
Patent Text Reader

Abstract

The application discloses a photographing control method and device. It belongs to the field of communication technology. The method is applied to an electronic device, the electronic device is provided with at least one camera, and the electronic device is in communication connection with a magnetic attraction accessory through a magnetic attraction interface; the method comprises the following steps: acquiring attribute information of the magnetic attraction accessory; determining a first photographing intention based on the attribute information; generating first photographing control information based on the first photographing intention, wherein the first photographing control information comprises working states and photographing parameters of the at least one camera; and controlling the at least one camera to execute a photographing task based on the first photographing control information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, specifically to a shooting control method and apparatus. Background Technology

[0002] Action cameras, gimbal cameras, and other electronic devices with shooting capabilities are generally equipped with magnetic interfaces, which can be used to connect various magnetic accessories such as lenses, microphones, and fill lights to expand the shooting capabilities of the device.

[0003] In existing technologies, after connecting magnetic accessories to electronic devices, users need to manually enter the settings menu to configure the camera parameters one by one, resulting in low shooting efficiency. Summary of the Invention

[0004] The purpose of this application is to provide a shooting control method and apparatus that can solve the problem of low shooting efficiency.

[0005] In a first aspect, embodiments of this application provide a shooting control method, which is executed by an electronic device equipped with at least one camera and communicatively connected to a magnetic accessory via a magnetic interface. The method includes: acquiring attribute information of the magnetic accessory; determining a first shooting intention based on the attribute information; generating first shooting control information based on the first shooting intention, the first shooting control information including the working state and shooting parameters of the at least one camera; and controlling the at least one camera to perform a shooting task based on the first shooting control information.

[0006] Secondly, embodiments of this application provide a shooting control device applied to an electronic device, the electronic device being equipped with at least one camera, and the electronic device being communicatively connected to a magnetic accessory via a magnetic interface; the device includes: an acquisition unit for acquiring attribute information of the magnetic accessory; a determination unit for determining a first shooting intention based on the attribute information; a generation unit for generating first shooting control information based on the first shooting intention, the first shooting control information including the working state and shooting parameters of the at least one camera; and a control unit for controlling the at least one camera to perform a shooting task based on the first shooting control information.

[0007] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0008] Fourthly, embodiments of this application provide a readable storage medium on which a computer program is stored, and when executed by a processor, the computer program implements the steps of the method described in the first aspect above.

[0009] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method described in the first aspect.

[0010] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.

[0011] In this embodiment, the attribute information of the magnetic accessory is first obtained, then a first shooting intention is determined based on the attribute information, followed by the generation of first shooting control information including the camera's working state and shooting parameters based on the first shooting intention, and finally, at least one camera is controlled to perform a shooting task based on the first shooting control information. The electronic device can automatically complete the entire process from intention recognition to parameter configuration to shooting execution after the magnetic accessory is connected, without requiring the user to manually enter the settings menu to configure camera parameters item by item. This allows the electronic device to promptly enter a shooting state matching the magnetic accessory, improving shooting efficiency. Attached Figure Description

[0012] Figure 1 This is a flowchart of the shooting control method provided in the embodiments of this application; Figure 2 This is a schematic diagram of the structure of attribute information in the shooting control method provided in the embodiments of this application; Figure 3 This is a schematic diagram illustrating the correspondence between shooting intent and shooting control information in the shooting control method provided in the embodiments of this application; Figure 4 This is a schematic diagram of the shooting control device provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application; Figure 6 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0013] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0014] The terms "first," "second," etc., used in this application's specification are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class, without limiting the number of objects; for example, a first object can be one or more. Furthermore, in the specification, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects have an "or" relationship.

[0015] The shooting control method and apparatus provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0016] Please refer to Figure 1 This document illustrates one of the flowcharts of the shooting control method provided in the embodiments of this application. The shooting control method provided in the embodiments of this application can be executed by an electronic device. In practice, the aforementioned electronic device can be an action camera, a gimbal camera, a smartphone, etc.

[0017] The electronic device may be equipped with at least one camera, for example, simultaneously incorporating a wide-angle camera and two telephoto cameras. The electronic device can establish physical and communication connections with external magnetic accessories via a magnetic interface. The magnetic interface includes power supply contacts and data communication contacts, enabling both power supply to the magnetic accessory and data exchange between the electronic device and the magnetic accessory.

[0018] A magnetic connector is a physical interface used to connect magnetic accessories. For example, a magnetic connector may contain at least four physical contacts, two for power supply and two for differential half-duplex data communication. The magnetic connector uses magnetic attraction to physically secure the accessory to the device, while simultaneously transmitting power and data through electrical contact between the contacts. When an accessory approaches the connector, the magnetic attraction guides the accessory contacts to precisely align with the host device contacts, completing the physical connection.

[0019] Magnetic accessories refer to external functional modules that connect to electronic devices via magnetic interfaces. Types of magnetic accessories include, but are not limited to, external lens modules, fill lights, wireless microphones, extension handles, and filter modules. Among these, external lens modules may include, but are not limited to, wide-angle lenses, telephoto lenses, and macro lenses.

[0020] The shooting control method provided in this application includes the following steps: Step 101: Obtain the attribute information of the magnetic accessory.

[0021] In this embodiment, attribute information refers to structured data carried by the magnetic accessory itself, used to describe the accessory's identity and capabilities. Attribute information may include the type of magnetic accessory, such as a lens module, fill light, microphone, etc.; it may also include functional parameters, such as the equivalent focal length, field of view, and distortion coefficient of the lens, and the color temperature range and brightness of the fill light; it may also include constraints, such as whether distortion correction is required, whether additional power supply is required, and whether recording time is limited, etc., which are not limited here.

[0022] Specifically, after the electronic device recognizes the magnetic accessory being connected, it can proactively initiate a request to the accessory to obtain attribute information. After receiving the request, the magnetic accessory can transmit the attribute information to the electronic device through the data channel of the magnetic interface. Alternatively, the magnetic accessory can also transmit the proactive attribute information to the electronic device through the data channel of the magnetic interface after being connected to the electronic device, which is not limited here.

[0023] For example, a user magnetically attaches an external wide-angle lens module to an action camera. Upon detecting the accessory's connection, the camera sends a request command to the lens module via a data contact. The lens module responds with data containing attribute information. The camera extracts this attribute information, obtaining the following: accessory type is lens module, subtype is wide-angle, equivalent focal length is 14mm, field of view is 120°, distortion coefficient is 0.028, maximum frame rate is 60fps, and distortion correction is required.

[0024] Step 102: Determine the first shooting intention based on the attribute information.

[0025] In this embodiment, the shooting intention refers to the shooting target or shooting direction deduced by the electronic device based on the attribute information of the magnetic accessory, which reflects the shooting effect that the user expects to achieve by connecting a specific magnetic accessory.

[0026] Specifically, after acquiring the attribute information of an accessory, the electronic device can analyze and judge the content of that information. Different attribute information corresponds to different shooting intentions. Based on the accessory type and functional characteristics indicated by the attribute information, the electronic device can determine the most suitable shooting intention for the current shooting scenario. For example, when the attribute information indicates that the accessory is a wide-angle lens, the electronic device determines that the shooting intention is a wide-angle shooting intention; when the attribute information indicates that the accessory is a telephoto lens, the electronic device determines that the shooting intention is a telephoto shooting intention; when the attribute information indicates that the accessory is a microphone, the electronic device determines that the shooting intention is an audio-priority shooting intention.

[0027] Following the example above, based on the attribute information of the external wide-angle lens, the action camera recognizes that the accessory is a lens module, the subtype is wide-angle, and the equivalent focal length is 14mm. Based on the above information, it can be determined that the currently connected accessory is a wide-angle shooting accessory, and thus the shooting intention is "enhanced wide-angle shooting".

[0028] Step 103: Based on the first shooting intention, generate first shooting control information, which includes the working status and shooting parameters of at least one camera.

[0029] In this embodiment, the first shooting control information may be a set of specific instructions for controlling the camera to perform shooting tasks. The first shooting control information may include the working status and shooting parameters of each camera in the electronic device.

[0030] The operating status indicates the role of the camera in the shooting task. For example, the operating status includes, but is not limited to, at least one of active recording status, auxiliary recording status, and standby status. A camera in active recording status undertakes the primary task of image acquisition. A camera in auxiliary recording status records synchronously at a lower configuration for later compositing or reference. A camera in standby status does not start recording but remains powered on and can quickly switch to active status when needed.

[0031] Shooting parameters may include, but are not limited to, specific shooting configurations such as resolution, frame rate, and encoding format. Cameras in different operating states can be configured with different shooting parameters. Shooting control information is a concrete expression of the shooting intent; it translates the abstract shooting direction into configuration commands that the camera can execute.

[0032] Specifically, after determining the shooting intention, the electronic device can determine the appropriate operating state for each camera during the shooting task and configure corresponding shooting parameters for cameras in different operating states. The method of allocating operating states and configuring shooting parameters differs depending on the shooting intention. For example, when the shooting intention is a wide-angle shot, the wide-angle lens is assigned to active recording mode and configured with higher resolution and frame rate; when the shooting intention is a telephoto shot, the telephoto lens is assigned to active recording mode. The electronic device generates shooting control information that includes the above-mentioned operating state allocation results and shooting parameter configuration results based on the shooting intention.

[0033] Following the example above, based on the aforementioned intent to "enhance wide-angle shooting," the action camera determines that the camera corresponding to the external wide-angle lens module should be in active recording mode, the built-in wide-angle camera should be in auxiliary recording mode, and the remaining cameras should be in standby mode. Furthermore, the camera in active recording mode can be configured with a higher resolution and a higher frame rate, such as 4K resolution and 60fps; the camera in auxiliary recording mode can be configured with a lower resolution and the same frame rate as the main camera, such as 1080P resolution and 60fps; and the remaining cameras can be configured to standby mode, i.e., not starting recording but remaining powered on. The electronic device generates shooting control information from the above allocation and configuration results.

[0034] Step 104: Control at least one camera to perform a shooting task based on the first shooting control information.

[0035] In this embodiment, a shooting task refers to the recording operation performed by the camera according to the configuration of the shooting control information. A shooting task may include, but is not limited to, a complete shooting process including starting recording, continuously acquiring image data, encoding and compressing, and storing and writing data. The electronic device can control one or more cameras to simultaneously execute shooting tasks, and different cameras can execute different recording configurations. The result of executing a shooting task is the generation of a video file that can be played and edited.

[0036] Specifically, the electronic device sends configuration commands to each camera according to the configuration in the first shooting control information, setting the working status and shooting parameters of each camera respectively. After configuration, the electronic device starts the corresponding recording operation according to the working status of each camera: cameras in active recording mode begin to acquire images and encode and store them; cameras in auxiliary recording mode begin recording simultaneously; and cameras in standby mode do not start recording but remain powered on and ready to shoot. During the shooting task, the electronic device continuously monitors the connection status of the magnetic interface. When it detects that the magnetic accessory has been removed, the electronic device stops all current recording tasks to ensure that the recorded files are completely saved.

[0037] Continuing with the example above, based on the shooting control information, the action camera can send configuration commands to each camera. The camera corresponding to the external wide-angle lens module is configured to activate recording, starting recording at 4K resolution and 60fps. The built-in wide-angle camera is configured to assist recording, starting simultaneous recording at 1080P resolution and 60fps. The remaining cameras are configured to standby. After configuration, the electronic device simultaneously starts recording for the two cameras mentioned above, while the remaining cameras remain powered on but do not record. The device screen displays the current operating mode indicator.

[0038] The method provided in the above embodiments of this application first obtains the attribute information of the magnetic accessory, then determines a first shooting intention based on the attribute information, then generates first shooting control information including the camera's working state and shooting parameters based on the first shooting intention, and finally controls at least one camera to perform a shooting task based on the first shooting control information. The electronic device can automatically complete the entire process from intention recognition to parameter configuration to shooting execution after the magnetic accessory is connected, without requiring the user to manually enter the settings menu to configure camera parameters item by item. This allows the electronic device to promptly enter a shooting state matching the magnetic accessory, improving shooting efficiency.

[0039] In some optional embodiments, step 101 may further include: Step S11: When a change in the level state of the magnetic interface is detected, a request frame is sent to the magnetic accessory.

[0040] Electronic devices can continuously sample the voltage levels of data communication contacts at fixed time intervals, for example, polling the contact levels at a fixed period of 10ms to identify plugging / unplugging events. A detected voltage level change indicates that the magnetic accessory has been connected. It is understood that digital signals typically represent logic "1" and logic "0" using two states: high and low. When the magnetic accessory is not connected, the data communication contact on the electronic device side is in a high-impedance state, meaning the contact is not connected to any external circuit, and the voltage level is uncertain or floating. When the magnetic accessory magnetically connects to the electronic device, the data communication contacts on the accessory side and the data communication contacts on the device side make physical contact, forming a complete electrical circuit. The voltage level of the contact changes from a high-impedance state to a definite low or high level. By detecting this voltage level change, the electronic device can determine that the magnetic accessory has completed its physical connection.

[0041] Upon detecting the magnetic accessory's insertion, the electronic device can send a request frame to the accessory via the magnetic interface's data communication channel to initiate the transmission of attribute information. The response frame is a data structure defined in the communication protocol, containing fields such as a frame header, command code, data length, and checksum. The frame header of the request frame identifies the start position of the response frame; the command code indicates the frame's purpose, such as requesting attribute information; the data length indicates the effective data length of the frame; and the checksum is used by the receiver to verify the integrity of the data transmission.

[0042] Step S12: Receive the response frame from the magnetic accessory in response to the request frame.

[0043] A response frame is a data structure containing attribute information that the magnetic accessory replies to a request from an electronic device. Response frames and request frames can use the same frame format, but their command codes differ to distinguish their purpose. The payload portion of the response frame carries the accessory's attribute information data. Upon receiving a response frame, the electronic device retrieves the accessory's attribute information by parsing the frame header, verifying data integrity, and extracting the payload.

[0044] Specifically, after receiving a request frame from the electronic device, the magnetic accessory can parse its content and identify the command code as an attribute information request. Then, the magnetic accessory can read pre-stored attribute information data from its internal storage medium and encapsulate it into a response frame according to a predefined frame format. The response frame has the same format as the request frame, including fields such as frame header identifier, command code, data length, payload, and checksum. The command code indicates that the frame is an attribute information response, and the payload is the attribute information itself. After encapsulating the response frame, the magnetic accessory sends it to the electronic device through the data communication channel of the magnetic interface. The electronic device enters a receive waiting state after sending the request frame and receives the response frame from the accessory.

[0045] Step S13: Verify the integrity of the response frame.

[0046] The integrity of an acknowledgment frame means that the frame has not been damaged or tampered with during transmission, and the data received by the receiver is completely identical to the data sent by the sender. In serial communication, data transmission may be affected by factors such as electromagnetic interference and signal attenuation, causing data bits to flip or be lost. To ensure communication reliability, the sender calculates a checksum when constructing the acknowledgment frame and appends it to the end of the frame. After receiving the acknowledgment frame, the receiver recalculates the checksum using the same algorithm and compares it with the received checksum. If they match, the acknowledgment frame is intact; if they do not match, an error occurred during transmission.

[0047] Specifically, after receiving the response frame, the electronic device can extract the checksum field from the response frame and recalculate the checksum using the same checksum algorithm as the magnetic accessory. The checksum algorithm is typically a cumulative checksum, which involves summing all bytes from the frame header to the end of the payload in the response frame to obtain a cumulative sum as the checksum value. When constructing the response frame, the magnetic accessory can append the calculated checksum to the end of the frame; after receiving the response frame, the electronic device can recalculate the checksum for the same range of data and compare the calculated result with the received checksum field. If they match, the response frame is considered complete and the transmission is error-free; if they do not match, an error occurred during transmission, and the data is unreliable. The checksum mechanism can effectively detect data transmission errors caused by factors such as electromagnetic interference and signal attenuation.

[0048] Step S14: If the verification passes, extract attribute information from the response frame.

[0049] After the electronic device completes the integrity verification of the response frame and the verification passes, it can determine that the payload data in the response frame is reliable. Then, it can parse the attribute information field by field from the payload field of the response frame according to a predefined attribute information data format. The attribute information can be organized in a structured binary format, including accessory type field, subtype field, functional parameter field, and constraint condition field. The electronic device reads the values ​​of each field sequentially, parses them according to predefined encoding rules, and obtains specific information such as accessory type, functional parameters, and constraints. After parsing, the electronic device can store the attribute information in a non-volatile storage area for use in subsequent steps. If the verification fails, the electronic device does not extract the attribute information and can choose to resend the request frame to retry the acquisition.

[0050] In this embodiment, the electronic device detects changes in the voltage level of the magnetic interface and actively sends a request frame to the magnetic accessory based on these changes. This allows the device to detect the accessory's connection the instant it makes physical contact, avoiding delays caused by manual user triggering or periodic polling. By actively sending request frames, the electronic device can request attribute information from the accessory as needed, rather than passively waiting for the accessory to report it automatically, ensuring the timeliness and certainty of information acquisition. Furthermore, through integrity verification, attribute information is extracted from the response frame if the verification passes. This confirms that the response frame was not affected by electromagnetic interference or other factors during transmission, ensuring that the attribute information entering subsequent processes is complete and accurate. This provides a complete and reliable data foundation for determining the shooting intention based on the attribute information.

[0051] In some optional embodiments, besides obtaining attribute information via a request-response method, after the magnetic accessory is connected to the electronic device, the electronic device can also directly read the pre-stored attribute information in the internal storage medium of the magnetic accessory through the data communication channel of the magnetic interface. In this method, the magnetic accessory does not need to wait for the electronic device to send a request frame; instead, it provides its internally stored attribute information to the electronic device for reading through the data communication channel after the physical connection is established. After reading the attribute information, the electronic device parses it according to a predefined data format. This method is suitable for scenarios where the internal storage medium of the magnetic accessory supports direct addressing and reading, further reducing the interaction steps in the attribute information acquisition process and improving acquisition efficiency.

[0052] In some optional embodiments, attribute information can be organized in the form of structured binary data blocks. The order and length of the fields in the data block are predefined. For example, the format of the binary data block is shown in Table 1, and the binary storage structure of the data block can be found in [reference needed]. Figure 2 .

[0053] Table 1

[0054] The offset is in bytes, and N is the value of param_count. The function parameter field consists of multiple parameter key-value pairs. Each key-value pair is 4 bytes long, with the first 2 bytes being the parameter identifier (param_id) and the last 2 bytes being the parameter value (param_value). The parameter identifier can be mapped to a predefined parameter semantic table, allowing the electronic device to parse the meaning of the parameter value and unit conversion rules based on the parameter identifier. The parameter semantic table is shown in Tables 2 and 3.

[0055] Table 2

[0056] Table 3

[0057] The constraint field is in bitmask format, 1 byte in length, consisting of 8 bits. Each bit independently identifies a constraint. When a bit is 1, it indicates that the corresponding constraint must be satisfied. The definitions of each bit are shown in Table 4.

[0058] Table 4

[0059] The ISP (Image Signal Processor) processes image signals captured by each camera, performing tasks such as 3D noise reduction, multi-frame fusion, and distortion correction. OTA (Over-The-Air Technology) is used for remote firmware upgrades and updates of the magnetic accessory.

[0060] exist Figure 2 In the binary frame structure, a fixed header, a variable parameter area, a tail, and a reserved padding segment are used. The fixed header occupies 3 bytes and stores the accessory type, subtype, and number of parameter groups N. The variable parameter area has a total length of N×4 bytes, with each 4-byte group consisting of a 2-byte parameter identifier (param_id) and a 2-byte parameter value (param_value). The tail occupies 3 bytes and contains a 1-byte constraint bitmask and a 2-byte firmware version. The reserved padding segment is filled with 0x00 for byte alignment. For example, an accessory type of 0x01, a subtype of 0x01, 3 parameter groups, parameters including a focal length of 16mm, an aperture of f / 2.8, and a distortion coefficient of 35, a constraint bitmask of 0x04 corresponding to bit 2 enabling distortion correction, and a firmware version of v1.2 are used.

[0061] After acquiring the attribute information, and before determining the initial shooting intent based on that information, the electronic device can parse the attribute information. The parsing process is as follows: The first step is to read the accessory type field. If the value of this field is not in the range of 0x01 to 0x06, the electronic device will mark the accessory as "unknown accessory type", skip the subsequent parsing steps, and directly execute step 103.

[0062] The second step involves reading the parameter count field and calculating the expected total length of the descriptor based on its value. If the actual received data length differs from the expected total length, the electronic device marks the descriptor as having a "descriptor format error" and generates default shooting control information.

[0063] The third step involves parsing the key-value pairs of the function parameter fields one by one. Each parameter identifier is mapped to a predefined parameter semantic table to determine the meaning and unit of the parameter. For example, for lens module type accessories, parameter identifier 0x0001 represents the equivalent focal length in millimeters; parameter identifier 0x0002 represents the maximum aperture value, the actual aperture value needs to be divided by 100. The electronic device performs unit conversion on the parameter values ​​according to the parameter semantic table to obtain standardized parameter values.

[0064] The fourth step is to parse the constraint field and extract the status of each constraint bit. When bit 0 is 1, it indicates that the accessory needs to perform a power supply compatibility check, and the electronic device reads the power consumption parameter to obtain the rated power consumption value. When bit 1 is 1, it indicates that the accessory limits the continuous recording time, and the electronic device reads the maximum continuous recording time field to obtain the duration value in seconds. When bit 2 is 1, it indicates that the accessory needs to enable the distortion correction module in the shooting control information, and the electronic device reads the distortion coefficient to obtain the correction parameter. When bit 3 is 1, it indicates that the accessory needs to switch the audio input source to the accessory in the shooting control information.

[0065] After parsing, the electronic device outputs a structured accessory capability object, which includes accessory type, subtype, list of functional parameters, list of constraints, firmware version number, and manufacturer identifier.

[0066] For example, in the 128-byte descriptor returned by the external wide-angle lens, the accessory type field is 0x01, indicating a lens module; the subtype field is 0x01, indicating wide-angle; and the parameter count field is 4. The function parameter field contains four key-value pairs: parameter identifier 0x0001 corresponds to an equivalent focal length of 14mm, parameter identifier 0x0003 corresponds to a field of view of 120°, parameter identifier 0x0006 corresponds to a distortion coefficient K1 of 0.028, and parameter identifier 0x0005 corresponds to a maximum frame rate of 60fps. The constraint field is 0x04, i.e., bit 2 is 1, indicating that distortion correction is required. The firmware version number is 0x0102, indicating version v1.2. The manufacturer identifier is 0x0001. The structured accessory capability object of the electronic device is parsed and output: the accessory type is lens module, the subtype is wide-angle, the functional parameter list includes equivalent focal length of 14mm, field of view of 120°, distortion coefficient K1 is 0.028, maximum frame rate of 60fps, the constraint condition list includes distortion correction, the firmware version number is 1.2, and the manufacturer identifier is 0x0001.

[0067] By organizing attribute information in the form of structured binary data blocks and parsing it, the information can be transformed into structured data with clear field meanings, providing a complete and accurate data foundation for subsequent determination of shooting intent and generation of shooting control information.

[0068] In some optional embodiments, the attribute information includes accessory type. Accessory type is a field in the attribute information used to identify the category to which the magnetic accessory belongs. Values ​​for accessory type include lens module, fill light, microphone, handle, filter module, and battery extension, etc. Different types of accessories have different functional characteristics and shooting purposes. For example, a lens module is used to change the shooting angle and imaging characteristics, a microphone is used to collect audio signals, and a fill light is used to provide illumination. Since different types of accessories correspond to different shooting scenarios and shooting needs, accessory type is a primary basis for the electronic device to determine the shooting intent. Based on this, step 102 may further include: Step S21: Query the candidate shooting intentions that match the accessory type from the mapping relationship table. The mapping relationship table includes the correspondence between accessory types and shooting intentions and the weight of each shooting intention.

[0069] The mapping table is a data structure pre-stored in the electronic device, recording the correspondence between accessory types and shooting intentions. Each row in the mapping table represents a mapping record, containing an accessory type field and a corresponding shooting intention field. The mapping table is statically pre-configured and written to the storage medium before the electronic device leaves the factory, and can be upgraded and expanded according to product strategy.

[0070] After obtaining the attribute information of the magnetic accessory, the electronic device can read the accessory type field from the attribute information and use this accessory type as a query keyword to search in a pre-stored mapping table. Specifically, the accessory type in the attribute information can be compared one by one with the accessory type conditions of each record in the mapping table. If the accessory type condition in a certain record matches the accessory type of the current accessory, the shooting intention corresponding to that record is determined as a candidate shooting intention. In subsequent processing, the electronic device needs to determine the final shooting intention to be used as the first shooting intention from the candidate shooting intentions.

[0071] The mapping table can also include weights for each shooting intention. Weights represent the priority of a shooting intention when multiple candidate intentions exist simultaneously. A higher weight value indicates a higher priority for the shooting intention to be selected as the first shooting intention. Weight values ​​typically range from 0 to 1. Weight configuration can be based on factors such as the historical frequency of use of the shooting intention, the matching degree between accessory type and shooting scene, etc. Weights provide a quantitative basis for subsequent intention selection.

[0072] Step S22: If there is only one candidate shooting intention, the candidate shooting intention is determined as the first shooting intention.

[0073] The electronic device can determine the number of candidate shooting intentions. If only one candidate shooting intention matches after querying the mapping table, the electronic device does not need to perform further comparison and selection, and directly determines this unique candidate shooting intention as the first shooting intention.

[0074] Step S23: If there are at least two candidate shooting intentions, and the weight difference between the candidate shooting intention with the highest weight and the candidate shooting intention with the second highest weight is greater than or equal to the first threshold, then the candidate shooting intention with the highest weight is determined as the first shooting intention.

[0075] When at least two candidate shooting intentions are matched after querying the mapping table, the electronic device can first obtain the weight value of each candidate shooting intention, and find the candidate shooting intention with the highest weight and the candidate shooting intention with the second highest weight.

[0076] Next, the weight difference between the candidate shooting intent with the highest weight and the candidate shooting intent with the second highest weight is calculated. The weight difference refers to the difference between the weights of the candidate shooting intent with the highest weight and the candidate shooting intent with the second highest weight. The weight difference reflects the degree of difference in priority between the two candidate intents. The larger the difference, the more obvious the advantage of the intent with the highest weight relative to the intent with the second highest weight.

[0077] Next, the weight difference can be compared with a first threshold. The first threshold is a pre-set numerical threshold used to determine whether the weight difference between the candidate shooting intention with the highest weight and the candidate shooting intention with the second highest weight is significant enough. The value of the first threshold can be set according to actual application needs, for example, it can be set to 0.1. When the weight difference is greater than or equal to the first threshold, it indicates that the candidate shooting intention with the highest weight has a significant advantage. At this time, the candidate shooting intention with the highest weight can be determined as the first shooting intention, and the candidate shooting intention with the second highest weight is not included in the first shooting intention.

[0078] It should be noted that if the accessory type in the attribute information does not have a corresponding shooting intent in the mapping table, a default shooting intent can be generated. This default shooting intent is "General Accessory Access" with a weight of 0.5.

[0079] By querying the mapping table for candidate shooting intentions that match the accessory type, if there is only one candidate shooting intention, that candidate shooting intention is determined as the first shooting intention. If there are at least two candidate shooting intentions and the weight difference is greater than or equal to the first threshold, the candidate shooting intention with the highest weight is determined as the first shooting intention. This can automatically, reasonably and efficiently deduce the shooting intention based on the accessory type, providing a clear basis for the subsequent generation of shooting control information.

[0080] In some alternative embodiments, step 102 may further include: Step S24: When there are at least two candidate shooting intentions and the weight difference between the candidate shooting intention with the highest weight and the candidate shooting intention with the second highest weight is less than a first threshold, query the compatibility degree between the candidate shooting intention with the highest weight and the candidate shooting intention with the second highest weight from the intention compatibility matrix. The intention compatibility matrix is ​​used to indicate the compatibility degree between different shooting intentions.

[0081] When at least two candidate shooting intentions are matched after querying the mapping table, and the weight difference between the candidate shooting intention with the highest weight and the candidate shooting intention with the second highest weight is less than the first threshold, it indicates that the candidate shooting intention with the highest weight does not have a sufficiently significant priority advantage over the candidate shooting intention with the second highest weight. In this case, it is necessary to further analyze the compatibility between these two candidate intentions to determine whether they can be executed simultaneously, or whether a trade-off needs to be made between the two.

[0082] Compatibility is a numerical value used to quantify the degree of conflict or coordination in resource requirements between two shooting intentions. The higher the compatibility of two shooting intentions, the less competition there is for hardware resources, and the easier it is to satisfy them simultaneously; the lower the compatibility of two shooting intentions, the more conflict there is in resource requirements, and the more difficult it is to execute them simultaneously.

[0083] Electronic devices can query the compatibility degree between the candidate shooting intent with the highest weight and the candidate shooting intent with the second highest weight from the intent compatibility matrix. The intent compatibility matrix is ​​a two-dimensional data structure pre-stored in the electronic device. Each row and column of the intent compatibility matrix corresponds to a shooting intent, and each element in the matrix represents the compatibility degree between the intent in the corresponding row and the intent in the corresponding column. The compatibility degree value is between 0 and 1, where 1 indicates that the two intents are completely compatible and can be executed simultaneously, and 0 indicates that the two intents are completely mutually exclusive and cannot be executed simultaneously. The intent compatibility matrix is ​​statically preset and written into the storage medium before the electronic device leaves the factory. The values ​​in the intent compatibility matrix can be determined based on the degree of competition between different shooting intents in terms of hardware resources such as image signal processor computing power, storage bandwidth, and power consumption. For example, the intent compatibility matrix can be seen in Table 5.

[0084] Table 5

[0085] Step S25: If the compatibility level is greater than or equal to the second threshold, the candidate shooting intention with the highest weight and the candidate shooting intention with the second highest weight are jointly determined as the first shooting intention.

[0086] When the compatibility level retrieved from the intent compatibility matrix is ​​greater than or equal to the second threshold, it indicates that there is little resource conflict between the candidate shooting intent with the highest weight and the candidate shooting intent with the second highest weight, and the two intents can be executed simultaneously without causing insufficient hardware resources. In this case, the electronic device jointly determines the candidate shooting intent with the highest weight and the candidate shooting intent with the second highest weight as the first shooting intent, and considers them together when generating shooting control information. The first shooting intent at this time is a composite shooting intent. The second threshold is a pre-set numerical threshold used to determine whether the compatibility level between the two candidate shooting intents is high enough. The value of the second threshold can be set according to the actual application requirements.

[0087] For example, candidate intent A is "enhanced wide-angle shooting" with a weight of 0.9; candidate intent B is "audio-priority shooting" with a weight of 0.85. The weight difference is 0.05, which is less than the first threshold of 0.1. The electronic device queries the intent compatibility matrix and finds that the compatibility between the two is 0.9, which is greater than the second threshold of 0.5, indicating that the resource conflict between the two intents is small. The electronic device jointly determines "enhanced wide-angle shooting" and "audio-priority shooting" as the first shooting intent.

[0088] Step S26: If the compatibility level is less than the second threshold, select one of the candidate shooting intentions with the highest weight and the candidate shooting intentions with the second highest weight as the first shooting intention.

[0089] When the compatibility level retrieved from the intent compatibility matrix is ​​less than the second threshold, it indicates a severe resource competition between the candidate shooting intent with the highest weight and the candidate shooting intent with the second highest weight, meaning the two intents cannot be satisfied simultaneously. In this case, the electronic device must make a trade-off between the two, selecting one as the primary shooting intent and discarding or downgrading the other.

[0090] Optionally, the electronic device can select a first shooting intention from the candidate shooting intentions with the highest weight and the second highest weight based on its own motion state. Motion state refers to the movement or stationary state of the electronic device in physical space. Motion state reflects the user's current usage scenario; for example, a stationary state typically corresponds to a fixed-point shooting scenario, while a moving state typically corresponds to dynamic shooting scenarios such as cycling, skiing, or walking. The user's priority for shooting differs depending on the motion state. In practice, motion state can be detected and determined using the gyroscope and accelerometer built into the electronic device. When the motion amplitude detected by the gyroscope and accelerometer is less than a preset value, the electronic device is determined to be in a stationary state; when the motion amplitude is greater than or equal to the preset value, the electronic device is determined to be in a moving state.

[0091] If the electronic device is stationary, it indicates that the user may be filming from a fixed point. In this case, the intent related to audio capture has higher priority, and the electronic device selects the candidate filming intent related to audio capture as the first filming intent. If the electronic device is in motion, it indicates that the user may be filming in a dynamic scene. In this case, the intent related to video capture has higher priority, and the electronic device selects the candidate filming intent related to video capture as the first filming intent.

[0092] For example, candidate intent A is "telephoto-priority shooting" with a weight of 0.85; candidate intent B is "audio-priority shooting" with a weight of 0.8. The weight difference is 0.05, which is less than the first threshold of 0.1. The electronic device queries the intent compatibility matrix and finds a compatibility score of 0.4, which is less than the second threshold of 0.5, indicating a severe resource competition between the two intents. Specifically, telephoto high frame rate recording consumes a large amount of storage bandwidth and image signal processor computing power, while high-fidelity audio acquisition requires a dedicated audio DMA (Direct Memory Access) channel and noise reduction computing power, resulting in competition between the two in terms of bandwidth and power consumption. The electronic device detects the current motion state using a gyroscope and accelerometer: if the detected motion amplitude is less than 0.5 m / s², it is determined to be a stationary state, and "audio-priority shooting" is selected as the first shooting intent, while "telephoto-priority shooting" is discarded; if the detected motion amplitude is greater than or equal to 0.5 m / s², it is determined to be a moving state, and "telephoto-priority shooting" is selected as the first shooting intent, while "audio-priority shooting" is discarded.

[0093] Optionally, the electronic device can directly select the candidate shooting intent with the highest weight as the first shooting intent.

[0094] For example, candidate intent A is "enhanced wide-angle shooting" with a weight of 0.9; candidate intent B is "telephoto priority shooting" with a weight of 0.85. The weight difference is 0.05, which is less than the first threshold of 0.1. The electronic device queries the intent compatibility matrix and finds a compatibility level of 0.3 between the two intents, which is less than the second threshold of 0.5, indicating a severe resource competition between the two intents. Specifically, both intents require occupying the main camera position and the highest resolution resources, which cannot be satisfied simultaneously. This resource competition is independent of the movement state of the electronic device; whether the device is stationary or in motion, wide-angle shooting and telephoto shooting cannot be satisfied simultaneously. Therefore, the electronic device directly selects the higher-weighted "enhanced wide-angle shooting" as the first shooting intent, and "telephoto priority shooting" is discarded.

[0095] Through the above process, when multiple accessories are connected at the same time and the priority of each candidate intent is similar, a reasonable intent selection is made based on resource compatibility analysis. This avoids resource conflicts or scene mismatch problems that may be caused by simply relying on weight comparison, thereby improving the rationality of intent determination and scene adaptability in multi-accessory scenarios while ensuring shooting quality.

[0096] In some optional embodiments, the operating states include active recording state, auxiliary recording state, and standby state. The camera in active recording state acts as the main camera, undertaking the primary task of image capture. The electronic device configures this camera with the highest resolution, highest frame rate, and optimal encoding format, and allocates the most image signal processor resources. The output of the camera in active recording state is the primary source of the final footage. The camera in auxiliary recording state acts as an auxiliary camera, recording synchronously with the main camera at a lower resolution. The auxiliary recording footage is used for post-production compositing, distortion correction reference, or picture-in-picture functions. The frame rate of the camera in auxiliary recording state is consistent with the main camera to ensure that multiple video streams are time-aligned. The camera in standby state does not initiate recording tasks but remains powered on. Maintaining power on means that the camera is ready and can quickly switch to active recording state when needed. The delay between a camera in standby state and active recording state is less than 200 milliseconds. When multiple cameras record synchronously, the hardware FSYNC (Frame Synchronization) synchronization pulse ensures that the timestamp error of each stream is less than 1ms. Step 103 may further include: Step S31: Obtain the arrangement template associated with the first shooting intention and the hardware information of at least one camera. The arrangement template includes the hardware conditions that cameras in different working states should meet.

[0097] After determining the first shooting intention, the electronic device can retrieve the choreography template associated with that first shooting intention from a pre-stored choreography template library. The choreography template library stores multiple choreography templates, each bound to a specific shooting intention. The choreography template defines the allocation of working states for each camera and the shooting parameter configuration strategy under the corresponding shooting intention. The choreography template contains abstract role definitions, such as main camera, auxiliary camera, and standby camera, as well as the hardware requirements that each role must meet.

[0098] The hardware requirements are the capability requirements defined in the orchestration template for cameras in different operating states. These requirements guide the electronic device in selecting the most suitable camera from among multiple available cameras for a given role. For example, the primary camera role requires the highest resolution and frame rate capabilities, while the secondary camera role requires the same frame rate capabilities as the primary camera. The electronic device matches the hardware information of each camera with the hardware requirements and determines the operating state of each camera based on the matching results.

[0099] After determining the initial shooting intention, the electronic device can also obtain hardware information for all currently available cameras, including each camera's identifier, type, maximum resolution, and maximum frame rate. These types may include, but are not limited to, wide-angle, telephoto, and ultra-wide-angle. This hardware information reflects the highest configuration each camera can support and serves as the basis for subsequent camera selection and parameter configuration.

[0100] Step S32: Match the hardware information with the hardware conditions, and determine the working status of each camera in at least one camera based on the matching result.

[0101] Specifically, the electronic device can match the hardware information of each camera with the hardware conditions corresponding to different working states defined in the programming template. The programming template defines the hardware conditions that cameras in active recording state should meet, the hardware conditions that cameras in auxiliary recording state should meet, and the hardware conditions that cameras in standby state should meet. The electronic device assigns a working state to each camera based on the matching results: the camera with the highest hardware condition matching degree is assigned to the active recording state, the cameras that meet the auxiliary recording conditions are assigned to the auxiliary recording state, and the remaining cameras are assigned to the standby state.

[0102] Step S33: Determine the shooting parameters of each camera based on the working status of at least one camera.

[0103] Electronic devices can determine the corresponding shooting parameters for each camera based on its assigned working status. Specifically, the most capable camera can be assigned to the active recording state to take on the main camera task, cameras with synchronous recording capabilities can be assigned to the auxiliary recording state, and the remaining cameras can be assigned to the standby state.

[0104] The shooting parameters of a camera in active recording mode include a first resolution, a first frame rate, and a first encoding format. For example, the first resolution can be the camera's maximum supported resolution, such as 4K; the first frame rate can be the camera's maximum supported frame rate, such as 60fps; and the first encoding format can be H.265. Thus, a camera in active recording mode obtains the highest resolution and the optimal encoding format to ensure the quality of the main camera image.

[0105] The camera's recording parameters in auxiliary recording mode include a second resolution, the same first frame rate as in active recording mode, and a second encoding format. The second resolution is lower than the first resolution. In practice, the second resolution can be calculated as 50% of the first resolution and rounded down to the standard resolution level, such as 1080P; the second encoding format can be H.264. Therefore, the camera in auxiliary recording mode records synchronously at a lower resolution to save storage and bandwidth resources.

[0106] A camera in standby mode has its shooting parameters set to not start recording and remain powered on, thereby reducing the power consumption of electronic devices.

[0107] For example, Figure 3 This diagram illustrates the correspondence between shooting intentions and shooting control information. For the intention to enhance wide-angle, the corresponding shooting control information indicates that the external wide-angle camera is the main camera, the built-in wide-angle camera is the auxiliary camera, and the built-in telephoto camera is in standby mode. For the intention to prioritize telephoto, the corresponding shooting control information indicates that the external telephoto camera is the main camera, the built-in wide-angle camera is the pre-focus auxiliary camera, and the built-in ultra-wide-angle camera is the panoramic backup auxiliary camera. For the intention to prioritize audio, the corresponding shooting control information indicates that the built-in wide-angle camera is the main camera, the magnetically attached external microphone serves as an independent audio source, and the other cameras are in standby mode. For the intention to create creative lighting effects, the corresponding shooting control information indicates that the built-in wide-angle camera is the main camera, the magnetically attached RGB fill light synchronizes white balance parameters, and the built-in telephoto camera is the close-up auxiliary camera. For the intention to stabilize shooting, the corresponding shooting control information indicates that the built-in wide-angle camera is the main camera, the magnetically attached extension handle is used for image stabilization enhancement, and the other cameras are in standby mode.

[0108] By acquiring the programming template and camera hardware information associated with the initial shooting intention, the electronic device matches the hardware information of each camera with the hardware conditions in the programming template, and determines the working status of each camera based on the matching results. The electronic device can automatically assign roles according to the actual capabilities of each camera, ensuring that the allocation of working status matches the hardware capabilities of each camera and avoiding assigning cameras lacking the corresponding capabilities to inappropriate working states. By determining the shooting parameters of each camera based on its working status, the electronic device can automatically configure differentiated resolutions, frame rates, and encoding formats for cameras in different working states, ensuring that each camera uses the most appropriate shooting parameter configuration. Through the above process, the electronic device can automatically complete the working status allocation and shooting parameter configuration of multiple cameras after the accessories are connected, eliminating the need for users to manually set the parameters of each camera individually. This improves configuration efficiency while ensuring the collaborative cooperation and resource optimization of multiple cameras in shooting tasks.

[0109] In some alternative embodiments, step 104 may further include: Step S41: Take the currently executing recording task as the first recording task, stop executing the first recording task, and store the second shooting control information used to execute the first recording task.

[0110] The first recording task refers to the shooting task being performed by the electronic device before acquiring the attribute information of the magnetic accessory. The shooting control information corresponding to the first recording task is the second shooting control information. The second shooting control information reflects the shooting status of the electronic device before the accessory is connected, including the working status of each camera and the shooting parameter configuration.

[0111] After detecting the magnetic accessory's insertion and generating the first shooting control information, the electronic device can designate the currently executing recording task as the first recording task and stop executing it, waiting for each camera to complete the encoding and writing of the current frame to ensure the complete preservation of the recording file. After stopping the first recording task and before starting a new recording task, the electronic device can store the second shooting control information in the state saving area of ​​the random access memory for later recovery.

[0112] Step S42: Control at least one camera to perform a second recording task according to the first shooting control information.

[0113] After stopping the first recording task and storing the second shooting control information, the electronic device can configure each camera according to the first shooting control information and control each camera to perform the second recording task. Based on the working state and shooting parameters defined in the first shooting control information, the electronic device sends configuration commands to each camera, setting parameters such as resolution, frame rate, and encoding format. After configuration, the electronic device starts recording from the cameras in active recording and auxiliary recording states, while the cameras in standby state remain powered on but do not start recording.

[0114] Step S43: When a change in the level state of the magnetic interface is detected, the second recording task is stopped, and the first recording task is resumed according to the second shooting control information.

[0115] During the second recording task, the electronic device can continue to periodically monitor the voltage level of the magnetic interface. When a change in voltage level is detected, such as a transition from low to high impedance, it indicates that the magnetic accessory has been removed from the electronic device. The electronic device immediately stops the second recording task and waits for each camera to complete the encoding and writing of the current frame, ensuring that the recorded file is completely saved.

[0116] Subsequently, the second shooting control information can be read from the status save area, and the working status and shooting parameters of each camera can be reset according to the configuration in the second shooting control information. After the configuration is completed, the electronic device restarts the recording task and restores the shooting state when the first recording task was executed.

[0117] By using the currently executing recording task as the first recording task, stopping the execution of the first recording task, and storing the second shooting control information used to execute the first recording task, the complete shooting state before accessory connection is saved before switching to new shooting control information, providing a data foundation for subsequent recovery. By controlling at least one camera to execute the second recording task according to the first shooting control information, the system can automatically switch to a shooting state adapted to the current accessory after accessory connection, ensuring that the accessory's functions take effect promptly without requiring manual switching of shooting modes by the user. By stopping the execution of the second recording task when a change in the level state of the magnetic interface is detected and resuming the first recording task according to the second shooting control information, the system can automatically restore the shooting state before accessory connection after accessory removal without requiring manual reconfiguration by the user. Through the above process, the electronic device automatically completes the switching of shooting states when accessories are connected and automatically completes the restoration of shooting states when accessories are removed. The entire switching and restoration process requires no manual operation by the user, achieving a seamless experience of plug-and-play and instant restoration of accessories. At the same time, the stopping of recording tasks is accompanied by an operation to wait for the current frame encoding to complete, ensuring the integrity of the recorded files during switching and restoration and avoiding file corruption caused by sudden interruption.

[0118] In some optional embodiments, the attribute information includes a manufacturer identifier. The manufacturer identifier is a field in the attribute information used to uniquely identify the manufacturer of the magnetic accessory. The manufacturer identifier is typically a 2-byte value; for example, 0x0001 represents the official manufacturer, and 0x0100 represents third-party manufacturer A. After performing step 101, the following steps can be further performed: Step S51: Send a challenge code to the magnetic accessory.

[0119] A challenge code is a random number generated by the electronic device to initiate authentication of the magnetic accessory. The challenge code is typically 16 bytes of random data, generated by the electronic device's secure random number generator. The challenge code is sent to the accessory via the magnetic interface's data communication channel. The magnetic accessory uses its built-in key to sign the challenge code and returns the signed data to the electronic device. Because the challenge code is randomly generated, it is different for each authentication process, effectively preventing replay attacks.

[0120] Step S52: Receive the signature data returned by the magnetic accessory.

[0121] The signature data is the authentication credential generated by the magnetic accessory after performing a signature operation on the challenge code sent by the electronic device. After receiving the challenge code from the electronic device, the magnetic accessory uses its built-in manufacturer's private key to perform a hash message authentication code signature operation on the challenge code, generating a fixed-length signature data. The signature data is typically 32 bytes. In practice, the magnetic accessory can encapsulate the signature data into an authentication response frame and return it to the electronic device through the data communication channel of the magnetic interface.

[0122] Step S53: Obtain the corresponding verification key based on the manufacturer's identifier, and use the verification key to verify the signature data.

[0123] The verification key is used by the electronic device to verify the signature data of the accessory. The verification key appears in pairs with the key used by the accessory to generate the signature data. The electronic device can retrieve the corresponding verification key from a pre-stored secure storage area based on the manufacturer identifier in the attribute information. The verification key can be a symmetric key, meaning it shares the same key with the magnetic accessory; or it can be the public key of an asymmetric key, meaning it is paired with the private key in the magnetic accessory. The verification key is pre-stored in the secure storage area of ​​the electronic device, either before the device leaves the factory or through a security upgrade process.

[0124] The electronic device can recalculate the signature value of the challenge code using the verification key, following the same algorithm as the magnetic accessory, and compare the calculated result with the signature data returned by the accessory. If they match, the verification passes, indicating that the accessory's identity is legitimate; if they do not match, the verification fails, indicating that the accessory's identity cannot be confirmed. Verification is the core step in identity authentication, and its result determines whether the accessory is authorized to use its full functionality.

[0125] In step S54, if the verification fails, control at least one camera to perform a shooting task according to the restricted first shooting control information, which includes a resolution upper limit and disabled function information.

[0126] When the electronic device fails to verify the signature data, it indicates that the identity of the magnetic accessory cannot be confirmed. The electronic device generates restricted shooting control information. This information includes a resolution cap and disabled function information. The resolution cap limits the camera's maximum resolution, for example, below 1080P. The disabled function information indicates advanced shooting functions that need to be disabled, such as high dynamic range imaging and multi-frame fusion. By functionally restricting uncertified accessories, the restricted shooting control information ensures the system stability and security of the electronic device.

[0127] Electronic devices can configure each camera and perform shooting tasks according to the restricted shooting control information, and can display a prompt message "Uncertified accessory, some functions are restricted" on the user interface to inform the user that the current accessory has not passed identity authentication.

[0128] By sending a challenge code to the magnetic accessory and receiving the signature data returned by the accessory, a challenge-response two-way authentication mechanism is established between the electronic device and the magnetic accessory. The randomness of the challenge code ensures that the challenge value is different in each authentication process, effectively preventing attackers from bypassing authentication by intercepting and replaying old signature data. By obtaining the corresponding verification key based on the manufacturer's identifier and using this verification key to verify the signature data, the legitimacy of the accessory's identity can be confirmed, achieving traceability of the accessory's origin. This also ensures that only accessories with the correct key can pass authentication, preventing unauthorized third-party accessories from forging valid signature data. In the event of verification failure, the camera is controlled to perform a shooting task according to restricted shooting control information. This ensures that when an unauthenticated magnetic accessory is connected to the electronic device, its access to shooting capabilities is limited to a safe range, preventing system instability or recording interruption caused by unauthenticated accessories triggering unexpected high-load operations. Through this process, unauthorized third-party accessories are effectively prevented from triggering abnormal orchestration or causing system crashes, ensuring the system stability and security of the electronic device in accessory-connected scenarios.

[0129] In some optional embodiments, the attribute information includes a power consumption parameter. The power consumption parameter is a field in the attribute information that represents the rated power consumption of the magnetic accessory during normal operation. By reading the power consumption parameter, the electronic device can assess the power supply requirements of the accessory and determine whether its current power supply capability is sufficient for the accessory's normal operation. The introduction of the power consumption parameter allows the electronic device to proactively assess its power supply capability when the accessory is connected, avoiding recording interruptions or device malfunctions due to insufficient power supply. After performing step 103, the following steps can be further performed: Step S61: If the power consumption parameter is greater than the third threshold, reduce the resolution of the camera in active recording state.

[0130] After generating the first shooting control information, the electronic device can read the power consumption parameters from the accessory's attribute information. The electronic device compares the power consumption parameters with a third threshold. The third threshold is a pre-set numerical threshold used to determine whether the power consumption of the magnetic accessory exceeds the power supply capacity of the electronic device. It can be set according to the hardware configuration and power supply design of the electronic device, and its specific value is not limited here. For example, the third threshold can be set to 80% of the maximum power supply capacity of the electronic device.

[0131] When the power consumption parameter of the magnetic accessory exceeds the third threshold, it indicates that the accessory's power demand is approaching or exceeding the upper limit of the electronic device's power supply capacity, requiring power optimization measures. Possible power optimization measures may include reducing the resolution of the camera in active recording mode, for example, from 4K to 1080P. Reducing the resolution can decrease the data acquisition amount of the image sensor and the computational load of the image signal processor, thereby reducing the total power consumption of the entire shooting system and bringing it back within the electronic device's power supply capacity.

[0132] By reading the power consumption parameters of the magnetic accessory and reducing the resolution of the camera in active recording mode when the power consumption parameter exceeds a third threshold, power optimization can be proactively performed when the accessory's power demand approaches or exceeds its power supply capacity. Reducing the main camera resolution reduces the amount of image data acquisition and the computational load on the image signal processor, thereby reducing the overall system power consumption and bringing the shooting configuration back within the power supply capacity of the electronic device. This avoids recording interruptions or abnormal device shutdowns due to insufficient power supply, ensuring the continuity of the shooting process.

[0133] Step S62: Replace the encoding format in the shooting parameters that is not supported by the electronic device with the encoding format that is supported by the electronic device.

[0134] Encoding format refers to the compression encoding standard used by a camera when recording video. Common encoding formats include H.265, H.264, and MJPEG. Different encoding formats have different compression efficiencies and computational complexities. H.265 has the highest compression efficiency, occupying less storage space and bandwidth at the same image quality, but it requires higher hardware decoding capabilities; H.264 is a widely supported encoding format with good compatibility; MJPEG has the lowest compression efficiency and the highest bandwidth consumption. The ability of electronic devices to support different encoding formats depends on their hardware configuration.

[0135] The electronic device can check the encoding formats configured for each camera in the first shooting control information and obtain a list of its supported encoding formats. For each encoding format in the first shooting control information, it can check whether it exists in the list of supported encoding formats. If an encoding format configured for a certain camera is not supported by the electronic device, the electronic device selects the highest priority encoding format from the list of supported encoding formats for replacement. The priority order of the encoding formats is H.265 > H.264 > MJPEG. After the replacement is completed, all encoding formats in the first shooting control information are supported by the electronic device.

[0136] By replacing encoding formats in the shooting parameters that are not supported by the electronic device with those that are, the electronic device can automatically adapt to the encoding format requirements of different accessories. When the encoding format configured for an accessory exceeds the decoding or encoding capabilities of the electronic device, the electronic device automatically selects the most efficient format it supports for replacement, ensuring that the encoding format configuration in the shooting control information is always executable. This avoids recording failures caused by incompatible encoding formats and guarantees the executableness of the shooting control information on the electronic device.

[0137] Step S63: Determine the total bandwidth requirement of the cameras in active recording state and auxiliary recording state. If the total bandwidth requirement is greater than the fourth threshold, reduce the resolution of the cameras in auxiliary recording state.

[0138] The electronic device can first determine the total data bandwidth requirement of all cameras in active and assisted recording states as specified in the first shooting control information. The total bandwidth requirement is calculated as follows: for each camera in active or assisted recording state, calculate the product of resolution width, resolution height, frame rate, bit depth, and encoding compression factor, and then sum the results for all cameras. The bit depth is fixed at 8 bits; the compression ratio is determined based on the encoding format: 0.02 for H.265, 0.04 for H.264, and 0.15 for MJPEG. The total bandwidth requirement reflects the extent to which the shooting task consumes the electronic device's data transmission capacity.

[0139] Next, the calculated total bandwidth requirement is compared with a fourth threshold. The fourth threshold is a pre-set numerical threshold used to determine whether the total bandwidth requirement for shooting control information exceeds the data transmission capability of the electronic device. Its value can be set according to the hardware bandwidth capability of the electronic device. For example, the fourth threshold can be 90% of the maximum bandwidth of the electronic device.

[0140] When the total bandwidth requirement exceeds the fourth threshold, it indicates that the current shooting configuration's demand for data transmission bandwidth exceeds the electronic device's capacity, necessitating bandwidth optimization measures. Specifically, the resolution of cameras in auxiliary recording mode can be reduced sequentially according to priority until the total bandwidth requirement meets the fourth threshold. If the bandwidth constraint is still not met even after all auxiliary recording cameras have had their resolution reduced to the minimum, the auxiliary recording cameras can be further disabled, i.e., only previewing is maintained without recording, until the bandwidth constraint is met.

[0141] By determining the total bandwidth requirements of cameras in active and auxiliary recording states, and reducing the resolution of cameras in auxiliary recording state when the total bandwidth requirement exceeds a fourth threshold, the electronic device can proactively optimize bandwidth when the shooting configuration exceeds its capacity. Reducing the auxiliary camera resolution decreases the amount of data in the auxiliary video stream, thereby reducing the total bandwidth requirement and bringing the shooting configuration back within the bandwidth capabilities of the electronic device. Since the optimization target is the camera in auxiliary recording state rather than the camera in active recording state, the image quality of the main camera is maintained. Thus, while ensuring the image quality of the main camera, data loss or recording stuttering due to insufficient bandwidth is avoided, guaranteeing the smoothness of multi-channel recording.

[0142] In some optional embodiments, during the process of controlling at least one camera to perform a shooting task based on the first shooting control information, the following steps may also be performed: Step S71: Periodically acquire status data, which includes at least one of the following: temperature of the magnetic accessory, battery level of the magnetic accessory, and image quality score.

[0143] Throughout the entire shooting process based on the initial shooting control information, status data can be acquired periodically. For example, status data can be acquired every 2 seconds. Status data may include, but is not limited to, the temperature of the magnetic accessory, the battery level of the magnetic accessory, and the image quality score of the main camera.

[0144] The temperature of magnetic accessories can be monitored using a built-in thermistor. The thermistor's resistance changes with temperature; the magnetic accessory converts this resistance into a digital temperature value, which is then transmitted back to the electronic device via a data communication channel. Temperature is a crucial indicator of the magnetic accessory's workload and heat dissipation. Different types of accessories have different temperature thresholds; for example, a lens module has a temperature threshold of 65°C, a fill light has a threshold of 75°C, and a microphone has a threshold of 50°C. Temperature monitoring aims to prevent accessories from overheating and being damaged due to prolonged high-load operation.

[0145] The battery level of the magnetic accessory refers to the remaining percentage of energy in its built-in battery. The battery level is expressed as a percentage and is monitored in real-time by the accessory's internal battery management chip. The magnetic accessory encapsulates this real-time battery level value as status data and transmits it back to the electronic device via the data communication channel of the magnetic interface. The battery level ranges from 0% to 100%, with higher values ​​indicating more remaining power. The purpose of battery monitoring is to provide early warnings and take appropriate measures when the accessory's battery is about to run out, preventing recording interruptions due to insufficient power.

[0146] Image quality score is a numerical value obtained by an electronic device to objectively evaluate the image quality of its main camera. Outputted by the device's image signal processor, it reflects quality indicators such as sharpness and detail retention. The image quality score ranges from 0 to 100, with higher values ​​indicating better image quality. It can be used to detect image quality degradation caused by factors such as lens contamination, focus shift, or obstructed optical paths. The image quality score is calculated based on underlying image features such as contrast, sharpness, and noise levels.

[0147] By periodically acquiring status data during the shooting task controlled by the camera based on the first shooting control information, the operation status of the magnetic accessory can be continuously tracked during the shooting process, providing a data basis for timely detection and handling of anomalies.

[0148] In step S72, if the temperature is greater than the fifth threshold, a power reduction command is sent to the magnetic accessory, and the frame rate of the camera in active recording state is reduced.

[0149] After acquiring the temperature of the magnetic accessory in each detection cycle, the electronic device compares this temperature with a fifth threshold. The fifth threshold can be set according to the accessory type. For example, 65°C for a lens module, 75°C for a fill light, and 50°C for a microphone. If the current temperature exceeds the fifth threshold, it indicates that the accessory is overheating, and the electronic device triggers power reduction protection. The electronic device sends a power reduction command to the accessory through the data communication channel of the magnetic interface, instructing the accessory to reduce its operating power by 20% from the current value. Simultaneously, the electronic device reduces the frame rate of the camera in active recording mode from the current value to 30fps to reduce the data acquisition amount of the image sensor and the computational load of the image signal processor, thereby reducing the overall heat generation of the system.

[0150] By sending a power reduction command to the magnetic accessory and lowering the frame rate of the camera in active recording mode when the temperature exceeds the fifth threshold, the system can proactively reduce the workload of the accessory and the overall heat generation of the system when the accessory temperature exceeds the limit, allowing the accessory temperature to drop back to a safe range. This avoids the risk of hardware damage caused by continuous overheating of the accessory, ensuring the continuity of the recording process and the safety of the equipment.

[0151] Step S73: When the battery level is less than the sixth threshold, switch the camera in active recording state to standby state and switch the camera in auxiliary recording state to active recording state.

[0152] After acquiring the battery level of the magnetic accessory in each detection cycle, the electronic device compares this battery level with a sixth threshold. For example, the sixth threshold can be set to 5%. When the battery level drops below 20%, the electronic device displays a low battery warning on the user interface, alerting the user to the accessory's battery status. When the battery level drops below 5%, it indicates that the accessory's battery is about to run out and can no longer support its corresponding camera as the main camera. The electronic device triggers a degraded recording protection mechanism: switching the camera in active recording mode to standby mode, and simultaneously switching the camera in auxiliary recording mode to active recording mode.

[0153] By switching the camera in active recording mode to standby mode and the camera in auxiliary recording mode to active recording mode when the battery level is below the sixth threshold, the electronic device can automatically and seamlessly switch the main camera role when the accessory battery is about to run out.

[0154] Furthermore, the switching of working states is performed via hot-switching, with the switching process taking less than 300 milliseconds and not interrupting the writing of the current recording file. During hot-switching, the electronic device performs a lightweight bandwidth check on the newly generated sequence. If the total bandwidth requirement of the new sequence exceeds 90% of the electronic device's maximum bandwidth, the priority is downgraded in the following order: auxiliary camera resolution downgraded by one level, auxiliary camera recording turned off and only preview retained, and only main camera recording retained, until the bandwidth constraint is met. The downgrade process is also performed via hot-switching, without interrupting the writing of the current recording file. Hot-switching ensures that the switching of roles does not interrupt the writing of the current recording file, avoiding recording interruptions and file corruption caused by accessory power failure. Thus, the smooth migration of shooting tasks is completed before the accessory power is exhausted, ensuring the continuity of recording.

[0155] Step S74: If the sliding average of the image quality score is less than the seventh threshold, perform a focus calibration operation on the camera in active recording state. If the sliding average of the image quality score is still less than the seventh threshold after calibration, if there is a camera in auxiliary recording state, switch the camera in active recording state to standby state and switch the camera in auxiliary recording state to active recording state, and output a prompt message indicating that the optical path of the magnetic accessory is blocked; if there is no camera in auxiliary recording state, switch the camera in active recording state to standby state and output a prompt message.

[0156] Specifically, after acquiring an image quality score in each detection cycle, the electronic device calculates a moving average of the image quality scores over the most recent five sampling cycles, including the current cycle, and compares this moving average with a seventh threshold. If the moving average is less than the seventh threshold, for example, 40, it indicates a continuous decline in the main camera's image quality, possibly due to accessory lens contamination, focus shift, or obstruction of the optical path. The electronic device first performs an autofocus calibration operation on the camera in active recording mode, attempting to restore image quality by recalculating the focus position. The seventh threshold can be set as needed.

[0157] If, after focus calibration, the moving average image quality score for one or more subsequent sampling periods recovers to above the seventh threshold, normal recording continues without further processing. If the moving average image quality score remains below the seventh threshold after calibration, it indicates that the image quality issue cannot be resolved through focus calibration, possibly due to lens physical contamination or obstruction of the optical path. In this case, the electronic device triggers a degraded recording process: if a camera is in auxiliary recording mode, the camera in active recording mode is switched to standby mode, and the camera in auxiliary recording mode is switched to active recording mode; if no camera is in auxiliary recording mode, the camera in active recording mode is switched to standby mode. Simultaneously, the electronic device displays a "Magnetic accessory optical path obstructed" message on the user interface, informing the user that there is a problem with the accessory's optical path.

[0158] By performing focus calibration on the camera in active recording mode when the sliding average image quality score is below the seventh threshold, and then performing a downgrade switch and outputting a prompt message if the sliding average image quality score remains below the seventh threshold after calibration, the electronic device can automatically diagnose the cause of the image quality degradation and attempt to repair it. When the repair fails, the electronic device automatically switches the shooting task from the camera corresponding to the faulty accessory to the built-in camera, while prompting the user to check the accessory's status on the user interface. This avoids continuous low-quality recording caused by obstructed optical paths in accessories, ensures the usability of the final captured footage, and allows the user to understand the device status in a timely manner and take appropriate measures through prompt messages.

[0159] It should be noted that the shooting control method provided in this application embodiment can be executed by a shooting control device. This application embodiment uses the shooting control device executing the shooting control method as an example to illustrate the shooting control device provided in this application embodiment. This device is applied to an electronic device, which is equipped with at least one camera, and the electronic device is communicatively connected to a magnetic accessory via a magnetic interface.

[0160] like Figure 4As shown, the shooting control device 400 in this embodiment includes: an acquisition unit 401, used to acquire attribute information of the magnetic accessory; a determination unit 402, used to determine a first shooting intention based on the attribute information; a generation unit 403, used to generate first shooting control information based on the first shooting intention, the first shooting control information including the working status and shooting parameters of the at least one camera; and a control unit, used to control the at least one camera to perform a shooting task based on the first shooting control information.

[0161] In some optional implementations of this embodiment, the acquisition unit 401 is further configured to: send a request frame to the magnetic accessory when a change in the level state of the magnetic interface is detected; receive a response frame from the magnetic accessory in response to the request frame; verify the integrity of the response frame; and extract the attribute information from the response frame if the verification passes.

[0162] In some optional implementations of this embodiment, the attribute information includes accessory type; the determining unit 402 is further configured to: query a mapping relationship table for candidate shooting intentions matching the accessory type, the mapping relationship table including the correspondence between accessory type and shooting intention and the weight corresponding to each shooting intention; when there is only one candidate shooting intention, determine the candidate shooting intention as the first shooting intention; when there are at least two candidate shooting intentions, and the weight difference between the candidate shooting intention with the highest weight and the candidate shooting intention with the second highest weight is greater than or equal to a first threshold, determine the candidate shooting intention with the highest weight as the first shooting intention.

[0163] In some optional implementations of this embodiment, the determining unit 402 is further configured to: when there are at least two candidate shooting intentions and the weight difference between the candidate shooting intention with the highest weight and the candidate shooting intention with the second highest weight is less than the first threshold, query the compatibility degree between the candidate shooting intention with the highest weight and the candidate shooting intention with the second highest weight from the intention compatibility matrix, wherein the intention compatibility matrix is ​​used to indicate the compatibility degree between different shooting intentions; when the compatibility degree is greater than or equal to the second threshold, determine the candidate shooting intention with the highest weight and the candidate shooting intention with the second highest weight together as the first shooting intention; when the compatibility degree is less than the second threshold, select one of the candidate shooting intention with the highest weight and the candidate shooting intention with the second highest weight as the first shooting intention.

[0164] In some optional implementations of this embodiment, the working state includes at least one of an active recording state, an auxiliary recording state, and a standby state; the generation unit 403 is further configured to: acquire an arrangement template associated with the first shooting intention and hardware information of the at least one camera, the arrangement template including hardware conditions that cameras in different working states should meet; match the hardware information with the hardware conditions, and determine the working state of each camera in the at least one camera based on the matching result; determine the shooting parameters of each camera based on the working state of each camera in the at least one camera; wherein, the shooting parameters of the camera in the active recording state include a first resolution, a first frame rate, and a first encoding format; the shooting parameters of the camera in the auxiliary recording state include a second resolution, the first frame rate, and a second encoding format, the second resolution being smaller than the first resolution; the shooting parameters of the camera in the standby state indicate that recording is not started and the camera remains powered on.

[0165] In some optional implementations of this embodiment, the control unit 404 is further configured to: take the currently executed recording task as the first recording task, stop executing the first recording task, and store the second shooting control information used to execute the first recording task; control the at least one camera to execute the second recording task according to the first shooting control information; when a change in the level state of the magnetic interface is detected, stop executing the second recording task and resume the first recording task according to the second shooting control information.

[0166] In some optional implementations of this embodiment, the attribute information includes a manufacturer identifier; the device further includes a verification unit, configured to: send a challenge code to the magnetic accessory; receive signature data returned by the magnetic accessory; obtain a corresponding verification key based on the manufacturer identifier, and use the verification key to verify the signature data; and, in the event of verification failure, control the at least one camera to perform a shooting task according to restricted first shooting control information, wherein the restricted first shooting control information includes a resolution upper limit and disabled function information.

[0167] In some optional implementations of this embodiment, the attribute information includes power consumption parameters; the device further includes a first processing unit, configured to: reduce the resolution of the camera in active recording state when the power consumption parameter is greater than a third threshold; replace the encoding format not supported by the electronic device in the shooting parameters with the encoding format supported by the electronic device; determine the total bandwidth requirement of the camera in active recording state and auxiliary recording state, and reduce the resolution of the camera in auxiliary recording state when the total bandwidth requirement is greater than a fourth threshold.

[0168] In some optional implementations of this embodiment, the device further includes a second processing unit, configured to: periodically acquire status data during the process of controlling the at least one camera to perform a shooting task based on the first shooting control information, the status data including at least one of the following: the temperature of the magnetic accessory, the battery level of the magnetic accessory, and an image quality score; when the temperature is greater than a fifth threshold, send a power reduction command to the magnetic accessory and reduce the frame rate of the camera in active recording mode; when the battery level is less than a sixth threshold, switch the camera in active recording mode to standby mode and switch the camera in auxiliary recording mode to standby mode. Switch to active recording mode; if the sliding average of the image quality score is less than the seventh threshold, perform a focus calibration operation on the camera in active recording mode. If the sliding average of the image quality score is still lower than the seventh threshold after calibration, if there is a camera in auxiliary recording mode, switch the camera in active recording mode to standby mode and switch the camera in auxiliary recording mode to active recording mode, and output a prompt message indicating that the optical path of the magnetic accessory is blocked; if there is no camera in auxiliary recording mode, switch the camera in active recording mode to standby mode and output the prompt message.

[0169] The device provided in the above embodiments of this application can automatically complete the entire process from intent recognition to parameter configuration to shooting execution after the magnetic accessory is connected to the electronic device, without requiring the user to manually enter the settings menu to configure the camera parameters one by one, so that the electronic device can enter the shooting state matching the magnetic accessory in a timely manner, thereby improving shooting efficiency.

[0170] The shooting control device in this application embodiment can be an electronic device or a component of an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, handheld shooting device, aircraft, vehicle-mounted electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. The embodiments of this application do not specifically limit the device.

[0171] The shooting control device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.

[0172] The shooting control device provided in this application embodiment can achieve... Figure 1 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0173] Optionally, such as Figure 5 As shown, this application embodiment also provides an electronic device 500, including a processor 501 and a memory 502. The memory 502 stores a program or instructions that can run on the processor 501. When the program or instructions are executed by the processor 501, they implement the various steps of the above-described shooting control method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0174] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0175] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application. The electronic device 600 includes, but is not limited to, components such as: radio frequency unit 601, network module 602, audio output unit 603, input unit 604, sensor 605, display unit 606, user input unit 607, interface unit 608, memory 609, and processor 610.

[0176] Those skilled in the art will understand that the electronic device 600 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 610 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 6 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here. The processor 610 is configured to acquire attribute information of the magnetic accessory; determine a first shooting intention based on the attribute information; generate first shooting control information based on the first shooting intention, the first shooting control information including the working status and shooting parameters of the at least one camera; and control unit is configured to control the at least one camera to perform a shooting task based on the first shooting control information.

[0177] Therefore, after the magnetic accessory is connected to the electronic device, the entire process from intent recognition to parameter configuration to shooting execution can be completed automatically, without the need for the user to manually enter the settings menu to configure the camera parameters one by one. This allows the electronic device to enter the shooting state that matches the magnetic accessory in a timely manner, thus improving shooting efficiency.

[0178] In some optional implementations of this embodiment, the processor 610 is further configured to send a request frame to the magnetic accessory when a change in the level state of the magnetic interface is detected; receive a response frame from the magnetic accessory in response to the request frame; verify the integrity of the response frame; and extract the attribute information from the response frame if the verification passes.

[0179] In some optional implementations of this embodiment, the attribute information includes accessory type; the processor 610 is further configured to query a mapping table for candidate shooting intentions matching the accessory type, the mapping table including the correspondence between accessory type and shooting intention and the weight corresponding to each shooting intention; when there is only one candidate shooting intention, the candidate shooting intention is determined as the first shooting intention; when there are at least two candidate shooting intentions, and the weight difference between the candidate shooting intention with the highest weight and the candidate shooting intention with the second highest weight is greater than or equal to a first threshold, the candidate shooting intention with the highest weight is determined as the first shooting intention.

[0180] In some optional implementations of this embodiment, the processor 610 is further configured to: query the compatibility degree between the highest-weighted candidate shooting intention and the second-highest-weighted candidate shooting intention from the intention compatibility matrix when there are at least two candidate shooting intentions and the weight difference between the highest-weighted candidate shooting intention and the second-highest-weighted candidate shooting intention is less than the first threshold; the intention compatibility matrix is ​​used to indicate the compatibility degree between different shooting intentions; when the compatibility degree is greater than or equal to the second threshold, determine the highest-weighted candidate shooting intention and the second-highest-weighted candidate shooting intention together as the first shooting intention; when the compatibility degree is less than the second threshold, select one of the highest-weighted candidate shooting intention and the second-highest-weighted candidate shooting intention as the first shooting intention.

[0181] In some optional implementations of this embodiment, the working state includes at least one of an active recording state, an auxiliary recording state, and a standby state; the processor 610 is further configured to acquire an arrangement template associated with the first shooting intention and hardware information of the at least one camera, the arrangement template including hardware conditions that cameras in different working states should meet; match the hardware information with the hardware conditions, and determine the working state of each camera in the at least one camera based on the matching result; determine the shooting parameters of each camera based on the working state of each camera in the at least one camera; wherein, the shooting parameters of the camera in the active recording state include a first resolution, a first frame rate, and a first encoding format; the shooting parameters of the camera in the auxiliary recording state include a second resolution, the first frame rate, and a second encoding format, the second resolution being smaller than the first resolution; the shooting parameters of the camera in the standby state indicate that recording is not started and the camera remains powered on.

[0182] In some optional implementations of this embodiment, the processor 610 is further configured to take the currently executing recording task as the first recording task, stop executing the first recording task, and store the second shooting control information used to execute the first recording task; control the at least one camera to execute the second recording task according to the first shooting control information; when a change in the level state of the magnetic interface is detected, stop executing the second recording task and resume the first recording task according to the second shooting control information.

[0183] In some optional implementations of this embodiment, the attribute information includes a manufacturer identifier; the processor 610 is further configured to send a challenge code to the magnetic accessory; receive signature data returned by the magnetic accessory; obtain a corresponding verification key based on the manufacturer identifier, and use the verification key to verify the signature data; in the event of verification failure, control the at least one camera to perform a shooting task according to restricted first shooting control information, the restricted first shooting control information including a resolution upper limit and disabled function information.

[0184] In some optional implementations of this embodiment, the attribute information includes power consumption parameters; the processor 610 is further configured to reduce the resolution of the camera in active recording state when the power consumption parameters are greater than a third threshold; replace the encoding format not supported by the electronic device in the shooting parameters with the encoding format supported by the electronic device; determine the total bandwidth requirement of the camera in active recording state and auxiliary recording state, and reduce the resolution of the camera in auxiliary recording state when the total bandwidth requirement is greater than a fourth threshold.

[0185] In some optional implementations of this embodiment, the processor 610 is further configured to periodically acquire status data during the process of controlling the at least one camera to perform a shooting task based on the first shooting control information. The status data includes at least one of the following: the temperature of the magnetic accessory, the battery level of the magnetic accessory, and the image quality score; when the temperature is greater than a fifth threshold, sending a power reduction command to the magnetic accessory and reducing the frame rate of the camera in active recording state; when the battery level is less than a sixth threshold, switching the camera in active recording state to standby state and switching the camera in auxiliary recording state to active recording state. In active recording mode, if the sliding average of the image quality score is less than the seventh threshold, a focus calibration operation is performed on the camera in active recording mode. If the sliding average of the image quality score is still lower than the seventh threshold after calibration, if there is a camera in auxiliary recording mode, the camera in active recording mode is switched to standby mode and the camera in auxiliary recording mode is switched to active recording mode, and a prompt message indicating that the optical path of the magnetic accessory is blocked is output; if there is no camera in auxiliary recording mode, the camera in active recording mode is switched to standby mode and the prompt message is output.

[0186] It should be understood that, in this embodiment, the input unit 604 may include a graphics processing unit (GPU) 6041 and a microphone 6042. The GPU 6041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 606 may include a display panel 6061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 607 includes at least one of a touch panel 6071 and other input devices 6072. The touch panel 6071 is also called a touch screen. The touch panel 6071 may include a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.

[0187] The memory 609 can be used to store software programs and various data. The memory 609 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 609 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 609 in this embodiment includes, but is not limited to, these and any other suitable types of memory.

[0188] Processor 610 may include one or more processing units; optionally, processor 610 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 610.

[0189] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described shooting control method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0190] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0191] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described shooting control method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0192] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0193] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the shooting control method embodiment described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0194] 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. Without further limitations, 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. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0195] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0196] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A shooting control method, characterized in that, Performed by an electronic device equipped with at least one camera, the electronic device being communicatively connected to a magnetic accessory via a magnetic interface; the method includes: Obtain the attribute information of the magnetic accessory; Based on the attribute information, the first shooting intention is determined; Based on the first shooting intention, first shooting control information is generated, which includes the working status and shooting parameters of the at least one camera; Based on the first shooting control information, control at least one camera to perform shooting tasks.

2. The method according to claim 1, characterized in that, The step of obtaining the attribute information of the magnetic accessory includes: When a change in the level state of the magnetic interface is detected, a request frame is sent to the magnetic accessory; Receive the response frame from the magnetic accessory in response to the request frame; Verify the integrity of the response frame; If the verification passes, the attribute information is extracted from the response frame.

3. The method according to claim 1, characterized in that, The attribute information includes accessory type; determining the first shooting intention based on the attribute information includes: The mapping relationship table is used to query the candidate shooting intentions that match the accessory type. The mapping relationship table includes the correspondence between accessory types and shooting intentions and the weight of each shooting intention. If there is only one candidate shooting intention, then the candidate shooting intention is determined as the first shooting intention; If there are at least two candidate shooting intentions, and the weight difference between the candidate shooting intention with the highest weight and the candidate shooting intention with the second highest weight is greater than or equal to a first threshold, then the candidate shooting intention with the highest weight is determined as the first shooting intention.

4. The method according to claim 1, characterized in that, The working state includes at least one of active recording state, assisted recording state, and standby state; the generation of first shooting control information based on the first shooting intention includes: Obtain a staging template associated with the first shooting intention and hardware information of the at least one camera, wherein the staging template includes hardware conditions that cameras in different working states should meet. The hardware information is matched with the hardware conditions, and the working status of each camera in the at least one camera is determined based on the matching result. Based on the working status of each of the at least one camera, the shooting parameters of that camera are determined; The shooting parameters of the camera in the active recording state include a first resolution, a first frame rate, and a first encoding format; the shooting parameters of the camera in the auxiliary recording state include a second resolution, the first frame rate, and a second encoding format, wherein the second resolution is smaller than the first resolution; and the shooting parameters of the camera in the standby state indicate that recording is not started and the camera remains powered on.

5. The method according to claim 1, characterized in that, The step of controlling at least one camera to perform a shooting task based on the first shooting control information includes: The currently executing recording task is designated as the first recording task. The execution of the first recording task is stopped, and the second shooting control information used to execute the first recording task is stored. Control the at least one camera to perform a second recording task according to the first shooting control information; When a change in the level state of the magnetic interface is detected, the second recording task is stopped, and the first recording task is resumed according to the second shooting control information.

6. A shooting control device, characterized in that, Applied to an electronic device, the electronic device is equipped with at least one camera, and the electronic device is communicatively connected to a magnetic accessory via a magnetic interface; the device includes: The acquisition unit is used to acquire the attribute information of the magnetic accessory; The determining unit is used to determine a first shooting intention based on the attribute information; The generation unit is configured to generate first shooting control information based on the first shooting intention, wherein the first shooting control information includes the working status and shooting parameters of the at least one camera; A control unit is configured to control at least one camera to perform a shooting task based on the first shooting control information.

7. The apparatus according to claim 6, characterized in that, The acquisition unit is further configured to: When a change in the level state of the magnetic interface is detected, a request frame is sent to the magnetic accessory; Receive the response frame from the magnetic accessory in response to the request frame; Verify the integrity of the response frame; If the verification passes, the attribute information is extracted from the response frame.

8. The apparatus according to claim 6, characterized in that, The attribute information includes the accessory type; the determining unit is further used for: The mapping relationship table is used to query the candidate shooting intentions that match the accessory type. The mapping relationship table includes the correspondence between accessory types and shooting intentions and the weight of each shooting intention. If there is only one candidate shooting intention, then the candidate shooting intention is determined as the first shooting intention; If there are at least two candidate shooting intentions, and the weight difference between the candidate shooting intention with the highest weight and the candidate shooting intention with the second highest weight is greater than or equal to a first threshold, then the candidate shooting intention with the highest weight is determined as the first shooting intention.

9. The apparatus according to claim 6, characterized in that, The working state includes at least one of active recording state, assisted recording state, and standby state; the generation unit is used for: Obtain a staging template associated with the first shooting intention and hardware information of the at least one camera, wherein the staging template includes hardware conditions that cameras in different working states should meet. The hardware information is matched with the hardware conditions, and the working status of each camera in the at least one camera is determined based on the matching result. Based on the working status of each of the at least one camera, the shooting parameters of that camera are determined; The shooting parameters of the camera in the active recording state include a first resolution, a first frame rate, and a first encoding format; the shooting parameters of the camera in the assisted recording state include a second resolution, the first frame rate, and a second encoding format, wherein the second resolution is smaller than the first resolution. The camera in the standby state has shooting parameters indicating that recording is not started and that it remains powered on.

10. The apparatus according to claim 6, characterized in that, The control unit is used for: The currently executing recording task is designated as the first recording task. The execution of the first recording task is stopped, and the second shooting control information used to execute the first recording task is stored. Control the at least one camera to perform a second recording task according to the first shooting control information; When a change in the level state of the magnetic interface is detected, the second recording task is stopped, and the first recording task is resumed according to the second shooting control information.