Data conversion method, data conversion device, and computer storage medium
Patent Information
- Application Number
- CN202610603923.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-30
- Publication Date
- 2026-08-18
AI Technical Summary
[0004]这种一对一的适配模式,由于各厂商的协议均为定制化设计,当存在多个厂商的适配需求时,需针对每两种厂商的协议组合分别开展适配开发,即每实现一组不同厂商镜头与机身的适配,都需要研发人员重新开展完整的协议逆向分析、信号解码、兼容性调试及适配软件开发工作,整个开发过程需投入大量的人力、物力及时间成本,研发周期普遍较长,难以快速响应市场上多样化的跨厂商适配需求,均需重新启动全套逆向开发流程,无法实现适配能力的快速扩展
[0016] Compared with existing technologies, the beneficial effects of this application are as follows: by introducing a preset protocol independent of each manufacturer's proprietary protocol, the one-to-one adaptation and conversion of two manufacturer protocols in the existing technology (direct conversion from the first protocol to the target protocol) is decomposed into two conversion stages: "from the first protocol to the preset protocol" and "from the preset protocol to the target protocol". There is no need to develop conversion rules separately for each pair of protocols. Only conversion rules from each manufacturer's protocol to the preset protocol need to be developed, which greatly reduces the number of times conversion rules are developed, reduces manpower, material resources and time costs, shortens the R&D cycle, and can quickly respond to the diverse cross-manufacturer adaptation needs in the market, breaking the limitations of the existing one-to-one adaptation model.
Smart Images

Figure CN122601769A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent robots, and in particular to a data conversion method, a data conversion device, and a computer storage medium. Background Technology
[0002] In the field of photography equipment, to consolidate their market competitiveness and build their own product ecosystems, major manufacturers have adopted customized hardware interface designs and proprietary communication protocol systems, forming significant industry protocol barriers. This results in core devices from different manufacturers being unable to achieve direct compatibility. Taking the compatibility of camera lenses and bodies as an example, major camera manufacturers each have their own proprietary lens mount systems. Just as plugs and sockets from different brands cannot be directly matched, this means that a lens from one manufacturer cannot be directly screwed onto a camera body from another manufacturer.
[0003] To address the aforementioned cross-vendor compatibility challenges, third-party adapters are used to enable connection and compatibility between lenses and camera bodies from different manufacturers. Most existing adapters employ a direct reverse adaptation solution targeting two specific manufacturers' protocols. This involves performing one-to-one reverse analysis, signal conversion, and adaptation development for both a lens protocol from one manufacturer and a camera body protocol from another, thereby achieving basic compatibility between the two specific devices.
[0004] This one-to-one adaptation model, because each manufacturer's protocol is a customized design, requires adaptation development for each combination of protocols when there are multiple manufacturers' adaptation needs. That is, to achieve adaptation for each set of lenses and bodies from different manufacturers, the R&D personnel need to carry out a complete reverse engineering of the protocol, signal decoding, compatibility debugging and adaptation software development. The entire development process requires a lot of manpower, material resources and time costs, and the R&D cycle is generally long. It is difficult to quickly respond to the diverse cross-manufacturer adaptation needs in the market, and the entire reverse development process needs to be restarted. It is impossible to achieve rapid expansion of adaptation capabilities. Summary of the Invention
[0005] To address the aforementioned technical problems, this application provides a data conversion method, a data conversion device, and a computer storage medium.
[0006] To address the aforementioned technical problems, this application provides a data conversion method, comprising: applying to a conversion module, the conversion module being communicatively connected to at least two devices; the data conversion method comprising: acquiring an initial data signal sent to the conversion module by a first device communicatively connected to the conversion module; converting the initial data signal into a first data signal based on a first conversion rule, wherein the first data signal follows a preset protocol and the initial data signal follows a first protocol; converting the first data signal into a target data signal based on a second conversion rule, wherein the target data signal follows a target protocol; and transmitting the target data signal to a target device communicatively connected to the conversion module.
[0007] The method further includes: in response to an extension instruction, obtaining a third conversion rule, wherein the extension instruction is used to indicate the device protocol type that the conversion module can adapt to, and the third conversion rule is used for mutual conversion between data following the extension protocol and data following the preset protocol; and storing the third conversion rule in the conversion module.
[0008] The method further includes, after acquiring the initial data signal sent to the conversion module by the first device connected to the conversion module, determining the signal type of the initial data signal; acquiring the device type of other devices that are communicatively connected to the conversion module besides the first device; and selecting the target device from the other devices based on the signal type and the device type.
[0009] The method further includes, after acquiring the initial data signal sent to the conversion module by the first device that is communicatively connected to the conversion module, determining whether the first protocol followed by the first device and the target protocol followed by the target device are the same; and when the first protocol and the target protocol are different, acquiring the first conversion rule and the second conversion rule stored in the conversion module, so as to perform protocol conversion on the initial data signal through the first conversion rule and the second conversion rule.
[0010] The step of determining whether the first protocol followed by the first device and the target protocol followed by the target device are the same includes: obtaining the first device identifier of the first device and the target device identifier of the target device; determining the first manufacturer and the first device model corresponding to the first device based on the first device identifier; determining the target manufacturer and the target device model corresponding to the first device based on the target device identifier; and determining whether the first protocol followed by the first device and the target protocol followed by the target device are the same based on the first manufacturer, the first device model, the target manufacturer, and the target device model.
[0011] The method further includes: transmitting the initial data signal to the target device when the first protocol and the target protocol are the same.
[0012] The method further includes, after acquiring the initial data signal sent to the conversion module by the first device connected to the conversion module, the method further includes: determining whether the initial data signal is recorded in a preset signal table, wherein the preset signal table records the mapping relationship between at least a portion of signals following a first protocol and at least a portion of signals following a target protocol; if yes, determining the target data signal based on the preset signal table; if no, performing the operation of converting the initial data signal into the first data signal.
[0013] The method further includes, after acquiring the initial data signal sent to the conversion module by the first device connected to the conversion module, determining whether the conversion module stores a target conversion rule corresponding to the first protocol followed by the first device and the target device protocol followed by the target device; if yes, converting the initial data signal into the target data signal based on the target conversion rule; if no, performing the operation of converting the initial data signal into the first data signal.
[0014] To address the aforementioned technical problems, this application also provides a data conversion device, which includes a memory and a processor coupled to the memory; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the data conversion method described above.
[0015] To address the aforementioned technical problems, this application also provides a computer storage medium storing a computer program, which, when executed by a processor, implements the steps in the data conversion method described above.
[0016] Compared with existing technologies, the beneficial effects of this application are as follows: by introducing a preset protocol independent of each manufacturer's proprietary protocol, the one-to-one adaptation and conversion of two manufacturer protocols in the existing technology (direct conversion from the first protocol to the target protocol) is decomposed into two conversion stages: "from the first protocol to the preset protocol" and "from the preset protocol to the target protocol". There is no need to develop conversion rules separately for each pair of protocols. Only conversion rules from each manufacturer's protocol to the preset protocol need to be developed, which greatly reduces the number of times conversion rules are developed, reduces manpower, material resources and time costs, shortens the R&D cycle, and can quickly respond to the diverse cross-manufacturer adaptation needs in the market, breaking the limitations of the existing one-to-one adaptation model. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein: Figure 1 This is a flowchart illustrating an embodiment of the data conversion method provided in this application; Figure 2 This is a schematic diagram of the initial data signal conversion provided in this application; Figure 3 This is a schematic diagram of the signal processing flow of the conversion module provided in this application; Figure 4 This is a schematic diagram of the protocol conversion process provided in this application. Figure 1 ; Figure 5 This is a schematic diagram of the protocol conversion process provided in this application. Figure 2 ; Figure 6 This is a schematic diagram of the structure of an embodiment of the data conversion device provided in this application; Figure 7 This is a schematic diagram of the structure of an embodiment of the computer storage medium provided in this application. Detailed Implementation
[0018] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application will be described in detail below with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, it should be noted that, for ease of description, only the parts relevant to this application are shown in the accompanying drawings, not all structures. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0019] The terms “first,” “second,” etc. (if applicable) in this application are used to distinguish different objects, not to describe a particular order. Furthermore, the terms “comprising” and “featured,” and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.
[0020] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0021] The data conversion method of this application is applied to a data conversion device, which can be a server, a terminal device, or a system in which the server and the terminal device cooperate with each other. Accordingly, the various parts of the data conversion device, such as each unit, subunit, module, and submodule, can all be set in the server, all in the terminal device, or separately in the server and the terminal device.
[0022] Furthermore, the aforementioned server can be either hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software programs or software modules, such as software or software modules used to provide distributed server functionality, or as a single software program or software module; no specific limitations are made here.
[0023] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the data conversion method provided in this application.
[0024] In this embodiment, the data conversion method is applied to the conversion module.
[0025] The conversion module can be physical hardware, such as an adapter chip, or it can be virtual software that runs as a program in electronic devices such as mobile phones, computers, and tablets.
[0026] Devices from different manufacturers / brands may not be able to communicate directly due to protocol barriers. For example, manufacturer A follows protocol 1, while manufacturer B follows protocol 2. Manufacturer A's camera body only recognizes the instruction set that follows protocol 1. When manufacturer A's camera body receives an unfamiliar instruction stream from manufacturer B's lens, it will directly determine it as illegal data and discard it, thus being unable to control the aperture opening and closing.
[0027] In addition, different devices may not be able to communicate directly due to differences in physical interfaces. For example, if the same manufacturer upgrades its hardware, the new and old devices may not be compatible and thus cannot communicate directly because the upgraded hardware interfaces cannot be adapted to achieve physical connection.
[0028] The conversion module communicates with devices that cannot communicate directly, enabling different devices to communicate indirectly through the conversion module. For example, the conversion module breaks down protocol barriers between manufacturers or overcomes the problem of different physical interfaces through protocol conversion.
[0029] The conversion module communicates with at least two devices and is responsible for data transmission between different devices. In the field of camera equipment, the devices that communicate with the conversion module are cameras, lenses, lighting equipment, etc.
[0030] In this application, the communication connection is a wireless connection, including Wi-Fi connection and Bluetooth connection.
[0031] Specifically, such as Figure 1 As shown, the specific steps are as follows: Step S11: Obtain the initial data signal sent to the conversion module by the first device that is communicatively connected to the conversion module.
[0032] In this embodiment of the application, any one of the multiple devices (at least two devices) that are communicatively connected to the conversion module first sends data to the conversion module, and the conversion module forwards the signal to the corresponding target device.
[0033] The data received by the conversion module from the communication-connected device is denoted as the initial data signal, and the device that sends the initial data signal is denoted as the first device. The first device is one of the multiple devices that are communication-connected to the conversion module.
[0034] Step S12: Convert the initial data signal into a first data signal based on the first conversion rule, wherein the first data signal follows a preset protocol and the initial data signal follows the first protocol; Step S13: Convert the first data signal into a target data signal based on the second conversion rule, wherein the target data signal follows the target protocol.
[0035] In this embodiment of the application, the initial data signal is sent to a target device, and both the first device and the target device are communicatively connected to the conversion module.
[0036] To overcome protocol barriers, the conversion module performs protocol conversion on the initial data signal before sending it to the target device. Please refer to [link / reference]. Figure 2 , Figure 2 This is a schematic diagram of the initial data signal conversion provided in this application, as shown below. Figure 2 As shown, the protocol conversion of the initial data signal is divided into two stages. The first stage converts the initial data signal into a first data signal that follows a preset protocol, and the second stage converts the first data signal into a target data signal that follows the target protocol.
[0037] The preset protocol is a universal intermediate protocol independent of all manufacturer-specific protocols. It does not depend on any manufacturer's protocol specifications and can adapt to the protocol conversion needs of all manufacturers. Regardless of the manufacturers of the first device and the target device, as long as the conversion module stores the first conversion rule (the corresponding conversion rule between the first protocol followed by the first device and the preset protocol) and the second conversion rule (the corresponding conversion rule between the target protocol followed by the target device and the preset protocol), the first device and the target device can be adapted.
[0038] The conversion process from the first protocol to the preset protocol includes parsing the initial data signal through the built-in first protocol parsing driver, extracting the core control instructions and data information, and then re-encapsulating the extracted information according to the preset private protocol specifications to generate intermediate data in the format of the preset protocol, namely the first data signal.
[0039] The conversion process from the preset protocol to the target protocol includes parsing the intermediate data in the format conforming to the preset protocol, i.e., the first data signal, extracting the core control instructions and data information, and then re-encapsulating the extracted information according to the preset private protocol specifications to generate the intermediate data in the format of the target protocol, i.e., the target data signal.
[0040] The default protocol uses a standardized data frame format, including a frame header identifier, device type field, command type field, data length field, core data area, checksum field, and frame tail identifier, ensuring the accuracy and integrity of data transmission. The default protocol's command set covers all scenarios of camera-lens communication needs, including core functions such as focus control, aperture adjustment, image stabilization control, exposure parameter transmission, and image data transmission.
[0041] Step S14: Transmit the target data signal to the target device that is communicatively connected to the conversion module.
[0042] In this embodiment, after the initial data signal is converted into a target data signal, the target data signal is transmitted to the target device through the communication channel between the conversion module and the target device. Upon receiving the target data signal, the target device can parse the signal because the protocol followed by the target data signal is compatible with the target device, thus enabling communication between the first device and the target device.
[0043] Through the above embodiments, by introducing a preset protocol independent of each manufacturer's proprietary protocol, the existing one-to-one adaptation and conversion of two manufacturer protocols (direct conversion from the first protocol to the target protocol) is decomposed into two conversion stages: "first protocol to preset protocol" and "preset protocol to target protocol". There is no need to develop conversion rules for each pair of protocols separately. Only conversion rules for each manufacturer's protocol to the preset protocol need to be developed, which greatly reduces the number of times conversion rules need to be developed, reduces manpower, material resources and time costs, shortens the R&D cycle, and can quickly respond to the diverse cross-manufacturer adaptation needs in the market, breaking the limitations of the existing one-to-one adaptation model.
[0044] Suppose there are 5 mainstream camera manufacturers in the market (denoted as Manufacturer A, Manufacturer B, Manufacturer C, Manufacturer D, and Manufacturer E respectively). Each manufacturer has its own lens protocol and body protocol. The conversion module needs to achieve cross-manufacturer adaptation of lenses and bodies between any two manufacturers (that is, lenses from any manufacturer can be adapted to bodies from any other manufacturer).
[0045] The current one-to-one adaptation model requires separate adaptation development for each pair of vendor protocol combinations, namely A-B, A-C, A-D, A-E, B-C, B-D, B-E, C-D, C-E, and D-E. Developers must perform complete protocol reverse engineering, signal decoding, compatibility debugging, and adaptation software development for each of the 10 protocol combinations. This means developing conversion rules for all 10 protocol combinations. Furthermore, adding a new vendor (vendor F) requires new conversion rules for the existing five vendors, necessitating five more complete reverse engineering processes, hindering rapid expansion of adaptation capabilities.
[0046] This application introduces a two-stage protocol conversion design using a pre-defined protocol. This eliminates the need for separate development for any two vendors' protocol combinations; only conversion rules between each vendor's protocol and the pre-defined intermediate protocol need to be developed. For the aforementioned five vendors, only five conversion rules between their proprietary protocols and the pre-defined intermediate protocol need to be developed (namely, Protocol A-pre-defined protocol, Protocol B-pre-defined protocol, Protocol C-pre-defined protocol, Protocol D-pre-defined protocol, and Protocol E-pre-defined protocol), achieving cross-vendor adaptation between any two vendors. This reduces the number of development sets from 10 in the existing model to 5, effectively halving the development effort.
[0047] In an optional embodiment, in response to an extension instruction, a third conversion rule is obtained, wherein the extension instruction is used to indicate the device protocol types that the conversion module can adapt to, and the third conversion rule is used for mutual conversion between data following the extension protocol and data following the preset protocol; the third conversion rule is stored in the conversion module.
[0048] In this application embodiment, the number of camera manufacturers and corresponding proprietary protocol types is constantly increasing. New manufacturers are continuously launching lenses, camera bodies and other devices with proprietary protocols, while existing manufacturers may also upgrade their own protocol versions.
[0049] To meet the growing demand for cross-vendor compatibility in the market and prevent the conversion module from being phased out due to its inability to adapt to devices that comply with new protocols, the types of device protocols that the conversion module can adapt to have been expanded. Specifically, this only requires adding and saving conversion rules between the extended protocol and the preset protocol in the conversion module to complete the expansion of the conversion module's adaptability.
[0050] There is no need to modify the core conversion logic of the conversion module, nor is there a need to develop new adaptation combinations for each of the extended protocol and all the original manufacturer protocols. The conversion module can be adapted to the extended protocol device simply by adding and saving the third conversion rule. This enables cross-vendor adaptation between the extended protocol device and all the original manufacturer devices of the conversion module, further reducing the number of times conversion rules need to be developed, reducing manpower, material resources and time costs, and shortening the R&D cycle.
[0051] In this embodiment of the application, devices that follow different protocols only need to be able to communicate with the conversion module, and the conversion module stores the conversion rules between the protocols followed by the devices and the preset protocols, so that the adaptation between devices that follow different protocols can be achieved.
[0052] In an optional embodiment, after acquiring the initial data signal sent to the conversion module by a first device connected to the conversion module, the method further includes: determining the signal type of the initial data signal; acquiring the device type of other devices that are communicatively connected to the conversion module besides the first device; and selecting the target device from the other devices based on the signal type and the device type.
[0053] In this embodiment, after receiving the initial data signal, it is necessary to determine the target of the initial data signal transmission. Taking a photographic device scenario as an example, the device type is divided into two types: lens and camera body. The conversion module parses the initial data signal, extracts core information such as the function identifier field and data command code in the signal, and then determines its specific signal type. When the first device is the camera body, the signal type of the initial data signal can be divided into focusing signal (used to control the action of the focusing mechanism inside the lens), aperture adjustment signal (used to control the opening and closing degree of the lens aperture blades, and adjust the amount of light and the depth of field), and shutter control signal (used to trigger the opening and closing of the optical shutter). When the first device is the lens, the signal type of the initial data signal can be divided into lens status feedback signal (used to provide feedback on the current focus position of the lens, focus completion status, and whether the focus travel is in place), aperture position feedback signal (used to provide feedback on the current actual opening and closing size of the aperture and the aperture adjustment status), etc.
[0054] The conversion module can communicate with at least two devices simultaneously. Other devices besides the first device may become the target of the initial data signal. The target device is determined based on the device type of the other devices and the device type of the initial data signal.
[0055] Taking the conversion module as an example where three devices are currently connected, namely device 1 (body, first device), device 2 (body), and device 3 (lens), the device types of the other devices (device 2 and device 3) obtained by the conversion module, excluding the first device, are body and lens, respectively. Since the signal type of the initial data signal is a focus signal, it can be determined that the device type of the initial data signal transmission target should be lens. Therefore, device 3, which has the device type of lens, is selected as the target device from among device 2 and device 3.
[0056] Please see Figure 3 , Figure 3 This is a schematic diagram of the signal processing flow of the conversion module provided in this application, as shown below. Figure 3 As shown, after receiving the initial data signal, the conversion module first determines whether the data protocols followed by the first device and the sending target (i.e., the target device) are the same. That is, it determines whether the first protocol followed by the first device and the target protocol followed by the target device are the same. If the first protocol and the target protocol are different, the module obtains the first conversion rule and the second conversion rule stored in the conversion module. Then, based on the first conversion rule, the initial data signal is converted into the first data signal, and based on the second conversion rule, the first data signal is converted into the target data signal. The target data signal is then transmitted to the target device that is communicatively connected to the conversion module. If the first protocol and the target protocol are the same, there is no need to perform protocol conversion on the initial data signal, and the initial data signal is directly transmitted to the target device.
[0057] Through the above embodiments, by first determining whether the data protocols followed by the first device and the target device are the same, and then determining whether to perform the corresponding processing, unnecessary protocol conversion is avoided. Especially when the manufacturer has upgraded the physical interface of the device, making it impossible to communicate directly with the old device through a physical connection, communication can be indirectly achieved by establishing communication connections with the conversion module respectively.
[0058] In this case, although the first device and the target device communicate indirectly using a conversion module because the physical interface of the devices has been upgraded, the protocol they follow is still the original protocol, that is, the first protocol and the target protocol are the same. At this time, there is no need to use a two-level conversion rule to convert step by step. The initial data signal can be directly transmitted to the target device, reducing the power consumption and computing overhead of the conversion module.
[0059] In an optional embodiment, determining whether the first protocol followed by the first device and the target protocol followed by the target device are the same includes: obtaining a first device identifier of the first device and a target device identifier of the target device; determining a first manufacturer and a first device model corresponding to the first device based on the first device identifier; determining a target manufacturer and a target device model corresponding to the first device based on the target device identifier; and determining whether the first protocol followed by the first device and the target protocol followed by the target device are the same based on the first manufacturer, the first device model, the target manufacturer, and the target device model.
[0060] In this embodiment, photographic equipment (body or lens) from different manufacturers and of different models typically employ proprietary communication protocols. While devices of the same manufacturer and model follow largely consistent data protocols, devices from different manufacturers or of different models often follow different data protocols. Therefore, by first obtaining the device identifiers of the first device and the target device, identifying their respective manufacturer and model information based on the device identifiers, and then accurately determining whether the two devices follow the same communication protocol based on the manufacturer and model information, a reliable basis for subsequent protocol conversion can be provided, ensuring the accuracy of protocol identification and the universality of adaptation.
[0061] Please see Figure 4 , Figure 4 This is a schematic diagram of the protocol conversion process provided in this application. Figure 1 ,like Figure 4As shown, after receiving the initial data signal, the conversion module first determines whether the initial data signal is recorded in a preset signal table, wherein the preset signal table records the mapping relationship between at least a portion of signals conforming to the first protocol and at least a portion of signals conforming to the target protocol. If yes, the target data signal is determined based on the preset signal table; and the target data signal is transmitted to the target device communicatively connected to the conversion module. If no, the initial data signal is converted into a first data signal, that is, the first conversion rule and the second conversion rule stored in the conversion module are obtained, the initial data signal is converted into a first data signal based on the first conversion rule, the first data signal is converted into a target data signal based on the second conversion rule, and the target data signal is transmitted to the target device communicatively connected to the conversion module.
[0062] In this embodiment of the application, by pre-establishing a preset signal table, commonly used signals with fixed meanings, simple formats, and no need for complex calculations between the first protocol and the target protocol are directly mapped and stored. During protocol conversion, it is first determined whether the initial data signal exists in the preset signal table. If it exists, the target data signal is obtained directly by looking up the table, which saves the multi-level format parsing and calculation conversion process and reduces the amount of calculation.
[0063] Please see Figure 5 , Figure 5 This is a schematic diagram of the protocol conversion process provided in this application. Figure 2 ,like Figure 5 As shown, after receiving the initial data signal, the conversion module first determines whether a target conversion rule is stored in the conversion module. The target conversion rule represents the conversion rule between the first protocol followed by the first device and the protocol followed by the target device. If yes, the initial data signal is converted into the target data signal based on the target conversion rule; the target data signal is then transmitted to the target device that is communicatively connected to the conversion module. If no, the initial data signal is converted into a first data signal, that is, the first conversion rule and the second conversion rule stored in the conversion module are obtained, the initial data signal is converted into a first data signal based on the first conversion rule, the first data signal is converted into a target data signal based on the second conversion rule, and the target data signal is transmitted to the target device that is communicatively connected to the conversion module.
[0064] In this embodiment of the application, since some protocols have similar structures and small differences in signal definitions, the conversion logic between these protocols is relatively simple. Therefore, the corresponding conversion rules can be pre-configured and stored in the conversion module to simplify the conversion process.
[0065] Therefore, when it is necessary to convert the initial data signal from the first protocol to the target protocol, if the conversion module stores the target conversion rules corresponding to the first protocol and the target protocol, the received initial data signal is directly converted into a target data signal that conforms to the target protocol based on the target conversion rules, and then the target data signal is transmitted to the target device that is communicatively connected to the conversion module to complete the data transmission.
[0066] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0067] To implement the above data conversion method, this application also proposes a data conversion device, please refer to the details below. Figure 6 , Figure 6 This is a schematic diagram of an embodiment of the data conversion device provided in this application.
[0068] The data conversion device 400 in this embodiment includes a processor 41, a memory 42, an input / output device 43, and a bus 44.
[0069] The processor 41, memory 42, and input / output device 43 are respectively connected to the bus 44. The memory 42 stores program data, and the processor 41 is used to execute the program data to implement the data conversion method described in the above embodiments.
[0070] In this embodiment, processor 41 can also be referred to as a CPU (Central Processing Unit). Processor 41 may be an integrated circuit chip with signal processing capabilities. Processor 41 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor, or processor 41 can be any conventional processor.
[0071] This application also provides a computer storage medium; please refer to the following: Figure 7 , Figure 7This is a schematic diagram of a computer storage medium according to an embodiment of the present application. The computer storage medium 600 stores a computer program 61, which, when executed by a processor, is used to implement the data conversion method of the above embodiment.
[0072] When the embodiments of this application are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0073] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A data conversion method, characterized in that, It is applied to a conversion module, which is communicatively connected to at least two devices; The data conversion method includes: Acquire the initial data signal sent to the conversion module by the first device that is communicatively connected to the conversion module; The initial data signal is converted into a first data signal based on the first conversion rule, wherein the first data signal follows a preset protocol and the initial data signal follows the first protocol; The first data signal is converted into a target data signal based on the second conversion rule, wherein the target data signal conforms to the target protocol; The target data signal is transmitted to the target device that is communicatively connected to the conversion module.
2. The data conversion method according to claim 1, characterized in that, The method further includes: In response to an extended instruction, a third conversion rule is obtained, wherein the extended instruction is used to indicate the device protocol types that the extended conversion module can adapt to, and the third conversion rule is used for mutual conversion between data that follows the extended protocol and data that follows the preset protocol; The third conversion rule is saved in the conversion module.
3. The data conversion method according to claim 1, characterized in that, After acquiring the initial data signal sent to the conversion module by the first device connected to the conversion module, the method further includes: Determine the signal type of the initial data signal; Obtain the device type of other devices that are communicatively connected to the conversion module, besides the first device; The target device is selected from the other devices based on the signal type and the device type.
4. The data conversion method according to claim 1, characterized in that, After acquiring the initial data signal sent to the conversion module by the first device communicatively connected to the conversion module, the method further includes: Determine whether the first protocol followed by the first device and the target protocol followed by the target device are the same; When the first protocol and the target protocol are different, the first conversion rule and the second conversion rule stored in the conversion module are obtained, so as to perform protocol conversion on the initial data signal through the first conversion rule and the second conversion rule.
5. The data conversion method according to claim 4, characterized in that, Determining whether the first protocol followed by the first device and the target protocol followed by the target device are the same includes: Obtain the first device identifier of the first device and the target device identifier of the target device; The first manufacturer and the first device model corresponding to the first device are determined based on the first device identifier; The target manufacturer and target device model corresponding to the first device are determined based on the target device identifier; Based on the first manufacturer, the first device model, the target manufacturer, and the target device model, determine whether the first protocol followed by the first device and the target protocol followed by the target device are the same.
6. The data conversion method according to claim 4, characterized in that, The method further includes: When the first protocol and the target protocol are the same, the initial data signal is transmitted to the target device.
7. The data conversion method according to claim 1, characterized in that, After acquiring the initial data signal sent to the conversion module by the first device connected to the conversion module, the method further includes: Determine whether the initial data signal is recorded in a preset signal table, wherein the preset signal table records the mapping relationship between at least a portion of signals that follow the first protocol and at least a portion of signals that follow the target protocol; If so, the target data signal is determined based on the preset signal table; If not, perform the operation of converting the initial data signal into the first data signal.
8. The data conversion method according to claim 1, characterized in that, After acquiring the initial data signal sent to the conversion module by the first device connected to the conversion module, the method further includes: Determine whether the conversion module stores a target conversion rule corresponding to the first protocol followed by the first device and the target device protocol followed by the target device; If so, the initial data signal is converted into the target data signal based on the target conversion rule; If not, perform the operation of converting the initial data signal into the first data signal.
9. A data conversion device, characterized in that, The data conversion device includes a memory and a processor, wherein the memory is coupled to the processor; The memory is used to store program data, and the processor is used to execute the program data to implement the data conversion method according to any one of claims 1 to 8.
10. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when executed by a processor, implements the steps of the data conversion method as described in any one of claims 1 to 8.