CN115629809A - Data processing method and device, electronic equipment and computer readable storage medium - Google Patents

Data processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN115629809A
CN115629809A CN202211269104.3A CN202211269104A CN115629809A CN 115629809 A CN115629809 A CN 115629809A CN 202211269104 A CN202211269104 A CN 202211269104A CN 115629809 A CN115629809 A CN 115629809A
Authority
CN
China
Prior art keywords
application
hardware
program
user system
service
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.)
Pending
Application number
CN202211269104.3A
Other languages
Chinese (zh)
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.)
Yuanxin Information Technology Group Co ltd
Original Assignee
Yuanxin Information Technology Group 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 Yuanxin Information Technology Group Co ltd filed Critical Yuanxin Information Technology Group Co ltd
Priority to CN202211269104.3A priority Critical patent/CN115629809A/en
Publication of CN115629809A publication Critical patent/CN115629809A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a data processing method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of computer software. The method comprises the following steps: acquiring a hardware control instruction based on an application program; wherein the application comprises any one of a first application and a second application; wherein the first application runs on a first user system and the second application runs on a second user system; receiving the hardware control instruction based on a service program corresponding to an application program; wherein the service program is run on the first user system; and responding to the hardware control instruction, and calling a hardware driver through the service program to realize the control of hardware resources. According to the embodiment of the application, the hardware drive is called through the service program running in the first user system, so that the problem of conflict of hardware control instructions is avoided.

Description

Data processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of computer software technologies, and in particular, to a data processing method, an apparatus, an electronic device, and a computer-readable storage medium.
Background
With the development of computer software technology, more and more electronic devices need to install a plurality of user systems to meet specific use requirements of users. Taking a dual-user system as an example, the two user systems are generally respectively disposed in different partitions of the electronic device, and the user systems do not overlap each other. Because the user systems share the hardware of the same electronic equipment, the orderly calling of the same hardware resource by each user system is ensured to be very important.
In the prior art, a plurality of user systems call hardware resources of a hardware layer through hardware drivers, each hardware resource corresponds to a plurality of hardware drivers, and when the plurality of user systems access the same hardware resource at the same time, instruction conflict often occurs, so that hardware control instructions of the user systems cannot be correctly executed.
Disclosure of Invention
Embodiments of the present application provide a data processing method and apparatus, an electronic device, and a computer-readable storage medium, which can solve the problem in the prior art that when a multi-user system accesses the same hardware resource simultaneously, a hardware control instruction conflicts. The technical scheme is as follows:
according to an aspect of an embodiment of the present application, there is provided a data processing method, including:
acquiring a hardware control instruction based on an application program; wherein the application program comprises any one of a first application program and a second application program; the first application program runs on a first user system, and the second application program runs on a second user system;
receiving a hardware control instruction based on a service program corresponding to the application program; wherein the service program is run on the first user system;
and responding to the hardware control instruction, and calling the hardware driver through the service program to realize the control of the hardware resource.
In one possible implementation, the method further includes:
acquiring control feedback information of hardware resources through a hardware driver;
acquiring control feedback information returned by the hardware drive based on a service program;
and acquiring control feedback information returned by the service program based on the application program.
In a possible implementation manner, the method further includes:
triggering a preset callback function through control feedback information based on an application program; the callback function is used for indicating a callback event.
In another possible implementation manner, the application program includes a second application program, and the service program includes a second service program;
receiving a hardware control instruction based on a service program corresponding to an application program, comprising:
transmitting a hardware control instruction to a kernel layer through a preset first interface; the first interface is used for communication between the first user system and the second user system;
and receiving the hardware control instruction transmitted by the kernel layer based on the second service program.
In another possible implementation manner, the application program includes a first application program, and the service program includes a first service program;
receiving a hardware control instruction based on a service program corresponding to an application program, comprising:
transmitting the hardware control instruction to the first service program through a preset second interface; wherein the second interface is for communication within the first user system.
In another possible implementation manner, the obtaining, based on the application program, control feedback information returned by the service program includes:
transmitting control feedback information returned by the second service program to the kernel layer through the first interface;
control feedback information is received from the kernel layer based on the second application.
In another possible implementation manner, the obtaining, based on the application program, control feedback information returned by the service program includes:
and transmitting the control feedback information returned by the first service program to the first application program through the second interface.
According to another aspect of embodiments of the present application, there is provided a data processing apparatus including:
the acquisition module is used for acquiring a hardware control instruction based on an application program; wherein the application program comprises any one of a first application program and a second application program; the first application program runs on a first user system, and the second application program runs on a second user system;
the receiving module is used for receiving a hardware control instruction based on a service program corresponding to the application program; wherein the service program is run on the first user system;
and the calling module is used for responding to the hardware control instruction and calling the hardware drive through the service program so as to realize the control of the hardware resource.
In one possible implementation manner, the apparatus further includes a feedback module, configured to:
acquiring control feedback information of hardware resources through a hardware driver;
acquiring control feedback information returned by the hardware drive based on a service program;
and acquiring control feedback information returned by the service program based on the application program.
In a possible implementation manner, the feedback module is further configured to:
triggering a preset callback function through controlling feedback information based on an application program; the callback function is used for indicating a callback event.
In one possible implementation, the application includes a second application, and the service includes a second service;
the receiving module, when receiving a hardware control instruction based on a service program corresponding to the application program, is configured to:
transmitting a hardware control instruction to a kernel layer through a preset first interface; the first interface is used for communication between the first user system and the second user system;
and receiving the hardware control instruction transmitted by the kernel layer based on the second service program.
In one possible implementation, the application includes a first application, and the service includes a first service;
the receiving module, when receiving a hardware control instruction based on a service program corresponding to the application program, is configured to:
transmitting the hardware control instruction to the first service program through a preset second interface; wherein the second interface is for communication within the first user system.
In one possible implementation manner, when the feedback module acquires the control feedback information returned by the service program based on the application program, the feedback module is configured to:
transmitting control feedback information returned by the second service program to the kernel layer through the first interface;
control feedback information is received from the kernel layer based on the second application.
In one possible implementation manner, when the feedback module acquires the control feedback information returned by the service program based on the application program, the feedback module is configured to:
and transmitting the control feedback information returned by the first service program to the first application program through the second interface.
According to another aspect of an embodiment of the present application, there is provided an electronic apparatus including: the device comprises a memory, a processor and a computer program stored on the memory, wherein the processor executes the computer program to realize the steps of the method shown in the first aspect of the embodiment of the application.
According to a further aspect of embodiments of the present application, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method as set forth in the first aspect of embodiments of the present application.
According to an aspect of embodiments of the present application, there is provided a computer program product comprising a computer program that, when executed by a processor, performs the steps of the method illustrated in the first aspect of embodiments of the present application.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
according to the embodiment of the application, the hardware control instruction is obtained through the application program, the service program corresponding to the application program receives the hardware control instruction, and the hardware drive is called through the service program in response to the hardware control instruction, so that the control of hardware resources is realized. The application programs can include a first application program and a second application program, the first application program is run on the first user system, the second application program is run on the second user system, and the service program corresponding to each application program is run on the first user system. Different from the prior art that different user systems respectively realize the calling of the same hardware resource through a plurality of hardware drivers, the embodiment of the application acquires the hardware control instruction through the application program of each user system, responds to the hardware control instruction according to the service program running in the first user system and calls the hardware driver corresponding to the hardware resource, so that the effective access and control of the multi-user system to the hardware resource are completed, the conflict of the hardware control instruction is avoided, and the correct execution of the instruction of the multi-user system is effectively ensured.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic view of an application scenario of a data processing method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a data processing method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of IPC communication in a first user system in a data processing method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of IPC communication flow across systems in a data processing method according to an embodiment of the present application;
FIG. 5 is a flowchart illustrating an exemplary data processing method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a data processing electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the embodiments set forth below in connection with the drawings are exemplary descriptions for explaining technical solutions of the embodiments of the present application, and do not limit the technical solutions of the embodiments of the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should be further understood that the terms "comprises" and/or "comprising," when used in this specification in connection with embodiments of the present application, specify the presence of stated features, information, data, steps, operations, elements, and/or components, but do not preclude the presence or addition of other features, information, data, steps, operations, elements, components, and/or groups thereof, as embodied in the art. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein indicates at least one of the items defined by the term, e.g., "a and/or B" may be implemented as "a", or as "B", or as "a and B".
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
At least two user systems can be installed on one electronic device, and the user systems are independent of each other, and the versions and the types of the user systems can be different from each other. A user system generally refers to an operating system that is capable of directly interacting with a user, receiving user instructions, and feeding back to the user according to the user instructions.
Two or more user systems are installed in electronic equipment such as a mobile phone, a tablet computer and a personal computer, so that the use of a user can be facilitated. For example, one user system is used for working, the other user system is used for life entertainment, the two user systems can respectively and independently work, and each user system adopts different safety control measures, so that the safety of office data can be ensured, and entertainment activities such as games, movies, shopping and the like are not influenced; or a program which cannot be run by another user system is run in one user system to ensure the running safety of the program. Or if one user system has problems, the user can enter other user systems, and the embarrassment situation that the electronic equipment cannot be used due to the fact that a certain user system is broken down is avoided.
If at least two user systems are installed on the electronic device, the user systems often take the form of container systems, and multiple containers are built on the same kernel, where each container corresponds to a user system. The user system may be considered an application layer with respect to the kernel. Taking Cgroup (control groups) technology of the Linux kernel as an example, two Android systems are run on the Linux kernel, one of the Android systems can be set as a security domain, i.e., a secure Android system which adopts more security control measures, and the other is set as a life domain, i.e., an open non-secure Android system. The secure Android system corresponds to a container two, the corresponding non-secure Android system corresponds to a container one, and the container one and the container two can communicate in a cross-system IPC (Inter-Process Communication) mode.
In a multi-user system scenario, instruction conflicts may occur when applications of multiple user systems access the same hardware resource, such as a calling camera. The application provides a data processing method, a data processing device, an electronic device and a computer-readable storage medium, which aim to solve the above technical problems in the prior art.
The technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application will be described below through descriptions of several exemplary embodiments. It should be noted that the following embodiments may be referred to, referred to or combined with each other, and the description of the same terms, similar features, similar implementation steps and the like in different embodiments is not repeated.
As shown in fig. 1, the data processing method of the present application may be applied to the scenario shown in fig. 1, specifically, a kernel layer 103 of an operating system runs in a terminal 101, an application layer 102 also runs on the kernel, the application layer includes a first user system and a second user system, the first user system runs a first application and a service program corresponding to each application, and the second user system runs a second application; the kernel layer 103 of the operating system includes a preset interface, and the interface may be used for communication between the first user system and the second user system or communication inside each user system; the hardware layer 104 of the terminal includes various hardware devices that may be used by a user of the terminal, such as a camera (a video camera), a microphone, a receiver, and the like, and the various hardware devices on the terminal are often collectively referred to as hardware resources. A user sends a hardware control instruction through a user system of the terminal 101, an application program in the user system obtains the hardware control instruction, a service program corresponding to the application program receives the hardware control instruction, the service program responds to the hardware control instruction to call hardware equipment so as to realize control of hardware resources, and control feedback information of the hardware resources is returned to the corresponding user system, so that the user knows the control condition of the hardware resources.
In the scenario shown in fig. 1, the data processing method may be performed in various electronic devices. As will be understood by those skilled in the art, the "electronic Device" used herein may be a Mobile phone, a tablet computer, a PDA (Personal Digital Assistant), an MID (Mobile Internet Device), etc., and may also be a stand-alone server or a server cluster composed of a plurality of servers.
An embodiment of the present application provides a data processing method, and as shown in fig. 2, the method includes:
s201, acquiring a hardware control instruction based on an application program.
Wherein the application program comprises any one of a first application program and a second application program; the first application runs on a first user system and the second application runs on a second user system.
Specifically, the hardware control instruction may be triggered by at least one of the following operations:
dragging or moving an interface element of an application program to an operation within a preset range of an application program interface in a user system;
clicking or touching operation for the interface element;
inputting operation aiming at the identifier of the hardware control instruction in a preset input control; among other things, interface elements may be used for hardware control.
In the embodiment of the present application, the user system may run the first user system and the second user system on the Linux kernel through the Cgroup technology. Each user system can be an Android system which is constructed through a container technology and is isolated from each other; the first user system may be a non-secure Android system and the second user system may be a secure Android system.
Further, at least one application is running in each user system, the application may be a computer program with a visual user interface and capable of user interaction, and the application may be combined with hardware resources to realize specific functions, for example, the application may be a camera application, an image editing application, a chat application, and the like. When the application program is a camera application software, the hardware control instructions may include instructions for taking a picture, previewing an image, recording a video, and the like.
S202, a hardware control command is received based on a service program corresponding to the application program.
Wherein the service program is run on the first user system. The application program and the service program have a corresponding relationship, and the service program supports the application program to realize a specific function thereof. For example, a first application program corresponds to a first service program and a second application program corresponds to a second service program. Generally, the service program is developed by a manufacturer providing the user system, and the application program may be developed by an application manufacturer, for example, an internet enterprise developing services such as take-out and taxi-taking develops a dedicated application program for the service, or may be developed by the manufacturer providing the user system. The presence of the service greatly facilitates the development of the application. When a service program calls a hardware device of the hardware layer of the operating system, the service program generally needs to use a corresponding hardware driver in the kernel, and therefore, the service program can also be called as a service program calling the hardware driver.
Specifically, the kernel layer of the operating system may include a first interface and a second interface, where the first interface may be used for cross-system IPC communication between at least two user systems; the second interface may be used for IPC communication within a certain user system.
In some embodiments, when the application includes a first application, the first application may pass hardware control instructions to the first service based on the second interface.
In other embodiments, when the application includes a second application, the second application may pass the hardware control instructions to the second service via the first interface.
S203, responding to the hardware control instruction, calling the hardware drive through the service program to realize the control of the hardware resource.
In the embodiment of the present application, taking a hardware device, i.e., a camera, as an example, the hardware control instruction may include instructions for taking a picture, previewing an image, recording a video, and the like, and a hardware driver corresponding to the camera is a camera driver.
In some embodiments, the hardware control instruction is a photographing instruction, and in response to the photographing instruction, the application program may call the camera driver to apply for the cache through the service program, and after the camera acquires an image, the image is filled in the cache, so as to implement a photographing function of the application program. The buffer may be a buffer for temporarily storing data to achieve synchronous transmission of data.
In other embodiments, when the hardware control instruction is an image preview instruction, in response to the image preview instruction, the application program may call the camera driver to obtain a preview result through the service program, so as to implement an image preview function of the application program.
According to the embodiment of the application, the hardware control instruction is obtained through the application program, the service program corresponding to the application program receives the hardware control instruction, and the hardware drive is called through the service program in response to the hardware control instruction so as to control the hardware resource. The application program can include a first application program and a second application program, the first application program is run on the first user system, the second application program is run on the second user system, and the service programs corresponding to the application programs are run on the first user system, so that the service program of the first user system calls the hardware driver, and the first user system receives and responds to the hardware control instruction to realize the uniform allocation and control of the hardware resources. The method and the device are different from the prior art that different user systems respectively call the same hardware resource through a plurality of hardware drivers, the hardware control instruction is obtained through the application program of each user system, the hardware control instruction is responded according to the service program running in the first user system, and the hardware driver corresponding to the hardware resource is called, so that the effective access and control of the multi-user system to the hardware resource are completed, the conflict of the hardware control instruction is avoided, and the correct execution of the instruction of the multi-user system is effectively ensured.
A possible implementation manner is provided in the embodiment of the present application, and the method further includes:
s301, control feedback information of the hardware resource is acquired through the hardware drive.
The control feedback information may be generated by a hardware driver of a certain hardware device executing a hardware control instruction.
In the embodiment of the present application, taking a hardware device, which is a camera, and a hardware control instruction as an example, the control feedback information may be cache information filled in an image acquired by the camera; when the hardware control instruction is an image preview instruction, the control feedback information may be a preview image determined by the camera.
Specifically, the user system may access the hardware layer through the property file, and obtain the control feedback information of the hardware resource through the hardware driver. Wherein the property file may characterize property data of the hardware resource. When the hardware device is a camera, the attribute data may include a type, a use state, and the like of the camera.
And S302, acquiring control feedback information returned by the hardware driver based on the service program.
Specifically, the application program in the user system may obtain the control feedback information returned by the hardware driver through a preset function by using the service program.
And S303, acquiring control feedback information returned by the service program based on the application program.
Specifically, the application program obtains the control feedback information returned by the service program through IPC communication.
Further, if the application program and the service program do not belong to the same user system, the IPC communication is cross-system IPC communication; if the application program and the service program belong to the same user system, the IPC is IPC communication in the system.
According to the embodiment of the application, the control feedback information is obtained through the hardware drive, the service program returns the control feedback information and transmits the control feedback information to the application program, so that a user can obtain the control feedback information from a corresponding user system, the feedback efficiency of hardware control is improved, and the user experience is effectively improved.
In an embodiment of the present application, a possible implementation manner is provided, where the control feedback information is associated with a preset callback event, and the method further includes:
triggering a preset callback function through control feedback information based on an application program; the callback function is used for indicating a callback event.
Specifically, the application program is taken as camera application software for example, the hardware control instruction is a photographing instruction, the control feedback information may include cache information filled with an image acquired by the camera, and the callback event associated with the control feedback information may include displaying the cache information, so that the corresponding user system may acquire and display the image acquired by the hardware resource.
In an embodiment of the present application, a possible implementation manner is provided, where the application program includes a second application program, and the service program includes a second service program.
Receiving a hardware control instruction based on a service program corresponding to an application program, comprising:
transmitting a hardware control instruction to a kernel layer through a preset first interface; and receiving the hardware control instruction transmitted by the kernel layer based on the second service program.
Wherein the first interface is used for communication between the first user system and the second user system.
Specifically, when the user system is an Android system, the first interface may be a Binder (inter-process communication mechanism) interface, and the Binder mechanism may be used to implement cross-process communication in Android. The space of a process can be divided into user space and kernel space, the user space data can not be shared, and the kernel space data can be shared. In order to ensure safety, android processes are mutually independent and isolated, and a Binder mechanism can be utilized for interaction among the processes.
A possible implementation manner is provided in the embodiment of the present application, as shown in fig. 3, where the application includes a first application, and the service includes a first service.
Receiving a hardware control instruction based on a service program corresponding to an application program, comprising: and transmitting the hardware control instruction to the first service program through a preset second interface. Wherein the second interface is for communication within the first user system. Specifically, when the user system is an Android system, the second interface may be a Binder interface, and cross-process communication is realized by using a Binder mechanism.
In the embodiment of the present application, as shown in fig. 4, since the second application and the second service belong to different user systems, the second application may bind the first interface and a third interface, where the third interface is used for implementing communication inside the second user system.
According to the embodiment of the application, the interface is set in the second user system based on the Binder mechanism, so that the second user system is bound with two interfaces, cross-system IPC communication between the first user system and the second user system and IPC communication inside the second user system are realized, and the efficiency of data interaction and data control between the user systems is improved.
The embodiment of the present application provides a possible implementation manner, where the obtaining of the control feedback information returned by the service program based on the application program includes:
and transmitting the control feedback information returned by the second service program to the kernel layer through the first interface, and receiving the control feedback information from the kernel layer based on the second application program.
Specifically, taking a user system as an Android system as an example, the kernel layer may create a first data cache region based on the Binder driver, where the first data cache region corresponds to the first interface; the control feedback information returned by the second service program can be stored in the data cache region through the first interface, and the second application program obtains the control feedback information from the data cache region.
The embodiment of the present application provides a possible implementation manner, where the obtaining of the control feedback information returned by the service program based on the application program includes:
and transmitting the control feedback information returned by the first service program to the first application program through the second interface.
Specifically, taking the user system as an Android system as an example, the kernel layer of the operating system may create a second data cache region based on Binder driving, where the second data cache region corresponds to the second interface; the control feedback information may be stored in a second data buffer, the control feedback information being passed from the first service program to the first application program through the second interface.
In this embodiment of the application, if the hardware control instruction includes an image preview instruction, the corresponding control feedback information may include a preview success identifier; if the hardware control instruction comprises a camera opening instruction, the corresponding control feedback information can comprise an opening success identifier; if the hardware control instruction comprises a shooting instruction, the corresponding control feedback information can comprise a shooting success identifier; if the hardware control instruction includes a video recording instruction, the corresponding control feedback information may include a video recording success identifier.
In order to better understand the above data processing method, an example of the data processing method of the present application is set forth in detail below with reference to fig. 5, and the method includes the following steps:
s401, the application layer application program of the operating system obtains a hardware control instruction.
Wherein the application program comprises any one of a first application program and a second application program; the first application runs on a first user system and the second application runs on a second user system.
S402, a service program corresponding to the application program receives a hardware control command.
Wherein the service program is run on the first user system. The application program and the service program have a corresponding relationship, and the service program supports the application program to realize a specific function. For example, a first application program corresponds to a first service program and a second application program corresponds to a second service program. The service program may be used to invoke a hardware device of the operating system hardware layer.
Specifically, the kernel layer of the operating system may include a first interface and a second interface, where the first interface may be used for cross-system IPC communication between at least two user systems; the second interface may be used for IPC communication within a certain user system.
And S403, responding to the hardware control instruction, and calling the hardware equipment by the service program through the hardware driver.
S404, the hardware device executes the hardware control instruction and generates control feedback information.
And S405, acquiring control feedback information of the hardware resource through the hardware driver.
The control feedback information may be generated by a certain hardware device executing a hardware control instruction.
Specifically, the user system may access the hardware layer through the attribute file, and obtain the control feedback information of the hardware resource through the hardware driver. Wherein the property file may characterize property data of the hardware resource. When the hardware resource is a camera, the attribute data may include a type, a use state, and the like of the camera.
S406, the service program acquires the control feedback information returned by the hardware driver.
Specifically, the service program obtains control feedback information returned by the hardware driver through a preset function.
And S407, the application program acquires the control feedback information returned by the service program through a preset interface.
When the application program is a first application program and the service program is a first service program, the preset interface may include a second interface; when the application program is a second application program and the service program is a second service program, the preset interface may include the first interface.
Specifically, the application program obtains the control feedback information returned by the service program through IPC communication.
In the embodiment of the application, the hardware control instruction is obtained through the application program, the service program corresponding to the application program receives the hardware control instruction, and the hardware drive is called through the service program in response to the hardware control instruction so as to control the hardware resource; the application programs may include a first application program and a second application program, the first application program is run on the first user system, the second application program is run on the second user system, and the service program corresponding to each application program is run on the first user system. Different from the prior art that different user systems respectively realize the calling of the same hardware resource through a plurality of hardware drivers, the embodiment of the application acquires the hardware control instruction through the application program of each user system, responds to the hardware control instruction according to the service program running in the first user system and calls the hardware driver corresponding to the hardware resource, so that the effective access and control of the multi-user system to the hardware resource are completed, the conflict of the hardware control instruction is avoided, and the correct execution of the instruction of the multi-user system is effectively ensured.
An embodiment of the present application provides a data processing apparatus, and as shown in fig. 6, the data processing apparatus 60 may include: an acquisition module 601, a receiving module 602 and a calling module 603;
the obtaining module 601 is configured to obtain a hardware control instruction based on an application program; wherein the application program comprises any one of a first application program and a second application program; the first application program runs on a first user system, and the second application program runs on a second user system;
a receiving module 602, configured to receive a hardware control instruction based on a service program corresponding to an application program; wherein the service program is run on the first user system;
the invoking module 603 is configured to invoke a hardware driver through a service program in response to the hardware control instruction, so as to implement control over the hardware resource.
A possible implementation manner is provided in the embodiment of the present application, and the apparatus further includes a feedback module, configured to:
acquiring control feedback information of hardware resources through a hardware driver;
acquiring control feedback information returned by the hardware drive based on a service program;
and acquiring control feedback information returned by the service program based on the application program.
In an embodiment of the present application, a possible implementation manner is provided, where the feedback control information is associated with a preset callback event, and the feedback module is further configured to:
triggering a preset callback function through control feedback information based on an application program; the callback function is used for indicating a callback event.
A possible implementation manner is provided in the embodiment of the present application, where the application includes a second application, and the service includes a second service;
the receiving module 602, when receiving a hardware control instruction based on a service program corresponding to an application program, is configured to:
transmitting a hardware control instruction to a kernel layer through a preset first interface; the first interface is used for communication between the first user system and the second user system;
and receiving the hardware control instruction transmitted by the kernel layer based on the second service program.
The embodiment of the present application provides a possible implementation manner, where the application program includes a first application program, and the service program includes a first service program;
the receiving module 602, when receiving a hardware control instruction based on a service program corresponding to an application program, is configured to:
transmitting the hardware control instruction to the first service program through a preset second interface; wherein the second interface is for communication within the first user system.
The embodiment of the present application provides a possible implementation manner, where the feedback module is configured to, when acquiring control feedback information returned by the service program based on the application program:
transmitting control feedback information returned by the second service program to the kernel layer through the first interface;
control feedback information is received from the kernel layer based on the second application.
The embodiment of the present application provides a possible implementation manner, where the feedback module is configured to, when acquiring control feedback information returned by the service program based on the application program:
and transmitting the control feedback information returned by the first service program to the first application program through the second interface.
The apparatus of the embodiment of the present application may execute the method provided by the embodiment of the present application, and the implementation principle is similar, the actions executed by the modules in the apparatus of the embodiments of the present application correspond to the steps in the method of the embodiments of the present application, and for the detailed functional description of the modules of the apparatus, reference may be specifically made to the description in the corresponding method shown in the foregoing, and details are not repeated here.
The method comprises the steps that a hardware control instruction is obtained through an application program, a service program corresponding to the application program is determined, the determined service program receives the hardware control instruction, and then a hardware drive is called through the service program in response to the hardware control instruction so as to control hardware resources; the application programs may include a first application program and a second application program, the first application program is run on the first user system, the second application program is run on the second user system, and the service program corresponding to each application program is run on the first user system. The method and the device are different from the prior art that different user systems respectively call the same hardware resource through a plurality of hardware drivers, the hardware control instruction is obtained through the application program of each user system, the hardware control instruction is responded according to the service program running in the first user system, and the hardware driver corresponding to the hardware resource is called, so that the effective access and control of the multi-user system to the hardware resource are completed, the conflict of the hardware control instruction is avoided, and the correct execution of the instruction of the multi-user system is effectively ensured.
The embodiment of the application provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory, wherein the processor executes the computer program to realize the steps of the data processing method, and compared with the related art, the method can realize the following steps: the method comprises the steps that a hardware control instruction is obtained through an application program, a service program corresponding to the application program is determined, the determined service program receives the hardware control instruction, and then a hardware drive is called through the service program in response to the hardware control instruction so as to control hardware resources; the application programs may include a first application program and a second application program, the first application program is run on the first user system, the second application program is run on the second user system, and the service program corresponding to each application program is run on the first user system. The method and the device are different from the prior art that different user systems respectively call the same hardware resource through a plurality of hardware drivers, the hardware control instruction is obtained through the application program of each user system, the hardware control instruction is responded according to the service program running in the first user system, and the hardware driver corresponding to the hardware resource is called, so that the effective access and control of the multi-user system to the hardware resource are completed, the conflict of the hardware control instruction is avoided, and the correct execution of the instruction of the multi-user system is effectively ensured.
In an alternative embodiment, an electronic device is provided, as shown in fig. 7, the electronic device 700 shown in fig. 7 comprising: a processor 701 and a memory 703. The processor 701 is coupled to a memory 703, such as via a bus 702. Optionally, the electronic device 700 may further include a transceiver 704, and the transceiver 704 may be used for data interaction between the electronic device and other electronic devices, such as transmission of data and/or reception of data. It should be noted that the transceiver 704 is not limited to one in practical applications, and the structure of the electronic device 700 is not limited to the embodiment of the present application.
The Processor 701 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 701 may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs, and combinations of microprocessors, and the like.
Bus 702 may include a path that transfers information between the above components. The bus 702 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 702 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 7, but that does not indicate only one bus or one type of bus.
The Memory 703 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact disk Read Only Memory) or other optical disk storage, optical disk storage (including Compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), a magnetic disk storage medium, other magnetic storage devices, or any other medium that can be used to carry or store a computer program and that can be Read by a computer, without limitation.
The memory 703 is used for storing computer programs for executing the embodiments of the present application, and is controlled by the processor 701 to execute. The processor 701 is adapted to execute a computer program stored in the memory 703 to implement the steps shown in the foregoing method embodiments.
Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, notebook computers, PADs, etc. and fixed terminals such as digital TVs, desktop computers, etc.
Embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, and when being executed by a processor, the computer program may implement the steps and corresponding contents of the foregoing method embodiments.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device realizes the following when executed:
acquiring a hardware control instruction based on an application program; wherein the application program comprises any one of a first application program and a second application program; the first application program runs on a first user system, and the second application program runs on a second user system;
receiving a hardware control instruction based on a service program corresponding to the application program; wherein the service program is run on the first user system;
and responding to the hardware control instruction, and calling the hardware driver through the service program to realize the control of the hardware resource.
The terms "first," "second," "third," "fourth," "1," "2," and the like in the description and claims of this application and in the preceding drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in other sequences than illustrated or otherwise described herein.
It should be understood that, although each operation step is indicated by an arrow in the flowchart of the embodiment of the present application, the implementation order of the steps is not limited to the order indicated by the arrow. In some implementation scenarios of the embodiments of the present application, the implementation steps in the flowcharts may be performed in other sequences as desired, unless explicitly stated otherwise herein. In addition, the actual implementation scenario of some or all of the steps in each flowchart may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages may be performed at the same time, or each of these sub-steps or stages may be performed at different times. In a scenario where execution times are different, an execution sequence of the sub-steps or the phases may be flexibly configured according to requirements, which is not limited in the embodiment of the present application.
The foregoing is only an optional implementation manner of a part of implementation scenarios in the present application, and it should be noted that, for those skilled in the art, other similar implementation means adopting the technical idea of the present application also belong to the protection scope of the embodiments in the present application without departing from the technical idea of the present application.

Claims (10)

1. A data processing method, comprising:
acquiring a hardware control instruction based on an application program; wherein the application comprises any one of a first application and a second application; wherein the first application is run on a first user system and the second application is run on a second user system;
receiving the hardware control instruction based on a service program corresponding to the application program; wherein the service program is run on the first user system;
and responding to the hardware control instruction, and calling a hardware driver through the service program to realize the control of hardware resources.
2. The method of claim 1, further comprising:
acquiring control feedback information of the hardware resource through the hardware driver;
acquiring control feedback information returned by the hardware drive based on the service program;
and acquiring control feedback information returned by the service program based on the application program.
3. The method of claim 2, wherein the control feedback information is associated with a preset callback event, the method further comprising:
triggering a preset callback function through the control feedback information based on the application program; wherein the callback function is used to indicate the callback event.
4. The method of claim 2, wherein the application comprises a second application and the service comprises a second service;
the receiving the hardware control instruction based on the service program corresponding to the application program comprises:
transmitting the hardware control instruction to a kernel layer through a preset first interface; wherein the first interface is used for communication between a first user system and a second user system;
and receiving the hardware control instruction transmitted by the kernel layer based on the second service program.
5. The method of claim 2, wherein the application comprises a first application, and the service comprises a first service;
the receiving the hardware control instruction based on the service program corresponding to the application program comprises:
transmitting the hardware control instruction to the first service program through a preset second interface; wherein the second interface is for communication within the first user system.
6. The method of claim 4, wherein the obtaining the control feedback information returned by the service program based on the application program comprises:
transmitting control feedback information returned by a second service program to the kernel layer through the first interface;
receiving the control feedback information from the kernel layer based on the second application.
7. The method of claim 5, wherein the obtaining the control feedback information returned by the service program based on the application program comprises:
and transmitting the control feedback information returned by the first service program to the first application program through the second interface.
8. A data processing apparatus, comprising:
the acquisition module is used for acquiring a hardware control instruction based on an application program; wherein the application program comprises any one of a first application program and a second application program; wherein the first application runs on a first user system and the second application runs on a second user system;
a receiving module, configured to receive the hardware control instruction based on a service program corresponding to the application program; wherein the service program is run on the first user system;
and the calling module is used for responding to the hardware control instruction and calling the hardware drive through the service program so as to realize the control of the hardware resource.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory, wherein the processor executes the computer program to implement the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202211269104.3A 2022-10-17 2022-10-17 Data processing method and device, electronic equipment and computer readable storage medium Pending CN115629809A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211269104.3A CN115629809A (en) 2022-10-17 2022-10-17 Data processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211269104.3A CN115629809A (en) 2022-10-17 2022-10-17 Data processing method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN115629809A true CN115629809A (en) 2023-01-20

Family

ID=84905626

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211269104.3A Pending CN115629809A (en) 2022-10-17 2022-10-17 Data processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115629809A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115858055A (en) * 2023-02-06 2023-03-28 中车工业研究院(青岛)有限公司 Decoupling method, system, device and medium between software and hardware

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115858055A (en) * 2023-02-06 2023-03-28 中车工业研究院(青岛)有限公司 Decoupling method, system, device and medium between software and hardware

Similar Documents

Publication Publication Date Title
CN109491725B (en) Interactive multi-opening method and system of application program, storage medium and electronic equipment
US7877091B2 (en) Method and system for executing a container managed application on a processing device
CN109308241B (en) Method and device for monitoring starting process of application program, terminal equipment and storage medium
US20170102957A1 (en) System and Method for Trusted Operability When Moving Between Network Functions Virtualization States
US11853767B2 (en) Inter-core data processing method, system on chip and electronic device
US7962926B2 (en) Method, system, and program storage device for generating a retry message when a thread in a real-time application is unavailable to process a request to utilize the real-time application
CN109889468B (en) Network data transmission method, system, device, equipment and storage medium
JP2021518955A (en) Processor core scheduling method, equipment, terminals and storage media
CN113886019B (en) Virtual machine creation method, device, system, medium and equipment
CN115904761B (en) System on chip, vehicle and video processing unit virtualization method
CN110968331A (en) Method and device for running application program
CN107800779B (en) Method and system for optimizing load balance
CN112835632B (en) Method and equipment for calling end capability and computer storage medium
CN115629809A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN115562887A (en) Inter-core data communication method, system, device and medium based on data package
CN115237481A (en) Method, device and equipment for driving external equipment and storage medium
CN109725887B (en) Data interaction method and device based on message research and development framework and terminal equipment
CN111274044A (en) GPU (graphics processing unit) virtualized resource limit processing method and device
CN111399928B (en) Application program starting method and device, electronic equipment and readable storage medium
CN109445960B (en) Application routing method, device and storage medium
EP3783484A1 (en) Data processing method and computer device
CN110120963B (en) Data processing method, device, equipment and machine readable medium
CN114726905A (en) Method, device, equipment and storage medium for accessing Tbox network to Android system
JP2019536173A (en) Reduce application resource usage
CN111324386B (en) Method and device for starting split application program, electronic equipment and storage 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