[go: up one dir, main page]

CN114443518B - Access method and electronic device - Google Patents

Access method and electronic device Download PDF

Info

Publication number
CN114443518B
CN114443518B CN202210112425.6A CN202210112425A CN114443518B CN 114443518 B CN114443518 B CN 114443518B CN 202210112425 A CN202210112425 A CN 202210112425A CN 114443518 B CN114443518 B CN 114443518B
Authority
CN
China
Prior art keywords
request
access
access information
target device
request instruction
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.)
Active
Application number
CN202210112425.6A
Other languages
Chinese (zh)
Other versions
CN114443518A (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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN202210112425.6A priority Critical patent/CN114443518B/en
Publication of CN114443518A publication Critical patent/CN114443518A/en
Application granted granted Critical
Publication of CN114443518B publication Critical patent/CN114443518B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/10Program control for peripheral devices
    • G06F13/12Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor
    • G06F13/124Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine
    • G06F13/126Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine and has means for transferring I/O instructions and statuses between control unit and main processor
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请公开了一种访问方法及电子设备,该方法包括:获取用于访问目标设备的至少一个访问信息;基于预设排序方式,对所述访问信息的处理顺序实施排序;基于所述处理顺序,获取当前处理的所述访问信息对应的请求指令集,生成与所述请求指令集相对应的第一访问请求和第一获取请求,其中,所述请求指令集用于请求从所述目标设备中获取目标数据;至少基于所述第一访问请求和所述第一获取请求,从所述目标设备中获取所述目标数据。该方法能够对获取到的多个不同的访问信息进行排序,使得所有相应的请求指令集之间不会发生冲突,而且也使得同一个请求指令集中的各个指令也不会发生冲突。实现目标设备反馈正确的目标数据,保证了整个访问过程的成功。

The present application discloses an access method and an electronic device, the method comprising: obtaining at least one access information for accessing a target device; sorting the processing order of the access information based on a preset sorting method; obtaining a request instruction set corresponding to the currently processed access information based on the processing order, generating a first access request and a first acquisition request corresponding to the request instruction set, wherein the request instruction set is used to request to obtain target data from the target device; obtaining the target data from the target device based on at least the first access request and the first acquisition request. The method can sort the multiple different access information obtained, so that there will be no conflict between all corresponding request instruction sets, and also so that there will be no conflict between the various instructions in the same request instruction set. The target device is enabled to feedback the correct target data, thus ensuring the success of the entire access process.

Description

Access method and electronic equipment
Technical Field
The present application relates to the field of device management and interaction, and in particular, to an access method and an electronic device.
Background
When devices accessing and controlling hardware manage and access, the phenomenon that access processes conflict with each other often occurs.
Disclosure of Invention
The embodiment of the application provides an access method, which comprises the following steps:
acquiring at least one piece of access information for accessing the target device;
based on a preset ordering mode, ordering is carried out on the processing sequence of the access information;
Acquiring a request instruction set corresponding to the access information currently processed based on the processing sequence, and generating a first access request and a first acquisition request corresponding to the request instruction set, wherein the request instruction set is used for requesting to acquire target data from the target equipment;
the target data is acquired from the target device based at least on the first access request and the first acquisition request.
Optionally, the method further comprises:
acquiring the information type of the access information;
And in the case that the information type is determined to be the first type, placing the corresponding access information in an ordering queue.
Optionally, the sorting the processing sequence of the access information based on the preset sorting manner includes:
based on the acquisition time of the access information, sequencing the processing sequence of the access information by utilizing the constructed layer structure;
and adding the access information for completing the sorting into a constructed sorting queue.
Optionally, the request instruction set includes a set request instruction and an acquisition request instruction, the acquiring the request instruction set corresponding to the access information currently processed, generating a first access request and a first acquisition request corresponding to the request instruction set, including:
And converting the acquisition request instruction into a corresponding first access request and a first acquisition request by using an agent connected with the layer structure.
Optionally, the method further comprises:
And sequencing the first access request, the first acquisition request and the setting request instruction belonging to the same request instruction set according to a sequence order so as to interact with the target equipment based on the formed sequence order.
Optionally, the acquiring the target data from the target device based at least on the first access request and the first acquisition request includes:
transmitting the first access request to the target device so that the target device determines corresponding target data;
And after receiving the feedback of the target equipment, sending the first acquisition request to the target equipment so as to acquire the target data.
Optionally, the layer structure is HID HELPER layers, a unified interface is provided in the HID HELPER layers, the unified interface is configured to receive the access information sent by at least one process, and the acquiring at least one access information for accessing the target device includes: and acquiring the access information through the unified interface.
Optionally, the target device is an HID device, and the acquiring the target data from the target device specifically includes:
and acquiring partial or all data of the HID sub-device from the HID device.
Alternatively, in the case where the target device is an HID device, the setting request instruction is a Set Report instruction, and the acquisition request instruction is a Get Report instruction.
The embodiment of the application also provides electronic equipment, which comprises a memory and a processor, wherein the memory stores executable programs, and the processor processes the executable programs to execute the steps of the method.
The access method of the embodiment of the application can sort the acquired multiple different access information, thereby realizing the sorting of the corresponding request instruction sets, avoiding the conflict among all the request instruction sets and avoiding the conflict of each instruction in the same request instruction set. And the target equipment processes different instructions respectively, so that the target equipment feeds back correct target data, and the success of the whole access process is ensured.
Drawings
FIG. 1 is a flow chart of an access method according to an embodiment of the present application;
FIG. 2 is a flow chart of one embodiment of an access method according to an embodiment of the present application;
FIG. 3 is a flow chart of one embodiment of step S200 of FIG. 1 according to an embodiment of the present application;
FIG. 4 is a flow chart of one embodiment of step S400 of FIG. 1 according to an embodiment of the present application;
FIG. 5 is a flow chart of one embodiment of an access method of an embodiment of the present application;
FIG. 6 is a block diagram of an electronic device according to an embodiment of the application;
FIG. 7 is a block diagram of another electronic device according to an embodiment of the present application;
Detailed Description
Various aspects and features of the present application are described herein with reference to the accompanying drawings.
It should be understood that various modifications may be made to the embodiments of the application herein. Therefore, the above description should not be taken as limiting, but merely as exemplification of the embodiments. Other modifications within the scope and spirit of the application will occur to persons of ordinary skill in the art.
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the application and, together with a general description of the application given above, and the detailed description of the embodiments given below, serve to explain the principles of the application.
These and other characteristics of the application will become apparent from the following description of a preferred form of embodiment, given as a non-limiting example, with reference to the accompanying drawings.
It is also to be understood that, although the application has been described with reference to some specific examples, those skilled in the art can certainly realize many other equivalent forms of the application.
The above and other aspects, features and advantages of the present application will become more apparent in light of the following detailed description when taken in conjunction with the accompanying drawings.
Specific embodiments of the present application will be described hereinafter with reference to the accompanying drawings; however, it is to be understood that the disclosed embodiments are merely exemplary of the application, which can be embodied in various forms. Well-known and/or repeated functions and constructions are not described in detail to avoid obscuring the application in unnecessary or unnecessary detail. Therefore, specific structural and functional details disclosed herein are not intended to be limiting, but rather to teach one skilled in the art to variously employ the present application in virtually any appropriately detailed structure.
The specification may use the word "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may each refer to one or more of the same or different embodiments in accordance with the application.
The access method of the embodiment of the application can be applied to the process of accessing the HID associated with the electronic device by the electronic device, wherein the HID can be a USB-based HID, USB-HID is an abbreviation of Universal Serial Bus-Human INTERFACE DEVICE, and the HID is a device which can interact with Human, such as a keyboard, a mouse, a joystick and the like. The method can control the access process in the process that the body of the electronic equipment accesses the target equipment such as the HID equipment.
Fig. 1 is a flowchart of an access method according to an embodiment of the present application, as shown in fig. 1 and described in detail with reference to fig. 4, the method includes the following steps:
S100, at least one piece of access information for accessing the target device is acquired.
The target device is illustratively a device associated with the electronic device, such as the HID device described above that is connected to the body of the electronic device. The target device is the target of the access, e.g. the target of the body access of the electronic device is an HID device. The access information includes information about the access target device, and may include information about a specific target, access time, access content, and the like. The access information may be of various types and the purpose of different access information to access the target device may be different. For example, the multiple different threads generated by the electronic device all access the target device, but the access information corresponding to the different threads is not the same.
In this embodiment, when access information is acquired, the electronic device may acquire all the access information through a pre-built unified interface, so that unified processing can be performed on the acquired access information.
S200, sorting is carried out on the processing sequence of the access information based on a preset sorting mode.
The preset ordering mode may be configured according to actual requirements, for example, may be configured according to time when the access information is acquired, may be configured according to a priority corresponding to the access information, and may be configured according to an identifier of a target device corresponding to the access information.
The access information is ordered based on a preset ordering mode, for example, the access information can be arranged in a queue according to the acquired access information, then the access information is processed according to the sequence in the queue, the acquired access information is processed first, and then the acquired access information is processed later. The access information is processed according to the arranged sequence, so that accidents of conflict processing among different access information can be avoided.
For example, two different threads send access information to the first target device, if the access information corresponding to the two threads is sequenced (the corresponding request instruction sets are sequenced), the request instruction sets corresponding to the respective access information can be processed one by one according to the logic sequence formed after sequencing, so that the phenomenon of information disorder caused by processing conflict can be avoided.
S300, acquiring a request instruction set corresponding to the access information which is currently processed based on the processing sequence, and generating a first access request and a first acquisition request corresponding to the request instruction set, wherein the request instruction set is used for requesting to acquire target data from the target equipment.
Illustratively, after the processing sequences of the access information are ordered, a corresponding processing sequence is formed, and the electronic device may process the access information according to the processing sequence. The access information corresponds to a request instruction set, where the request instruction set is used to request to obtain target data from the target device, for example, the first access information includes a plurality of different request instructions (all the request instructions may be used as a request instruction set), so as to request to obtain a plurality of different feedback information of the target device.
In one embodiment, the request instruction set includes multiple types of request instructions, such as may include a get request instruction and a set request instruction. For example, the Get request instruction is a Get Report instruction, and the Set request instruction is a Set Report instruction. The Get Report instruction is used for acquiring information, and the Set Report instruction is used for setting target equipment. The Get Report instruction may be converted into a corresponding first access request and a first acquisition request, for example, into a Set Feature instruction and a Get Feature instruction, which form a first access request and a first acquisition request corresponding to the request instruction Set.
S400, acquiring the target data from the target equipment at least based on the first access request and the first acquisition request.
Illustratively, the fetch request instructions in the same request instruction Set correspond to a first access request (e.g., the Set Feature instruction described above) and a first fetch request (e.g., the Get Feature instruction described above). The first access request and the first acquisition request have relative logic processing sequences, the first access request can be sent to the target device first, so that the target device determines corresponding target data according to the first access request, then the first acquisition request can be sent to the target device, the target device can send the target data to a requester according to the first acquisition request, such as an entity of the electronic device, and therefore, loopholes can not occur in the processing process of the acquisition request instruction and the related instruction thereof, such as the phenomenon that the acquisition request instruction in the request instruction set is not executed all the time.
Further, the target device may be accessed based on a logical order among a first access request, a first fetch request, and other instructions in the request instruction set corresponding to the same request instruction set. The target device is accessed, for example, based on the first access request, the first acquisition request, and a set request instruction in the request instruction set. Such as accessing the target device in the following order: a first access request (e.g., the Set Feature instruction described above), a first fetch request (e.g., the Get Feature instruction described above), and a Set request instruction (e.g., the Set Report instruction described above). This allows individual instructions in the same request instruction set to not conflict.
Since different sets of requested instructions also have processing sequences, no conflict occurs for all instructions. And the target equipment processes different instructions respectively in sequence to realize that the target equipment feeds back correct target data, such as buffer data.
The access method can sort the acquired different access information, thereby realizing the sorting of the corresponding request instruction sets, avoiding the conflict among all the request instruction sets and avoiding the conflict of each instruction in the same request instruction set. And the target equipment processes different instructions respectively, so that the target equipment feeds back correct target data, and the success of the whole access process is ensured.
In one embodiment of the present application, as shown in fig. 2, the method further comprises the steps of:
s500, obtaining the information type of the access information.
Illustratively, the access information is of a variety of different types, such as an input report type, an output report type, and a feature report type. The type of the acquired access information can be determined by the identification of the access information, and the type of the access information can also be determined by the data structure of the access information.
For different information types, a processing mode matched with the information types can be adopted.
And S600, in the case that the information type is determined to be the first type, placing the corresponding access information in a sorting queue.
Illustratively, in connection with FIG. 4, the first type may be a feature report type, with access information of the feature report type placed in an ordering queue. So that the feature report type of access information can be processed in the order formed in the ordering queue (e.g., the first ordering queue).
Of course, the first type may be other types of access information, and other types of access information may be processed in other manners. For example, the method can be used for processing similar manner to the method for processing the access information of the feature report type, such as using a second sorting queue to place the access information of the input report type, and then uniformly processing the access information in the second sorting queue; and placing the access information of the output report type by using the third sorting queue, and further uniformly processing the access information in the third sorting queue.
Of course, the processing may be performed in a manner completely different from the processing of the access information of the feature report type, which is not limited herein. Thus, for the same type of access information arranged in the same ordering queue, the processing efficiency can be effectively improved during specific processing.
In one embodiment of the present application, the sorting the processing order of the access information based on the preset sorting manner, as shown in fig. 3, includes:
s210, based on the acquisition time of the access information, sequencing the processing sequence of the access information by using the constructed layer structure.
S220, adding the access information with the completed sequencing into the constructed sequencing queue.
The layer structure is illustratively a virtual structure that may be disposed between the requesting party and the target device, such as between the thread/process and the HDI device. The relatively independent hierarchy can receive access information sent by a plurality of different requesters in a unified and orderly mode, and then the received access information is ordered. Including ordering the access information by the acquisition time at which the access information can be acquired in accordance with the hierarchy. For example, access information acquired first adds it to the front of the ordering queue and access information acquired later adds it to the back of the ordering queue. Thereby gradually realizing the ordering of the whole access information.
When the access information in the sequencing queue is processed, the access information is obtained from the head of the sequencing queue to be used as current processing access information, and all the access information is further processed step by step in sequence.
In one embodiment of the present application, the request instruction set includes a set request instruction and an acquire request instruction, the acquiring the request instruction set corresponding to the access information currently processed, generating a first access request and a first acquire request corresponding to the request instruction set, including:
And converting the acquisition request instruction into a corresponding first access request and a first acquisition request by using an agent connected with the layer structure.
For example, the request instruction Set may include various request instructions, and in this embodiment, it is clear that the request instruction Set includes a Set request instruction and an acquire request instruction, where in a case where the target device is an HID device, the Set request instruction may be a Set Report instruction, and the acquire request instruction may be a Get Report instruction, where the Get Report instruction is used to acquire information, and the Set Report instruction is used to Set the target device.
The layer structure is connected with an Agent, the Agent can be arranged between the layer structure and the target equipment, after the layer structure determines a corresponding request instruction set according to the access information, the Agent can receive the request instruction set from the layer structure, further, the setting request instruction and the acquisition request instruction in the request instruction set are ordered, and then the acquisition request instruction in the request instruction set is converted into a corresponding first access request and a corresponding first acquisition request.
In one embodiment of the application, the method further comprises the steps of: and sequencing the first access request, the first acquisition request and the setting request instruction belonging to the same request instruction set according to a sequence order so as to interact with the target equipment based on the formed sequence order.
Illustratively, the first access request, the first fetch request, and the set request instruction in the same set of request instructions are ordered. So that no conflict occurs among the first access request, the first acquisition request and the setting request instruction.
For example, with reference to FIG. 5, the instructions in the first request instruction Set are ordered, the Get Report instruction is ordered first, and the Set Report instruction is ordered second. So that the Get Report instruction is processed in advance. The Set Feature instruction and the Get Feature instruction are converted into the Set Feature instruction and the Get Feature instruction, so that the Set Feature instruction can be sent to the target equipment first, and the Get Feature instruction can be sent to the target equipment after feedback is obtained. And then sending a Set Report instruction to the target equipment. Thereby avoiding collision between the respective instructions.
In one embodiment of the present application, the acquiring the target data from the target device based on at least the first access request and the first acquisition request, as shown in fig. 4, includes the following steps:
S410, the first access request is sent to the target device, so that the target device determines corresponding target data;
And S420, after receiving the feedback of the target equipment, sending the first acquisition request to the target equipment so as to acquire the target data.
Illustratively, the first access request is for a requestor to request target data that is required for a target device determination, such as determining relevant data for a sub-device in the target device. The target device determines the relevant data and feeds the relevant data back to the requesting party. The requester requests the related data of the sub-device to the target device again through the first acquisition request. And the target equipment feeds the target data back to the requester according to the first acquisition request. Therefore, the whole asking process is logical and is not confused.
For example, in one embodiment, the motherboard of the computer sends a Set feature instruction to the HID keyboard to ask the HID keyboard for the data of the lamp Set thereon, where the Set feature instruction may include target data such as position information, quantity information, and lighting state of the lamp, and the HID keyboard determines the target data to be fed back according to the Set feature instruction. And the main board of the computer sends a Get Feature instruction to the HID keyboard, and the HID keyboard feeds back target data about the lamp to the main board according to the Get Feature instruction. And then the main board sends a Set Report instruction to the HID keyboard, so that the state of the lamp can be Set.
In one embodiment of the present application, the layer structure is HID HELPER layers, a unified interface is provided in the HID HELPER layers, the unified interface is configured to receive the access information sent by at least one process, and the acquiring at least one access information for accessing a target device includes: and acquiring the access information through the unified interface.
For example, the HID HELPER layer may be disposed between a thread/process and an HID device, for example, the HID HELPER layer may be connected to a target device through an Agent (HID Agent), and the HID HELPER layer may be provided with a unified interface for receiving access information sent by one or more processes. The HID HELPER layer receives the access information and converts the access information into a corresponding request instruction set, the request instruction set is sent to the HID Agent, the HID Agent sequences a setting request instruction and an acquisition request instruction in the request instruction set into a sequencing queue, and then converts the acquisition request instruction into a corresponding first access request and a corresponding first acquisition request. And then interacting with the target device based on the instructions in the ordering queue.
In one embodiment of the present application, the target device is an HID device, and the acquiring the target data from the target device specifically includes: and acquiring partial or all data of the HID sub-device from the HID device.
For example, the HID device is a USB HID keyboard, and the target data obtained from the USB HID keyboard may be data related to some or all of the lamps on the USB HID keyboard. Such as the flashing status of the lamp.
The embodiment of the application also provides an electronic device, as shown in fig. 6, including:
An acquisition module configured to acquire at least one access information for accessing the target device.
The target device is illustratively a device associated with the electronic device, such as the HID device described above that is connected to the body of the electronic device. The target device is the target of the access, e.g. the target of the body access of the electronic device is an HID device. The access information includes information about the access target device, and may include information about a specific target, access time, access content, and the like. The access information may be of various types and the purpose of different access information to access the target device may be different. For example, the multiple different threads generated by the electronic device all access the target device, but the access information corresponding to the different threads is not the same.
In this embodiment, when the obtaining module obtains the access information, all the access information may be obtained through a pre-built unified interface, so that the obtained access information may be uniformly processed.
And the ordering module is configured to order the processing sequence of the access information based on a preset ordering mode.
The preset ordering mode may be configured according to actual requirements, for example, may be configured according to time when the access information is acquired, may be configured according to a priority corresponding to the access information, and may be configured according to an identifier of a target device corresponding to the access information.
The sorting module sorts the access information based on a preset sorting mode, for example, the access information can be arranged in a queue according to the acquired access information, and then the access information is processed according to the sequence in the queue, and the access information acquired first is processed and then the access information acquired later is processed. The access information is processed according to the arranged sequence, so that accidents of conflict processing among different access information can be avoided.
For example, two different threads send access information to the first target device, if the ordering module orders the access information corresponding to the two threads respectively (also orders the corresponding request instruction sets), the request instruction sets corresponding to the respective access information can be processed one by one according to the logic sequence formed after the ordering, so that the phenomenon of information disorder caused by conflict in processing can be avoided.
The processing module is configured to acquire a request instruction set corresponding to the access information currently processed based on the processing sequence, and generate a first access request and a first acquisition request corresponding to the request instruction set, wherein the request instruction set is used for requesting to acquire target data from the target equipment;
the target data is acquired from the target device based at least on the first access request and the first acquisition request.
Illustratively, after the ordering module performs ordering on the processing sequence of the access information, a corresponding processing sequence is formed, and the processing module may process the access information according to the processing sequence. The access information corresponds to a request instruction set, where the request instruction set is used to request to obtain target data from the target device, for example, the first access information includes a plurality of different request instructions (all the request instructions may be used as a request instruction set), so as to request to obtain a plurality of different feedback information of the target device.
In one embodiment, the request instruction set includes multiple types of request instructions, such as may include a get request instruction and a set request instruction. For example, the Get request instruction is a Get Report instruction, and the Set request instruction is a Set Report instruction. The Get Report instruction is used for acquiring information, and the Set Report instruction is used for setting target equipment. The processing module may convert the Get Report instruction into a corresponding first access request and a first acquisition request, for example, a Set Feature instruction and a Get Feature instruction, that is, a first access request and a first acquisition request corresponding to the request instruction Set are formed.
Illustratively, the fetch request instructions in the same request instruction Set correspond to a first access request (e.g., the Set Feature instruction described above) and a first fetch request (e.g., the Get Feature instruction described above). The first access request and the first acquisition request have relative logic processing sequences, and the processing module can firstly send the first access request to the target equipment, so that the target equipment can determine corresponding target data according to the first access request, and then can send the first acquisition request to the target equipment, so that the target equipment can send the target data to a requester according to the first acquisition request, such as an entity of the electronic equipment, thereby ensuring that loopholes can not occur in the processing process of the acquisition request instruction and the related instruction thereof, such as the phenomenon that the acquisition request instruction in the request instruction set is not executed all the time.
Further, the processing module may access the target device based on a logical order among a first access request, a first fetch request, and other instructions in the request instruction set corresponding to the same request instruction set. The target device is accessed, for example, based on the first access request, the first acquisition request, and a set request instruction in the request instruction set. Such as accessing the target device in the following order: a first access request (e.g., the Set Feature instruction described above), a first fetch request (e.g., the Get Feature instruction described above), and a Set request instruction (e.g., the Set Report instruction described above). This allows individual instructions in the same request instruction set to not conflict.
In one embodiment of the application, the ranking module is further configured to:
acquiring the information type of the access information;
And in the case that the information type is determined to be the first type, placing the corresponding access information in an ordering queue.
In one embodiment of the application, the ranking module is further configured to:
based on the acquisition time of the access information, sequencing the processing sequence of the access information by utilizing the constructed layer structure;
and adding the access information for completing the sorting into a constructed sorting queue.
In one embodiment of the application, the request instruction set includes a set request instruction and a get request instruction, and the processing module is further configured to:
And converting the acquisition request instruction into a corresponding first access request and a first acquisition request by using an agent connected with the layer structure.
In one embodiment of the application, the ranking module is further configured to:
And sequencing the first access request, the first acquisition request and the setting request instruction belonging to the same request instruction set according to a sequence order so as to interact with the target equipment based on the formed sequence order.
In one embodiment of the application, the processing module is further configured to:
transmitting the first access request to the target device so that the target device determines corresponding target data;
And after receiving the feedback of the target equipment, sending the first acquisition request to the target equipment so as to acquire the target data.
In one embodiment of the present application, the layer structure is HID HELPER layers, a unified interface is provided in the HID HELPER layers, the unified interface is used for receiving the access information sent by one or more processes, and the obtaining module is further configured to:
and acquiring the access information through the unified interface.
In one embodiment of the application, the target device is an HID device, and the processing module is further configured to:
and acquiring partial or all data of the HID sub-device from the HID device.
In one embodiment of the present application, in a case where the target device is an HID device, the setting request instruction is a Set Report instruction, and the acquisition request instruction is a Get Report instruction.
The embodiment of the application also provides an electronic device, as shown in fig. 7, which comprises a memory and a processor, wherein the memory stores an executable program, and the processor processes the executable program to execute the steps of the access method.
The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application, the scope of which is defined by the claims. Various modifications and equivalent arrangements of this application will occur to those skilled in the art, and are intended to be within the spirit and scope of the application.

Claims (9)

1.一种访问方法,包括:1. An access method, comprising: 获取用于访问目标设备的至少一个访问信息,其中,当同一个电子设备的多个不同的线程或进程均对目标设备进行访问时,相对应的所述访问信息不相同;Acquire at least one access information for accessing the target device, wherein when multiple different threads or processes of the same electronic device access the target device, the corresponding access information is different; 基于预设排序方式,对所述访问信息的处理顺序实施排序;Sorting the processing order of the access information based on a preset sorting method; 基于所述处理顺序,获取当前处理的所述访问信息对应的请求指令集,生成与所述请求指令集相对应的第一访问请求和第一获取请求,其中,所述请求指令集用于请求从所述目标设备中获取目标数据;Based on the processing sequence, obtaining a request instruction set corresponding to the currently processed access information, and generating a first access request and a first acquisition request corresponding to the request instruction set, wherein the request instruction set is used to request to obtain target data from the target device; 至少基于所述第一访问请求和所述第一获取请求,从所述目标设备中获取所述目标数据;其中,At least based on the first access request and the first acquisition request, the target data is acquired from the target device; wherein, 所述目标设备为HID设备,所述从所述目标设备中获取所述目标数据,具体为:从HID设备中获取部分或全部的HID子设备的数据。The target device is a HID device, and obtaining the target data from the target device specifically includes: obtaining part or all of the data of the HID sub-device from the HID device. 2.根据权利要求1所述的方法,所述方法还包括:2. The method according to claim 1, further comprising: 获取所述访问信息的信息类型;Acquire information type of the access information; 在确定所述信息类型为第一类型的情况下,将相应的所述访问信息放置在排序队列中。In the case where it is determined that the information type is the first type, the corresponding access information is placed in a sorting queue. 3.根据权利要求1所述的方法,所述基于预设排序方式,对所述访问信息的处理顺序实施排序,包括:3. The method according to claim 1, wherein the step of sorting the processing order of the access information based on a preset sorting method comprises: 基于所述访问信息的获取时间,利用构建的层结构,对所述访问信息的处理顺序实施排序;Based on the acquisition time of the access information, the processing order of the access information is sorted by using the constructed layer structure; 将完成排序的所述访问信息添加到构建的排序队列中。The access information that has completed sorting is added to the constructed sorting queue. 4.根据权利要求3所述的方法,所述请求指令集包括设置请求指令和获取请求指令,所述获取当前处理的所述访问信息对应的请求指令集,生成与所述请求指令集相对应的第一访问请求和第一获取请求,包括:4. The method according to claim 3, wherein the request instruction set comprises a set request instruction and an obtain request instruction, and the obtaining the request instruction set corresponding to the access information currently being processed, and generating a first access request and a first obtain request corresponding to the request instruction set, comprises: 利用与所述层结构相连接的智能体,将所述获取请求指令转换为相对应的第一访问请求和第一获取请求。The acquisition request instruction is converted into a corresponding first access request and a first acquisition request by using an agent connected to the layer structure. 5.根据权利要求4所述的方法,所述方法还包括:5. The method according to claim 4, further comprising: 将属于同一个所述请求指令集中的所述第一访问请求、所述第一获取请求以及所述设置请求指令按照先后顺序排序,以基于形成的排列顺序对所述目标设备进行交互。The first access request, the first acquisition request, and the setting request instructions belonging to the same request instruction set are sorted in order of precedence, so as to interact with the target device based on the formed arrangement order. 6.根据权利要求1所述的方法,所述至少基于所述第一访问请求和所述第一获取请求,从所述目标设备中获取所述目标数据,包括:6. The method according to claim 1, wherein obtaining the target data from the target device based at least on the first access request and the first acquisition request comprises: 将所述第一访问请求发送给所述目标设备,以使所述目标设备确定相应的目标数据;Sending the first access request to the target device so that the target device determines corresponding target data; 在接收到所述目标设备的反馈后,将所述第一获取请求发送给所述目标设备,以获取所述目标数据。After receiving the feedback from the target device, the first acquisition request is sent to the target device to acquire the target data. 7.根据权利要求3所述的方法,所述层结构为HID Helper层,所述HID Helper层中设置有统一接口,所述统一接口用于接收至少一个进程发送的所述访问信息,所述获取用于访问目标设备的至少一个访问信息,包括:通过所述统一接口获取所述访问信息。7. According to the method of claim 3, the layer structure is a HID Helper layer, a unified interface is set in the HID Helper layer, the unified interface is used to receive the access information sent by at least one process, and the obtaining of at least one access information for accessing the target device includes: obtaining the access information through the unified interface. 8.根据权利要求4所述的方法,在所述目标设备为HID设备的情况下,所述设置请求指令为Set Report指令,所述获取请求指令为Get Report指令。8 . The method according to claim 4 , wherein when the target device is a HID device, the setting request instruction is a Set Report instruction, and the obtaining request instruction is a Get Report instruction. 9.一种电子设备,包括存储器和处理器,所述存储器中存储有可执行程序,所述处理器处理所述可执行程序以执行如权利要求1至8任意一项所述的方法步骤。9. An electronic device, comprising a memory and a processor, wherein the memory stores an executable program, and the processor processes the executable program to execute the method steps as claimed in any one of claims 1 to 8.
CN202210112425.6A 2022-01-29 2022-01-29 Access method and electronic device Active CN114443518B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210112425.6A CN114443518B (en) 2022-01-29 2022-01-29 Access method and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210112425.6A CN114443518B (en) 2022-01-29 2022-01-29 Access method and electronic device

Publications (2)

Publication Number Publication Date
CN114443518A CN114443518A (en) 2022-05-06
CN114443518B true CN114443518B (en) 2024-11-26

Family

ID=81371714

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210112425.6A Active CN114443518B (en) 2022-01-29 2022-01-29 Access method and electronic device

Country Status (1)

Country Link
CN (1) CN114443518B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108234663A (en) * 2018-01-09 2018-06-29 武汉斗鱼网络科技有限公司 A kind of method, apparatus and computer equipment for obtaining data
CN109922539A (en) * 2019-04-30 2019-06-21 Oppo广东移动通信有限公司 Network connection method and related products

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7359847B2 (en) * 2001-11-30 2008-04-15 International Business Machines Corporation Tracking converage results in a batch simulation farm network
US7085852B2 (en) * 2002-03-01 2006-08-01 Sun Microsystems, Inc. Deterministic immutable access elimination for efficient distributed state saves
GB0600207D0 (en) * 2006-01-05 2006-02-15 Bishop Durrell G B Apparatus for direct automated access to a task or content

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108234663A (en) * 2018-01-09 2018-06-29 武汉斗鱼网络科技有限公司 A kind of method, apparatus and computer equipment for obtaining data
CN109922539A (en) * 2019-04-30 2019-06-21 Oppo广东移动通信有限公司 Network connection method and related products

Also Published As

Publication number Publication date
CN114443518A (en) 2022-05-06

Similar Documents

Publication Publication Date Title
US5835737A (en) Method and apparatus for arbitrating access to selected computer system devices
KR910001790B1 (en) Apparatus and its method for arbitrating assigning control of a communications path digital computer system
US6247041B1 (en) Multiprocessor computer system with user specifiable process placement
JP2009508247A (en) Method and system for bus arbitration
JPH0844681A (en) Centralized management of resource shared by plurality of processors
US20050060443A1 (en) Method, system, and program for processing packets
US8364874B1 (en) Prioritized polling for virtual network interfaces
CN1185218A (en) Add-in board with active/inactive expansion ROM for PCI bus computers
CN116302617B (en) Method for sharing memory, communication method, embedded system and electronic equipment
WO2022247198A1 (en) Interrupt distributor, data processing chip, interrupt distribution method and data processing method
US7529875B2 (en) Assigning interrupts for input/output (I/O) devices among nodes of a non-uniform memory access (NUMA) system
WO2019228237A1 (en) Data processing method and computer device
CN114443518B (en) Access method and electronic device
EP1187029B1 (en) Peripheral component interconnect arbiter implementation with dynamic priority scheme
US7000050B2 (en) Apparatus, method and program for contention arbitration
CN112181637B (en) Method and device for allocating memory resources
CN100345128C (en) Bus arbiter based on dynamic priority and method for dynamic changing priority
US20090177821A1 (en) Cache Intervention on a Separate Data Bus When On-Chip Bus Has Separate Read and Write Data Busses
JP2000227872A (en) Dynamic slot allocation and tracking method for request of plural memories
US5243702A (en) Minimum contention processor and system bus system
CN111353811B (en) Unified resource issuing method and system
US8719466B2 (en) Direct data transfer for device drivers
CN1134737C (en) Method and device for bus transaction processing in computer system
CN115914218B (en) Method, device and equipment for platform access to service center
CN109769030B (en) Method and apparatus for controlling access of applications

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