US-12625823-B2 - Method of generating firmware compatible peripheral device drivers, terminal device and storage medium
Abstract
The present application is applicable to a field of computer technology, and provides a data processing method, a terminal device and a storage medium. The method is applied in a first terminal, which has loaded a first firmware, the first firmware including a first instruction set and first configuration information corresponding to each peripheral device. The method including: the first terminal acquires second configuration information from the first firmware according to the first instruction set, the second configuration information being first configuration information corresponding to target peripheral devices of the first terminal; and the first terminal drives the target peripheral devices according to the first instruction set and the second configuration information. The method can save software research and development resources.
Inventors
- BICONG HUANG
Assignees
- PAX COMPUTER TECHNOLOGY (SHENZHEN) CO., LTD.
Dates
- Publication Date
- 20260512
- Application Date
- 20220830
- Priority Date
- 20211230
Claims (15)
- 1 . A method of generating firmware compatible peripheral device drivers, applied in a first terminal, which has loaded a first firmware, the first firmware comprising a first instruction set and first configuration information corresponding to each of a plurality of peripheral devices, the first firmware comprising configuration information corresponding to peripheral devices of different terminals, the method comprising: acquiring second configuration information from the first firmware according to the first instruction set by using the first terminal, comprising: acquiring fifth configuration information and sixth configuration information from the first firmware according to the first instruction set by using the first terminal, the fifth configuration information representing first configuration information corresponding to a peripheral device of a third terminal, and the sixth configuration information representing first configuration information corresponding to target peripheral devices, the sixth configuration information being different from the first configuration information of the peripheral device of the third terminal, the third terminal and the first terminal being two different terminals; extracting common seventh configuration information of the first terminal and the third terminal from the fifth configuration information by using the first terminal, the seventh configuration information representing configuration information common to the target peripheral device of the first terminal and the peripheral device of the third terminal; and obtaining the second configuration information according to the sixth configuration information and the seventh configuration information by using the first terminal, the second configuration information being first configuration information corresponding to the target peripheral devices of the first terminal; and driving the target peripheral devices according to the first instruction set and the second configuration information by using the first terminal.
- 2 . The method of generating firmware compatible peripheral device drivers of claim 1 , further comprising: acquiring a type of a processor of the first terminal by a second terminal; selecting first preset source codes corresponding to the type of the processor of the first terminal from second preset source codes by the second terminal, the second preset source codes comprising common logic codes and configuration codes corresponding to each of the plurality of peripheral devices, and different second preset source codes corresponding to different types of processors; and generating the first firmware according to the first preset source codes and loading the first firmware into the first terminal by the second terminal.
- 3 . The method of generating firmware compatible peripheral device drivers of claim 1 , wherein the first firmware further comprises third configuration information corresponding to each of a plurality of processors, different third configuration information corresponding to different types of the plurality of processors, and the method further comprises: acquiring fourth configuration information corresponding to a type of a processor of the first terminal from the third configuration information by using the first terminal, according to the first instruction set; and changing a running state parameter of the processor of the first terminal according to the fourth configuration information by using the first terminal.
- 4 . The method of generating firmware compatible peripheral device drivers of claim 1 , wherein acquiring the second configuration information from the first firmware according to the first instruction set by using the first terminal comprises: based on the first instruction set, acquiring the second configuration information from the first configuration information using the first terminal, according to an identifier of the first terminal.
- 5 . The method of generating firmware compatible peripheral device drivers of claim 4 , wherein based on the first instruction set, acquiring the second configuration information from the first configuration information using the first terminal, according to the identifier of the first terminal comprises: traversing a first preset list using the identifier of the first terminal according to the first instruction set by the first terminal, and acquiring a target storage address corresponding to the identifier of the first terminal, the first preset list comprising a plurality of identifiers of different terminals and a plurality of storage addresses corresponding to the plurality of identifiers of different terminals, and the plurality of storage addresses being memory addresses for storing configuration information of the plurality of peripheral devices; and acquiring the second configuration information by the first terminal, according to the target storage address.
- 6 . A first terminal comprising: a first firmware, the first firmware comprising a first instruction set and first configuration information corresponding to each of a plurality of peripheral devices, the first firmware comprising configuration information corresponding to peripheral devices of different terminals; a processor; and a storage device storing computer program, which when executed by the processor, cause the processor to: acquire second configuration information from the first firmware according to the first instruction set by using the first terminal, comprising: acquire fifth configuration information and sixth configuration information from the first firmware according to the first instruction set by using the first terminal, the fifth configuration information representing first configuration information corresponding to a peripheral device of a third terminal, and the sixth configuration information representing first configuration information corresponding to target peripheral devices, the sixth configuration information being different from the first configuration information of the peripheral device of the third terminal, the third terminal and the first terminal being two different terminals; extract common seventh configuration information of the first terminal and the third terminal from the fifth configuration information, the seventh configuration information representing configuration information common to the target peripheral device of the first terminal and the peripheral device of the third terminal; and obtain the second configuration information according to the sixth configuration information and the seventh configuration information, the second configuration information being first configuration information corresponding to the target peripheral devices of the first terminal; and drive the target peripheral devices according to the first instruction set and the second configuration information.
- 7 . The first terminal of claim 6 , wherein the first terminal is in communication with a second terminal, which is configured to: acquire a type of a processor of the first terminal; select first preset source codes corresponding to the type of the processor of the first terminal from second preset source codes, the second preset source codes comprising common logic codes and configuration codes corresponding to each of the plurality of peripheral devices, and different second preset source codes corresponding to different types of processors; and generate the first firmware according to the first preset source codes and load the first firmware into the first terminal.
- 8 . The first terminal of claim 6 , wherein the first firmware further comprises third configuration information corresponding to each of a plurality of processors, different third configuration information corresponding to different types of the plurality of processors, and the processor of the first terminal is further caused to: acquire fourth configuration information corresponding to a type of a processor of the first terminal from the third configuration information, according to the first instruction set; and change a running state parameter of the processor of the first terminal according to the fourth configuration information.
- 9 . The first terminal of claim 6 , wherein the processor of the first terminal is further caused to: based on the first instruction set, acquire the second configuration information from the first configuration information, according to an identifier of the first terminal.
- 10 . The first terminal of claim 9 , wherein the processor of the first terminal is further caused to: traverse a first preset list using the identifier of the first terminal according to the first instruction set, and acquire a target storage address corresponding to the identifier of the first terminal, the first preset list comprising a plurality of identifiers of different terminals and a plurality of storage addresses corresponding to the plurality of identifiers of different terminals, and the plurality of storage addresses being memory addresses for storing configuration information of the plurality of peripheral devices; and acquire the second configuration information according to the target storage address.
- 11 . A non-transitory computer-readable storage medium of a first terminal having stored computer program, which when executed by a processor, causes the processor to perform a method of generating firmware compatible peripheral device drivers, the first terminal comprising a first firmware, the first firmware comprising a first instruction set and first configuration information corresponding to each of a plurality of peripheral devices, the first firmware comprising configuration information corresponding to peripheral devices of different terminals, the method comprising: acquiring second configuration information from the first firmware according to the first instruction set by using the first terminal, comprising: acquiring fifth configuration information and sixth configuration information from the first firmware according to the first instruction set by using the first terminal, the fifth configuration information representing first configuration information corresponding to a peripheral device of a third terminal, and the sixth configuration information representing first configuration information corresponding to target peripheral devices, the sixth configuration information being different from the first configuration information of the peripheral device of the third terminal, the third terminal and the first terminal being two different terminals; extracting common seventh configuration information of the first terminal and the third terminal from the fifth configuration information by using the first terminal, the seventh configuration information representing configuration information common to the target peripheral device of the first terminal and the peripheral device of the third terminal; and obtaining the second configuration information according to the sixth configuration information and the seventh configuration information by using the first terminal, the second configuration information being first configuration information corresponding to the target peripheral devices of the first terminal; and driving the target peripheral devices according to the first instruction set and the second configuration information.
- 12 . The non-transitory computer-readable storage of claim 11 , wherein the first terminal is in communication with a second terminal, which is configured to: acquire a type of a processor of the first terminal; select first preset source codes corresponding to the type of the processor of the first terminal from second preset source codes, the second preset source codes comprising common logic codes and configuration codes corresponding to each of the plurality of peripheral devices, and different second preset source codes corresponding to different types of processors; and generate the first firmware according to the first preset source codes and load the first firmware into the first terminal.
- 13 . The non-transitory computer-readable storage of claim 11 , wherein the first firmware further comprises third configuration information corresponding to each of a plurality of processors, different third configuration information corresponding to different types of the plurality of processors, and the method further comprises: acquiring fourth configuration information corresponding to a type of a processor of the first terminal from the third configuration information, according to the first instruction set; and changing a running state parameter of the processor of the first terminal according to the fourth configuration information.
- 14 . The non-transitory computer-readable storage of claim 11 , wherein acquiring the second configuration information from the first firmware according to the first instruction set by using the first terminal comprises: based on the first instruction set, acquiring the second configuration information from the first configuration information, according to an identifier of the first terminal.
- 15 . The non-transitory computer-readable storage of claim 14 , wherein based on the first instruction set, acquiring the second configuration information from the first configuration information using the first terminal, according to the identifier of the first terminal comprises: traversing a first preset list using the identifier of the first terminal according to the first instruction set, and acquiring a target storage address corresponding to the identifier of the first terminal, the first preset list comprising a plurality of identifiers of different terminals and a plurality of storage addresses corresponding to the plurality of identifiers of different terminals, and the plurality of storage addresses being memory addresses for storing configuration information of the plurality of peripheral devices; and acquiring the second configuration information, according to the target storage address.
Description
This application claims a priority of a Chinese Patent Application with an application number 202111662392.4 filed with the China National Intellectual Property Administration on Dec. 30, 2021, the entire contents of which are incorporated by reference in the present application. FIELD The present application belongs to a field of computer technology, and in particular relates to a data processing method, a system, a terminal device and a storage medium. BACKGROUND With rapid development of an electronic technology and a network technology, a transaction volume of non-cash business is in a stage of rapid development. As an important manner of electronic payment, point of sale (POS) transactions have also been more and more widely used. At present, a POS industry has developed different types of POS terminals, and different types of POS terminals correspond to different functional configurations, for satisfying different needs of a payment market. In order to deal with differences in security processor models, peripheral modules, peripheral communication interface resources, peripheral general input and output resources, and functional configurations of different types of POS terminals, development and maintenance of operating systems on the security processors of different types of POS terminals employed different software code bases and firmware. Each firmware could only be applied to one type of terminal, and a compatibility is poor, resulting in a significant waste of software development resources. BRIEF DESCRIPTION OF THE DRAWINGS In order to more clearly illustrate technical solutions in the embodiments of the present application, drawings that need to be used in the descriptions of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are merely some examples of the present application, those of ordinary skill in the art can also obtain other drawings based on the drawings without paying creative efforts. FIG. 1 is a schematic flowchart of a data processing method provided by an embodiment of the present application; FIG. 2 is a schematic flowchart of a data processing method provided by another embodiment of the present application; FIG. 3 is a schematic flowchart of implementation steps of S101 in FIG. 1; FIG. 4 is a schematic structural diagram of a terminal device provided by an embodiment of the present application. DESCRIPTION In following description, specific details such as specific system structures and technologies are presented for a purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can 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 avoid unnecessary details that may hinder description of the present application. It should be understood that when used in this specification and appended claims, a term “including” indicates a presence of described features, integers, steps, operations, elements and/or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and/or groups thereof. As used in this specification and the appended claims, a term “if” may be construed depending on a context as “when” or “once” or “in response to determine” or “in response to detect”. Similarly, a phrase “if determined” or “if a described condition or an event is detected” may be construed, depending on the context, to mean “once determined” or “in response to determine” or “once detected the described condition or the event” or “in response to detection of the described condition or the event”. In addition, in the description of the specification and the appended claims of the present application, terms “first”, “second”, “third” and so on are only used to distinguish descriptions, and should not be understood as indicating or implying relative importance. Reference to “one embodiment” or “some embodiments” or the like in the specification of the present application means that particular features, structures, or characteristics described in connection with the embodiment are included in one or more embodiments of the present application. Therefore, appearances of the phrases “in one embodiment”, “in some embodiments”, “in other embodiments”, “in other embodiments again” and the like in various places in this specification are not necessarily all referring to same embodiment, but mean “one or more but not all embodiments” unless expressly specified otherwise. Terms “including”, “comprising”, “having” and their variations mean “including but not limited to”, unless expressly specified otherwise. FIG. 1 shows a schematic flowchart of a data processing method provided by the present applicat