CN109298862B - Customized data value acquisition method and device and storage medium - Google Patents
Customized data value acquisition method and device and storage medium Download PDFInfo
- Publication number
- CN109298862B CN109298862B CN201811042876.7A CN201811042876A CN109298862B CN 109298862 B CN109298862 B CN 109298862B CN 201811042876 A CN201811042876 A CN 201811042876A CN 109298862 B CN109298862 B CN 109298862B
- Authority
- CN
- China
- Prior art keywords
- protocol
- code
- customized data
- header
- acquiring
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/36—Software reuse
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/72—Code refactoring
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Communication Control (AREA)
Abstract
The invention discloses a method and a device for acquiring numerical values of customized data and a storage medium. The method comprises the following steps: establishing a lookup MAP table between keywords and numerical values required by customized data in a preset file, wherein each keyword corresponds to each numerical value one to one; receiving an operation instruction of a user, acquiring a first head code and a first protocol according to the operation instruction, and acquiring a second head code and a second protocol corresponding to the first head code and the first protocol respectively from a preset file; acquiring keywords corresponding to the second head code and the second protocol according to the second head code and the second protocol; and searching the MAP table according to the second head code and the key word corresponding to the second protocol to obtain the numerical value corresponding to the key word in the MAP table. The invention provides a numerical value acquisition method of customized data, and aims to solve the problems that various customized requirements of users cannot be met and development resources are greatly wasted in the prior art.
Description
Technical Field
The present invention relates to the field of embedded electronics, and in particular, to a method and an apparatus for obtaining a value of customized data, and a computer-readable storage medium.
Background
With the continuous improvement of living standard of people, various electronic products have gone into thousands of households, and the requirements of consumers on the electronic products are higher and higher, and the requirements are different. Therefore, in the development process of electronic products, part of data needs to be customized according to different requirements of different customers so as to realize new functions required by the customers.
The technical scheme for acquiring the numerical value of the existing customized data is as follows: a header code in the customized data corresponds to different protocols, after the corresponding protocol is determined according to the user requirement, different numerical values are given to the data according to the protocol, so that the data can realize different functions, and the customized requirement is met. However, when the user's needs change, the subject software needs to be recompiled, which wastes development resources greatly. Therefore, how to use the minimum development resources to make software meet the requirement of customization is a problem to be solved urgently at present.
Disclosure of Invention
The invention mainly aims to provide a method and a device for acquiring numerical values of customized data and a storage medium. The method aims to solve the problems that the prior art can not meet the customized requirements and greatly wastes development resources.
In order to achieve the above object, the present invention provides a method for obtaining a value of customized data, comprising the following steps:
establishing a lookup MAP table between keywords and numerical values required by customized data in a preset file, wherein each keyword corresponds to each numerical value one to one;
receiving an operation instruction of a user, acquiring a first head code and a first protocol according to the operation instruction, and acquiring a second head code and a second protocol corresponding to the first head code and the first protocol respectively from a preset file;
acquiring keywords corresponding to the second head code and the second protocol according to the second head code and the second protocol;
and searching the MAP table according to the second head code and the key word corresponding to the second protocol to obtain a numerical value corresponding to the key word in the MAP table.
Optionally, the step of obtaining the first header and the first protocol according to the operation instruction includes:
acquiring a code value corresponding to the operation instruction according to the operation instruction;
and analyzing the code value to obtain a first head code and a first protocol.
Optionally, before the step of obtaining a second header code and a second protocol respectively corresponding to the first header code and the first protocol from a preset file, the method further includes:
acquiring an analysis file corresponding to a preset file, and analyzing the preset file through the analysis file;
the step of obtaining a second header code and a second protocol respectively corresponding to the first header code and the first protocol from a preset file includes:
and acquiring a second header code and a second protocol respectively corresponding to the first header code and the first protocol from the analyzed preset file.
Optionally, the step of obtaining a second header code and a second protocol respectively corresponding to the first header code and the first protocol from a preset file includes:
acquiring a plurality of head codes and a plurality of protocols from the analyzed preset file;
and matching the first head code and the first protocol with the plurality of head codes and the plurality of protocols to obtain a second head code and a second protocol respectively corresponding to the first head code and the first protocol.
Optionally, the step of obtaining a second header code and a second protocol respectively corresponding to the first header code and the first protocol from a preset file further includes:
obtaining an interrupt number corresponding to the first protocol from the analyzed preset file;
acquiring a driving function of a function corresponding to the interrupt number according to the interrupt number;
after the step of obtaining the value corresponding to the keyword in the MAP table, the method further includes:
and transferring the customized data according to the driving function.
Optionally, the step of acquiring, according to the second header code and the second protocol, a keyword corresponding to the second header code and the second protocol includes:
obtaining a program statement from the analyzed preset file;
reading a program statement according to a preset rule to obtain a keyword in the program statement;
the preset rules include: skipping over comment statements in the program statement and other keywords except keywords corresponding to the second protocol and the second header.
Optionally, while the step of obtaining the first header and the first protocol according to the operation instruction is executed, the following steps are executed:
acquiring a code comprising a variable according to the operation instruction;
after the step of searching the MAP table according to the second header code and the keyword corresponding to the second protocol to obtain the value corresponding to the keyword in the MAP table, the method further includes:
and assigning the numerical value to a variable in the code to complete customization of data.
Optionally, the method further comprises after all the steps:
receiving a customized data modification instruction of a user;
and modifying the corresponding relation between the key words in the MAP table and the numerical values required by the customized data according to the customized data modification instruction.
In addition, to achieve the above object, the present invention provides a customized data value obtaining apparatus, including: the system comprises a memory, a processor and a numerical value acquisition program of customized data stored on the memory and capable of running on the processor, wherein the numerical value acquisition program of customized data realizes the steps of the numerical value acquisition method of customized data as described above when being executed by the processor.
In addition, to achieve the above object, the present invention further provides a computer-readable storage medium having a customized data value acquisition program stored thereon, which when executed by a processor, implements the steps of the customized data value acquisition method as described above.
The invention provides a numerical value acquisition method, a numerical value acquisition device and a storage medium of customized data, which comprise the following steps: establishing a lookup MAP table between keywords and numerical values required by customized data in a preset file, wherein each keyword corresponds to each numerical value one to one; receiving an operation instruction of a user, acquiring a first head code and a first protocol according to the operation instruction, and acquiring a second head code and a second protocol corresponding to the first head code and the first protocol respectively from a preset file; acquiring keywords corresponding to the second head code and the second protocol according to the second head code and the second protocol; and searching the MAP table according to the second head code and the key word corresponding to the second protocol to obtain the numerical value corresponding to the key word in the MAP table. According to the invention, by pre-establishing the MAP table between the keywords and the numerical values required by the customized data, each keyword corresponds to each protocol one by one, and each keyword corresponds to each numerical value one by one, when the requirement of a user changes, the MAP table is just recompiled, so that the new functions required by the user can be realized, the development resources are greatly saved, and the production period is reduced. In addition, the corresponding head codes and protocols in the preset file are determined according to the head codes and the protocols obtained by the operation instructions of the user, so that the head codes and the protocols are in one-to-one correspondence, and the protocols can be effectively analyzed even if a plurality of protocols exist.
Drawings
FIG. 1 is a schematic diagram of an apparatus in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for obtaining customized data values according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for obtaining customized data values according to another embodiment of the present invention;
fig. 4 is a flowchart illustrating a detailed process of the step of obtaining a second header code and a second protocol respectively corresponding to the first header code and the first protocol from a preset file according to the embodiment of the present invention;
FIG. 5 is a flowchart illustrating a method for obtaining customized data values according to another embodiment of the present invention;
FIG. 6 is a flowchart illustrating a method for obtaining customized data according to yet another embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
The terminal of the embodiment of the invention is a numerical value acquisition device of customized data, and can be a computer, or a mobile terminal device with a display function and an input function, such as a smart phone, a tablet computer, a portable computer and the like.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the terminal may further include a camera, a WiFi module, and the like, which are not described herein again.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 mainly includes an input unit such as a keyboard including a wireless keyboard and a wired keyboard, and is used to connect to the client and perform data communication with the client; and the processor 1001 may be used to invoke the tuning customized data program stored in the memory 1005.
The specific embodiment of the apparatus for obtaining customized data values as a terminal of the present invention is substantially the same as the following embodiments of the method for obtaining customized data values, and will not be described herein again.
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating a method for obtaining customized data according to an embodiment of the present invention, where the method for obtaining customized data according to the embodiment includes the following steps:
step S110, establishing a lookup MAP table between keywords and numerical values required by customized data in a preset file, wherein each keyword corresponds to each numerical value one by one;
and establishing MAP tables with different keywords and different numerical values in the preset file, wherein the keywords in the MAP table correspond to the numerical values one by one. Different functions of the data are realized by assigning different values in the MAP table to the codes. In addition, by pre-establishing the MAP table comprising different values, when the requirement of a user changes, the new function required by the user can be realized only by recompiling the MAP table, thereby greatly reducing the maintenance cost of production and development and reducing the production and development period.
Step S120, receiving an operation instruction of a user, acquiring a first header code and a first protocol according to the operation instruction, and acquiring a second header code and a second protocol corresponding to the first header code and the first protocol respectively from a preset file;
in the embodiment of the present invention, taking the application of the customized data value acquisition method to a remote controller as an example, it should be understood that the present invention can be applied to a remote controller, and the method for acquiring customized data values disclosed by the present invention can realize the independence of sound data, screen parameter data and PQ data of an embedded electronic product and the configuration of a signal source.
In the embodiment of the invention, a user firstly sends an operation instruction, for example, a remote controller key is pressed, and according to the operation of the user, software acquires a first head code and a first protocol generated by pressing the remote controller key by the user. It should be understood that a pair of header codes and protocols corresponds to a function required by the client. For example, for the same remote control key of the same remote controller, the client a needs to implement the function of increasing the sound of the television, at this time, the corresponding header code and protocol are configured in the preset file, and when the client B uses the same remote control key of the remote controller and requires to implement the function of changing the channel, the data in the MAP table of the preset file needs to be recompiled.
A plurality of protocols and a plurality of head codes can be added in a preset file in advance according to different requirements of different clients, and the head codes and the protocols correspond to functions required by the clients one by one, namely a pair of head codes and protocols correspond to functions of keys of a remote controller. After receiving the first header and the first protocol, traversing the preset file, and obtaining a second header and a second protocol corresponding to the file from the plurality of protocols and the plurality of headers. In this way, the protocol is configured in the upper layer file, and the independence of different protocols is realized. When a plurality of protocols exist and the protocols need to be analyzed, the phenomenon that data are overlapped in the analysis process so that the analysis fails can be avoided.
Step S130, acquiring keywords corresponding to the second head code and the second protocol according to the second head code and the second protocol;
a plurality of keywords are added in program sentences of a preset file in advance according to different requirements of different clients, and the keywords correspond to a pair of head codes and protocols one to one, namely the pair of head codes and the protocols correspond to the keywords in a section of program sentences. In the prior art, after a corresponding protocol in a preset file is obtained, the definition of a data function is directly realized, and when more required functions result in more protocols, code confusion is easily caused, so that protocol analysis fails. The invention utilizes different keywords to correspond to different protocols, and then carries out subsequent operation of functional definition on data, so that the code logic is clearer, and the independence of the protocols is really realized.
Step S140, according to the second head code and the keyword corresponding to the second protocol, the MAP table is searched to obtain a numerical value corresponding to the keyword in the MAP table.
After the corresponding key is obtained, the numerical value corresponding to the key is obtained in the MAP table. The preset file is provided with MAP tables with different keywords and different values, and the keywords in the MAP table correspond to the values one by one. And assigning different values to the codes to enable the data to realize different functions.
The method for acquiring the numerical value of the customized data in the embodiment comprises the following steps: establishing a lookup MAP table between keywords and numerical values required by customized data in a preset file, wherein each keyword corresponds to each numerical value one to one; receiving an operation instruction of a user, acquiring a first head code and a first protocol according to the operation instruction, and acquiring a second head code and a second protocol corresponding to the first head code and the first protocol respectively from a preset file; acquiring keywords corresponding to the second head code and the second protocol according to the second head code and the second protocol; and searching the MAP table according to the second head code and the key word corresponding to the second protocol to obtain the numerical value corresponding to the key word in the MAP table. According to the invention, by pre-establishing the MAP table between the keywords and the numerical values required by the customized data, each keyword corresponds to each protocol one by one, and each keyword corresponds to each numerical value one by one, when the requirement of a user changes, the MAP table is just recompiled, so that the new functions required by the user can be realized, the development resources are greatly saved, and the production period is reduced. In addition, the corresponding head codes and protocols in the preset file are determined according to the head codes and the protocols obtained by the operation instructions of the user, so that the head codes and the protocols are in one-to-one correspondence, and even if a plurality of protocols exist, the protocols can be effectively and accurately analyzed.
Further, referring to fig. 3, fig. 3 is a flowchart illustrating another embodiment of the method for obtaining customized data values according to the present invention, wherein the step of obtaining the first header and the first protocol according to the operation instruction in step S120 includes:
s150, acquiring a code value corresponding to the operation instruction according to the operation instruction;
and step S160, analyzing the code value to obtain a first head code and a first protocol.
And receiving an operation instruction generated when a user uses the embedded electronic product, and acquiring a corresponding code value according to the operation instruction. Taking the remote controller as an example, when a user presses a key of the remote controller, a remote control code value is generated immediately. And after the corresponding code value is obtained, decoding the code value to obtain a corresponding first head code and a first protocol. The head code is a part of sentences in the code, plays a role of identification, and performs mutual matching between program sentences through the head code. A protocol is a set of conventions that must be followed by both communicating computers, rules, conventions, or standards established for implementing network data exchanges, and technical specifications to which modules communicating with each other are to adhere.
Further, before the step S120 of obtaining a second header and a second protocol respectively corresponding to the first header and the first protocol from a preset file, the method further includes:
step S170, obtaining an analysis file corresponding to a preset file, and analyzing the preset file through the analysis file;
the step S120 includes:
step S121, obtaining, from the parsed preset file, a second header and a second protocol corresponding to the first header and the first protocol, respectively.
When the preset file type is an ini preset file, the preset file is analyzed to be an iniarser.c file, and it should be understood that different preset file types correspond to different analyzed files. The ini file, which is a system configuration file, may be used to store software information, registry information, and the like. The configuration of the ini file management system generally has ini files under the application program used by people, and the ini files are used for configuring software to meet the requirements of different users. Therefore, the invention preferably configures the file in the ini format as the preset file to realize the separation of the data and the program. The data interface of the program is reserved in the preset file, when the software needs to be updated, the new function required by the user can be realized only by updating the data of the relevant data interface, the customized requirement is met, and the software does not need to be compiled again.
It should be understood that the present invention may first parse the default file using parsing decomposition, and then obtain the second header and the second protocol from the parsed default file. After the preset file is analyzed, a second header code and a second protocol respectively corresponding to the first header code and the first protocol can be obtained from the analyzed preset file.
Further, referring to fig. 4, fig. 4 is a flowchart illustrating a detailed process of the step of acquiring the second header code and the second protocol respectively corresponding to the first header code and the first protocol from the preset file in step S120 according to an embodiment of the present invention, where the step of acquiring the second header code and the second protocol respectively corresponding to the first header code and the first protocol from the preset file includes:
step S122, acquiring a plurality of head codes and a plurality of protocols from the analyzed preset file;
step S123, matching the first header and the first protocol with the plurality of headers and the plurality of protocols to obtain a second header and a second protocol respectively corresponding to the first header and the first protocol.
Analyzing the preset file by using the analysis file to obtain a plurality of head codes and a plurality of protocols in the preset file, and taking the head code in the preset file, which is the same as the first head code, as a second head code; and taking the protocol which is the same as the first protocol in the preset file as a second protocol. It should be understood that the second header and the second protocol correspond one-to-one to the first header and the first protocol, respectively. By the method, the protocols are directly matched, so that the protocol independence is realized, and the situation that data overlap occurs to cause analysis errors when the protocols are analyzed is avoided.
Further, referring to fig. 5, fig. 5 is a flowchart illustrating a flow of a method for obtaining customized data according to another embodiment of the present invention, where after the step S120 obtains a second header and a second protocol respectively corresponding to the first header and the first protocol from a preset file, the method includes:
step S180, obtaining an interrupt number corresponding to the first protocol from the analyzed preset file;
step S190, obtaining a driving function with a function corresponding to the interrupt number according to the interrupt number;
after the step S140 obtains the value corresponding to the keyword in the MAP table, the method further includes:
and S200, transferring the customized data according to the driving function.
The preset file is analyzed through the analysis file, a plurality of interrupt numbers which are registered in the kernel are preset in the preset file, and the interrupt numbers corresponding to the first protocol are obtained through analyzing the preset file. The interrupt number can judge which device makes an operation request, and the address of the device sending the interrupt is found by using the characteristic of the interrupt number to obtain the corresponding device interrupt, so as to obtain a driving function in the device interrupt. And after the corresponding numerical value in the MAP table is obtained and the numerical value corresponding to the customized data is obtained, the obtained driving function is utilized to transmit the customized data to the controlled equipment, so that the actual transmission according to the key value is realized. This is prior art and will not be described again. By calling the driving function in the interruption of the related equipment, the transfer of customized data is ensured, and the controlled equipment is ensured to really realize the function required by a customer.
Further, the step of obtaining the keyword corresponding to the second header code and the second protocol according to the second header code and the second protocol includes:
step S131, obtaining a program statement from the analyzed preset file;
step S132, reading a program statement according to a preset rule to acquire a keyword in the program statement;
the preset rules include: skipping over comment statements in the program statement and other keywords except keywords corresponding to the second protocol and the second header.
Program statements corresponding to different head codes and protocols are built in the preset file, and the program statements corresponding to the second head codes and the second protocol are obtained through analysis of the preset file. The program statement is divided into two parts, wherein the statement beginning with a sign "#" is an annotation part of the program statement, and is generally remark information left for developers, so that the operation of the whole program is not affected, and the part is directly skipped when keywords are searched. The other part is a chapter part which is composed of program statements with computer language logic and can realize the functions expressed by the program. And skipping the annotation part of the program statement, and obtaining preset keywords corresponding to the second protocol and the second head code in the chapter part of the program statement.
The invention utilizes the keywords to correspond to different protocols, and then carries out subsequent operation of functional definition on the data, so that the code logic is clearer, the independence of the protocols is really realized, and when the requirements of customers are changed, the whole main software does not need to be compiled again.
Further, referring to fig. 6, fig. 6 is a flowchart illustrating a method for obtaining customized data according to another embodiment of the present invention, and after all the steps, the method further includes:
step S220, receiving a customized data modification instruction of a user;
step S230, modifying the corresponding relationship between the key words in the MAP table and the values required by the customized data according to the customized data modification instruction. ,
when a user wants to realize more functions or change functions, the corresponding customized data modification instruction is received, and according to the customized data modification instruction, the corresponding relation between the key words in the MAP table and the numerical values required by the customized data is only required to be changed, and the assignment of the corresponding variables in the data codes is changed, so that the new functions required by the user can be realized, the customized requirements are further met, software does not need to be compiled again, and the development cost is greatly saved.
Further, while the step of acquiring the first header and the first protocol according to the operation instruction is executed, the following steps are executed:
step S124, acquiring codes comprising variables according to the operation instructions;
the step S140 searches the MAP table according to the second header code and the keyword corresponding to the second protocol, and after obtaining the value corresponding to the keyword in the MAP table, the method further includes:
and step S210, assigning the numerical value to a variable in the code to complete customization of data.
In the embodiment of the invention, the corresponding code is obtained according to the operation instruction of the user, wherein the variable in the code is not endowed with an exact numerical value, so that the function of the data is not defined, and a certain numerical value needs to be endowed to the variable according to the requirement of the client. And after the numerical value corresponding to the key word in the MAP table is obtained, assigning the corresponding numerical value to a variable in the code to complete the definition of the data function. The invention separates the data from the program by the way, and when the requirement of the user changes, different functions can be realized only by changing the specific numerical value of the variable in the code, thereby achieving the purpose of saving development resources.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a customized data value obtaining program is stored on the computer-readable storage medium, and when executed by a processor, the customized data value obtaining program implements the following operations:
establishing a lookup MAP table between keywords and numerical values required by customized data in a preset file, wherein each keyword corresponds to each numerical value one to one;
receiving an operation instruction of a user, acquiring a first head code and a first protocol according to the operation instruction, and acquiring a second head code and a second protocol corresponding to the first head code and the first protocol respectively from a preset file;
acquiring keywords corresponding to the second head code and the second protocol according to the second head code and the second protocol;
and searching the MAP table according to the second head code and the key word corresponding to the second protocol to obtain a numerical value corresponding to the key word in the MAP table.
Further, the customized data value acquisition program when executed by the processor further implements the following operations:
acquiring a code value corresponding to the operation instruction according to the operation instruction;
and analyzing the code value to obtain a first head code and a first protocol.
Further, the customized data value acquisition program when executed by the processor further implements the following operations:
acquiring an analysis file corresponding to a preset file, and analyzing the preset file through the analysis file;
and acquiring a second header code and a second protocol respectively corresponding to the first header code and the first protocol from the analyzed preset file.
Further, the customized data value acquisition program when executed by the processor further implements the following operations:
acquiring a plurality of head codes and a plurality of protocols from the analyzed preset file;
and matching the first head code and the first protocol with the plurality of head codes and the plurality of protocols to obtain a second head code and a second protocol respectively corresponding to the first head code and the first protocol.
Further, the customized data value acquisition program when executed by the processor further implements the following operations:
obtaining an interrupt number corresponding to the first protocol from the analyzed preset file;
acquiring a driving function of a function corresponding to the interrupt number according to the interrupt number;
and transferring the customized data according to the driving function.
Further, the customized data value acquisition program when executed by the processor further implements the following operations:
obtaining a program statement from the analyzed preset file;
reading a program statement according to a preset rule to obtain a keyword in the program statement;
the preset rules include: skipping over comment statements in the program statement and other keywords except keywords corresponding to the second protocol and the second header.
Further, the customized data value acquisition program when executed by the processor further implements the following operations:
acquiring a code comprising a variable according to the operation instruction;
and assigning the numerical value to a variable in the code to complete customization of data.
Further, the customized data value acquisition program when executed by the processor further implements the following operations:
receiving a customized data modification instruction of a user;
and modifying the corresponding relation between the key words in the MAP table and the numerical values required by the customized data according to the customized data modification instruction.
The specific embodiment of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the customized data value obtaining method described above, and will not be described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. A method for obtaining a value of customized data is characterized by comprising the following steps:
establishing a lookup MAP table between keywords and numerical values required by customized data in a preset file, wherein each keyword corresponds to each numerical value one to one;
receiving an operation instruction of a user, acquiring a first head code and a first protocol according to the operation instruction, and acquiring a second head code and a second protocol corresponding to the first head code and the first protocol respectively from a preset file; wherein, the head code and the corresponding protocol correspond to the function required by the user one by one;
acquiring keywords corresponding to the second head code and the second protocol according to the second head code and the second protocol;
and searching the MAP table according to the second head code and the key word corresponding to the second protocol to obtain a numerical value corresponding to the key word in the MAP table.
2. The method of claim 1, wherein the step of obtaining the first header and the first protocol according to the operation command comprises:
acquiring a code value corresponding to the operation instruction according to the operation instruction;
and analyzing the code value to obtain a first head code and a first protocol.
3. The method for obtaining numerical values of customized data according to claim 1, wherein before the step of obtaining the second header code and the second protocol corresponding to the first header code and the first protocol, respectively, from a preset file, the method further comprises:
acquiring an analysis file corresponding to a preset file, and analyzing the preset file through the analysis file;
the step of obtaining a second header code and a second protocol respectively corresponding to the first header code and the first protocol from a preset file includes:
and acquiring a second header code and a second protocol respectively corresponding to the first header code and the first protocol from the analyzed preset file.
4. The method as claimed in claim 3, wherein the step of obtaining the second header code and the second protocol corresponding to the first header code and the first protocol from a preset file comprises:
acquiring a plurality of head codes and a plurality of protocols from the analyzed preset file;
and matching the first head code and the first protocol with the plurality of head codes and the plurality of protocols to obtain a second head code and a second protocol respectively corresponding to the first head code and the first protocol.
5. The method as claimed in claim 3, wherein the step of obtaining the second header code and the second protocol corresponding to the first header code and the first protocol respectively from a preset file further comprises:
obtaining an interrupt number corresponding to the first protocol from the analyzed preset file;
acquiring a driving function of a function corresponding to the interrupt number according to the interrupt number;
after the step of obtaining the value corresponding to the keyword in the MAP table, the method further includes:
and transferring the customized data according to the driving function.
6. The method of claim 3, wherein the step of obtaining the key corresponding to the second header and the second protocol according to the second header and the second protocol comprises:
obtaining a program statement from the analyzed preset file;
reading a program statement according to a preset rule to obtain a keyword in the program statement;
the preset rules include: skipping over comment statements in the program statement and other keywords except keywords corresponding to the second protocol and the second header.
7. The numerical value acquisition method of customized data according to any one of claims 1 to 6, wherein the following steps are performed while the step of acquiring the first header and the first protocol according to the operation instruction is performed:
acquiring a code comprising a variable according to the operation instruction;
after the step of searching the MAP table according to the second header code and the keyword corresponding to the second protocol to obtain the value corresponding to the keyword in the MAP table, the method further includes:
and assigning the numerical value to a variable in the code to complete customization of data.
8. The method for numerical acquisition of customized data according to any of the claims 1-6, further comprising after all the steps:
receiving a customized data modification instruction of a user;
and modifying the corresponding relation between the key words in the MAP table and the numerical values required by the customized data according to the customized data modification instruction.
9. A numerical value acquisition apparatus for customized data, comprising: memory, a processor and a numerical acquisition program of customized data stored on the memory and executable on the processor, the numerical acquisition program of customized data implementing the steps of the numerical acquisition method of customized data according to any one of claims 1 to 8 when executed by the processor.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a numerical value acquisition program of customized data, which when executed by a processor implements the steps of the numerical value acquisition method of customized data according to any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811042876.7A CN109298862B (en) | 2018-09-06 | 2018-09-06 | Customized data value acquisition method and device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811042876.7A CN109298862B (en) | 2018-09-06 | 2018-09-06 | Customized data value acquisition method and device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109298862A CN109298862A (en) | 2019-02-01 |
CN109298862B true CN109298862B (en) | 2021-12-21 |
Family
ID=65166408
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811042876.7A Active CN109298862B (en) | 2018-09-06 | 2018-09-06 | Customized data value acquisition method and device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109298862B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112346712B (en) * | 2020-10-22 | 2023-07-18 | 深圳市慧为智能科技股份有限公司 | System customization method, device and computer readable storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104616470A (en) * | 2015-01-30 | 2015-05-13 | 王亚斌 | Method and device for remotely controlling terminal |
CN104702585A (en) * | 2014-02-28 | 2015-06-10 | 杭州海康威视***技术有限公司 | Protocol conversion method and protocol conversion gateway equipment |
CN105118254A (en) * | 2015-07-14 | 2015-12-02 | 芜湖美的厨卫电器制造有限公司 | Communication method used for remote controller to control household electrical appliance, and household electrical appliance system |
CN106357706A (en) * | 2015-07-13 | 2017-01-25 | 青岛海尔滚筒洗衣机有限公司 | Electrical equipment control method, electrical equipment control device and electrical equipment thereof |
CN106713343A (en) * | 2017-01-09 | 2017-05-24 | 青岛金思特电子有限公司 | Method for realizing intelligent analysis of communication protocol based on cloud computation |
CN107037294A (en) * | 2017-05-25 | 2017-08-11 | 绵阳美菱软件技术有限公司 | The detection method and detecting system of a kind of host computer, frequency conversion integrated board |
CN107450924A (en) * | 2017-07-31 | 2017-12-08 | 绵阳美菱软件技术有限公司 | One kind driving monitoring method, device and system |
-
2018
- 2018-09-06 CN CN201811042876.7A patent/CN109298862B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104702585A (en) * | 2014-02-28 | 2015-06-10 | 杭州海康威视***技术有限公司 | Protocol conversion method and protocol conversion gateway equipment |
CN104616470A (en) * | 2015-01-30 | 2015-05-13 | 王亚斌 | Method and device for remotely controlling terminal |
CN106357706A (en) * | 2015-07-13 | 2017-01-25 | 青岛海尔滚筒洗衣机有限公司 | Electrical equipment control method, electrical equipment control device and electrical equipment thereof |
CN105118254A (en) * | 2015-07-14 | 2015-12-02 | 芜湖美的厨卫电器制造有限公司 | Communication method used for remote controller to control household electrical appliance, and household electrical appliance system |
CN106713343A (en) * | 2017-01-09 | 2017-05-24 | 青岛金思特电子有限公司 | Method for realizing intelligent analysis of communication protocol based on cloud computation |
CN107037294A (en) * | 2017-05-25 | 2017-08-11 | 绵阳美菱软件技术有限公司 | The detection method and detecting system of a kind of host computer, frequency conversion integrated board |
CN107450924A (en) * | 2017-07-31 | 2017-12-08 | 绵阳美菱软件技术有限公司 | One kind driving monitoring method, device and system |
Also Published As
Publication number | Publication date |
---|---|
CN109298862A (en) | 2019-02-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI512489B (en) | Multi-screen interactive method, center equipment, terminal equipment and systems | |
CN110012328B (en) | Method and device for interacting with smart television | |
US20130227014A1 (en) | Data sharing system and method | |
CN103475577A (en) | Method, device and network equipment for obtaining characteristic information | |
CN105554588B (en) | Closed caption-supporting content receiving apparatus and display apparatus | |
CN109492181B (en) | Page jump method, device, computer equipment and storage medium | |
CN107818046B (en) | A/B test method and device for application program page | |
CN105704562B (en) | Multi-version compatible method and device for network television cloud service platform | |
US9418539B2 (en) | Remote control apparatus and electronic device remotely controlled by the same | |
US20170099507A1 (en) | Method and apparatus for transmitting data in intelligent terminal to television terminal | |
CN106604109B (en) | Configuration method and device of smart television | |
CN111008254B (en) | Object creation method, device, computer equipment and storage medium | |
CN109298862B (en) | Customized data value acquisition method and device and storage medium | |
CN111343506B (en) | Video searching method, device, system, server and readable storage medium | |
CN108052401B (en) | System attribute monitoring method, terminal device and computer readable storage medium | |
KR102506155B1 (en) | Electronic device, application executing system and control methods thereof | |
CN112003928B (en) | Multifunctional screen synchronous control method, device and equipment | |
CN103647818A (en) | Method and system for realizing function setting | |
CN114116866A (en) | Data acquisition method and device, terminal equipment and storage medium | |
CN108984206B (en) | Data sending method and equipment | |
CN113687901A (en) | Interface display method and interface display device | |
CN113256253A (en) | Data processing method, device, equipment, computer readable storage medium and product | |
CN114697713B (en) | Voice assistant control method and device, storage medium and intelligent television | |
CN112351420A (en) | Networking identity creating method and device of terminal device and readable storage medium | |
CN105631303B (en) | Method for acquiring data, providing data and realizing search and electronic terminal thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |