A device access control method, apparatus, device, and storage medium
By introducing a logic device between the master control device and the target downstream device, and utilizing the wired-AND structure of the logic device's output pins and clock line, the communication between the master control device and the target downstream device is controlled, thus solving the problem of the master control device arbitrarily accessing the device and achieving higher security and access control.
Patent Information
- Application Number
- CN202311842144.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-12-28
AI Technical Summary
In existing technologies, the main control device can arbitrarily obtain or rewrite board-level device information, leading to abnormal device operation and reducing the security of device access.
By introducing a logic device between the master control device and the target downstream device, and utilizing the wired-AND structure of the logic device's output pins and clock line, the communication between the master control device and the target downstream device can be controlled to be turned on or off, thereby achieving the function of shielding access to the master control device.
It improves the security of device access, prevents unauthorized access or misoperation, and enhances access control over target devices.
Smart Images

Figure CN117786723B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a device access control method, apparatus, device, and storage medium. Background Technology
[0002] Currently, in the field of switches or servers, the main control device accesses and manages the board-level devices connected to the bus through bus protocols. The main control device can arbitrarily obtain relevant information of the device through read operations, and can even rewrite important configurations through write operations, causing abnormal device operation and reducing the security of device access. Summary of the Invention
[0003] In view of this, the purpose of this invention is to provide a device access control method, apparatus, device, and storage medium, capable of controlling the access shielding function of the main control device to the target downstream device. The specific solution is as follows:
[0004] In a first aspect, this application discloses a device access control method, comprising:
[0005] Obtain user access permissions to the target connected device; the target connected device communicates with the master control device using a target type bus, wherein the data lines and clock lines of the target type bus are both wired-AND structures;
[0006] The output level of the output pin of the logic device is controlled according to the access permission, and the output level is used to control the opening or closing of the communication between the master control device and the target downstream device, so as to control the master control device's access to the target downstream device; the master control device is connected to the logic device through a first data line and a first clock line, and the master control device is connected to the target downstream device through a second data line and a second clock line, and the output pin of the logic device is connected to the second clock line according to the wire-AND structure.
[0007] Optionally, controlling the output level of the output pin of the logic device according to the access permission includes:
[0008] If the access permission is not allowed, then the output level of the output pin of the logic device is controlled to be low through the first data line and the first clock line;
[0009] The low-level signal is used to shield the main control device from controlling the second clock line, thereby controlling the shutdown of communication between the main control device and the target downstream device.
[0010] Optionally, controlling the output level of the output pin of the logic device according to the access permission includes:
[0011] If the access permission is allowed, then the output level of the output pin of the logic device is controlled to be high through the first data line and the first clock line;
[0012] The high-level signal maintains communication between the master control device and the target downstream device on the second clock line, thereby controlling the activation of communication between the master control device and the target downstream device.
[0013] Optionally, after enabling communication between the main control device and the target connected device, the method further includes:
[0014] After the main control device completes access to the target device, it controls the output level of the logic device's output pin to be low through the first data line and the first clock line.
[0015] The low-level signal is used to shield the main control device from controlling the second clock line, thereby controlling the shutdown of communication between the main control device and the target downstream device.
[0016] Optionally, the device access control method further includes:
[0017] Before the main control device detects that it has started up, the logic device controls the output level of the output pin to be high, so that the main control device can execute the target type bus driver and scan the target connected devices under the target type bus.
[0018] Optionally, the target device is a device that requires access shielding;
[0019] The master control device is connected to the access open device via a third data line and a third clock line; the communication between the master control device and the access open device is not controlled by the logic device, and the access open device is a device that does not require access shielding.
[0020] Optionally, the access permissions are in register units. The step of controlling the output level of the logic device's output pins based on the access permissions, and using the output level to control the opening or closing of communication between the master control device and the target downstream device, to control the master control device's access to the target downstream device, includes:
[0021] The output level of the output pin of the access control logic device is controlled according to the access permission, and the output level is used to control the opening or closing of communication between the master control device and the target downstream device, so as to control the master control device's access to the target register in the target downstream device.
[0022] Secondly, this application discloses a device access control apparatus, comprising:
[0023] The access permission acquisition module is used to acquire access permissions for the target connected device; the target connected device communicates with the master control device through a target type bus, and the data lines and clock lines of the target type bus are both wired-AND structures;
[0024] An access control module is used to control the output level of the output pins of a logic device according to the access permissions, so as to control the opening or closing of communication between the master control device and the target downstream device using the output level; the master control device is connected to the logic device through a first data line and a first clock line, and the master control device is connected to the target downstream device through a second data line and a second clock line, and the output pins of the logic device are connected to the second clock line according to a wire-AND structure.
[0025] Thirdly, this application discloses an electronic device, including:
[0026] Memory, used to store computer programs;
[0027] A processor is used to execute the computer program to implement the aforementioned device access control method.
[0028] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned device access control method.
[0029] In this application, user access permissions to a target downstream device are obtained. The target downstream device communicates with the master control device via a target type bus, where the data lines and clock lines of the target type bus are wired-AND structures. The output level of the logic device's output pins is controlled according to the access permissions, and the output level is used to control the opening or closing of communication between the master control device and the target downstream device, thereby controlling the master control device's access to the target downstream device. The master control device is connected to the logic device via a first data line and a first clock line, and the master control device is also connected to the target downstream device via a second data line and a second clock line. The output pins of the logic device are connected to the second clock line in a wired-AND structure.
[0030] As can be seen, for target devices connected to a bus with both data and clock lines in a wired-AND configuration, adding logic devices and connecting their output pins to the corresponding second clock line of the target device allows control of the master device's control over the second clock line. This enables or disables communication between the master device and the target device, thereby controlling the master device's access to the target device. Essentially, it adds a shielding function to the master device's access to the target device's information. When access is allowed, the logic control removes the shield for normal access; when information protection is required, the logic control opens the shield to prevent access. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0032] Figure 1 A flowchart of a device access control method provided in this application;
[0033] Figure 2 This is a schematic diagram of the IIC bus structure;
[0034] Figure 3 This is a schematic diagram of the IIC topology.
[0035] Figure 4 A specific IIC management architecture diagram is provided for this application;
[0036] Figure 5 A flowchart of a specific device access control method provided in this application;
[0037] Figure 6 A specific IIC topology diagram is provided for this application;
[0038] Figure 7 This application provides a schematic diagram of the structure of a device access control device;
[0039] Figure 8 This application provides a structural diagram of an electronic device. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0041] In existing technologies, the master control device manages access to board-level devices connected to the bus via a bus protocol. The master control device can arbitrarily obtain device information through read operations and even rewrite important configurations through write operations, leading to abnormal device operation and reducing device access security. To overcome these technical problems, this application proposes a device access control method that can control the master control device to block access to target connected devices.
[0042] This application discloses a device access control method, see [link to relevant documentation]. Figure 1 As shown, the method may include the following steps:
[0043] Step S11: Obtain user access permissions to the target connected device; the target connected device communicates with the master control device using a target type bus, and the data lines and clock lines of the target type bus are both wired-AND structures.
[0044] In this embodiment, the master control device obtains the current user's access permissions to the target downstream device. Specifically, it obtains the user's access request for the target downstream device and the user's corresponding device access permissions, and determines whether the user has the necessary access permissions for the target downstream device based on the device access permissions. The master control device can be a CPU (Central Processing Unit) or a BMC (Baseboard Management Controller). In this embodiment, the target downstream device is a downstream device on a target type bus, meaning the target downstream device communicates with the master control device using a target type bus. Furthermore, the data lines and clock lines of the target type bus are both wired-AND structures. The target type bus is either an Inter-Integrated Circuit (IIC) bus or a System Management Bus (SMBus).
[0045] In the field of switches or servers, the main control chip (CPU) or BMC uses the IIC or SMBus protocol to access and manage board-level devices. Taking IIC as an example, the IIC bus is a serial communication bus that uses a multi-master-slave architecture and is widely used in electronic devices such as motherboards, embedded systems, or mobile phones to connect the CPU with low-speed peripheral devices. In switch or server scenarios, it is used by the CPU or BMC to manage communication with board-level devices, including power supplies, fans, logic devices, temperature sensors, voltage / current sensors, and EEPROM (Electrically Erasable Programmable Read Only Memory). Correspondingly, the CPU / BMC can obtain the status of the corresponding devices through the IIC bus, such as obtaining the power supply's operating status, fan speed, sensor temperature, voltage, and current values, and board information stored in the EEPROM. All IIC devices that conform to the IIC bus are combined into an on-chip interface, enabling direct communication between devices via the IIC bus. The IIC bus defines only two bus lines: a serial data line (SDA) and a serial clock line (SCL). Each device has a unique address identifier and can function as either a transmitter or a receiver (depending on the device's function). Besides being a transmitter and receiver, devices can also be considered masters or slaves when performing data transmission. The master is the device that initializes data transmission on the bus and generates the clock signal that allows transmission. In this case, any addressed device is considered a slave. In this proposal, the master control chip CPU / BMC is considered the master in the IIC topology, and the remaining connected IIC devices are considered slaves.
[0046] In IIC, both SDA and SCL are open-collector or open-drain structures. SDA and SCL require external pull-up resistors to the power supply. When the bus is idle, both SDA and SCL are high. During bus communication, the chip actively drives SDA and SCL low; a high level is achieved by external pull-up resistors. Figure 2 As shown, the SDA and SCL (defined as SMBDAT and SBMCLK in SMBus) of each device are wired-AND. That is, the bus signal is high only when all devices connected to the bus output a high level; a low output from any device connected to the bus will cause the bus signal to go low. OUT in the diagram below represents the device output. If any device outputs a low level, the MOSFET is turned on, the bus is grounded, and the signal goes low, thus implementing the wired-AND function. This application implements device access shielding functionality based on the wired-AND structure of the bus; that is, the solution of this application can be used for any bus employing a wired-AND structure.
[0047] Step S12: Control the output level of the output pins of the logic device according to the access permission, and use the output level to control the opening or closing of communication between the master control device and the target downstream device, so as to control the master control device's access to the target downstream device; the master control device is connected to the logic device through the first data line and the first clock line, and the master control device is connected to the target downstream device through the second data line and the second clock line, and the output pins of the logic device are connected to the second clock line according to the wire-AND structure.
[0048] In this embodiment, the master control device is connected to the logic device via a first data line and a first clock line. The master control device can control the output level of the logic device's output pins via the first data line and the first clock line. Simultaneously, the master control device is connected to the target downstream device via a second data line and a second clock line, and the logic device's output pin is connected to the second clock line. The output level controls whether the field-effect transistor on the second clock line is turned on. When it is on, the second clock line is grounded, and the master control device cannot control the second clock line to emit a clock signal normally; that is, the second clock line cannot complete communication, and the master control device cannot access the downstream device on the second clock line. Thus, the control of the IIC physical link by the logic device adds an access shielding function to the IIC device. Furthermore, the implementation cost is low; only a control channel for the logic device's connection to the relevant IIC bus SCL needs to be reserved in the hardware, and the software and logic functions are simple to implement.
[0049] Traditional IIC topology design approach, such as Figure 3 As shown, the main control chip CPU typically has multiple IIC controllers. These controllers are independent of each other, and each controller can act as an independent host to access its subordinate IIC devices without interfering with each other. All IIC devices in the entire system can be managed according to their categories, with each IIC controller able to connect to a single category of IIC devices (each category in the diagram actually represents multiple devices of the same type). Access to each IIC device is open. This "access" is divided into two types: read operations and write operations. Read operations retrieve information stored in the IIC device, while write operations modify the configuration or stored data within the IIC device. The main control chip CPU can arbitrarily access the register contents of its subordinate IIC devices (read operations) and modify the register configuration (write operations). In related technologies, some devices (such as EEPROM chips (GT24C256C)) may have write protection functionality. This write protection function can prevent the master device from modifying the register information of the connected device, but it cannot prevent the master device from obtaining the connected device information. Furthermore, for other devices without write protection, the connected device can obtain information about all connected devices on the bus through the IIC bus and modify the connected device configuration. This embodiment, however, can achieve access control for each type of device.
[0050] I2C is a multidirectional control bus, typically designed using a daisy-chain topology, where multiple chips can be connected to the same bus structure. On a daisy-chain, the SDA pin of an I2C device is connected to the SDA pin of the bus, and the SCL pin is connected to the SCL pin of the bus. In a master-slave scenario, SDA is a bidirectional transmission signal, which can be issued by either the master or slave device depending on the read / write scenario. SCL can be understood as a unidirectional transmission signal, issued only by the master device. Both SDA and SCL are open-collector or open-drain structures, meaning the chip can only output "0" and not "1" (requiring external pull-up resistors to output "1"). Pull-up resistors must be connected to the SDA and SCL links. When the chip control terminal wants to output "1", the chip releases bus control, and the signal link will output "1" due to the pull-up resistors.
[0051] like Figure 4 As shown, the system provided in this application includes an IIC management architecture, with the CPU as the main device, having at least two IIC controllers and one logic device, which can be a CPLD (Complex Programmable Logic Device). The first clock line (IIC-1) and the first data line are directly connected to the CPLD, responsible for completing the CPU's logic control and status acquisition of the CPLD.
[0052] In this embodiment, before controlling the output level of the logic device's output pin according to the access permission, the method further includes: configuring the logic device's output pin as an open-drain output; defining a target register in the logic device; the value of the target register is used to control the output level of the logic device's output pin; correspondingly, controlling the output level of the logic device's output pin according to the access permission includes: updating the value of the target register in the logic device according to the access permission to control the output level of the logic device's output pin. That is, the logic device's output pin needs to be configured as an open-drain output to form a wired-AND structure with the second clock line, and then a target register is defined to control the output level of the logic device's output pin. In other words, the master control device updates the value of the target register in the logic device according to the access permission to control the output level of the logic device's output pin.
[0053] Taking CPLD as an example, in this embodiment, the CPLD can be customized to implement the functions required by the chip through encoding. Specifically, the functions that the CPLD needs to implement are: 1. The CPLD implements the IIC standard slave interface to enable the master control chip to access the CPLD through IIC; 2. The CPLD defines a register (RegXX), the value of which can be read and written through IIC. The register value is associated with the CPLD's pin output (R / W_P). When the register value is 0, R / W_P outputs a low level; when the register value is 1, R / W_P outputs a high impedance; 3. The R / W_P pin is defined as open drain (OD), and the external circuit is connected to the second clock line (IIC-2_SCL); IIC-2 is connected to multiple slave devices (power supply, fan, logic device, sensor, RTC, EEPROM, etc.) in a daisy chain topology. The CPU manages the board-level devices through IIC-2. IIC-2 includes a second data line and a second clock line. The daisy-chain topology here refers to a way of connecting electronic devices, where a chip can only be connected to two other chips through two transmission lines. For example, the main control chip CPU and device A are connected through I2C, device A and device B are connected through I2C, and device B and device C are connected through I2C. There are no other connection methods between devices. This connection method will not form a mesh topology and will not form loops.
[0054] The logic device CPLD has a custom pin R / W_P connected to the SCL of IIC-2. It is controlled by the CPLD's custom register RegXX and is defined as OD output mode. The value of the RegXX register can be rewritten by the CPU through IIC-1, which includes the first data line and the first clock line.
[0055] In this embodiment, controlling the output level of the logic device's output pin according to the access permission may include: if the access permission is not allowed, controlling the output level of the logic device's output pin to a low level via the first data line and the first clock line; using the low level to block the master control device's control over the second clock line, thereby controlling the closure of communication between the master control device and the target downstream device. That is, by controlling the output level of the output pin to a low level, the second clock line is at a low level and cannot conduct, thereby controlling the closure of communication between the master control device and the target downstream device, thus achieving device access blocking.
[0056] In this embodiment, controlling the output level of the logic device's output pin according to the access permission includes: if the access permission is "allow access," then controlling the output level of the logic device's output pin to a high level via the first data line and the first clock line; maintaining communication between the master control device and the target downstream device via the high level, thereby controlling the start of communication between the master control device and the target downstream device. That is, by controlling the output level of the output pin to a high level, i.e., the second clock line is turned on, thereby controlling the start of communication between the master control device and the target downstream device, and removing the device access block.
[0057] In this embodiment, after enabling communication between the master control device and the target downstream device, the method further includes: after the master control device completes access to the target downstream device, controlling the output level of the logic device's output pin to a low level via the first data line and the first clock line; using the low level to shield the master control device's control over the second clock line, thereby controlling the closure of communication between the master control device and the target downstream device. That is, to ensure device security after access, the output pin is again controlled to output a low level. According to the wired-AND structure of the clock line, when the output pin outputs a low level, the master control device cannot control the second clock line to normally emit a clock signal, thus the second clock line cannot communicate normally, meaning the master control device cannot access the target downstream device.
[0058] by Figure 5 Taking the system shown as an example, in a master-slave architecture, SCL is controlled only by the master device CPU, and SDA transmission requires reference to the SCL clock signal. The logic device CPLD has a custom R / W_P pin connected to IIC-2_SCL. When the system disables IIC-2 bus access, the CPU rewrites the value of the CPLD register RegXX to 0 via IIC-2, meaning the R / W_P pin outputs a low level. Based on the open-drain design principle of IIC, the CPU cannot control IIC-2_SCL to output its clock normally, IIC-2 cannot complete communication, and the CPU cannot access devices connected to IIC-2. A specific device access control method is as follows... Figure 6 As shown, it includes the following steps:
[0059] 1. First, determine whether the system allows the CPU to access the device connected to IIC-2;
[0060] 2. If access is allowed: a) The CPU operates the CPLD register RegXX to 1 via IIC-1, controlling the R / W_P output to a high-impedance state, thus releasing control over IIC-2_SCL (the RegXX value can be 0 by default, meaning access is not allowed by default); b) The CPU can normally access the downstream IIC device via IIC-2; c) After the CPU access is completed, the CPU operates the CPLD register RegXX to 0 via IIC-1, controlling the R / W_P signal to a low-level output. At this time, the IIC-2SCL signal is controlled to 0. According to the principle of open-drain IIC signals, the CPU IIC-2 controller cannot drive SCL to a high level. Therefore, IIC-2 cannot complete normal communication, meaning the CPU cannot access the IIC device via IIC-2, thus closing the access channel.
[0061] 3. If access is not allowed (default state): a. The CPU operates the CPLD register RegXX through IIC-1 to control the R / W_P signal to a low level output. At this time, the CPU cannot access the downstream IIC device through IIC-2.
[0062] In this embodiment, the device access control method further includes: before detecting that the master control device has completed startup, the logic device controls the output level of its output pin to a high level, so that the master control device executes the target type bus driver and scans the target downstream devices under the target type bus. It is understood that during CPU startup, the logic device is not allowed to pull the SCL signal low, otherwise it will affect the CPU's bus driver loading. For example, during the IIC driver loading process, it is necessary to scan the downstream devices on the bus, and the bus communication function must be ensured to be normal during this process. Specifically, the logic device will control the output level of its own pin to a high level before detecting that the master control device has completed startup.
[0063] In this embodiment, the target connected device is a device with access shielding requirements; the main control device is connected to the access-open device via a third data line and a third clock line; the communication between the main control device and the access-open device is not controlled by the logic device, and the access-open device is a device without access shielding requirements. For example... Figure 6 As shown, this embodiment utilizes an IIC topology design method based on information openness level classification. This method follows the traditional IIC topology design approach, dividing IIC devices into open access devices and shielded access devices. Open access devices maintain the traditional IIC design method, while shielded access devices incorporate the access shielding design method proposed in this application. Using this topology design method, publicly available IIC access channels can be flexibly selected, resulting in low implementation costs.
[0064] In this embodiment, the access permissions are measured in units of registers. The step of controlling the output level of the logic device's output pins based on the access permissions, and using the output level to control the opening or closing of communication between the master control device and the target downstream device, thereby controlling the master control device's access to the target downstream device, includes: controlling the output level of the logic device's output pins based on the access permissions, and using the output level to control the opening or closing of communication between the master control device and the target downstream device, thereby controlling the master control device's access to the target register in the target downstream device. This adds access permission control for IIC device information partitions. The CPU can not only identify different IIC devices through device addresses to control access permissions, but also identify the register addresses under the device's physical address to control access permissions. That is, user access permissions to devices are specifically limited to registers. For example, if a user requests access to register 0 of device a, and if the user's permissions are queried and it is determined that the user only has access permissions to registers 3-5 of device a, then the output pin is controlled to output a low level to block access.
[0065] In this embodiment, the device access control method further includes: when multiple master devices access the target type bus simultaneously, determining the access order of different master devices through an arbitration mechanism; and when it is the turn of the local master device, performing the operation of obtaining the user's access rights to the target downstream device. It can be understood that if the system is designed as a one-master-multiple-slave configuration, then only one device in the daisy chain is the master device, which can serve as the control source for real-time data transmission; if the system is designed as a multi-master-multiple-slave configuration, then multiple devices in the daisy chain serve as master devices, which can serve as the control source for data transmission. In this case, an arbitration mechanism for multi-master access is introduced to determine the access order of different master devices through arbitration.
[0066] As can be seen from the above, this embodiment obtains the user's access rights to the target downstream device; the target downstream device communicates with the master control device using a target type bus, and the data lines and clock lines of the target type bus are both wired-AND structures; the output level of the logic device's output pins is controlled according to the access rights, and the output level is used to control the opening or closing of communication between the master control device and the target downstream device, so as to control the master control device's access to the target downstream device; the master control device is connected to the logic device through a first data line and a first clock line, and the master control device is connected to the target downstream device through a second data line and a second clock line, and the output pins of the logic device are connected to the second clock line in a wired-AND structure. As can be seen, for target devices connected to a bus with both data and clock lines in a wired-AND configuration, adding logic devices and connecting their output pins to the corresponding second clock line of the target device allows control of the master device's control over the second clock line. This enables or disables communication between the master device and the target device, thereby controlling the master device's access to the target device. Essentially, it adds a shielding function to the master device's access to the target device's information. When access is allowed, the logic control removes the shield for normal access; when information protection is required, the logic control opens the shield to prevent access.
[0067] Accordingly, embodiments of this application also disclose a device access control device, see [link to relevant documentation]. Figure 7 As shown, the device includes:
[0068] Access permission acquisition module 11 is used to acquire access permissions for the target connected device; the target connected device communicates with the master control device through a target type bus, and the data line and clock line of the target type bus are both wired-AND structures;
[0069] Access control module 12 is used to control the output level of the output pins of the logic device according to the access permission, so as to control the opening or closing of communication between the master control device and the target downstream device using the output level; the master control device is connected to the logic device through a first data line and a first clock line, and the master control device is connected to the target downstream device through a second data line and a second clock line, and the output pins of the logic device are connected to the second clock line according to the wire-AND structure.
[0070] As can be seen from the above, this embodiment obtains the user's access rights to the target downstream device; the target downstream device communicates with the master control device using a target type bus, and the data lines and clock lines of the target type bus are both wired-AND structures; the output level of the logic device's output pins is controlled according to the access rights, and the output level is used to control the opening or closing of communication between the master control device and the target downstream device, so as to control the master control device's access to the target downstream device; the master control device is connected to the logic device through a first data line and a first clock line, and the master control device is connected to the target downstream device through a second data line and a second clock line, and the output pins of the logic device are connected to the second clock line in a wired-AND structure. As can be seen, for target devices connected to a bus with both data and clock lines in a wired-AND configuration, adding logic devices and connecting their output pins to the corresponding second clock line of the target device allows control of the master device's control over the second clock line. This enables or disables communication between the master device and the target device, thereby controlling the master device's access to the target device. Essentially, it adds a shielding function to the master device's access to the target device's information. When access is allowed, the logic control removes the shield for normal access; when information protection is required, the logic control opens the shield to prevent access.
[0071] In some specific embodiments, the access control module 12 may specifically include:
[0072] A low-level control unit is used to control the output level of the output pin of the logic device to be low via the first data line and the first clock line if the access permission is not allowed.
[0073] The main control device controls the shielding unit, which is used to shield the main control device's control over the second clock line by means of the low level, so as to control the shutdown of communication between the main control device and the target downstream device.
[0074] In some specific embodiments, the access control module 12 may specifically include:
[0075] A high-level control unit is used to control the output level of the output pin of the logic device to be high level via the first data line and the first clock line if the access permission is allowed.
[0076] The second clock line holding unit is used to maintain the communication between the second clock line of the master control device and the target downstream device through the high level, so as to control the start of communication between the master control device and the target downstream device.
[0077] In some specific embodiments, the access control module 12 may specifically include:
[0078] A low-level control unit is used to control the output level of the logic device's output pin to be low after the main control device has started communicating with the target device and after the main control device has completed accessing the target device.
[0079] The main control device controls the shielding unit, which is used to shield the main control device's control over the second clock line by means of the low level, so as to control the shutdown of communication between the main control device and the target downstream device.
[0080] In some specific embodiments, the device access control device may specifically include:
[0081] A high-level control unit is used to control the output level of the output pin to a high level before the logic device detects that the master control device has completed startup, so that the master control device can execute the target type bus drive and scan the target connected devices under the target type bus.
[0082] In some specific embodiments, the target device is a device that has access shielding requirements;
[0083] The master control device is connected to the access open device via a third data line and a third clock line; the communication between the master control device and the access open device is not controlled by the logic device, and the access open device is a device that does not require access shielding.
[0084] In some specific embodiments, the access permissions are in units of registers, and the access control module 12 may specifically include:
[0085] The register access control unit is used to control the output level of the output pin of the logic device according to the access permission, and to control the opening or closing of the communication between the master control device and the target downstream device by using the output level, so as to control the master control device's access to the target register in the target downstream device.
[0086] Furthermore, this application also discloses an electronic device, see [link to relevant documentation]. Figure 8 As shown, the content in the figure should not be considered as any limitation on the scope of use of this application.
[0087] Figure 8This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the device access control method disclosed in any of the foregoing embodiments.
[0088] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0089] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon include operating system 221, computer program 222 and data 223 including access permissions, etc. The storage method can be temporary storage or permanent storage.
[0090] The operating system 221 manages and controls the various hardware devices on the electronic device 20 and the computer program 222 to enable the processor 21 to perform calculations and processing on the massive amounts of data 223 in the memory 22. The operating system 221 can be Windows Server, Netware, Unix, Linux, etc. In addition to including computer programs capable of performing the device access control method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0091] Furthermore, this application also discloses a computer storage medium storing computer-executable instructions. When the computer-executable instructions are loaded and executed by a processor, they implement the device access control method steps disclosed in any of the foregoing embodiments.
[0092] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0093] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0094] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0095] The present invention has provided a detailed description of a device access control method, apparatus, device, and storage medium. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A device access control method, characterized in that, Applied to main control equipment, including: Obtain user access permissions to the target connected device; the target connected device communicates with the master control device using a target type bus, wherein the data lines and clock lines of the target type bus are both wired-AND structures; The output level of the output pin of the access control logic device is controlled according to the access permission, and the output level is used to control the opening or closing of communication between the master control device and the target downstream device, so as to control the master control device's access to the target downstream device; The main control device is connected to the logic device via a first data line and a first clock line, and the main control device is connected to the target downstream device via a second data line and a second clock line. The output pins of the logic device are connected to the second clock line in a wired-AND configuration. The step of controlling the output level of the output pin of the logic device according to the access permission includes: If the access permission is not allowed, then the output level of the output pin of the logic device is controlled to be low through the first data line and the first clock line; The low-level signal is used to shield the main control device from controlling the second clock line, thereby controlling the shutdown of communication between the main control device and the target downstream device.
2. The device access control method according to claim 1, characterized in that, The control of the output level of the output pin of the logic device according to the access permission includes: If the access permission is allowed, then the output level of the output pin of the logic device is controlled to be high through the first data line and the first clock line; The high-level signal maintains communication between the master control device and the target downstream device on the second clock line, thereby controlling the activation of communication between the master control device and the target downstream device.
3. The device access control method according to claim 2, characterized in that, After enabling communication between the main control device and the target connected device, the method further includes: After the main control device completes access to the target device, it controls the output level of the logic device's output pin to be low through the first data line and the first clock line. The low-level signal is used to shield the main control device from controlling the second clock line, thereby controlling the shutdown of communication between the main control device and the target downstream device.
4. The device access control method according to claim 1, characterized in that, Also includes: Before the main control device detects that it has started up, the logic device controls the output level of the output pin to be high, so that the main control device can execute the target type bus driver and scan the target connected devices under the target type bus.
5. The device access control method according to claim 1, characterized in that, The target device is one that requires access shielding. The master control device is connected to the access open device via a third data line and a third clock line; the communication between the master control device and the access open device is not controlled by the logic device, and the access open device is a device that does not require access shielding.
6. The device access control method according to any one of claims 1 to 5, characterized in that, The access permissions are measured in registers. The step of controlling the output level of the logic device's output pins based on the access permissions, and using the output level to control the opening or closing of communication between the master control device and the target downstream device, thereby controlling the master control device's access to the target downstream device, includes: The output level of the output pin of the access control logic device is controlled according to the access permission, and the output level is used to control the opening or closing of communication between the master control device and the target downstream device, so as to control the master control device's access to the target register in the target downstream device.
7. A device access control device, characterized in that, Applied to main control equipment, including: The access permission acquisition module is used to acquire access permissions for the target connected device; the target connected device communicates with the master control device through a target type bus, and the data lines and clock lines of the target type bus are both wired-AND structures; An access control module is used to control the output level of the output pins of the logic device according to the access permissions, so as to use the output level to control the opening or closing of communication between the master control device and the target downstream device; The main control device is connected to the logic device via a first data line and a first clock line, and the main control device is connected to the target downstream device via a second data line and a second clock line. The output pins of the logic device are connected to the second clock line in a wired-AND configuration. The access control module is configured to, if the access permission is not allowed, control the output level of the output pin of the logic device to be low via the first data line and the first clock line; and to block the main control device from controlling the second clock line by the low level, thereby controlling the closure of communication between the main control device and the target downstream device.
8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the device access control method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein the computer programs, when executed by a processor, implement the device access control method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Signal processing method of intermediate device, intermediate device, system and vehicle
CN116016642A
