Concentrator control method and device, readable medium and electronic equipment
By acquiring the device port correspondence and device information, the edge control device controls the hub port to restart or adjust the current, solving the problem of decreased control reliability caused by hub connection, and realizing stable device connection and battery health management.
Patent Information
- Application Number
- CN202310834342.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-07
- Publication Date
- 2025-01-07
AI Technical Summary
When edge control devices are connected to edge node devices via a hub, control reliability decreases, potentially leading to issues such as device offline or battery swelling.
Edge control devices acquire device port correspondence and device information, and perform operations such as restarting or adjusting current by controlling the hub's ports to improve control reliability.
It improves the control reliability of edge node devices, avoids device offline and battery swelling, and enhances the stability and security of the system.
Smart Images

Figure CN119271450A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular, to a hub control method, device, readable medium and electronic device. Background Art
[0002] In order to control or test the edge node device, the edge node device can be connected to the edge control device, and the edge node device can be controlled by the edge control device. Since the ports of the edge control device are limited, in order to connect more edge node devices, the edge control device can be connected to the edge node device through a hub. It should be noted that the edge node device can be a mobile device such as a mobile phone, and the edge control device can be an electronic device such as a computer.
[0003] In the related art, the connection through a hub will reduce the reliability of the edge control device controlling the edge node device. For example, the edge node device may be offline due to the hub, or the edge node device may be charged for a long time, resulting in battery swelling and other problems. Summary of the invention
[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] According to a first aspect of an embodiment of the present disclosure, a hub control method is provided, which is applied to an edge control device, wherein the edge control device is connected to at least one hub, and a hub includes at least one first port, and the first port is used to connect an edge node device; the method includes:
[0006] Obtaining a device port correspondence relationship; the device port correspondence relationship includes a plurality of edge node devices connected to the edge control device through a hub, and the first port corresponding to each edge node device;
[0007] Obtaining device information of the edge node device;
[0008] A first port corresponding to the edge node device is controlled according to the device information.
[0009] According to a second aspect of an embodiment of the present disclosure, a hub control device is provided, which is applied to an edge control device, wherein the edge control device is connected to at least one hub, and a hub includes at least one first port, and the first port is used to connect an edge node device; the device includes:
[0010] A first acquisition module is used to acquire a device port correspondence relationship; the device port correspondence relationship includes a plurality of edge node devices connected to the edge control device through a hub, and the first port corresponding to each edge node device;
[0011] A second acquisition module, used to acquire device information of the edge node device;
[0012] A control module is used to control the first port corresponding to the edge node device according to the device information.
[0013] According to a third aspect of an embodiment of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the computer program is executed by a processing device, the steps of the method described in the first aspect of the present disclosure are implemented.
[0014] According to a fourth aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0015] a storage device having a computer program stored thereon;
[0016] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect of the present disclosure.
[0017] By adopting the above technical solution, the edge control device obtains the device port correspondence, obtains the device information of the edge node device, and controls the first port corresponding to the edge node device according to the device information, wherein the device port correspondence includes the correspondence between the edge node device and the first port, and the first port is the port of the hub connected to the edge control device. In this way, the first port of the hub can be controlled according to the device information to perform corresponding actions such as restarting or changing the output current, thereby improving the reliability of the control of the edge node device.
[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:
[0020] Figure 1 It is a block diagram of a device control system according to an exemplary embodiment.
[0021] Figure 2 The figure is a flow chart of a hub control method according to an exemplary embodiment.
[0022] Figure 3 The figure is a schematic diagram of information displayed on a port device tree according to an exemplary embodiment.
[0023] Figure 4 is a flow chart showing another hub control method according to an exemplary embodiment.
[0024] Figure 5 is a flow chart of another hub control method according to an exemplary embodiment.
[0025] Figure 6 The invention is a block diagram of a hub control device according to an exemplary embodiment.
[0026] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0027] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0028] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0029] The term "including" and its variations used in the present disclosure are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0030] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0031] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise clearly indicated in the context, they should be understood as "one or more". In the description of the present disclosure, unless otherwise specified, "multiple" refers to two or more than two, and other quantifiers are similar; "at least one item", "one or more items" or similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one item a can represent any number of a; for another example, one or more items of a, b and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple; "and / or" is a kind of association relationship that describes the associated objects, indicating that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character “ / ” indicates that the preceding and following objects are in an “or” relationship. The singular forms “a”, “an”, “an”, “said” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0032] Although operations or steps are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood that it is required to perform these operations or steps in the specific order shown or in a serial order, or to perform all the operations or steps shown to obtain the desired results. In the embodiments of the present disclosure, these operations or steps can be performed in series; these operations or steps can also be performed in parallel; or some of these operations or steps can be performed.
[0033] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0034] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0035] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0036] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0037] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0038] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0039] The present disclosure is described below in conjunction with specific embodiments.
[0040] Figure 1 FIG. 1 is a block diagram of a device control system according to an exemplary embodiment. Figure 1 As shown, the device control system 100 may include an edge control device 101, a hub 102 and an edge node device 103. The edge control device 101 is connected to at least one hub 102, and a hub 102 may include at least one first port, which may be used to connect to the edge node device 103.
[0041] In some embodiments, the edge control device 101 may be connected to N hubs 102 through N second ports, and one hub 102 may be connected to M edge node devices through M first ports.
[0042] In other embodiments, multiple hubs may also be connected in series, for example, the edge control device is connected to a first hub, connected to a second hub through the first hub, and then connected to the edge node device through the second hub.
[0043] It should be noted that the edge control device may be a computer or other electronic device. For example, the edge control device may be an electronic device installed with a first operating system. The edge node device may be a mobile terminal device such as a mobile phone or a PAD. The hub may be a Universal Serial Bus (USB) hub, which may also be called a USB HUB or a smart HUB.
[0044] In some embodiments, the hub may have at least one of the following functions:
[0045] M first ports may be provided, and at most M edge node devices may be connected thereto. M may be any natural number, for example, M may be equal to 6 or 8.
[0046] A port indicator light may be provided, each first port corresponding to a port indicator light, and the port indicator light may be used to indicate whether the corresponding first port is connected to an edge node device. For example, when the first port is not plugged into an edge node device, the indicator light is green; after the first port is connected to an edge node device, the indicator light is yellow.
[0047] Each first port can be controlled independently, or all first ports can be controlled simultaneously.
[0048] Each first port can output at least two currents of different magnitudes.
[0049] The hub may be provided with a controller or a chip, and may communicate with the edge control device, for example, communication transmission may be performed via a Universal Asynchronous Receiver / Transmitter (UART) protocol.
[0050] In some embodiments, the device control system may further include a server 104. The server 104 may be connected to the edge control device 101, and is used to receive information sent by the edge control device, and send a control instruction to the edge control device, and the control instruction may be used to control the target device to perform a corresponding task or action, and the target device may include at least one of an edge control device, a hub, and an edge node device.
[0051] In one implementation, there may be multiple edge control devices, and the server may be connected to the multiple edge control devices respectively.
[0052] In some embodiments, the device control system may further include a client 105, which may be connected to a server 104. The client may receive information sent by the server and display relevant information (such as information of a hub or device information of an edge node device, etc.) to the user. The client may also receive a user instruction sent by the user and send the user instruction to the server, and the server may send a control instruction to the edge control device according to the user instruction.
[0053] It should be noted that the above-mentioned server 104 and client 105 may constitute a cloud testing platform. For example, the cloud testing platform may include at least one server and at least one client, and the cloud testing platform may also include other hardware or software.
[0054] Figure 2is a flow chart of a hub control method according to an exemplary embodiment. The method can be applied to Figure 1 The edge control device shown in Figure 2 As shown, the method may include:
[0055] S201, obtaining device port correspondence.
[0056] The device-port correspondence relationship includes a correspondence relationship between the edge node device and the first port.
[0057] In some embodiments, the device port correspondence includes all edge node devices to which the edge control device is connected via a hub.
[0058] For example, the edge node device can be indexed by a device identifier, which can be a serial number (serial number) of the edge node device or other parameters used to distinguish the edge node device; the first port can be indexed by a first port identifier, which can be a local identifier (LocationID) of the first port or other parameters used to distinguish the first port; in this way, the device-port correspondence can include a correspondence between a device identifier and a port identifier.
[0059] Optionally, the first port identifier may include a hub identifier and a second port identifier. The second port identifier may be used to uniquely identify a first port in the same hub, and the first port identifier may be used to uniquely identify a first port within a range of multiple hubs connected to an edge control device. For example, if the edge control device is connected to multiple hubs, each of which has multiple first ports, a first port may be uniquely identified by the hub identifier and the second port identifier.
[0060] It should be noted that the device port correspondence may be a correspondence for pre-configuration, or may be a correspondence pre-generated by the edge control device.
[0061] In some embodiments, the operating system of the edge control device is a first operating system, and the device port correspondence relationship can be obtained according to the port device tree of the first operating system.
[0062] By way of example, the edge control device may be a MAC MINI, the first operating system may be a MAC OS, and the port device tree may be a USB device tree of the MAC OS. The device identifier of the edge node device and the first port identifier of the first port may be obtained through the port device tree, thereby obtaining the above-mentioned device-port correspondence.
[0063] Figure 3FIG. 1 is a schematic diagram showing information displayed on a port device tree according to an exemplary embodiment. Figure 3 As shown, the port device tree displays two first ports, namely the first port 1 and the first port 2, wherein the first port identifier of the first port 1 (the first port identifier can also be called LocationID) is 0x14146000 / 39, and the first port identifier of the first port 2 is 0x14141000 / 40. It can be seen that the first port identifier has a certain regularity. In the macOS system, the first port identifier of the first port connected to each edge node device will be displayed in the form of "0x14141000--->0x14146000" memory address. The first port identifier is relatively fixed and will not change with swapping of devices, restarting, or when the hub port is not fully plugged in. Optionally, the port device tree can also display the above-mentioned device identifier (the device identifier can also be called Serial Number), for example Figure 3 As shown, the device identifier corresponding to the first port 1 is
[0064] 1433c368c7bbd5755b05d052ddd5657d268el896, and the device identifier corresponding to the first port 2 is 874507. In this way, the correspondence between the first port identifier and the device identifier can be obtained through the first command of the first operating system, thereby obtaining the above-mentioned device-port correspondence.
[0065] In some embodiments, Figure 3 The information shown can be obtained through a first command of a first operating system. For example, the first command can be the following command under MAC OS:
[0066] system_profilerSPUSBDataType.
[0067] It should be noted that, in this way, the device identifier and the first port identifier of the edge node device based on the IOS system can be obtained, and the device identifier and the first port identifier of the edge node device based on the Android system can also be obtained.
[0068] Furthermore, the device name of the hub can be obtained through the command of the first operating system, and the device port correspondence relationship can also include the device name of the hub. The device port correspondence relationship can also be called a mapping relationship or a mapping summary table.
[0069] For example, when the same edge control device (such as MAC MINI) is connected to multiple hubs, the device name of the hub can be obtained in the dev directory of the first operating system of the edge control device. The device name of the hub can be named in the form of tty.wchusbserialxxxxxx.
[0070] The device name can be obtained through a second command of the first operating system. For example, the second command may include the following commands under the MAC OS system: ls -l / dev / tty.usbserial*, ls -l
[0071] / dev / tty.wc*.
[0072] S202: Obtain device information of edge node devices.
[0073] The device information may include at least one of the following information: device identification, connection status, remaining power, device model, device version, usage status, etc. of the edge node device.
[0074] S203: Control a first port corresponding to the edge node device according to the device information.
[0075] In some embodiments, the device information may include a connection status of the edge node device. When the connection status is an offline state, the first port corresponding to the edge node device may be controlled to restart.
[0076] In other embodiments, the device information may include the remaining power of the edge node device, and the current output by the first port may be controlled according to the remaining power.
[0077] By adopting the above method, the edge control device obtains the device port correspondence, obtains the device information of the edge node device, and controls the first port corresponding to the edge node device according to the device information, wherein the device port correspondence includes the correspondence between the edge node device and the first port, and the first port is the port of the hub connected to the edge control device. In this way, the first port of the hub can be controlled according to the device information to perform corresponding actions such as restarting or changing the output current, thereby improving the reliability of the control of the edge node device.
[0078] Figure 4 is a flow chart of another hub control method according to an exemplary embodiment. The method can be applied to Figure 1 The edge control device shown in Figure 4 As shown, the method may include:
[0079] S201, obtaining device port correspondence.
[0080] The device-port correspondence relationship includes a correspondence relationship between an edge node device and a first port.
[0081] S402: Obtain the connection status of the edge node device.
[0082] The connection state may be an offline state or a connected state.
[0083] S403: When the connection state is offline, control the first port corresponding to the edge node device to restart.
[0084] The method of controlling the first port to restart may be to first close the first port and then open the first port. The restart operation may be performed through a command of the operating system.
[0085] In some embodiments, the above steps S402 and S403 may be performed periodically, and the period may be any pre-set duration, such as five minutes, ten minutes, thirty minutes, or one hour. For example, a first list of edge node devices in a connected state may be periodically obtained through a third command, and the first list may be compared with the edge control devices in the device-port correspondence relationship to obtain edge control devices for which the device-port correspondence relationship exists but does not exist in the first list, and it may be determined that the connection state of the edge control device is an offline state. Furthermore, when the connection state of the edge control device is an offline state, the first port corresponding to the edge node device may be controlled to restart.
[0086] In this way, the edge control device can periodically poll the connection status of the edge node device without manual operation. If the device is offline, the port can be restarted to try to restore the device online. According to verification, there is a 70% probability that the connection between the edge control device and the edge node device can be restored by restarting the port when the device is offline, so that the device can be online. In this way, the control reliability of the edge node device can be improved.
[0087] In some embodiments, after controlling the first port to restart a preset number of times, if the connection state of the edge node device is still the offline state, the restart of the first port may be stopped and log information may be recorded.
[0088] For example, the preset number of times may be 3 times. If the connection state of the edge node device is still the offline state after restarting 3 times, it will not be restarted, and a log information may be recorded in the local cache. Furthermore, the recovery information of the edge node device may be sent to the user, for example, by sending the recovery information in the form of a chat group or email.
[0089] Figure 5 is a flowchart of another hub control method according to an exemplary embodiment. The method can be applied to Figure 1 The edge control device shown in Figure 5 As shown, the method may include:
[0090] S201, obtaining device port correspondence.
[0091] The device-port correspondence relationship includes a correspondence relationship between an edge node device and a first port.
[0092] S502: Obtain the remaining power of the edge node device.
[0093] For example, the remaining power corresponding to the edge node device can be obtained through a power query command. Different power query commands can be used for edge node devices of different systems.
[0094] For example, for an edge node device based on the IOS system, the power query command can be: ideviceinfo-uudid--domain com.apple.mobile.battery|
[0095] grepBatteryCurrentCapacity; For edge node devices based on the Android system, the power query command can be: adb-s serial shell dumpsys battery|grep level.
[0096] S503: Control the current output by the first port corresponding to the edge node device according to the remaining power.
[0097] In some embodiments, when the remaining power is less than a first preset threshold, the current output by the first port may be controlled to be a first current.
[0098] In other embodiments, when the remaining power is greater than a second preset threshold, the current output by the first port may be controlled to be a second current.
[0099] The second preset threshold may be greater than or equal to the first preset threshold. For example, the first preset threshold and the second preset threshold may both be 80%. For another example, the first preset threshold is 50%, and the second preset threshold may both be 80%.
[0100] The second current may be less than the first current. For example, the second current may be the minimum current to ensure that the edge node device can connect and communicate with the edge control device through the hub. The first current may be the current required to charge the edge node device. For example, the first current may be 1.5A, and the second current may be 140mA.
[0101] In some embodiments of the present disclosure, when the use state of the edge node device is an idle state (that is, the edge node device is not occupied by a user), the current output by the first port can be controlled according to the remaining power.
[0102] Furthermore, when the edge node device is in an occupied state (ie, the edge node device is occupied by a user), the current output by the first port can be stopped from being controlled according to the remaining power. For example, the current output by the first port can be kept at the second current.
[0103] In this way, edge node devices in an occupied state may not be involved, thereby preventing the adjustment of the current from affecting the normal use of the edge node devices (such as device testing, etc.).
[0104] In some embodiments of the present disclosure, the above steps S502 and S503 may be performed periodically, and the period may also be any preset duration, such as five minutes, ten minutes, thirty minutes or one hour.
[0105] In this way, the edge control device can periodically poll the remaining power of the edge node device and monitor the charging current of the device without manual operation. Charging with a small current can delay battery aging, avoid battery swelling, and improve the safety and reliability of the edge node device.
[0106] In some embodiments of the present disclosure, the edge control device is also connected to a server, and the edge control device can also communicate with the server.
[0107] In some embodiments, the edge control device may send the device port correspondence and the device information of the edge node device to the server, so that the server can display the edge node device and the first port corresponding to each edge node device to the user.
[0108] In some embodiments, the edge control device may receive a control instruction sent by the server, and control the first port according to the control instruction.
[0109] In one implementation, the edge control device generates a control interface through a microservice HTTP framework. The control interface may include a hub information interface, a restart port interface, a current control interface, etc.; the microservice HTTP framework may be a Hertz framework. The server may perform related operations through the control interface, for example, the server may obtain the current status of each first port of the hub through the hub information interface; the server may control the current output of one or more first ports through the current control interface; the server may also control the restart of one or more first ports through the restart port interface.
[0110] In other embodiments, the server can also be connected to the client, and the server can send the current status to the client, and the client can display the current status of the first port to the user through a display page. The client can also receive a user instruction input by the user and send the user instruction to the server, and the server can perform the operation corresponding to the user instruction through the control interface according to the user instruction. For example, operations such as modifying the current output by the first port and restarting the first port can be triggered by a user instruction input by the user.
[0111] In this way, the client and server can display information to the user and control the interface to perform operations corresponding to user instructions.
[0112] In some embodiments, when the first port is controlled according to the control instruction, the control of the first port according to the device information may be stopped.
[0113] In this way, conflicts between control instruction control and automatic control can be avoided, and the port is controlled based on the control instruction first.
[0114] Figure 6 1 is a block diagram of a hub control device 1100 according to an exemplary embodiment. The device can be applied to an edge control device, the edge control device is connected to at least one hub, and a hub includes at least one first port, and the first port is used to connect to an edge node device. Figure 6 As shown, the device 1100 may include:
[0115] A first acquisition module 1101 is used to acquire a device port correspondence relationship; the device port correspondence relationship includes a plurality of edge node devices connected to the edge control device through a hub, and the first port corresponding to each edge node device;
[0116] The second acquisition module 1102 is used to acquire device information of the edge node device;
[0117] The control module 1103 is configured to control the first port corresponding to the edge node device according to the device information.
[0118] In some embodiments, the device information includes a connection status between the edge node device and the edge control device; the control module 1103 is used to control the first port to restart when the connection status is offline.
[0119] In some embodiments, the control module 1103 is further configured to stop restarting the first port and record log information if the connection status of the edge node device is still the offline status after controlling the first port to restart a preset number of times.
[0120] In some embodiments, the device information includes the remaining power of the edge node device; the control module 1103 is used to control the current output by the first port according to the remaining power.
[0121] In some embodiments, the control module 1103 is used to control the current output by the first port to be a first current when the remaining power is less than a first preset threshold; or to control the current output by the first port to be a second current when the remaining power is greater than a second preset threshold; wherein the second preset threshold is greater than or equal to the first preset threshold, and the second current is less than the first current.
[0122] In some embodiments, the control module 1103 is used to control the current output by the first port according to the remaining power when the use state of the edge node device is an idle state.
[0123] In some embodiments, the operating system of the edge control device is a first operating system; the first acquisition module 1101 is used to acquire the device port correspondence according to the port device tree of the first operating system.
[0124] In some embodiments, the edge control device is also connected to a server; the control module 1103 is also used to send the device port correspondence and the device information of the edge node device to the server; or, receive a control instruction sent by the server, and control the first port according to the control instruction.
[0125] In some embodiments, the control module 1103 is further configured to stop controlling the first port corresponding to the edge node device according to the device information when the first port is controlled according to the control instruction.
[0126] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0127] Reference below Figure 7, which shows a schematic diagram of the structure of an electronic device 2000 (e.g., edge control device, server, client) suitable for implementing the embodiment of the present disclosure. The edge control device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (e.g., vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The server in the embodiment of the present disclosure may include, but is not limited to, local servers, cloud servers, single servers, distributed servers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0128] like Figure 7 As shown, the electronic device 2000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 2001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 2002 or a program loaded from a storage device 2008 into a random access memory (RAM) 2003. In the RAM 2003, various programs and data required for the operation of the electronic device 2000 are also stored. The processing device 2001, the ROM 2002, and the RAM 2003 are connected to each other via a bus 2004. An input / output (I / O) interface 2005 is also connected to the bus 2004.
[0129] Typically, the following devices may be connected to the input / output interface 2005: an input device 2006 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 2007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 2008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 2009. The communication device 2009 may allow the electronic device 2000 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 2000 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0130] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 2009, or installed from the storage device 2008, or installed from the ROM 2002. When the computer program is executed by the processing device 2001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0131] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. Computer-readable storage media may include, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0132] In some embodiments, the client, server, or edge control device can communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0133] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0134] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains a device port correspondence relationship; the device port correspondence relationship includes multiple edge node devices connected to the edge control device through a hub, and the first port corresponding to each of the edge node devices; obtains the device information of the edge node device; and controls the first port corresponding to the edge node device according to the device information.
[0135] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0136] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0137] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of the module does not limit the module itself in some cases. For example, the first acquisition module may also be described as a "module for acquiring device port correspondence".
[0138] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0139] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0140] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0141] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0142] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Claims
1. A hub control method, characterized in that: Applied to an edge control device, the edge control device is connected to at least one hub, a hub includes at least one first port, and the first port is used to connect an edge node device; the method includes: Obtaining a device port correspondence relationship; the device port correspondence relationship includes a plurality of edge node devices connected to the edge control device through a hub, and the first port corresponding to each edge node device; Obtaining device information of the edge node device; A first port corresponding to the edge node device is controlled according to the device information.
2. The method according to claim 1, characterized in that: The device information includes a connection status between the edge node device and the edge control device; and controlling the first port corresponding to the edge node device according to the device information includes: When the connection state is an offline state, the first port is controlled to restart.
3. The method according to claim 2, characterized in that The method further comprises: After controlling the first port to restart a preset number of times, if the connection state of the edge node device is still the offline state, stopping restarting the first port and recording log information.
4. The method according to claim 1, characterized in that The device information includes the remaining power of the edge node device; and controlling the first port corresponding to the edge node device according to the device information includes: The current output by the first port is controlled according to the remaining power.
5. The method according to claim 4, characterized in that The controlling the current output by the first port according to the remaining power comprises: When the remaining power is less than a first preset threshold, controlling the current output by the first port to be a first current; or, When the remaining power is greater than a second preset threshold, the current output by the first port is controlled to be a second current; wherein the second preset threshold is greater than or equal to the first preset threshold, and the second current is less than the first current.
6. The method according to claim 4, characterized in that The controlling the current output by the first port according to the remaining power comprises: When the use state of the edge node device is an idle state, the current output by the first port is controlled according to the remaining power.
7. The method according to claim 1, characterized in that The operating system of the edge control device is a first operating system; The obtaining of the device port correspondence relationship comprises: The device-port correspondence is acquired according to the port device tree of the first operating system.
8. The method according to any one of claims 1 to 7, characterized in that The edge control device is also connected to the server; the method further includes: Sending the device port correspondence and the device information of the edge node device to the server; or, Receive a control instruction sent by the server, and control the first port according to the control instruction.
9. The method according to claim 8, characterized in that The method further comprises: In a case where the first port is controlled according to the control instruction, control of the first port corresponding to the edge node device according to the device information is stopped.
10. A hub control device, characterized in that: Applied to an edge control device, the edge control device is connected to at least one hub, a hub includes at least one first port, and the first port is used to connect an edge node device; the device includes: A first acquisition module is used to acquire a device port correspondence relationship; the device port correspondence relationship includes a plurality of edge node devices connected to the edge control device through a hub, and the first port corresponding to each edge node device; A second acquisition module, used to acquire device information of the edge node device; A control module is used to control the first port corresponding to the edge node device according to the device information.
11. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 9 are implemented.
12. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 9.