CN113076273A - Component access method, device, electronic equipment, storage medium and program product - Google Patents

Component access method, device, electronic equipment, storage medium and program product Download PDF

Info

Publication number
CN113076273A
CN113076273A CN202110438562.4A CN202110438562A CN113076273A CN 113076273 A CN113076273 A CN 113076273A CN 202110438562 A CN202110438562 A CN 202110438562A CN 113076273 A CN113076273 A CN 113076273A
Authority
CN
China
Prior art keywords
component
communication node
new
target communication
identity information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110438562.4A
Other languages
Chinese (zh)
Other versions
CN113076273B (en
Inventor
朱金平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110438562.4A priority Critical patent/CN113076273B/en
Publication of CN113076273A publication Critical patent/CN113076273A/en
Application granted granted Critical
Publication of CN113076273B publication Critical patent/CN113076273B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • G06F13/4081Live connection to bus, e.g. hot-plugging

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure provides a component access method, a component access device, an electronic device, a computer readable storage medium and a computer program product, and relates to the technical field of component operation and maintenance such as component access and component replacement. One embodiment of the method comprises: acquiring identity information of a new component accessed to the embedded equipment; determining the component type of the new component according to the identity information, and determining a target communication node corresponding to the component type; and binding the new component to the target communication node so that the new component communicates with the embedded device through the target communication node. The implementation mode enables the embedded device to support hot plug of the component, communication node information in the configuration item does not need to be manually adjusted after the component is replaced each time, and the difficulty of component replacement is reduced.

Description

Component access method, device, electronic equipment, storage medium and program product
Technical Field
The present disclosure relates to the field of embedded device technologies, and in particular, to the field of component operation and maintenance technologies such as component access and component replacement, and in particular, to a component access method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
Background
With the development of electronic informatization and intellectualization, various lightweight embedded devices are produced. Such embedded devices often do not need a complete system, but only need to satisfy system functions related to the design purpose of the embedded devices, thereby adapting to the characteristics of low power consumption and low computing power required by the embedded devices.
The kernel of the embedded device, for example, a Linux embedded device, is an important component of a Linux system. In the related art, the communication between the application layer of the Linux embedded device and the input device is performed based on the fixed device node, that is, a certain input device can only communicate with the Linux kernel through the fixed device node, so that the normal operation is realized.
Disclosure of Invention
The embodiment of the disclosure provides a component access method, a component access device, an electronic device, a computer-readable storage medium and a computer program product.
In a first aspect, an embodiment of the present disclosure provides a component access method, including: acquiring identity information of a new component accessed to the embedded equipment; determining the component type of the new component according to the identity information, and determining a target communication node corresponding to the component type; and binding the new component to the target communication node so that the new component communicates with the embedded device through the target communication node.
In a second aspect, an embodiment of the present disclosure provides a component access apparatus, including: an identity information acquisition unit configured to acquire identity information of a new component accessed to the embedded device; a component type and target communication node determination unit configured to determine a component type of the new component according to the identity information and determine a target communication node corresponding to the component type; and the node binding unit is configured to bind the new component to the target communication node so that the new component can communicate with the embedded device through the target communication node.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the component access method as described in any implementation manner of the first aspect when executed.
In a fourth aspect, the disclosed embodiments provide a non-transitory computer-readable storage medium storing computer instructions for enabling a computer to implement a component access method as described in any implementation manner of the first aspect when executed.
In a fifth aspect, the embodiments of the present disclosure provide a computer program product comprising a computer program, which when executed by a processor is capable of implementing the component access method as described in any implementation manner of the first aspect.
The component access method provided by the embodiment of the disclosure includes the steps of firstly, acquiring identity information of a new component accessed to an embedded device; then, determining the component type of the new component according to the identity information, and determining a target communication node corresponding to the component type; the new component is then bound to the target communication node by a soft link technique such that the new component communicates with the embedded device through the target communication node. According to the method and the device, the identity information of the accessed new component is identified, different types of components are distinguished based on the identity information, and the binding relationship between the new component and the matched target communication node is established, so that the problems that an embedded device kernel does not distinguish the accessed components and randomly distributes the communication nodes are avoided, the embedded device can support hot plug of the components, the communication node information in the configuration item does not need to be manually adjusted after the components are replaced each time, and the difficulty in component replacement is reduced.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture to which the present disclosure may be applied;
fig. 2 is a flowchart of a component access method according to an embodiment of the present disclosure;
fig. 3 is a flowchart of another component access method provided in an embodiment of the present disclosure;
fig. 4 is a block diagram of a component access apparatus according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device adapted to execute a component access method according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness. It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, necessary security measures are taken, and the customs of the public order is not violated.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the component access methods, apparatus, electronic devices, and computer-readable storage media of the present disclosure may be applied.
As shown in fig. 1, a system architecture 100, taking a card puncher as an example, may include an image capture component 101, a fingerprint capture component 102, a touch display component 103, a physical key component 104, and a sound output component 105. Each component is respectively connected with a main control (such as a central processing unit) of the embedded device in a wired or wireless data mode for information communication. The image capturing component 101, the fingerprint capturing component 102, and the physical key component 104 shown in fig. 1 are simple information input components, the sound output component 105 is a simple information output component, and the touch display component 103 is an information input component and an information output component at the same time.
Of course, the card puncher shown in fig. 1 is only used as a simple example of the embedded device, and the embedded device may be further provided with other types of information input acquisition and information input devices, such as an audible and visual alarm, a temperature collector, a light intensity collector, and the like, according to different functions. Other types of embedded devices also include: embedded vehicle-mounted terminals, embedded access control management terminals, etc., which are not listed herein.
It should be noted that the embedded device is provided with an operating system component required for completing the set function, the operating system communicates with each component through its kernel during running, and analyzes and processes the information collected by each component, and outputs the analysis result through an output component, thereby realizing interaction with the user.
Because such embedded equipment has accessed multiple assemblies, need not face the change of subassembly, in order to guarantee that the subassembly can normally work after changing, when carrying out the change of subassembly, steerable embedded equipment carries out following operation under operating system's control: firstly, acquiring identity information of a new component accessed to embedded equipment; then, determining the component type of the new component according to the identity information, and determining a target communication node corresponding to the component type; the new component is then bound to the target communication node. Thereby enabling the new component to communicate with the embedded device through the target communication node.
It should be understood that the number, type and arrangement positions of the information input components and the information output components in fig. 1 are illustrative. Any number and type of access components may be provided in the respective locations, as desired for implementation.
Referring to fig. 2, fig. 2 is a flowchart of a component access method according to an embodiment of the present disclosure, where the process 200 includes the following steps:
step 201: acquiring identity information of a new component accessed to the embedded equipment;
this step is intended to obtain identity information of a new component accessing the embedded device by the executing entity of the component accessing method (e.g. the master of the embedded device shown in fig. 1). The embedded device is provided with an operating system and functional components thereof for realizing preset functions, preferably a Linux operating system, and can also be provided with a simplified version, a light-weight version or a self-defined version according to the actual calculation capability, wherein the simplified version of the operating system generally cannot have various high-level functions as a standard version, but can be better suitable for the embedded device with low performance requirements.
Access to a new component can generally be divided into two levels, physical access and logical access. The physical access is usually represented by that the data interaction port of the new component and the data interaction port of the embedded device are connected in a wired or wireless mode, and only establishing the physical access only shows that the basic conditions for establishing data communication are met between the two. Taking the Linux operating system as an example, if the Linux kernel in the Linux operating system cannot "find" new components to be accessed through the built-in logic of the Linux kernel, efficient data communication cannot be necessarily performed with the Linux operating system. Therefore, on the basis of physical access, logical access is to achieve the purpose that the Linux kernel can perform effective data communication with the new component.
In the Linux operating system, data communication is often performed between the Linux operating system and the functional component through a plurality of Event device nodes, and it can also be simply understood that an Event device node is a data transmission channel for data communication between the Linux kernel and the functional component.
Limited by the performance of the embedded device, the function of the Linux operating system installed thereon is not complete, so that the Linux kernel in such a case can only use the Event device node fixed in advance to perform data communication with the corresponding functional component, for example, the Linux kernel can only perform data communication with the touch display screen through the communication node numbered 13, that is, the communication node numbered 13 receives information collected by the touch display screen, and sends information to be displayed to the touch display screen through the communication node numbered 13.
If the touch display screen needs to be replaced, when a new touch display screen is physically accessed to the embedded device, the Linux kernel often randomly or installs a fixed sequence to allocate an Event device node to the new touch display screen, but no matter which Event device node is allocated to the new touch display screen, the new touch display screen cannot be normally used because the Linux kernel cannot be changed in the configuration item, the configuration item still writes the configuration information for performing data communication between the communication node with the number 13 and the touch display screen, and once the Event device node allocated randomly or according to the fixed sequence is not the communication node with the number 13, the newly accessed touch display screen cannot normally perform data interaction with the Linux kernel. The configuration items need to be manually corrected to the numbers of newly allocated Event device nodes, so that the replacement difficulty of the components of the embedded device is high, and the efficiency is low.
To solve this problem, this step first identifies the identity information of the new component accessed, so as to subsequently identify the type of the new component accessed based on the identity information. The identity information of the component may be obtained in various ways, for example, directly from a memory on a pin of the new component, directly read and written in an on-chip memory thereof, or obtained by running a driver on the new component, or even indirectly obtained by reading a production serial number thereof or a character string that can be used for identifying an identity, and so on, and is not expanded one by one here.
Step 202: determining the component type of the new component according to the identity information, and determining a target communication node corresponding to the component type;
on the basis of step 201, this step is intended to determine, by the executing entity, the component type of the new component from the identity information, and determine a target communication node corresponding to the component type.
Since the related information of the related function performed by the component can be determined by the identity information of the component, this step aims to determine a new component type to be accessed by the related information determined by the identity information, so as to further determine a matched target communication node according to the determined component type.
It should be noted that, the present disclosure provides target communication nodes matched with different component types for components of different component types in advance, and the correspondence between different objects may be represented in different forms according to different record carriers, such as a correspondence table, a key value pair, a relational database, and so on. The target communication node may be a fixed communication node with a certain number, or may be a virtual communication node dividing at least one communication node from a logical level, but whatever form is presented, the target communication node is intended to determine a communication node capable of performing effective data communication with the new component so that the accessed new component can normally operate through the present step.
Step 203: and binding the new component to the target communication node so that the new component communicates with the embedded device through the target communication node.
On the basis of step 202, this step is intended to establish a data connection path between the target communication node and the new component by the execution subject, and since the target communication node has been set as a communication node in the operating system for data communication with a component of the type to which the new component belongs, after the binding of the correspondence relationship is completed, the operating system can normally communicate with the accessed new component. Taking an embedded device installed with a Linux operating system (may be referred to as a Linux embedded device for short) as an example, the step is to establish a data connection between the new component and the kernel of the Linux system, i.e. to enable the new component to perform data interaction with the kernel of the Linux system through the target communication node.
The binding of the component to a communication node or the establishment of a data connection between the component and each communication node can be done in a number of ways, preferably in a soft link. The soft link (also called symbolic link) is another link method different from the hard link, and the content stored in the file user data block in the link method is the point of the path name of another file. The soft link is a common file, and the content of the data block is only a little special. Soft links may be created for files or directories.
And hard links are links made through the inode. In Linux, it is allowed that multiple files point to the same inode, and such a link is a hard link. Hard links can only link between files in the same file system, and directories cannot be created. If the source file corresponding to the hard link is deleted, the hard link file still exists and the original content is saved, so that the file can be prevented from being deleted by mistake due to misoperation. Since the hard links are files having the same inode number but different file names, deleting one hard link file does not affect other files having the same inode number.
Soft linking is mainly applied in two aspects: the method is convenient to manage, for example, files under a complex path can be linked to files under a simple path, so that users can conveniently access the files; and on the other hand, the situation that the disk space of the file system is insufficient is solved. For example, a file system space is used up, but now a new directory must be created under the file system and a large number of files must be stored, then a directory in another file system with more space left can be linked to the file system, so that the problem of insufficient space can be solved well. Deleting a soft link does not affect the pointed to file, but if the pointed to original file is deleted, the associated soft link becomes a dead link.
Therefore, the soft link technology can be specifically adopted to establish the corresponding relation between the new component and the target communication node so as to realize the data communication between the Linux kernel and the new component through the target communication stage. Of course, other ways of achieving the same or similar technical effect as the soft link technique may be used.
The component access method provided by the embodiment of the disclosure identifies the identity information of the accessed new component, distinguishes different types of components based on the identity information, and establishes the binding relationship between the new component and the matched target communication node, thereby avoiding the problem that the kernel of the embedded device does not distinguish the accessed components and randomly allocates the communication nodes, enabling the embedded device to support hot plug of the component, eliminating the need of manually adjusting the communication node information in the configuration item after replacing the component each time, and reducing the difficulty of replacing the component.
Referring to fig. 3, fig. 3 is a flowchart of another component access method according to an embodiment of the disclosure, where the process 300 includes the following steps:
step 301: allocating a new communication node for the new component, and acquiring a component driving application from a preset storage position of the new component;
the new communication node allocated to the new component in this step is randomly selected from all allocatable communication nodes by the Linux kernel or allocated to the new component in a fixed order, and it can be understood that in this case, the probability that the new communication node is just the target communication node matched with the new component is low. Namely, the embodiment is directed to the Linux embedded device.
Step 302: loading a driver application to obtain a component name of a new component;
step 301 and step 302 provide a specific manner of obtaining the identity information of the component name as the identity information of the new component by loading the driver application of the new component. The driver application stored in the new component storage space is written based on the functional characteristics of the new component, so that all relevant information of the new component, such as a component name, a component number, a component model number and the like, can be acquired in a correct loading mode.
Step 303: determining a component type corresponding to the component name through a preset type corresponding table;
in this embodiment, a type correspondence table is preset, and correspondence between different identity information and different component types is recorded in the type correspondence table.
Step 304: determining a target communication node corresponding to the component type;
the information about which communication nodes correspond to which component types can be obtained in various ways, for example, according to the functional characteristics of the communication nodes, the number of different types of components used, the replacement frequency, the replacement complexity, the compatibility, and so on.
One implementation, including and not limited to, is:
receiving node configuration information transmitted by a preset external node;
and dividing each communication node in the Linux embedded equipment into target communication nodes corresponding to different component types according to the node configuration information. I.e. in such a way that the correspondence between the component type and the communication node is determined from externally incoming configuration information. It should be noted that, if the embedded device is not a Linux embedded device, the implementation method also needs to be adjusted accordingly to match the actual application scenario.
Step 305: judging whether the new communication node is a target communication node, if so, executing a step 307, otherwise, executing a step 306;
on the basis of step 304, this step is intended to determine by the executing agent whether or not the new communication node previously assigned to the new component happens to be the matching target communication node.
Step 306: disconnecting the new component from the new communication node through a soft link technology, and establishing the connection between the new component and the target communication node;
this step is established in that if the determination result of step 305 is that the new communication node is not the target communication node, it means that to implement normal use of the new component, the corresponding relationship between the new component and the communication node needs to be adjusted, that is, the soft link technology disconnects the new component from the new communication node, and establishes the connection between the new component and the target communication node.
Step 307: and (6) ending.
In this step, when the determination result in step 305 is that the new communication node is exactly the target communication node, it is indicated that the current new component can already be normally communicated with the Linux kernel and can be normally used, and therefore, other operations do not need to be executed, and the process is finished directly.
On the basis of the previous embodiment, the present embodiment specifically takes the case where a new communication node is allocated by a Linux kernel when a new component is accessed as an example, and specifically provides a way to obtain identity information through steps 301 to 302, so as to obtain more accurate identity information by means of a driver application; also provided by step 303 is a method for quickly and accurately determining the component type of a new component by means of a pre-constructed type correspondence table; and judging whether the new communication node is the target communication node or not through steps 305 to 307, and respectively giving different subsequent processing modes according to the judgment result so as to ensure that the counted new components can be normally used through the subsequent processing.
It should be understood that the manner of acquiring the identity information based on the driver application provided in steps 301 to 302, the manner of determining the component type through the pre-constructed type correspondence table provided in step 303, and the manner of determining the component type provided in steps 305 to 307 do not have causal and dependency relationships therebetween, are examples of the lower level implementation modes respectively given for different upper level schemes in the present embodiment, and the three lower level implementation modes may completely form respective embodiments separately from the embodiment shown in fig. 2, and the present embodiment only exists as a preferred embodiment that includes the three lower level implementation modes at the same time.
On the basis of any of the above embodiments, it is considered that, in some special cases, an old component may be removed from an embedded device, but a binding relationship between the old component and a target communication node matched with the old component cannot be removed therewith, which results in finding that the target communication node is currently in a busy state when the target communication node is allocated to a new component for access (for example, whether there is a response meeting expectations may be determined by sending a test packet thereto). For such a situation, the use state of the original access component currently occupying the target communication node can be further determined, and when the use state is found to be unavailable, the binding relationship between the original access component and the target communication node is released through a soft link technology. So that the binding relationship between the target communication node and the new component can be established sequentially.
Of course, the above-mentioned situation that the old binding relationship needs to be released to enable the new binding relationship to be sequentially established is often established in the case that the target communication node can establish the binding relationship with only one component, and in the case that the target communication node that may exist can establish the binding relationship with a plurality of components at the same time, the releasing operation of the old binding relationship may be performed in parallel with or behind the establishing operation of the new binding relationship.
For further understanding, the present disclosure also relates to a specific application scenario pair, and how to solve the technical problem through the technical solution of the present disclosure.
The technical problem to be solved is as follows: the method has the advantages that the problem that the touch screen cannot be used by an upper application program of the Linux embedded device is caused due to the fact that the Event device node in the Linux embedded device jumps caused by adding an input device or replacing the touch screen, so that the Event device node corresponding to the touch screen changes.
The reason for this technical problem: in an embedded device provided with a touch screen, the replacement of the touch screen will cause the input device connected to the touch screen to change frequently, and the change causes the input device corresponding to the touch screen to change, for example, the input device corresponding to the touch screen is event1 before, and the input device corresponding to the touch screen changes to event2 after the change. The upper application program needs to configure the touch screen device first, and due to a change of the touch screen device, for example, an event1 is configured for the touch screen before, when the newly accessed touch screen device becomes an event2, the newly accessed touch screen cannot be used normally by the previously configured touch screen parameters.
The purpose is solved: through the fixed touch screen equipment, the parameters of the touch screen are configured into the fixed equipment, so that the problem that the QT program cannot normally use the touch screen due to the change of the touch screen equipment is solved.
The idea for realizing the purpose is as follows: the most important is to correctly identify the touch screen device from different input devices, and sometimes the change of the loading sequence of the input devices causes the upper layer application not to normally use the touch screen, so the design comprises two main parts: (1) and automatically searching the input device according to the name of the touch screen device. (2) The touch screen input device is bound through a soft link technique.
1. Find touch screen device
The touch screen belongs to an input device, and the number of a main device is generally 13, but the number of the device is not fixed. And through traversing/dev/input, performing ioctl reading equipment information to judge whether the equipment is the touch screen equipment. And obtaining the equipment name corresponding to the touch screen through an ioctl (fd, eviiocgname (sizeof (buf)) function, matching the equipment name with the hardware equipment name of the touch screen, and if the matching is successful, indicating that eventX is the input equipment corresponding to the touch screen.
2. Stationary touch screen device
And fixing the searched touch screen input device by using a soft link technology, wherein the 'ln-s/dev/input/eventX/dev/input/ts 0' is the touch screen input device. The QT program only needs to configure "/dev/input/ts 0" for the configuration of the touch screen, and even if the input device corresponding to the touch screen is changed, the use of the touch screen is not affected.
A complete implementation flow is as follows:
loading a touch screen drive, and searching the name of the touch screen equipment through the touch screen drive;
calling an identification module, and searching a corresponding event equipment node by the identification module according to the set name of the touch screen equipment;
if the identification is successful, fixing the event node corresponding to the touch screen into a touchscreen through soft link;
if the recognition fails, the recognition module returns a failure and prints an error from the host program.
In the embodiment, the device name of the new touch screen is obtained by loading the accessed driver of the new touch screen, so that the component is determined to be the touch screen component in the input device based on the obtained device name, and then the event device node of the new touch screen component is modified into the corresponding event device node, so that the Linux embedded device can support hot plug of the input device, the event device node in the configuration item does not need to be manually adjusted after the touch screen is replaced each time, and the difficulty in replacing the touch screen is reduced.
With further reference to fig. 4, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides an embodiment of a component access apparatus, which corresponds to the method embodiment shown in fig. 2, and which can be applied in various electronic devices.
As shown in fig. 4, the component access apparatus 400 of the present embodiment may include: an identity information obtaining unit 401, a component type and target communication node determining unit 402, and a node binding unit 403. Wherein, the identity information obtaining unit 401 is configured to obtain identity information of a new component accessing the embedded device; a component type and target communication node determining unit 402 configured to determine a component type of the new component according to the identity information, and determine a target communication node corresponding to the component type; a soft link binding node unit 403 configured to bind the new component to the target communication node so that the new component communicates with the embedded device through the target communication node.
In the present embodiment, in the component access apparatus 400: the specific processes of the identity information obtaining unit 401, the component type and target communication node determining unit 402, and the node binding unit 403 and the technical effects thereof can refer to the related descriptions of step 201 and step 203 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of this embodiment, the identity information obtaining unit 401 may be further configured to:
acquiring a component driving application from a preset storage position of the new component;
the load driver application obtains the component name of the new component.
In some optional implementations of this embodiment, the component type and target communication node determining unit 402 may include a component type determining subunit configured to determine the component type of the new component according to the identity information, and the component type determining subunit may be further configured to:
determining the component type corresponding to the identity information through a preset type corresponding table; wherein, the type corresponding table records the corresponding relationship between different identity information and different component types.
In some optional implementations of this embodiment, the component access apparatus 400 may further include:
a node configuration information receiving unit configured to receive node configuration information incoming through a preset information incoming node;
and the communication node dividing unit is configured to divide each communication node in the embedded device into target communication nodes corresponding to different component types according to the node configuration information.
In some optional implementations of this embodiment, when the embedded device is a Linux embedded device, the node binding unit 403 may be further configured to:
responding to the fact that a new communication node is distributed by a Linux kernel when the new component is accessed and the new communication node is different from the target communication node, disconnecting the connection between the new component and the new communication node through a soft link technology, and establishing the connection between the new component and the target communication node; the Linux kernel is a kernel of a Linux system running in the Linux embedded device.
In some optional implementations of this embodiment, the component access apparatus 400 may further include:
a use state determination unit configured to determine, in response to a target communication node being currently in an occupied state, a use state of an original access component currently occupying the target communication node;
and the binding relation removing unit is configured to remove the binding relation between the original access component and the target communication node through a soft link technology in response to the use state being unavailable.
The component access device provided by the embodiment of the present disclosure (the embodiment exists as a device embodiment corresponding to the above method embodiment) identifies the identity information of the accessed new component, distinguishes different types of components based on the identity information, and establishes a binding relationship between the new component and the matched target communication node, thereby avoiding the problem that the kernel of the embedded device does not distinguish the accessed components and randomly allocates communication nodes, so that the embedded device can support hot plug of the component, does not need to manually adjust the communication node information in the configuration item after replacing the component each time, and reduces the difficulty of component replacement.
According to an embodiment of the present disclosure, the present disclosure also provides an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can realize any component access method when executing the instructions.
According to an embodiment of the present disclosure, the present disclosure further provides a readable storage medium, which stores computer instructions for enabling a computer to implement any one of the component access methods described above when executed.
The disclosed embodiments provide a computer program product, which when executed by a processor is capable of implementing any one of the above component access methods.
FIG. 5 illustrates a schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the apparatus 500 comprises a computing unit 501 which may perform various appropriate actions and processes in accordance with a computer program stored in a Read Only Memory (ROM)502 or a computer program loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The calculation unit 501, the ROM 502, and the RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
A number of components in the device 500 are connected to the I/O interface 505, including: an input unit 506 such as a keyboard, a mouse, or the like; an output unit 507 such as various types of displays, speakers, and the like; a storage unit 508, such as a magnetic disk, optical disk, or the like; and a communication unit 509 such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The computing unit 501 may be a variety of general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 501 performs the various methods and processes described above, such as the component access methods. For example, in some embodiments, the component access methods may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 500 via the ROM 502 and/or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the component access method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the component access method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The 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, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server may be a cloud Server, which is also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service extensibility in the conventional physical host and Virtual Private Server (VPS) service.
According to the method and the device, the identity information of the accessed new component is identified, the different types of components are distinguished based on the identity information, and the binding relationship between the new component and the matched target communication node is established, so that the problems that an embedded device kernel does not distinguish the accessed components and randomly distributes the communication nodes are avoided, the embedded device can support hot plug of the components, the communication node information in the configuration item does not need to be manually adjusted after the components are replaced each time, and the difficulty in component replacement is reduced.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (15)

1. A component access method, comprising:
acquiring identity information of a new component accessed to the embedded equipment;
determining the component type of the new component according to the identity information, and determining a target communication node corresponding to the component type;
binding the new component to the target communication node such that the new component communicates with the embedded device through the target communication node.
2. The method of claim 1, wherein the obtaining identity information of the new component accessing the embedded device comprises:
acquiring a component driving application from a preset storage position of the new component;
and loading the drive application to acquire the component name of the new component.
3. The method of claim 1, wherein the determining a component type of the new component from the identity information comprises:
determining the component type corresponding to the identity information through a preset type corresponding table; wherein, the type corresponding table records the corresponding relationship between different identity information and different component types.
4. The method of claim 1, further comprising:
receiving node configuration information transmitted by a preset external node;
and dividing each communication node in the embedded equipment into target communication nodes corresponding to different component types according to the node configuration information.
5. The method of claim 1, wherein the binding the new component to the target communication node when the embedded device is a Linux embedded device comprises:
in response to that a new communication node is allocated by a Linux kernel when the new component is accessed and the new communication node is different from the target communication node, disconnecting the new component from the new communication node through a soft link technology and establishing the connection between the new component and the target communication node; the Linux kernel is a kernel of a Linux system running in the Linux embedded device.
6. The method of any of claims 1-5, further comprising:
responding to the current occupied state of the target communication node, and determining the use state of an original access component currently occupying the target communication node;
and in response to the use state being unavailable, releasing the binding relationship between the original access component and the target communication node through a soft link technology.
7. A component access device, comprising:
an identity information acquisition unit configured to acquire identity information of a new component accessed to the embedded device;
a component type and target communication node determining unit configured to determine a component type of the new component according to the identity information and determine a target communication node corresponding to the component type;
a node binding unit configured to bind the new component to the target communication node to enable the new component to communicate with the embedded device through the target communication node.
8. The apparatus of claim 7, wherein the identity information acquisition unit is further configured to:
acquiring a component driving application from a preset storage position of the new component;
and loading the drive application to acquire the component name of the new component.
9. The apparatus of claim 7, wherein the component type and target communication node determining unit comprises a component type determining subunit configured to determine a component type of the new component from the identity information, the component type determining subunit further configured to:
determining the component type corresponding to the identity information through a preset type corresponding table; wherein, the type corresponding table records the corresponding relationship between different identity information and different component types.
10. The apparatus of claim 7, further comprising:
a node configuration information receiving unit configured to receive node configuration information incoming through a preset information incoming node;
and the communication node dividing unit is configured to divide each communication node in the embedded equipment into target communication nodes corresponding to different component types according to the node configuration information.
11. The apparatus of claim 7, wherein, when the embedded device is a Linux embedded device, the node binding unit is further configured to:
in response to that a new communication node is allocated by a Linux kernel when the new component is accessed and the new communication node is different from the target communication node, disconnecting the new component from the new communication node through a soft link technology and establishing the connection between the new component and the target communication node; the Linux kernel is a kernel of a Linux system running in the Linux embedded device.
12. The apparatus of any of claims 7-11, further comprising:
a usage state determination unit configured to determine, in response to the target communication node being currently in an occupied state, a usage state of an original access component currently occupying the target communication node;
a binding relation releasing unit configured to release the binding relation between the original access component and the target communication node through a soft link technology in response to the use status being unavailable.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the component access method of any one of claims 1-6.
14. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the component access method of any one of claims 1-6.
15. A computer program product comprising a computer program which, when executed by a processor, implements a component access method according to any one of claims 1-6.
CN202110438562.4A 2021-04-22 2021-04-22 Component access method, device, electronic equipment, storage medium and program product Active CN113076273B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110438562.4A CN113076273B (en) 2021-04-22 2021-04-22 Component access method, device, electronic equipment, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110438562.4A CN113076273B (en) 2021-04-22 2021-04-22 Component access method, device, electronic equipment, storage medium and program product

Publications (2)

Publication Number Publication Date
CN113076273A true CN113076273A (en) 2021-07-06
CN113076273B CN113076273B (en) 2023-08-08

Family

ID=76618562

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110438562.4A Active CN113076273B (en) 2021-04-22 2021-04-22 Component access method, device, electronic equipment, storage medium and program product

Country Status (1)

Country Link
CN (1) CN113076273B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140379800A1 (en) * 2013-06-25 2014-12-25 Actiontec Electronics, Inc. Systems and methods for sharing digital information between mobile devices of friends and family by loading application components onto embedded devices
US20150359026A1 (en) * 2012-12-21 2015-12-10 Nec Corporation Radio communication system, radio access network node, communication device, and core network node
US20190364492A1 (en) * 2016-12-30 2019-11-28 Intel Corporation Methods and devices for radio communications

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150359026A1 (en) * 2012-12-21 2015-12-10 Nec Corporation Radio communication system, radio access network node, communication device, and core network node
US20140379800A1 (en) * 2013-06-25 2014-12-25 Actiontec Electronics, Inc. Systems and methods for sharing digital information between mobile devices of friends and family by loading application components onto embedded devices
US20190364492A1 (en) * 2016-12-30 2019-11-28 Intel Corporation Methods and devices for radio communications

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
石志国;贺也平;淮晓永;张宏;: "一种面向网格计算的分布式匿名协作算法", 计算机研究与发展, no. 1 *

Also Published As

Publication number Publication date
CN113076273B (en) 2023-08-08

Similar Documents

Publication Publication Date Title
CN109587271B (en) Main chain parallel chain architecture system, block synchronization method, equipment and storage medium
US7702655B1 (en) Maintaining and using user-created mapping history for network resource mapping
US10860539B2 (en) De-duplication-based remote replication method, and apparatus
CN109241014B (en) Data processing method and device and server
CN110688305B (en) Test environment synchronization method, device, medium and electronic equipment
CN112433812B (en) Virtual machine cross-cluster migration method, system, equipment and computer medium
CN111225073B (en) Service code distribution method and device, storage medium and computer system
CN103701653A (en) Processing method for interface hot plugging and unplugging configuration data and network configuration server
JP2016504672A (en) Method of applying virtual machine image to computer system, information processing system, and computer program
CN111209125B (en) Multi-process command line implementation method
US20230161664A1 (en) Method of responding to operation, electronic device, and storage medium
US8056052B2 (en) Populating service requests
CN113076273A (en) Component access method, device, electronic equipment, storage medium and program product
CN107665210A (en) Data processing method and device
CN113360689B (en) Image retrieval system, method, related device and computer program product
CN115640280A (en) Data migration method and device
CN115329395A (en) Database data processing method, device, system, equipment and storage medium
CN112714163B (en) Data transmission method, device, electronic equipment and medium
CN109901933B (en) Operation method and device of business system, storage medium and electronic device
CN109740027B (en) Data exchange method, device, server and storage medium
CN114003497A (en) Method, device and equipment for testing service system and storage medium
US20150195366A1 (en) Switching device, non-transitory computer readable medium and zoning setting method
CN114722261A (en) Resource processing method and device, electronic equipment and storage medium
CN110554915A (en) Information processing method and device, computer storage medium and terminal
CN117311832B (en) PCIE equipment starting mode display method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant