Application program and physical device matching method, device and terminal device
By obtaining and matching the parameter information of applications and physical devices, automatic matching is achieved, and the problems of low configuration efficiency and high error rate in the prior art are solved, and matching efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202010037091.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-14
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2040-01-14
AI Technical Summary
In the prior art, the mapping relationship configuration between the application program and the physical device is inefficient, and various configuration parameters need to be manually input, resulting in low efficiency and prone to errors.
By obtaining the target parameter information of physical devices and applications, determining their category information, and matching them according to the mapping relationship, automatic matching between applications and physical devices is achieved.
Improve matching efficiency, eliminate manual matching errors, and improve matching accuracy.
Smart Images

Figure CN113190185B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of device matching, and in particular, relates to a method, apparatus and terminal device for matching an application program and a physical device. Background Art
[0002] On the same terminal, physical devices and applications may belong to different manufacturers, or even multiple physical devices may belong to different manufacturers. The existing cross-platform system needs to establish a mapping relationship between applications and physical devices, so that the application can correctly operate and control the physical device and realize the corresponding business functions.
[0003] Currently, it is necessary to manually input various configuration parameters to establish the mapping relationship between application programs and physical devices, which has the problem of low efficiency. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus and terminal device for matching applications and physical devices, which can solve the problem of low configuration efficiency of the mapping relationship between applications and physical devices.
[0005] In a first aspect, an embodiment of the present application provides a method for matching an application program with a physical device, comprising:
[0006] Acquire first target parameter information of each physical device and second target parameter information of each application program;
[0007] Determine first target category information of each of the physical devices according to the first target parameter information, and determine second target category information of each of the application programs according to the second target parameter information;
[0008] According to the mapping relationship between the first target category information and the second target category information, each of the physical devices and each of the application programs are matched.
[0009] In a possible implementation manner of the first aspect, before obtaining the first target parameter information of each physical device and the second target parameter information of each application, the method further includes:
[0010] Acquire first parameter information, preset response information and characteristic instruction sequence of each of the physical devices;
[0011] Classify each of the physical devices according to the logical function, and determine first category information of each of the physical devices;
[0012] The first parameter information, the preset response information, the first category information and the characteristic instruction sequence corresponding to the same type of physical devices are associated and stored in a database.
[0013] In a possible implementation manner of the first aspect, before obtaining the first target parameter information of each physical device and the second target parameter information of each application, the method further includes:
[0014] Obtaining second parameter information of each of the applications;
[0015] Classify each of the applications according to a logical function, and determine second category information of each of the applications;
[0016] The second parameter information and the second category information corresponding to the same type of application are associated and stored in a database.
[0017] In a possible implementation manner of the first aspect, the acquiring first target parameter information of each of the physical devices includes:
[0018] Sending a plurality of characteristic instruction sequences to each of the physical devices in sequence; wherein each of the characteristic instruction sequences can be correctly executed by a unique physical device;
[0019] Obtaining response information returned by each of the physical devices when executing each of the characteristic instruction sequences;
[0020] In the case where the response information successfully matches the preset response information, determining the characteristic instruction sequence corresponding to the response information as the target characteristic instruction sequence;
[0021] The database is traversed according to the target feature instruction sequence to determine the first target parameter information.
[0022] In a possible implementation manner of the first aspect, matching each of the physical devices and each of the application programs according to a mapping relationship between the first target category information and the second target category information includes:
[0023] Obtaining matching results between each of the physical devices and each of the application programs;
[0024] When the matching result is a preset result, running a test on the physical device and the application program, and obtaining a running result;
[0025] When the running result is a preset result, the matching information of the physical device and the application is saved.
[0026] In a possible implementation manner of the first aspect, obtaining a matching result between each of the physical devices and each of the application programs includes:
[0027] When the first target category information and the second target category information satisfy a preset mapping relationship, the physical device and the application are matched successfully.
[0028] In a possible implementation manner of the first aspect, when the matching result is a preset result, running a test on the physical device and the application and obtaining a running result includes:
[0029] Controlling the application to send a setting instruction to the physical device;
[0030] Obtain result information returned by the physical device when executing the setting instruction.
[0031] In a second aspect, an embodiment of the present application provides an application and physical device matching device, including:
[0032] A parameter information acquisition module, used to acquire first target parameter information of each physical device and second target parameter information of each application program;
[0033] a target category information acquisition module, configured to determine first target category information of each of the physical devices according to the first target parameter information, and to determine second target category information of each of the application programs according to the second target parameter information;
[0034] A matching module is used to match each of the physical devices and each of the application programs according to a mapping relationship between the first target category information and the second target category information.
[0035] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the methods described in the first aspect when executing the computer program.
[0036] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the above-mentioned first aspects is implemented.
[0037] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute any of the methods described in the first aspect above.
[0038] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0039] In the embodiment of the present application, the first target parameter information of each physical device and the second target parameter information of each application are first obtained, and then the first target category information of each physical device is determined according to the first target parameter information, and the second target category information of each application is determined according to the second target parameter information, and finally, each physical device and each application are matched according to the mapping relationship between the first target category information and the second target category information. The above method realizes automatic matching of applications and physical devices, improves matching efficiency, and eliminates the phenomenon of manual matching errors, thereby improving matching accuracy.
[0040] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 labor.
[0042] Figure 1 It is a flowchart of a method for matching an application program and a physical device provided in an embodiment of the present application;
[0043] Figure 2 It is a flowchart of a method for matching an application program and a physical device provided in an embodiment of the present application;
[0044] Figure 3 It is a flowchart of a method for matching an application program and a physical device provided in an embodiment of the present application;
[0045] Figure 4 It is a flowchart of a method for matching an application program and a physical device provided in an embodiment of the present application;
[0046] Figure 5 It is a flowchart of a method for matching an application program and a physical device provided in an embodiment of the present application;
[0047] Figure 6 It is a flowchart of a method for matching an application program and a physical device provided in an embodiment of the present application;
[0048] Figure 7 It is a structural diagram of an application program and a physical device matching device provided in an embodiment of the present application;
[0049] Figure 8 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0051] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0052] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0053] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0054] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0055] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0056] On the same terminal, physical devices and applications may belong to different manufacturers, or even multiple physical devices may belong to different manufacturers. The cross-platform system of the existing technology needs to establish a mapping relationship between the application and the physical device, so that the application can correctly operate and control the physical device and realize the corresponding business functions. At present, it is necessary to manually input various configuration parameters to establish the mapping relationship between the application and the physical device, which has the problem of low efficiency.
[0057] Based on the above problems, the application and physical device matching method proposed in the embodiment of the present application first obtains the first target parameter information of each physical device and the second target parameter information of each application, then determines the first target category information of each physical device according to the first target parameter information, determines the second target category information of each application according to the second target parameter information, and finally matches each physical device and each application according to the mapping relationship between the first target category information and the second target category information. The above method realizes automatic matching of applications and physical devices, improves matching efficiency; at the same time, eliminates the phenomenon of manual matching errors, and improves matching accuracy.
[0058] Figure 1 A flow chart of a method for matching an application program and a physical device provided in an embodiment of the present application is shown. As an example but not a limitation, the method may include the following steps:
[0059] S101, obtaining first target parameter information of each physical device and second target parameter information of each application program.
[0060] Specifically, the first target parameter information of the physical device may include information such as the manufacturer, brand or model of the device, and the second target parameter information of the application may include information such as the name, version, logical function and dynamic library name.
[0061] For example, refer to Figure 2 , before step S101, the following may also be included:
[0062] S1001, obtaining first parameter information, preset response information and characteristic instruction sequence of each physical device.
[0063] Specifically, by referring to the guidance document of the physical device, the first parameter information corresponding to the physical device (the first parameter information may include information such as the manufacturer, brand or model of the device), preset response information and characteristic instruction sequence may be obtained.
[0064] For example, refer to Figure 3 , step S1001 may include:
[0065] S10011, sending multiple characteristic instruction sequences to each physical device in sequence.
[0066] Among them, each characteristic instruction sequence can be correctly executed by a unique physical device.
[0067] Specifically, since the communication methods between different physical devices and servers are different, in order to ensure that the physical device can receive the characteristic instruction sequence, multiple communication methods can be used to send the characteristic instruction sequence to the physical device. The communication methods can be USB communication, serial port communication, wireless 2.4G communication, wireless Bluetooth communication, wireless 433 communication, wireless zegbee communication, wireless WiFi communication and other communication methods.
[0068] Exemplarily, step S10011 may specifically include:
[0069] A, get device identification instructions.
[0070] Specifically, the device identification instruction may be automatically generated by an external device or generated by manual input.
[0071] B. Determine multiple communication modes and multiple characteristic instruction sequences according to device identification instructions.
[0072] Specifically, multiple communication modes and multiple characteristic instruction sequences can be stored in the database in advance, and when identifying the physical device, the required multiple communication modes and multiple characteristic instruction sequences are called in the database. The selected multiple characteristic instruction sequences can be all characteristic instruction sequences in the database, or part of the characteristic instruction sequences; similarly, the selected multiple communication modes can be all data communication modes in the database, or part of the communication modes.
[0073] For example, when the physical device is a printer of a certain brand and model, you can select the communication method and feature instruction sequence corresponding to the printer, that is, select some communication methods and some feature instruction sequences in the database. Since the number of selected communication methods and feature instruction sequences is small, the speed of device recognition can be improved.
[0074] At the same time, when identifying physical devices, all communication methods and characteristic instruction sequences in the database can also be selected. The advantage of this method is that there is no need to determine the type of physical device, and any type of device can be identified.
[0075] C, send all characteristic instruction sequences to the physical device in sequence using each communication mode.
[0076] Specifically, multiple communication methods and multiple feature instruction sequences are combined one by one to send feature instruction sequences to the physical device, thereby ensuring that each feature instruction sequence can be received by the physical device. This can prevent the physical device from not receiving the corresponding feature instruction sequence, being unable to return response information, or the returned response information not matching the preset response information, causing the device to be unable to recognize the phenomenon.
[0077] Exemplarily, the multiple communication modes include: communication mode A, communication mode B and communication mode C, and the multiple characteristic instruction sequences include: characteristic instruction sequence a, characteristic instruction sequence b and characteristic instruction sequence c. When sending the characteristic instruction sequence to the physical device, the three communication modes and the three characteristic instruction sequences form 9 combinations, and the characteristic instruction sequence a is sent to the physical device in communication mode A, communication mode B and communication mode C respectively; the characteristic instruction sequence b is sent to the physical device in communication mode A, communication mode B and communication mode C respectively; the characteristic instruction sequence c is sent to the physical device in communication mode A, communication mode B and communication mode C respectively. In this way, multiple communication modes and multiple characteristic instruction sequences are combined one by one to send the characteristic instruction sequence to the physical device.
[0078] The characteristic instruction sequence sent to the physical device in step S10011 can be correctly executed by a unique (for example, device brand and model) physical device. Each characteristic instruction sequence includes multiple instructions that can be executed by the physical device, and the characteristic instruction sequence and the first parameter information of the physical device are in a one-to-one correspondence. Therefore, as long as the physical device can correctly execute the characteristic instruction sequence, the corresponding first parameter information can be obtained to achieve identification of the physical device.
[0079] Exemplarily, a method for creating a characteristic instruction sequence may include:
[0080] A1, obtain the instruction set of the physical device.
[0081] The instruction set is a collection of multiple instructions that can be executed by a physical device.
[0082] B1, select multiple instructions in the instruction set to form a characteristic instruction sequence.
[0083] Among them, the characteristic instruction sequences of different physical devices are different.
[0084] Specifically, selecting instructions from the instruction set of a physical device to form a characteristic instruction sequence requires reference to the instruction sets of other physical devices to ensure that the instructions in the characteristic instruction sequence corresponding to each physical device are not exactly the same as the instructions in the instruction sets of other physical devices, thereby ensuring that the created characteristic instruction sequence can be correctly executed by a unique physical device.
[0085] For example, taking three printers as an example, the executable instruction set of printer A is {a, b, g, h, i,, j, k}, the instruction set of printer B is {a, b, c, d, e, f, g, h}, and the instruction set of printer C is {c, d, e, f, g, h, i, j, k}.
[0086] In this embodiment, the characteristic instruction sequence of printer A is determined to be {a, h, i}, printer B cannot execute instruction i, and printer C cannot execute instruction a; the characteristic instruction sequence of printer B is determined to be {a, d}, printer A cannot execute instruction d, and printer C cannot execute instruction a; the characteristic instruction sequence of printer C is determined to be {d, i}, printer A cannot execute instruction d, and printer B cannot execute instruction i.
[0087] Send characteristic instruction sequences {a, h, i}, {a, d} and {d, i} to the physical device respectively. If the physical device executes the characteristic instruction sequence {a, h, i} successfully, the physical device is determined to be printer A; if the physical device executes the characteristic instruction sequence {a, d} successfully, the physical device is determined to be printer B; if the physical device executes the characteristic instruction sequence {d, i} successfully, the physical device is determined to be printer C. The above method realizes automatic identification of the device.
[0088] When selecting instructions, the instructions with high execution success rate and fast execution speed should be selected for the physical device, so as to improve the speed of physical device recognition. At the same time, other physical devices will not cause damage or side effects to other physical devices when executing the selected instructions, so as to ensure that other physical devices will not cause damage when executing instructions.
[0089] In order to clearly illustrate the creation of a characteristic instruction sequence, a specific embodiment is described below.
[0090] Take two printers as examples, namely printer A and printer B, where the instruction set of printer A is shown in Table 1, and the instruction set of printer B is shown in Table 2.
[0091] Table 1 Instruction set of printer A
[0092] instruction Brief Description Function Type D Understand the current status of the printer and whether there is paper Detection P Execute the print operation Print K Fill print data command data M Fill print to execute buffered print commands data Q Clear print buffer data command data I Check whether all parts of the printer are normal Print F Fast Line Wrap Paper Feed W Set word spacing Word spacing E Set the color of printed characters Print V Get the film version number Version Number
[0093] Table 2 Instruction set of printer B
[0094] instruction Brief Description Function Type D Understand the current status of the printer and whether there is paper Detection P Execute the print operation Print I Check whether all parts of the printer are normal Print C Detect black bars and cut paper Paper cutting W Set word spacing Word spacing F Fast Line Wrap Paper Feed L Set line spacing Line Spacing G Fast paper feed Paper Feed B Printing Bitmap Print V Get the film version number Version Number
[0095] From Table 1 and Table 2, we can find out the differences and similarities between the instruction set of printer A and the instruction set of printer B, where:
[0096] 1) Check whether the printer has paper in its current state (shared by A and B);
[0097] 2) Execute the printing operation (shared by A and B);
[0098] 3) Check whether all parts of the printer are normal (shared by A and B);
[0099] 4) Quick line break (shared by A and B);
[0100] 5) Set the line spacing (A does not have it, B does);
[0101] 6) Set the color of the printed characters (A has it, B doesn’t);
[0102] 7) Set the character spacing (shared by A and B);
[0103] 8) Get the film version number (shared by A and B);
[0104] 9) Print bitmap (A does not have it, B does);
[0105] 10) Fast paper feed (A does not have it, B does);
[0106] 11) Fill in print data command (A has it, B doesn't);
[0107] 12) Fill print and execute buffered print commands (A has it but B doesn’t);
[0108] 13) Clear print buffer data command (A has it but B doesn't);
[0109] 14) Detect the black strip and cut the paper (A does not have it, B does).
[0110] By analyzing the instruction sets of printer A and printer B, there are 6 instructions shared by printer A and printer B. When creating a characteristic instruction sequence, it is not necessary to select the 6 instructions shared by printer A and printer B. Among them, the four instructions of "setting the color of the printed characters", "filling the print data command", "filling the print execution buffer print command" and "clearing the print buffer data command" can be executed by printer A, but not by printer B. Therefore, when creating a characteristic instruction sequence corresponding to printer A, one or more of the above four instructions can be selected, for example, the instruction with the shortest execution time among the four instructions can be selected and put into the characteristic instruction sequence. Among them, the four instructions of "setting the line spacing", "printing bitmap", "fast paper feed" and "detecting black bars and cutting paper" can be executed by printer B, but not by printer A. Therefore, when creating a characteristic instruction sequence corresponding to printer B, one or more of the above four instructions can be selected, for example, the instruction with the shortest execution time among the four instructions can be selected and put into the characteristic instruction sequence.
[0111] S10012, obtaining the response information returned by each physical device when executing each characteristic instruction sequence.
[0112] Specifically, the physical device will return a response message when executing each characteristic instruction sequence. The response message can be a level signal (high or low level) or a code. After receiving the response message, the received response message is matched with the preset response message to determine whether the execution result of the physical device executing the characteristic instruction sequence is correct or not. When the received response message matches the preset response message successfully, it means that the physical device executes the characteristic instruction sequence successfully, otherwise the physical device fails to execute the characteristic instruction sequence.
[0113] S10013, when the response information successfully matches the preset response information, determine the characteristic instruction sequence corresponding to the response information as the target characteristic instruction sequence.
[0114] Specifically, if the response information successfully matches the preset response information, it means that the physical device can execute the characteristic instruction sequence. At this time, the characteristic instruction sequence successfully executed by the physical device is determined as the target characteristic instruction sequence to achieve the positioning of the characteristic instruction sequence.
[0115] S10014, traverse the database according to the target feature instruction sequence to determine the first target parameter information.
[0116] Specifically, the corresponding first parameter information is searched in the database according to the target feature instruction sequence obtained in step S10013, and the first parameter information is used as the first target parameter information. The first target parameter information includes information such as the device brand and device model of the physical device, thereby completing the identification of the physical device.
[0117] Exemplarily, the method for creating a database in step S10014 may include:
[0118] A2, obtaining preset response information, first parameter information and characteristic instruction sequence of the physical device.
[0119] B2, associating the preset response information, the first parameter information and the characteristic instruction sequence corresponding to the same physical device and storing them.
[0120] Specifically, by associating preset response information, category information and characteristic instruction sequence of the physical device and then storing them, identification data of the physical device is pre-established to provide data for physical device identification.
[0121] S1002, classify each physical device according to the logical function, and determine the first category information of each physical device.
[0122] Specifically, the physical devices are classified according to their logical functions, and each function determines a corresponding first category information.
[0123] Exemplarily, the three physical devices are a printer of model A, a printer of model B, and a printer of model C. All three physical devices have printing functions, so the three physical devices have the same first category information, and the first category information may be "printer".
[0124] In one embodiment of the present application, when the same physical device has multiple logical functions, the physical device belongs to multiple different first category information.
[0125] Exemplarily, the physical device is a printer having printing and scanning functions, and the first category information of the physical device is “printer” and “scanner”.
[0126] S1003, associating the first parameter information, preset response information, first category information and characteristic instruction sequence corresponding to the same type of physical devices and storing them in a database.
[0127] Specifically, the first parameter information, preset response information, first category information and characteristic instruction sequence corresponding to the same type of physical device are associated and then stored in a database to complete the creation of data and provide data support for determining the first category information of the physical device.
[0128] For example, refer to Figure 4 , before step S101, the following may also be included:
[0129] S10001, obtaining second parameter information of each application.
[0130] Specifically, the second parameter information of the application may include information such as name, version, logical function, and dynamic library name.
[0131] Exemplarily, the application name is yihuaBankEPP, which belongs to the encryption keyboard category, and the second parameter information stored by the application can be shown in Table 3.
[0132] Table 3 Application yihuaBankEPP second parameter information storage table
[0133]
[0134] S10002, classify each application according to the logical function, and determine the second category information of each application.
[0135] Specifically, the application is classified according to the logical function of the application to determine the second category information of the application. For example, when the application is a printing application, the second category information of the application is "printing"; when the application is a scanning application, the second category information of the application is "scanning".
[0136] S10003, associating the second parameter information and the second category information corresponding to the same type of application programs and storing them in a database.
[0137] Specifically, the second parameter information corresponding to the same type of application is associated with the second category information and stored in the database, thereby completing the creation of data and providing data support for determining the second category information of the application.
[0138] S102, determining first target category information of each physical device according to the first target parameter information, and determining second target category information of each application according to the second target parameter information.
[0139] Specifically, a mapping relationship between the first parameter information, preset response information, first category information and characteristic instruction sequence of the same physical device is established through the above steps S1001 to S1003. The first target parameter information of the physical device is determined in step S101. According to the mapping relationship, the first category information of the physical device can be obtained as the first target category information.
[0140] At the same time, a mapping relationship between the second parameter information and the second category information of the same application is established through the above steps S10001 to S10003. The second target parameter information of the application is determined in step S101. According to the mapping relationship, the second category information of the application can be obtained as the second target category information.
[0141] S103: Match each physical device with each application program according to the mapping relationship between the first target category information and the second target category information.
[0142] Specifically, if the first target category information and the second target category information satisfy a mapping relationship, the matching of the physical device and the application program can be achieved.
[0143] In step S103, it is possible that one physical device matches multiple applications or multiple physical devices match one application, but there will be a phenomenon of wrong matching in the matching result, for example, the physical device and the application match, but the two cannot run normally. Therefore, it is necessary to test the physical device and the application matched in step S103 to prevent the problem that the matching is successful but the operation cannot be performed normally.
[0144] For example, refer to Figure 5 , in step S103, it may include:
[0145] S1031, obtaining matching results between each physical device and each application program.
[0146] Specifically, whether the physical device and the application program match can be determined according to a mapping table of the first category information and the second category information pre-stored in the database. If the first target category information and the second target category information satisfy the mapping relationship, the physical device and the application program match successfully.
[0147] S1032: When the matching result is a preset result, run a test on the physical device and the application program, and obtain the running result.
[0148] For example, refer to Figure 6 , step S1032 may include:
[0149] S10321, control the application to send a setting instruction to the physical device.
[0150] Specifically, the setting instruction may select an instruction that can be quickly executed by the physical device to improve the efficiency of the test.
[0151] S10322, obtaining result information returned by the physical device executing the setting instruction.
[0152] Specifically, the result information returned by the physical device after executing the setting instruction may be a code or a high or low level. Whether the physical device can correctly execute the setting instruction can be determined through the returned result information.
[0153] S1033: When the running result is a preset result, save the matching information of the physical device and the application program.
[0154] Specifically, if the application and the physical device can run normally, it means that the application and the physical device are matched successfully, and the matching information of the application and the physical device is included, so that the application and the physical device can be automatically matched next time.
[0155] In the above-mentioned application and physical device matching method, the first target parameter information of each physical device and the second target parameter information of each application are first obtained, and then the first target category information of each physical device is determined according to the first target parameter information, and the second target category information of each application is determined according to the second target parameter information. Finally, each physical device and each application are matched according to the mapping relationship between the first target category information and the second target category information. The above method can realize automatic matching of applications and physical devices, improve matching efficiency; at the same time, it can prevent the phenomenon of manual matching errors and improve matching accuracy.
[0156] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0157] Corresponding to the method for matching applications and physical devices described in the above embodiment, Figure 7 A schematic diagram of the structure of an application and a physical device matching apparatus provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0158] See also Figure 7 In the embodiment of the present application, the application and physical device matching device may include a parameter information acquisition module 71, a target category information acquisition module 72 and a matching module 73.
[0159] The parameter information acquisition module 71 is used to acquire the first target parameter information of each physical device and the second target parameter information of each application program;
[0160] A target category information acquisition module 72, configured to determine first target category information of each of the physical devices according to the first target parameter information, and to determine second target category information of each of the application programs according to the second target parameter information;
[0161] The matching module 73 is used to match each of the physical devices and each of the application programs according to the mapping relationship between the first target category information and the second target category information.
[0162] Optionally, the application and physical device matching apparatus may further include a physical device parameter acquisition module, a physical device classification module and a first storage module.
[0163] Wherein, the physical device parameter acquisition module is used to acquire the first parameter information, preset response information and characteristic instruction sequence of each of the physical devices;
[0164] A physical device classification module, used to classify each of the physical devices according to a logical function, and determine first category information of each of the physical devices;
[0165] The first storage module is used to associate the first parameter information, the preset response information, the first category information and the characteristic instruction sequence corresponding to the same type of physical device and store them in a database.
[0166] Optionally, the application and physical device matching apparatus may further include an application parameter acquisition module, an application classification module and a second storage module.
[0167] The application parameter acquisition module is used to acquire the second parameter information of each of the applications;
[0168] An application classification module, used for classifying each of the applications according to a logical function, and determining second category information of each of the applications;
[0169] The second storage module is used to associate the second parameter information and the second category information corresponding to the same type of application programs and store them in a database.
[0170] Optionally, the parameter information acquisition module 71 may include a characteristic instruction sequence sending module, a response information acquisition module, a target characteristic instruction sequence determination module and a first target parameter information determination module.
[0171] Wherein, the characteristic instruction sequence sending module is used to send multiple characteristic instruction sequences to each of the physical devices in sequence; wherein each of the characteristic instruction sequences can be correctly executed by a unique physical device;
[0172] A response information acquisition module, used to acquire response information returned by each of the physical devices when executing each of the characteristic instruction sequences;
[0173] A target characteristic instruction sequence determination module is used to determine the characteristic instruction sequence corresponding to the response information as a target characteristic instruction sequence when the response information successfully matches the preset response information;
[0174] The first target parameter information determination module is used to traverse the database according to the target feature instruction sequence to determine the first target parameter information.
[0175] Optionally, the matching module 73 may include a matching result acquisition module, a testing module and a third storage module.
[0176] Wherein, the matching result acquisition module is used to obtain the matching result of each of the physical devices and each of the application programs;
[0177] A testing module, used for running a test on the physical device and the application program and obtaining a running result when the matching result is a preset result;
[0178] The third storage module is used to save the matching information between the physical device and the application program when the running result is a preset result.
[0179] Optionally, the matching result acquisition module may include a judgment module.
[0180] Wherein, the judgment module is used to determine that the physical device and the application are matched successfully when the first target category information and the second target category information satisfy a preset mapping relationship.
[0181] Optionally, the test module may include a setting instruction sending module and a result information obtaining module.
[0182] Wherein, the setting instruction sending module is used to control the application to send the setting instruction to the physical device;
[0183] The result information acquisition module is used to acquire the result information returned by the physical device when executing the setting instruction.
[0184] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0185] in addition, Figure 7 The application and physical device matching device shown may be a software unit, a hardware unit, or a combination of software and hardware units built into an existing terminal device, or may be integrated into the terminal device as an independent widget, or may exist as an independent terminal device.
[0186] The technicians in the relevant field 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 practical 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 can be 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 in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in 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 system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0187] Figure 8 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Figure 8 As shown, the terminal device 8 of this embodiment may include: at least one processor 80 ( Figure 8 Only one processor 80 is shown in the figure), a memory 81, and a computer program 82 stored in the memory 81 and executable on the at least one processor 80. When the processor 80 executes the computer program 82, the steps in any of the above-mentioned method embodiments are implemented, for example Figure 1 Steps S101 to S103 in the illustrated embodiment. Alternatively, when the processor 80 executes the computer program 82, the functions of each module / unit in the above-mentioned device embodiments are implemented, for example Figure 7 The functions of modules 71 to 73 are shown.
[0188] Exemplarily, the computer program 82 may be divided into one or more modules / units, which are stored in the memory 81 and executed by the processor 80 to implement the present invention. The one or more modules / units may be a series of computer program 82 instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 82 in the terminal device 8.
[0189] The terminal device 8 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device 8 may include, but is not limited to, a processor 80 and a memory 81. Those skilled in the art will appreciate that Figure 8 It is only an example of the terminal device 8 and does not constitute a limitation on the terminal device 8. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0190] The processor 80 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.
[0191] In some embodiments, the memory 81 may be an internal storage unit of the terminal device 8, such as a hard disk or memory of the terminal device 8. In other embodiments, the memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device 8. Further, the memory 81 may also include both an internal storage unit of the terminal device 8 and an external storage device. The memory 81 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program 82. The memory 81 may also be used to temporarily store data that has been output or is to be output.
[0192] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program 82. When the computer program 82 is executed by the processor 80, the steps in the above-mentioned method embodiments can be implemented.
[0193] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0194] If the integrated 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 computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program 82, and the computer program 82 can be stored in a computer-readable storage medium. When the computer program 82 is executed by the processor 80, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program 82 includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, RandomAccess Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0195] 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.
[0196] 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.
[0197] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, 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.
[0198] 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.
[0199] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for matching an application program and a physical device, characterized in that: include Acquire first parameter information, preset response information and characteristic instruction sequence of each physical device; Classify each of the physical devices according to the logical function, and determine first category information of each of the physical devices; Associating the first parameter information, the preset response information, the first category information and the characteristic instruction sequence corresponding to the same type of physical devices and storing them in a database; Acquire first target parameter information of each of the physical devices and second target parameter information of each application program; Determine first target category information of each of the physical devices according to the first target parameter information, and determine second target category information of each of the application programs according to the second target parameter information; Matching each of the physical devices and each of the application programs according to a mapping relationship between the first target category information and the second target category information; The obtaining of first target parameter information of each of the physical devices includes: Sending a plurality of characteristic instruction sequences to each of the physical devices in sequence; wherein each of the characteristic instruction sequences can be correctly executed by a unique physical device; Obtaining response information returned by each of the physical devices when executing each of the characteristic instruction sequences; In the case where the response information successfully matches the preset response information, determining the characteristic instruction sequence corresponding to the response information as the target characteristic instruction sequence; The database is traversed according to the target feature instruction sequence to determine the first target parameter information.
2. The method for matching an application program and a physical device according to claim 1, characterized in that: Before obtaining the first target parameter information of each physical device and the second target parameter information of each application, the method further includes: Obtaining second parameter information of each of the applications; Classify each of the applications according to a logical function, and determine second category information of each of the applications; The second parameter information and the second category information corresponding to the same type of application are associated and stored in a database.
3. The method for matching an application program and a physical device according to claim 1, characterized in that: The matching of each of the physical devices and each of the application programs according to the mapping relationship between the first target category information and the second target category information includes: Obtaining matching results between each of the physical devices and each of the application programs; When the matching result is a preset result, running a test on the physical device and the application program, and obtaining a running result; When the running result is a preset result, the matching information of the physical device and the application is saved.
4. The method for matching an application program and a physical device according to claim 3, characterized in that: The obtaining of the matching result between each of the physical devices and each of the application programs includes: When the first target category information and the second target category information satisfy a preset mapping relationship, the physical device and the application are matched successfully.
5. The method for matching an application program and a physical device according to claim 3, characterized in that: When the matching result is a preset result, running a test on the physical device and the application program and obtaining a running result includes: Controlling the application to send a setting instruction to the physical device; Obtain result information returned by the physical device when executing the setting instruction.
6. An application and physical device matching device, characterized in that: include: A first acquisition module, used to acquire first parameter information, preset response information and characteristic instruction sequence of each physical device; A category information determination module, used to classify each of the physical devices according to a logical function, and determine first category information of each of the physical devices; A storage module, used for associating the first parameter information, the preset response information, the first category information and the characteristic instruction sequence corresponding to the same type of physical devices and storing them in a database; A parameter information acquisition module, used to acquire first target parameter information of each physical device and second target parameter information of each application program; a target category information acquisition module, configured to determine first target category information of each of the physical devices according to the first target parameter information, and to determine second target category information of each of the application programs according to the second target parameter information; a matching module, configured to match each of the physical devices with each of the application programs according to a mapping relationship between the first target category information and the second target category information; The parameter information acquisition module is configured to acquire the first target parameter information of each physical device as follows: Sending a plurality of characteristic instruction sequences to each of the physical devices in sequence; wherein each of the characteristic instruction sequences can be correctly executed by a unique physical device; Obtaining response information returned by each of the physical devices when executing each of the characteristic instruction sequences; In the case where the response information successfully matches the preset response information, determining the characteristic instruction sequence corresponding to the response information as the target characteristic instruction sequence; The database is traversed according to the target feature instruction sequence to determine the first target parameter information.
7. A terminal 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 method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Internet of Things device identification method and system
CN110022308A
Installation method, apparatus, control program and medium stored with the program
JP2006024199A
