External equipment control method and device, electronic equipment and computer program product
By receiving and parsing data information between external devices and node devices, determining the data transmission path of the host to the external device, and sending control commands to it, the problem of difficulty in controlling external devices in different solutions is solved, and effective control of external devices is achieved.
Patent Information
- Application Number
- CN202510042958.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-05-30
AI Technical Summary
In the prior art, in different solutions, the same external devices have difficulty controlling the external devices due to their different locations.
By receiving the data information sent by the external device step by step through one or more node devices, obtaining the first address code of the external device carried in the data information and the second address code of the node device superimposed step by step during the transmission of the data information, determining the data transmission path of the host to the external device, and sending control commands to the external device based on the path.
No matter how the external device is connected, control commands can be sent to it through a determined data transmission path to achieve effective control of external devices, solving the problem of difficulty in controlling external devices in different solution combinations.
Smart Images

Figure CN120067030A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of vehicle-mounted devices, and particularly relates to a method and device for controlling external devices, an electronic device, and a computer program product. Background Art
[0002] In a set of vehicle-mounted devices, it usually consists of a host, multiple slaves, and various different external devices. The same external device can be connected to the host or any one of the slaves, mainly depending on different project requirements and different solution combinations. However, this connection characteristic of the external device is not conducive to the host or other upper-layer devices connected to the host to control the external device, making the difficulty of the host or other upper-layer devices connected to the host to control the external device increase significantly, and there is a technical problem of difficult control of the external device. Summary of the Invention
[0003] This application provides a method and device for controlling external devices, an electronic device, and a computer program product, which can solve the technical problem that in the existing solutions, due to the different positions of the same external device in different solution combinations, it is difficult for the host or other upper-layer devices connected to the host to control the external device.
[0004] In the first aspect of the embodiments of this application, a method for controlling an external device is provided. The external device is connected to a host through one or more node devices. The method for controlling the external device includes:
[0005] Receiving data information sent step by step by the external device through one or more node devices;
[0006] Obtaining a first address code of the external device carried in the data information and a second address code of each of the one or more node devices stacked step by step during the step-by-step transmission of the data information, and determining a data transmission path from the host to the external device based on the first address code and the second address code;
[0007] Sending a control command to the external device based on the data transmission path, where the control command is used to instruct the external device to perform a target processing task.
[0008] In the second aspect of the embodiments of this application, an external device control device is further provided. The external device is connected to a host through one or more node devices. The external device control device includes:
[0009] A receiving unit, configured to receive data information sent step by step by the external device through one or more node devices;
[0010] A determination unit, configured to obtain a first address code of the external device carried in the data information and a second address code of each of the one or more node devices that are successively superimposed during the successive transmission process of the data information, and determine a data transmission path from the host to the external device based on the first address code and the second address code;
[0011] A control unit, configured to send a control command to the external device based on the data transmission path, where the control command is used to instruct the external device to perform a target processing task.
[0012] A third aspect of the embodiments of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the external device control method described in the first aspect above are implemented.
[0013] A fourth aspect of the embodiments of the present application provides a computer program product. The computer program product stores a computer program, and when the computer program is executed by a processor, the steps of the external device control method described in the first aspect above are implemented.
[0014] In the embodiments of the present application, by receiving data information successively sent by the external device through one or more node devices, and obtaining a data transmission path from the host to the external device based on the first address code of the external device carried in the data information and the second address code of each of the one or more node devices that are successively superimposed during the successive transmission process of the data information, no matter how the external device is connected, a control command can be sent to the external device based on this data transmission path, thereby realizing the control of the external device, and solving the technical problem that it is difficult for the host or other upper-layer devices connected to the host to control the external device due to the different positions of the same external device in different solution combinations. Description of the Drawings
[0015] Figure 1 It is a first schematic diagram of the external device connection structure provided by the embodiments of the present application.
[0016] Figure 2 It is a second schematic diagram of the external device connection structure provided by the embodiments of the present application.
[0017] Figure 3 It is a first implementation flow diagram of the external device control method provided by the embodiments of the present application.
[0018] Figure 4 It is an implementation flow diagram of the address code allocation method provided by the embodiments of the present application.
[0019] Figure 5 This is the third schematic diagram of the external device connection structure provided by the embodiment of the present application.
[0020] Figure 6 This is the schematic diagram of the structure of the external device control device provided by the embodiment of the present application.
[0021] Figure 7 This is the schematic diagram of the structure of the electronic device provided by the embodiment of the present application. Detailed implementation manners
[0022] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0023] It should be understood that in the description of the specification and the appended claims of the present application, the term "including" indicates the presence of the described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations.
[0024] In addition, in the description of the specification and the appended claims of the present application, the terms "first", "second", etc. are only used for differential description and cannot be understood as indicating or implying relative importance.
[0025] The reference to "one embodiment" or "some embodiments" etc. in the description of the present application means that a specific feature, structure or characteristic described in combination with the embodiment is included in one or more embodiments of the present application. Thus, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments" etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
[0026] In a set of vehicle-mounted devices, it is usually composed of a main unit, multiple slave units and various different external devices. For the same external device, it can be connected to the main unit or any one of the slave units, mainly depending on different project requirements and different solution combinations.
[0027] For example, in Figure 1 the shown solution, external device A is connected to slave unit 3, while in Figure 2 the shown solution, the same external device A is directly connected to the main unit. In practical applications, these two different solution combinations may be due to different requirements of different customers.
[0028] For example, assume that the host has three functions a, b, and c, and the slave device 3 has three functions c, d, and e, and both functions c and d depend on the external device A. At this time, customer 1 needs five functions a, b, c, d, and e. In terms of the solution, it is more suitable for customer 1 to turn off the function c of the host and then connect the external device A to the slave device 3; while customer 2 may only need three functions a, b, and c. At this time, it is more suitable for customer 2 to remove the slave device 3 and directly connect the external device A to the host. For these two solutions, for the host, the position of the same external device A is not fixed, which causes many inconveniences in some business processes. For example, when it is necessary to remotely upgrade the external device A from the platform, it is somewhat difficult to locate the position of the external device A.
[0029] Currently, the commonly used method is to release different upgrade firmware for different solution combinations of the same external device and write the path hard in the code of different upgrade firmware. However, this method increases a great deal of workload for the subsequent version maintenance and test release of the software firmware. Therefore, a more convenient method for controlling external devices is needed.
[0030] Based on this, the embodiments of the present application provide an external device control method, device, electronic device, and computer program product, which can solve the technical problem that in the existing solutions, for the same external device in different solution combinations, it is difficult for the host or other upper-layer devices connected to the host to control the external device due to its different positions. The external device control method can be applied to the host or other upper-layer devices connected to the host, and the present application does not limit this.
[0031] As Figure 3 shown, it is a schematic diagram of the first implementation process of an external device control method provided by an embodiment of the present application. The external device control method can be implemented by the following steps 301 to 303.
[0032] Step 301: Receive the data information sent by the external device step by step through one or more node devices.
[0033] In the embodiments of the present application, the data information in step 301 above can be the version number information actively sent by the external device to the host, or any other type of data information, and the present application does not limit the type of the above data information.
[0034] Step 302: Obtain the first address code of the external device carried in the data information and the second address code of each of the one or more node devices stacked step by step during the step-by-step transmission of the data information, and determine the data transmission path from the host to the external device based on the first address code and the second address code.
[0035] In the embodiments of the present application, an external device can be directly connected to the host, or can be connected to the host through one or more node devices. When the external device is directly connected to the host, the host can directly obtain the data transmission path from the external device to the host. For example, the host can use the port number of the port connected to the external device as the data transmission path between the host and the external device. When the external device is connected to the host through one or more node devices, after receiving the data information sent step by step by the external device through one or more node devices, the first address code of the external device carried in the data information and the second address code of each of the one or more node devices superimposed step by step during the step-by-step transmission process can be obtained, and the data transmission path from the host to the external device can be determined based on the first address code and the second address code.
[0036] In an embodiment of the present application, the first address code of the external device and the second address code of each node device can be the address codes assigned by the address management module of the host.
[0037] In a practical application, after each node device and each external device are started, they can first determine whether they are configured with an address code. In the case of not being configured with an address code, they can apply to the address management module of the host for an address code, and save the address code after obtaining the address code.
[0038] Specifically, as Figure 4 shown, the host can allocate address codes to each node device and external device based on the following steps 401 to 402.
[0039] Step 401, receive the address acquisition requests broadcast by each of the one or more node devices and the external device.
[0040] Step 402, allocate corresponding second address codes to each of the one or more node devices based on the address acquisition requests, and allocate first address codes to the external devices.
[0041] In this embodiment, when the node device and the external device are started and find that they are not configured with an address code, they can broadcast an address acquisition request through the ports they set to apply for an address code, so that the host can allocate an address code after receiving the address acquisition request.
[0042] Specifically, during the application process of address coding for node devices and external devices, the node device or external device that first obtains the address coding from the address management module of the host is the node device or external device directly connected to the host. The main reason is that the node device or external device directly connected to the host receives the address coding assigned by the host first. Any other node device or external device that needs to obtain the address coding must receive the address coding assigned by the address management module of the host through the forwarding of the address coding by the node device or external device directly connected to the host.
[0043] After the node device or external device directly connected to the host obtains the address coding, the node device or external device directly connected to the address management module of the host can establish a stable communication connection with the host. Moreover, the node device or external device at the next level can apply for the address coding from the address management module of the host based on this stable communication connection, and so on. Each node device can obtain the corresponding second address coding allocated from the host and establish a stable communication connection with the node device at the previous level or the next level. Each external device can obtain the corresponding first address coding allocated from the host.
[0044] It should be noted that the above is only an example of the allocation method of the first address coding and the second address coding, and does not represent a limitation on the protection scope of this application. In other embodiments of this application, other methods can also be used for the allocation of the first address coding and the second address coding.
[0045] In order to improve the allocation efficiency of the first address coding, in an embodiment of this application, the first address coding of the external device can be the unique identification information of the external device, which is used to uniquely identify the external device. Moreover, the unique identification information can be the identification information assigned to the node device directly connected to the external device, or the identification information carried by the external device itself. For example, the physical address or device number of the external device, etc. This application does not limit this.
[0046] In this embodiment, by using the identification information that can be used to uniquely identify the external device and is carried by the external device itself, or the identification information assigned to the node device directly connected to the external device as the first address coding of the external device, it is not necessary for the host to allocate the address coding for the external device and each node device. Moreover, the external device and each node device do not need to broadcast multiple address acquisition requests. Therefore, the allocation efficiency of the first address coding is improved.
[0047] Similarly, to improve the allocation efficiency of the second address code, in an embodiment of the present application, the second address code of each of the above one or more node devices may be the unique identification information of each node device. For example, the physical address of the node device or the identification information carried by the node device itself such as the device number, or the identification information assigned by the upper-level node device directly connected to the node device, etc. The present application does not limit this.
[0048] In the embodiment of the present application, after each node device actively or passively creates a stable communication connection with other node devices, a node mapping table (map table) can be created on this node device to represent the correspondence between the address code and the connection.
[0049] For example, in Figure 1 the shown connection structure, assuming that the address code applied by the host is mac1, the address code applied by slave 2 (the node device connected to the host) is mac2, the address code applied by slave 3 is mac3, the address code applied by slave 4 is mac4, and the address code applied by external device A is mac5. Then when slave 3 sends data to slave 2 with the address code mac2, it will send its own address code mac3 to slave 2. When slave 2 receives the address code mac3 sent by slave 3, it will also send its own address code (i.e., mac2) to slave 3. In this way, slave 3 knows that it is connected to the node device with the address mac2 and records it in the map table. For example, the map table of slave 3 is shown in Table 1 below. Similarly, for all other node devices and external devices, there are corresponding similar map tables as above.
[0050] Table 1:
[0051] Address coding Connection mac2 Connection with slave device 3 with address coding mac3 mac5 Connection with external device A with address coding mac5
[0052] When any external device has any data information to send to the host (or other slaves, etc.) through each node device (for example, Figure 1 slave 2 and slave 3 in it), when the data information passes through each node device, the node device can attach its own address code to the address of the data. For example, the data structure definition during data transmission is as follows:
[0053]
[0054] Among them, data is the data to be transmitted, and addr is the set of address encodings of all node modules passed through during the entire data transmission process. There is no restriction on the assembly rule of the set, and special identifiers such as colons or underscores can be used to separate them. For example, using an underscore as the separator for different address encodings, when a piece of data passes through node devices with address encodings mac5, mac3, and mac2 respectively, the value of addr is mac5_mac3_mac2. If the data information continues to be sent and passes through a node device with address encoding mac1, the value of addr will become mac5_mac3_mac2_mac1. That is, the second address encoding can be stacked level by level behind the first address encoding. Eventually, the host will receive the data information carrying the address encoding mac5_mac3_mac2_mac1. At this time, the data transmission path from the external device to the host is mac5_mac3_mac2_mac1. By performing reverse parsing on this data transmission path, the host can obtain the data transmission path from the host to the external device as mac1_mac2_mac3_mac5.
[0055] It should be noted that the second address encoding can also be stacked level by level in front of the first address encoding, and this application does not limit this. The stacking order level by level between the second address encoding and the first address encoding is used to represent each node device that the external device needs to pass through to reach the host and the connection relationship between each node device.
[0056] Step 303: Send a control command to the external device based on the data transmission path from the host to the external device.
[0057] In the embodiments of this application, the above control command is used to instruct the external device to execute a target processing task. For example, it is used to instruct the external device to send status data of types such as temperature, humidity, and speed, or to instruct the external device to perform a version upgrade, or to execute a test task, etc. This application does not limit this.
[0058] In the embodiments of this application, by receiving the data information sent step by step by the external device through one or more node devices, and based on the first address encoding of the external device carried in the data information, and the second address encoding of each node device in one or more node devices stacked level by level during the step-by-step transmission of the data information, the data transmission path from the host to the external device is obtained, so that no matter how the external device is connected, it is possible to send a control command to the external device based on this data transmission path, thereby realizing the control of the external device, and solving the technical problem that it is difficult for the host or other upper-layer devices connected to the host to control the external device due to the different positions of the same external device in different scheme combinations.
[0059] In an embodiment of the present application, each node device may further include a plurality of node modules. For example, as Figure 5 shown, the node device connected to the external device A is the slave device 3, and the slave device 3 may include a plurality of node modules such as an external device A interaction module, a peripheral management module, an external device B interaction module, and a network management module. Among them, the external device A interaction module is directly connected to the external device A, and the external device B interaction module is directly connected to the external device B.
[0060] In the embodiment of the present application, when the node device includes one or more node modules, the second address code of each node device is the address code of each node module in each node device. That is to say, when the node device includes a plurality of node modules, the second address code of the node device will be replaced by the address codes corresponding to each node module in the node device.
[0061] It should be noted that for the method of obtaining the address code of the node module, reference can be made to the method of obtaining the second address code of the foregoing node device.
[0062] For example, the host can obtain the address acquisition requests broadcast by each node module and external device in each node device; based on the address acquisition requests, allocate corresponding address codes to each node module and allocate a first address code to the external device.
[0063] For another example, the address code corresponding to each node module may be the unique identification information corresponding to each node module.
[0064] In an embodiment of the present application, the unique identification information corresponding to each node module may be the identification information carried by the node module itself, or the identification information allocated by the upper-level node module directly connected to the node module, etc., and the present application does not limit this.
[0065] After each node module and each external device are started, first determine whether they are configured with an address code, and when it is detected that there is no configured address code, apply for an address code from the address management module of the host, and save the address code after obtaining the address code.
[0066] In a practical application, after each node module actively or passively creates a communication connection with other node modules, a node mapping table (map table) will be created in this node module to represent the correspondence between the address code and the connection. As Figure 5As shown in the figure, the peripheral management module with the address code of 04 in slave device 3 can be connected to the network management module through the network plug-in socket. When the 04 peripheral management module connects to the 03 network management module, it will send its own address code (i.e., 04) to the network management module. When the network management module receives the address code of 04 sent by the peripheral management module, it will also send its own address code (i.e., 03) to the peripheral management module. At this time, the peripheral management module will know that the socket is connected to the node module with the address of 03. The same logic is used when connecting the 05 peripheral B interaction module and the 06 peripheral A interaction module, and the map table of the peripheral management module 04 as shown in Table 2 below can be obtained.
[0067] Table 2:
[0068] Address coding Connection 03 Connection with network management module with address coding 03 05 Connection with peripheral B interaction module with address coding 05 06 Connection with peripheral A interaction module with address coding 06
[0069] Similarly, for other node modules, there are corresponding map tables for each module.
[0070] In a practical application, as Figure 5 shown, assume that the address code applied by the upgrade management module in the host is 00, and the address code applied by the network management module is 01; the address code applied by the network management module of slave device 2 is 02; the address code applied by the network management module of slave device 3 is 03, the address code applied by the peripheral management module is 04, the address code applied by the peripheral B interaction module is 05, the address code applied by the peripheral A interaction module is 06; the address code applied by the network management module of slave device 4 is 07. When external device A has any data to be sent to the host (or other slave devices, etc.) through each node device (for example, Figure 5 slave device 2 and slave device 3 in the figure), when the data passes through any node module in each node device, the node module will attach its own address code to the address of the data. For example, after a piece of data passes through the node modules with the address codes of 06, 04, and 03 respectively, the value of addr is 06_04_03. If the data continues to be sent and passes through the node module with the address code of 02, the value of addr will become 06_04_03_02, and so on. That is, the second address code is stacked step by step behind the first address code.
[0071] In a practical application, as Figure 5 shown, when external device A reports its own version number to the upgrade management module of the host, the version number data will pass through the node modules with the address codes of 06, 04, 03, 02, and 01 in turn. Then the host will finally receive the version number with the attached address code of 06_04_03_02_01. At this time, the data transmission path of the external device to the host is 06_04_03_02_01.
[0072] In an embodiment of the present application, the second address code is stacked level by level behind the first address code, and the second address code stacked level by level behind the first address code and the first address code together form a data transmission path from the external device to the host. In the process of determining the data transmission path from the host to the external device based on the first address code and the second address code in step 302 above, the data transmission path from the external device to the host can be reversely parsed to obtain the data transmission path from the host to the external device.
[0073] In an embodiment of the present application, when the second address code is stacked level by level behind the first address code, the data transmission path from the external device to the host can be reversely read to obtain the data transmission path from the host to the external device.
[0074] Continuing with the above example, when the host finally receives the version number with the address code 06_04_03_02_01 attached, it can first determine whether an upgrade is required. When it is determined that the external device A needs to be upgraded, the host will send an upgrade instruction and an upgrade software package to the external device A. At this time, the logic of sending the upgrade instruction and the upgrade software package is the address code obtained by reversely parsing the address code 06_04_03_02_01. That is, the upgrade management module of the host first reads that the last address code in the data transmission path from the external device to the host is 01. Then, after the upgrade management module queries the connection corresponding to 01 from its own address mapping table, it sends the upgrade instruction, the upgrade software package, and the data transmission path from the external device to the host (i.e., 06_04_03_02_01) to the network management module with the address code 01. Similarly, after receiving the instruction, the 01 network management module parses the data transmission path from the external device to the host received (i.e., 06_04_03_02_01). First, it finds its own address code in the address set, then obtains the upper-level address 02. Next, it finds the connection corresponding to 02 from its own address mapping table, and then through this connection, it sends the upgrade instruction, the upgrade software package, and the data transmission path from the external device to the host (i.e., 06_04_03_02_01) to the node module with the address code 02. And so on, until the instruction reaches the final destination - the node module with the address code 06, that is, the external device A interaction module. After receiving the upgrade instruction and the software upgrade package, this module performs an upgrade operation on the external device A.
[0075] That is to say, in the above step 303, before sending a control command to the external device based on the data transmission path from the host to the external device, the host or other upper-layer devices connected to the host may first receive the version number sent by the external device to the host based on the data transmission path; then, determine whether the external device needs to be upgraded based on the version number; when the external device needs to be upgraded, send an upgrade instruction and an upgrade package to the external device based on the data transmission path from the host to the external device.
[0076] In an embodiment of the present application, the host or other upper-layer devices connected to the host may also send a test command to the external device based on the data transmission path between the host and the external device to test the external device.
[0077] In the embodiments of the present application, by receiving the data information sent by the external device step by step through one or more node devices, and obtaining the data transmission path from the host to the external device based on the first address code of the external device carried in the data information and the second address code of each of the one or more node devices superimposed step by step during the step-by-step transmission of the data information, no matter how the external device is connected, operations such as version maintenance and testing of the external device can be realized by sending a control command to the external device based on the data transmission path.
[0078] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence. In some embodiments of the present application, certain steps may be performed in other sequences.
[0079] The embodiments of the present application further provide an external device control device, as Figure 6 shown. The external device control device 600 may be configured in the host or other upper-layer devices connected to the host. The external device control device includes:
[0080] A receiving unit 601, configured to receive data information sent by the external device step by step through one or more node devices;
[0081] A determining unit 602, configured to obtain the first address code of the external device carried in the data information and the second address code of each of the one or more node devices superimposed step by step during the step-by-step transmission of the data information, and determine the data transmission path from the host to the external device based on the first address code and the second address code;
[0082] A control unit 603, configured to send a control command to the external device based on the data transmission path from the host to the external device, where the control command is used to instruct the external device to perform a target processing task.
[0083] It should be noted that, for the convenience and conciseness of description, the specific working process of the external device control device 600 described above can refer to the corresponding process of the method described above Figures 1 to 5 and will not be elaborated here.
[0084] As Figure 7 shown, an embodiment of the present application further provides an electronic device. The electronic device may be a vehicle. As Figure 7 shown, the electronic device 7 may include: a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70. When the processor 70 executes the computer program 72, the steps in the above embodiments of the external device control method are implemented. For example, Figure 3 the steps 301 to 303 shown.
[0085] The so-called processor 70 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0086] The memory 71 may be an internal storage unit of the electronic device 7, for example, a hard disk or a memory. The memory 71 may also be an external storage device for the electronic device 7, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the electronic device 7. The memory 71 is used to store the above computer program and other programs and data required by the electronic device.
[0087] The above computer program may be divided into one or more units, and the above one or more units are stored in the above memory 71 and executed by the above processor 70 to complete the present application. The above one or more units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the process of the above computer program executing the external device control method in the electronic device.
[0088] For example, the above computer program can be divided into: a receiving unit, a determining unit, and a control unit, and the specific functions are as follows:
[0089] The receiving unit is used to receive data information sent step by step by an external device through one or more node devices;
[0090] The determining unit is used to obtain the first address code of the external device carried in the data information and the second address code of each of the one or more node devices stacked step by step during the step-by-step transmission of the data information, and determine the data transmission path from the host to the external device based on the first address code and the second address code;
[0091] The control unit is used to send a control command to the external device based on the data transmission path from the host to the external device, and the control command is used to instruct the external device to execute a target processing task.
[0092] The embodiment of the present application further provides a computer program product. The computer program product stores a computer program, and when the computer program is executed by a processor, the steps of the external device control method described in any of the above embodiments are implemented.
[0093] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.
[0094] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0095] Those of ordinary skill in the art will realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0096] In the embodiments provided in this application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the electronic device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be indirect couplings or communication connections through some interfaces, systems or units, and can be electrical, mechanical or other forms.
[0097] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0098] In addition, the functional units in the various embodiments of this application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0099] When an integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above-described embodiment methods of this application, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or recording medium capable of carrying the computer program code, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0100] The above embodiments are only used to illustrate the technical solutions of this application, rather than to limit them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of this application, and should all be included in the protection scope of this application.
Claims
1. A method for controlling an external device, characterized in that: The external device is connected to the host through one or more node devices; the external device control method includes: Receiving data information sent by the external device step by step through one or more node devices; Obtaining a first address code of the external device carried in the data information and a second address code of each node device in the one or more node devices to which the data information is superimposed step by step during the step-by-step sending process, and determining a data transmission path from the host to the external device based on the first address code and the second address code; A control command is sent to the external device based on a data transmission path from the host to the external device, where the control command is used to instruct the external device to perform a target processing task.
2. The external device control method according to claim 1, characterized in that: Before receiving the data information sent by the external device through the one or more node devices step by step, the method includes: Receiving an address acquisition request broadcasted outwardly by each node device in the one or more node devices and the external device; Based on the address acquisition request, the corresponding second address code is allocated to each of the one or more node devices, and the first address code is allocated to the external device.
3. The external device control method according to claim 2, characterized in that: When the node device includes one or more node modules, the second address code of each node device is the address code of each node module in each node device, and the assigning of the corresponding second address code to each node device in the one or more node devices based on the address acquisition request includes: Based on the address acquisition request, a corresponding address code is allocated to each node module of each node device.
4. The external device control method according to claim 1, characterized in that: The first address code of the external device is the unique identification information of the external device, and the unique identification information of the external device is the identification information assigned by the node device or node module directly connected to the external device; The second address code is unique identification information of each node device, and the unique identification information of each node device is identification information allocated by an upper-level node device directly connected to the node device.
5. The external device control method according to claim 1, characterized in that: The second address code is stacked step by step behind the first address code, and the second address code stacked step by step behind the first address code and the first address code together constitute a data transmission path from the external device to the host, and the determining of the data transmission path from the host to the external device based on the first address code and the second address code includes: The data transmission path from the external device to the host is reversely parsed to obtain the data transmission path from the host to the external device.
6. The external device control method according to any one of claims 1 to 5, characterized in that: Before sending a control command to the external device based on the data transmission path from the host to the external device, the method includes: receiving a version number sent by the external device to the host based on the data transmission path; Determining whether the external device needs to be upgraded based on the version number; The sending of a control command to the external device based on a data transmission path from the host to the external device comprises: When the external device needs to be upgraded, an upgrade instruction and an upgrade package are sent to the external device based on the data transmission path from the host to the external device.
7. The external device control method according to any one of claims 1 to 5, characterized in that: The sending of a control command to the external device based on a data transmission path from the host to the external device comprises: A test command is sent to the external device based on a data transmission path from the host to the external device, so as to test the external device.
8. An external device control device, characterized in that: The external device is connected to the host through one or more node devices; the external device control device includes: A receiving unit, used to receive data information sent by the external device step by step via one or more node devices; a determining unit, configured to obtain a first address code of the external device carried in the data information and a second address code of each node device in the one or more node devices to which the data information is superimposed step by step during the step-by-step sending process, and determine a data transmission path from the host to the external device based on the first address code and the second address code; A control unit is used to send a control command to the external device based on a data transmission path from the host to the external device, wherein the control command is used to instruct the external device to perform a target processing task.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is executed by a processor, the steps of the external device control method according to any one of claims 1 to 7 are implemented.
10. A computer program product, characterized in that It comprises a computer program, and when the computer program is executed, the steps of the external device control method according to any one of claims 1 to 7 are implemented.