Device function conversion method, device and computer readable storage medium
By obtaining and encapsulating application attribute information and executable files of KTV system devices, the conversion of device functions and multi-functional operation are achieved, solving the problem of insufficient compatibility of existing KTV systems, saving hardware costs and promoting multi-device equipment Functional application.
Patent Information
- Application Number
- CN202210550373.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-20
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-05-20
AI Technical Summary
The existing KTV system has diversified functions and insufficient compatibility, resulting in the device being used either as a VR gaming device or as a KTV singing device, and the peripheral functions cannot be integrated on a system, which increases merchant costs.
By obtaining the application attribute information of the first device and the executable file of the second device, encapsulate it into a target application, and execute it on the first device, the conversion of device functions and multifunctional operation are realized.
It realizes the integration of multiple device functions on a system, saves hardware costs, and is conducive to the promotion and application of the first device.
Smart Images

Figure CN114840271B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of embedded software development, and in particular to a device function conversion method, a device and a computer-readable storage medium. Background Art
[0002] KTV systems are common equipment in entertainment venues, communities or corridors. Although the functions of current KTV systems are becoming more and more diverse, their compatibility is not ideal. For example, a KTV system can be used as either a VR gaming device or a KTV singing device, and the two always exist as separate entities, which is equivalent to increasing costs for businesses. Summary of the invention
[0003] The present application provides a device function conversion method, a device and a computer-readable storage medium, which can integrate peripheral functions on a system.
[0004] On the one hand, the present application provides a method for converting device functions, comprising:
[0005] Acquire attribute information of an application based on the first device;
[0006] Acquire an executable file based on the second device;
[0007] Encapsulating the application based on the second device as a target application according to the attribute information of the application based on the first device and the executable file based on the second device;
[0008] The target application is executed on the first device.
[0009] On the other hand, the present application provides a device function conversion device, comprising:
[0010] A first acquisition module, used to acquire attribute information of an application based on the first device;
[0011] A second acquisition module, used to acquire an executable file based on a second device;
[0012] A packaging module, used for packaging the application based on the second device into a target application according to the attribute information of the application based on the first device and the executable file based on the second device;
[0013] An execution module is used to execute the target application on the first device.
[0014] In a third aspect, the present application provides a device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the technical solution of the above-mentioned device function conversion method when executing the computer program.
[0015] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, it implements the steps of the technical solution of the above-mentioned device function conversion method.
[0016] It can be seen from the technical solution provided by the above-mentioned present application that after obtaining the attribute information of the application based on the first device and the executable file based on the second device, the application based on the second device can be packaged as a target application according to the attribute information of the application based on the first device and the executable file based on the second device. Since the present application can repackage the executable file based on the second device as a new application to run on the first device, it is equivalent to that the first device can also run the application of the second device. Therefore, it not only realizes the conversion of the function of the second device and realizes more functions on the second device, but also saves hardware costs, which is more conducive to the promotion and application of the first device. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 is a flow chart of a device function conversion method provided in an embodiment of the present application;
[0019] Figure 2 It is a structural schematic diagram of the device function conversion device provided in the embodiment of the present application;
[0020] Figure 3 It is a schematic diagram of the structure of the device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0022] In this specification, adjectives such as first and second may be used only to distinguish one element or action from another element or action, without necessarily requiring or implying any actual such relationship or order. Where circumstances permit, reference to an element or component or step (etc.) should not be interpreted as being limited to only one of the elements, components, or steps, but may be one or more of the elements, components, or steps, etc.
[0023] In this specification, for the convenience of description, the sizes of various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0024] As attached Figure 1 As shown, this application proposes a flow chart of a device function conversion method, which mainly includes steps S101 to S104, which are described in detail as follows:
[0025] Step S101: Acquire attribute information of an application based on a first device.
[0026] In the embodiment of the present application, the attribute information of the application based on the first device refers to the basic data of the application that meets the hardware and software platform requirements of the first device and can be run on the first device, including information such as the format, size, and permissions of the application. In other words, only if an application meets the format, size, and permissions required by the hardware and software platform of the first device, can the application run smoothly on the first device. The first device can be a traditional KTV device, which has the most basic functions such as ordering songs and singing.
[0027] As an embodiment of the present application, obtaining the attribute information of the application based on the first device can be: running the main process and starting the thread corresponding to the first device; through the thread corresponding to the first device, obtaining the format, size and permissions of the application based on the first device from the download interface of the first device. In the embodiment of the present application, the main process mainly includes two threads, namely the thread corresponding to the first device and the thread corresponding to the second device involved in the subsequent embodiments. The main process is a program stored in a storage medium such as a USB flash drive, and these storage media can be inserted into the first device. After the thread corresponding to the first device is started, it is determined whether the device into which the current storage medium is inserted is the first device. If the current device is the first device, the format, size, permissions, etc. of the application based on the first device are obtained from the download interface of the first device through the thread corresponding to the first device. The format, size, permissions, etc. of the application based on the first device are the attribute information of the application based on the first device.
[0028] Step S102: Acquire an executable file based on the second device.
[0029] In an embodiment of the present application, the executable file based on the second device is an application that can be run on the second device and / or used in conjunction with the second device, and the second device can be other devices other than the first device, such as a dance machine, a virtual reality game device, and the like. As mentioned above, the main process is a program stored in a storage medium such as a USB flash drive. Just as these storage media can be inserted into the first device, these storage media can also be inserted into the second device, and the executable file based on the second device can be obtained by running the main process therein. Specifically, as an embodiment of the present application, obtaining the executable file based on the second device can be: running the main process; obtaining the hardware information of the second device through the driver layer of the main process; and reading the executable file based on the second device according to the hardware information of the second device. In the above embodiment, the driver layer is a program between the operating system and the hardware. It can be determined whether the current device is the first device or the second device through the driver layer of the main process and the hardware device information driven by the driver layer of the main process is found by disassembly. When it is determined to be the second device, the hardware information of the second device is obtained, and the executable file based on the second device is read according to the hardware information of the second device.
[0030] Step S103: encapsulate the application based on the second device as a target application according to the attribute information of the application based on the first device and the executable file based on the second device.
[0031] It should be noted that the executable file based on the second device is still a compilable file. As mentioned above, the main process includes a thread corresponding to the first device and a thread corresponding to the second device, and according to the characteristics of the thread, the threads can exchange information. The attribute information of the application of the first device can be transmitted to the thread corresponding to the second device through the interaction of the above two threads. Specifically, as an embodiment of the present application, according to the attribute information of the application based on the first device and the executable file based on the second device, encapsulating the application based on the second device as a target application can be: receiving the attribute information of the application based on the first device transmitted through the thread corresponding to the first device; recompiling the executable file based on the second device according to the attribute information of the application of the first device to obtain the corresponding intermediate file; adding the interface related to the first device to the intermediate file and packaging it to obtain the target application. In the above embodiment, receiving the attribute information of the application based on the first device transmitted through the thread corresponding to the first device is actually the interaction between the thread corresponding to the first device and the thread corresponding to the second device, and the thread corresponding to the second device receives the attribute information of the application based on the first device transmitted through the thread corresponding to the first device. Since the above-mentioned encapsulation of the application based on the second device as the target application is actually a secondary encapsulation of the executable file based on the second device, the interface related to the first device can be an interface that the first device can recognize and install, an interface for the first device to obtain hardware information content, etc. After these interfaces are added, it is convenient for the target application obtained by the final encapsulation to run on the first device.
[0032] Step S104: Execute the target application on the first device.
[0033] Specifically, the target application generated by steps S101 to S103 may be installed on the first device, and after the installation is complete, the target application may be opened to execute the target application on the first device.
[0034] Considering that threads may crash, exit abnormally, freeze, and other anomalies during operation, the main process in the above embodiment, in addition to starting the thread corresponding to the first device and the thread corresponding to the second device, also includes monitoring the thread corresponding to the first device and the thread corresponding to the second device; and refreshing the information sent and received by the thread corresponding to the first device and the thread corresponding to the second device. Among them, monitoring the thread corresponding to the first device and the thread corresponding to the second device specifically includes: monitoring whether the thread corresponding to the first device and the thread corresponding to the second device have anomalies; if the thread corresponding to the first device and / or the thread corresponding to the second device have anomalies, such as crash, exit abnormally, freeze, etc., then the thread corresponding to the first device and / or the thread corresponding to the second device are restored, and the information sent and received by the thread corresponding to the first device and the thread corresponding to the second device are refreshed, in order to ensure that the information exchanged between the thread corresponding to the first device and the thread corresponding to the second device is not missed, so as to perform operations such as retransmission when the interactive information is out of order and / or missed.
[0035] From the above attached Figure 1 It can be seen from the example device function conversion method that after obtaining the attribute information of the application based on the first device and the executable file based on the second device, the application based on the second device can be packaged as a target application according to the attribute information of the application based on the first device and the executable file based on the second device. Since the present application can repackage the executable file based on the second device as a new application to run on the first device, it is equivalent to the first device also being able to run the application of the second device. Therefore, it not only realizes the conversion of the function of the second device and realizes more functions on the second device, but also saves hardware costs, which is more conducive to the promotion and application of the first device.
[0036] Please refer to the attached Figure 2 , is a device function conversion apparatus provided in an embodiment of the present application, which may include a first acquisition module 201, a second acquisition module 202, a packaging module 203 and an execution module 204, which are described in detail as follows:
[0037] A first acquisition module 201 is used to acquire attribute information of an application based on a first device;
[0038] A second acquisition module 202, used to acquire an executable file based on a second device;
[0039] The encapsulation module 203 is used to encapsulate the application based on the second device into a target application according to the attribute information of the application based on the first device and the executable file based on the second device;
[0040] The execution module 204 is configured to execute the target application on the first device.
[0041] From the description of the above technical solution, it can be seen that after obtaining the attribute information of the application based on the first device and the executable file based on the second device, the application based on the second device can be packaged as a target application according to the attribute information of the application based on the first device and the executable file based on the second device. Since the present application can repackage the executable file based on the second device as a new application to run on the first device, it is equivalent to that the first device can also run the application of the second device. Therefore, it not only realizes the conversion of the function of the second device and realizes more functions on the second device, but also saves hardware costs, which is more conducive to the promotion and application of the first device.
[0042] Figure 3 Schematic diagram of the structure of the device provided by an embodiment of the present application. Figure 3 As shown, the device 3 of this embodiment mainly includes: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30, such as a program of the device function conversion method. When the processor 30 executes the computer program 32, the steps in the above-mentioned device function conversion method embodiment are implemented, such as Figure 1 Alternatively, when the processor 30 executes the computer program 32, the functions of each module / unit in the above-mentioned device embodiments are implemented, for example Figure 2 The functions of the first acquisition module 201, the second acquisition module 202, the encapsulation module 203 and the execution module 204 are shown.
[0043] Exemplarily, the computer program 32 of the device function conversion method mainly includes: obtaining the attribute information of the application based on the first device; obtaining the executable file based on the second device; encapsulating the application based on the second device as a target application according to the attribute information of the application based on the first device and the executable file based on the second device; and executing the target application on the first device. The computer program 32 can be divided into one or more modules / units, one or more modules / units are stored in the memory 31 and executed by the processor 30 to complete the present application. One or more modules / units can be a series of computer program instruction segments that can complete a specific function, and the instruction segment is used to describe the execution process of the computer program 32 in the device 3. For example, the computer program 32 can be divided into the functions of a first acquisition module 201, a second acquisition module 202, a packaging module 203 and an execution module 204 (modules in the virtual device), and the specific functions of each module are as follows: the first acquisition module 201 is used to obtain the attribute information of the application based on the first device; the second acquisition module 202 is used to obtain the executable file based on the second device; the packaging module 203 is used to package the application based on the second device into a target application according to the attribute information of the application based on the first device and the executable file based on the second device; the execution module 204 is used to execute the target application on the first device.
[0044] The device 3 may include but is not limited to a processor 30 and a memory 31. Those skilled in the art will appreciate that Figure 3 It is only an example of device 3 and does not constitute a limitation of device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, a computing device may also include input and output devices, network access devices, buses, etc.
[0045] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0046] The memory 31 may be an internal storage unit of the device 3, such as a hard disk or memory of the device 3. The memory 31 may also be an external storage device of the device 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the device 3. Further, the memory 31 may also include both an internal storage unit and an external storage device of the device 3. The memory 31 is used to store computer programs and other programs and data required by the device. The memory 31 may also be used to temporarily store data that has been output or is to be output.
[0047] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0048] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0049] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0050] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0051] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0052] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0053] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-temporary computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program of the device function conversion method can be stored in a computer-readable storage medium. When the computer program is executed by the processor, it can implement the steps of the above-mentioned method embodiments, that is, obtaining the attribute information of the application based on the first device; obtaining the executable file based on the second device; according to the attribute information of the application based on the first device and the executable file based on the second device, encapsulating the application based on the second device as a target application; executing the target application on the first device. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. Non-temporary computer-readable media may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, mobile hard disks, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content contained in the non-temporary computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, non-temporary computer-readable media do not include electric carrier signals and telecommunication signals. The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application is described in detail with reference to the aforementioned embodiments, ordinary technicians in this field should understand that they can still modify the technical solutions recorded in the aforementioned embodiments, or replace some of the technical features therein by equivalent; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the scope of protection of the present application. The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation method of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present invention.
Claims
1. A device function conversion method, characterized in that: The method comprises: Acquire attribute information of an application based on the first device; Acquire an executable file based on the second device; Encapsulating the application based on the second device as a target application according to the attribute information of the application based on the first device and the executable file based on the second device; executing the target application on the first device; wherein receiving attribute information of an application based on the first device transmitted through a thread corresponding to the first device; Recompile the executable file based on the second device according to the attribute information of the application program of the first device to obtain a corresponding intermediate file; The target application is obtained by adding an interface related to the first device to the intermediate file and packaging the intermediate file.
2. The device function conversion method according to claim 1, characterized in that: The acquiring of attribute information of an application program based on the first device includes: Run the main process and start the thread corresponding to the first device; The format, size and permission of the application based on the first device are obtained from the download interface of the first device through the thread corresponding to the first device.
3. The device function conversion method according to claim 2, characterized in that: The first device is a KTV device.
4. The device function conversion method according to claim 1, characterized in that: The obtaining of the executable file based on the second device includes: Run the main process; Acquire hardware information of the second device through the driver layer of the main process; According to the hardware information of the second device, an executable file based on the second device is read.
5. The device function conversion method according to any one of claims 1 to 4, characterized in that: The method further comprises: Monitoring the thread corresponding to the first device and the thread corresponding to the second device; and Refresh information sent and received by a thread corresponding to the first device and a thread corresponding to the second device.
6. The device function conversion method according to claim 5, characterized in that: The monitoring of the thread corresponding to the first device and the thread corresponding to the second device includes: Monitoring whether an exception occurs in a thread corresponding to the first device and a thread corresponding to the second device; If an exception occurs in the thread corresponding to the first device and / or the thread corresponding to the second device, the thread corresponding to the first device and / or the thread corresponding to the second device is restored.
7. A device for converting equipment functions, characterized in that: The device comprises: A first acquisition module, used to acquire attribute information of an application based on the first device; A second acquisition module, used to acquire an executable file based on a second device; A packaging module, used for packaging the application based on the second device into a target application according to the attribute information of the application based on the first device and the executable file based on the second device; an execution module, configured to execute the target application on the first device; receiving attribute information of an application based on the first device transmitted through a thread corresponding to the first device; Recompile the executable file based on the second device according to the attribute information of the application of the first device to obtain a corresponding intermediate file; The target application is obtained by adding an interface related to the first device to the intermediate file and packaging the intermediate file.
8. A device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Methods for mobile phone applications
CN102105863A
Data transferring method for plug-in equipment
CN103020051A
Conversion methods of applications of mobile devices and mobile devices and systems using the same
CN103150176A
Method for processing application programs, operation system and electronic equipment
CN103677767A
Application running method and system
CN108399084A
