CN111885568B - Loading method and device of near field communication configuration parameters and electronic equipment - Google Patents

Loading method and device of near field communication configuration parameters and electronic equipment Download PDF

Info

Publication number
CN111885568B
CN111885568B CN202010656831.XA CN202010656831A CN111885568B CN 111885568 B CN111885568 B CN 111885568B CN 202010656831 A CN202010656831 A CN 202010656831A CN 111885568 B CN111885568 B CN 111885568B
Authority
CN
China
Prior art keywords
near field
field communication
communication function
configuration parameters
variable
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
Application number
CN202010656831.XA
Other languages
Chinese (zh)
Other versions
CN111885568A (en
Inventor
龙祖明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Realme Chongqing Mobile Communications Co Ltd
Original Assignee
Realme Chongqing Mobile Communications Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Realme Chongqing Mobile Communications Co Ltd filed Critical Realme Chongqing Mobile Communications Co Ltd
Priority to CN202010656831.XA priority Critical patent/CN111885568B/en
Publication of CN111885568A publication Critical patent/CN111885568A/en
Application granted granted Critical
Publication of CN111885568B publication Critical patent/CN111885568B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)
  • Communication Control (AREA)

Abstract

The application relates to a loading method, a loading device, computer equipment and a storage medium of near field communication configuration parameters. The method comprises the following steps: when the near field communication function is started, variable values of control variables corresponding to the near field communication function are obtained; when the variable value of the control variable is a first preset value, acquiring a configuration file of the near field communication function, and acquiring configuration parameters from the configuration file; loading configuration parameters, and performing near field communication according to the configuration parameters. The method can ensure loading of the configuration parameters, so that near field communication is performed according to the configuration parameters.

Description

Loading method and device of near field communication configuration parameters and electronic equipment
Technical Field
The present invention relates to the field of communications, and in particular, to a method and apparatus for loading a near field communication configuration parameter, an electronic device, and a computer readable storage medium.
Background
With the development of communication technology, near field communication (Near Field Communication, abbreviated as NFC) technology is developed, near field communication is an emerging technology, devices (such as mobile phones) using NFC technology can exchange data under the condition of being close to each other, and the devices are integrated and evolved by using a non-contact Radio Frequency Identification (RFID) technology and an interconnection technology, and by integrating functions of an inductive card reader, an inductive card and point-to-point communication on a single chip, mobile terminals are utilized to realize applications such as mobile payment, electronic ticketing, access control, mobile identity recognition, anti-counterfeiting and the like.
Various problems may occur during testing or during the use of near field communication by a user, and a background staff needs to modify and load configuration parameters of near field communication to solve the problems existing in near field communication. However, the conventional loading method of the near field communication configuration parameters has a problem that the configuration parameters cannot be loaded.
Disclosure of Invention
The embodiment of the application provides a loading method, a loading device, electronic equipment and a computer readable storage medium for near field communication configuration parameters, which can ensure that the near field communication configuration parameters are loaded.
A method for loading near field communication configuration parameters, comprising:
when a near field communication function is started, obtaining a variable value of a control variable corresponding to the near field communication function;
when the variable value of the control variable is a first preset value, acquiring a configuration file of the near field communication function, and acquiring configuration parameters from the configuration file;
loading the configuration parameters, and performing near field communication according to the configuration parameters.
A loading device of near field communication configuration parameters, comprising:
the variable value acquisition module is used for acquiring the variable value of the control variable corresponding to the near field communication function when the near field communication function is started;
the configuration parameter acquisition module is used for acquiring a configuration file of the near field communication function when the variable value of the control variable is a first preset value, and acquiring configuration parameters from the configuration file;
and the loading module is used for loading the configuration parameters and performing near field communication according to the configuration parameters.
An electronic device comprising a memory and a processor, wherein the memory stores a computer program which, when executed by the processor, causes the processor to perform the steps of the method for loading near field communication configuration parameters as described above.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of a method as described above.
The loading method, the loading device, the electronic equipment and the computer readable storage medium of the near field communication configuration parameters acquire the variable value of the control variable corresponding to the near field communication function when the near field communication function is started; when the variable value of the control variable is a first preset value, acquiring a configuration file of the near field communication function, and acquiring configuration parameters from the configuration file; by controlling the variable value of the control variable, that is, controlling the variable value of the control variable to be a first preset value, the configuration parameters are obtained from the configuration file to be loaded, so that the loading of the configuration parameters can be ensured, and near field communication is performed according to the configuration parameters.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is an application environment diagram of a method for loading near field communication configuration parameters in one embodiment;
FIG. 2 is a flow chart of a method of loading near field communication configuration parameters in one embodiment;
FIG. 3 is a flowchart of a step of acquiring a variable value of a control variable corresponding to a near field communication function when the near field communication function is turned on in one embodiment;
FIG. 4 is a flowchart of steps in one embodiment for obtaining a configuration file of a near field communication function and obtaining configuration parameters from the configuration file when a variable value of a control variable is a first preset value;
FIG. 5 is a flowchart of a method for loading near field communication configuration parameters in another embodiment;
FIG. 6 is a flowchart of a method for loading near field communication configuration parameters in another embodiment;
FIG. 7 is a flowchart of a method for loading near field communication configuration parameters in another embodiment;
FIG. 8 is a block diagram of a near field communication configuration parameter loading device in one embodiment;
fig. 9 is a schematic diagram of an internal structure of an electronic device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
It will be understood that the terms "first," "second," and the like, as used herein, may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another element. For example, a first preset value may be referred to as a second preset value, and similarly, a second preset value may be referred to as a first preset value, without departing from the scope of the present application. Both the first preset value and the second preset value are preset values, but they are not the same preset value.
Fig. 1 is an application environment schematic diagram of a loading method of near field communication configuration parameters in one embodiment. As shown in fig. 1, the application environment includes an electronic device 102 and an electronic device 104. When the electronic device 102 is near the sensing region of the electronic device 104, the near field communication function may be turned on. When the near field communication function is started, the electronic device 102 acquires a variable value of a control variable corresponding to the near field communication function; when the variable value of the control variable is a first preset value, acquiring a configuration file of the near field communication function, and acquiring configuration parameters from the configuration file; loading configuration parameters, and performing near field communication according to the configuration parameters. The electronic device 102 and the electronic device 104 may be various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
Fig. 2 is a flow chart of a method for loading near field communication configuration parameters in one embodiment. As shown in fig. 2, the loading method of the near field communication configuration parameters includes steps 202 to 206.
Step 202, when the near field communication function is started, obtaining a variable value of a control variable corresponding to the near field communication function.
Near field communication (Near Field Communication, abbreviated as NFC) is an emerging technology, devices (such as mobile phones) using NFC technology can exchange data in a situation of being close to each other, and the devices are integrated and evolved by non-contact Radio Frequency Identification (RFID) and interconnection technology.
And when the electronic equipment receives an opening instruction of the near field communication function, opening the near field communication function.
In one embodiment, when the electronic device receives a triggering operation of the near field communication function control by a user, an opening instruction of the near field communication function is generated, and the electronic device opens the near field communication function according to the opening instruction. Wherein the triggering operation may be a single click, a slide, a double click, etc.
In another embodiment, when the distance between the electronic device and another electronic device is smaller than the preset distance, the electronic device may detect the other electronic device and generate an opening instruction of the near field communication function, and the electronic device opens the near field communication function according to the opening instruction. For example, when the mobile phone approaches the subway gate, the mobile phone can detect the subway gate and generate an opening instruction of the near field communication function to open the near field communication function, so that the gate can be passed.
The manner in which the electronic device turns on the near field communication function is not limited.
The control variable refers to a variable that controls loading of configuration parameters of near field communication. The variable value of the control variable refers to the value given by the control variable. The variable value of the control variable may be true or false, Y or N, 1 or 0, a or B, or the like, but is not limited thereto.
The electronic device may preset a control variable "set_rf_config_always" corresponding to the near field communication function, and when the near field communication function is turned on, acquire a variable value of the control variable "set_rf_config_always".
And 204, when the variable value of the control variable is a first preset value, acquiring a configuration file of the near field communication function, and acquiring configuration parameters from the configuration file.
The first preset value refers to a value preset by the control variable for loading the configuration parameter. For example, the first preset value may be true, Y, 1 or 0, a or B, and is not limited thereto.
The configuration file refers to a file for configuring parameters required for the near field communication function. The configuration files may include a master configuration file and a city configuration file. Configuration parameters are included in the configuration file. The configuration parameter may be a configuration parameter of an RF (Radio Frequency) register, a configuration parameter of a chip, or other configuration parameters, and is not limited thereto.
The electronic equipment acquires a first preset value, compares the variable value of the control variable with the first preset value, acquires a configuration file of the near field communication function from the memory when the variable value of the control variable is the first preset value, and acquires configuration parameters from the configuration file.
And step 206, loading configuration parameters, and performing near field communication according to the configuration parameters.
The configuration parameters loaded by the electronic device may be original configuration parameters of near field communication or modified configuration parameters, and are not limited to the original configuration parameters.
After the electronic equipment acquires the configuration parameters, the configuration parameters are loaded, and near field communication can be performed according to the configuration parameters. Further, after the electronic device loads the configuration parameters, other initialization operations may be performed, so that near field communication is performed according to the configuration parameters.
According to the loading method of the near field communication configuration parameters, when the near field communication function is started, the variable value of the control variable corresponding to the near field communication function is obtained; when the variable value of the control variable is a first preset value, acquiring a configuration file of the near field communication function, and acquiring configuration parameters from the configuration file; by controlling the variable value of the control variable, that is, controlling the variable value of the control variable to be a first preset value, the configuration parameters are obtained from the configuration file to be loaded, so that the loading of the configuration parameters can be ensured, and near field communication is performed according to the configuration parameters.
In addition, according to the loading method of the near field communication configuration parameters, after the near field communication function is started, the variable value of the control variable is controlled to control the loading flow of the configuration parameters, so that the loading of the configuration parameters is dynamically controlled, and the loading of the configuration parameters can be more rapidly controlled.
In one embodiment, as shown in fig. 3, when the near field communication function is started, obtaining a variable value of a control variable corresponding to the near field communication function includes:
step 302, when the near field communication function is started, acquiring an attribute value of the input preset attribute through the preset interface.
The preset interface may be an interface in an application framework layer (frames layer), which is an upper layer interface. And the preset attribute belongs to a service layer (service layer). The attribute value of the preset attribute "persistence.nfc.rf_conf_always" may be true or false, or Y or N, or 1 or 0, or a or B, and is not limited thereto.
The electronic device may set a preset interface "vendor_set_config_ always (boolean)" in the application framework layer (frameworks layer) in advance, through which a user may input an attribute value of a preset attribute.
And step 304, obtaining the variable value of the control variable corresponding to the near field communication function according to the attribute value of the preset attribute.
In one embodiment, the electronic device may use an attribute value of the preset attribute as a variable value of a control variable corresponding to the near field communication function. For example, when the near field communication function is started, the attribute value of the preset attribute input through the preset interface is true, and the variable value of the control variable corresponding to the near field communication function is not true.
In another embodiment, the electronic device may also find, according to the attribute value of the preset attribute, a variable value of the control variable corresponding to the near field communication function from a correspondence between the attribute value of the preset attribute and the variable value of the control variable. The corresponding relation between the attribute value of the preset attribute and the variable value of the control variable can be preset.
For example, when the near field communication function is started, acquiring the attribute value of the input preset attribute as 1 through the preset interface, and finding the variable value of the control variable corresponding to the attribute value of the preset attribute as 1 as true from the corresponding relation between the attribute value of the preset attribute and the variable value of the control variable, wherein the true is taken as the variable value of the control variable corresponding to the near field communication function.
In this embodiment, when the near field communication function is turned on, an attribute value of an input preset attribute is obtained through a preset interface; according to the attribute value of the preset attribute, the variable value of the control variable corresponding to the near field communication function can be obtained, so that loading of the configuration parameters is accurately controlled through the variable value of the control variable.
In one embodiment, as shown in fig. 4, when the variable value of the control variable is a first preset value, acquiring a configuration file of the near field communication function, and acquiring configuration parameters from the configuration file, including:
and step 402, when the variable value of the control variable is a first preset value, acquiring a log file corresponding to the near field communication function.
The log file includes log records, each log record describing a separate system event. A log refers to a time ordered collection of certain operations of an object specified by a system and its results of operations.
The electronic equipment acquires a first preset value, compares the variable value of the control variable with the first preset value, and acquires a log file corresponding to the near field communication function when the variable value of the control variable is the first preset value.
Step 404, obtaining a configuration file of the near field communication function, which is effective when the near field communication function is started, from the log file, and obtaining configuration parameters from the effective configuration file.
It is understood that the electronic device may perform near field communication in different scenarios. For example, the electronic device can perform near field communication with an IC (Integrated Circuit Card ) card (bus card, subway card, etc.), so that services such as recharging, logging in, modifying information, etc. can be performed on the IC card. For another example, the electronic device may perform near field communication with a card swiping machine (bus swiping machine, subway gate, etc.), so as to perform operations such as payment, registration, etc. And the electronic device performs near field communication in different scenes, and the used (loaded) configuration files are different. Thus, one or at least two configuration files are stored at the electronic device, while the configuration file used when the near field communication function is turned on is the currently active configuration file.
When the electronic equipment starts the near field communication function, the electronic equipment records the configuration file which takes effect when the near field communication function is started in the log file, when the variable value of the control variable is a first preset value, the log file corresponding to the near field communication function is obtained, the effective configuration file is obtained from the log file, and the configuration parameters are obtained from the effective configuration file, so that the problem that the configuration parameters cannot be loaded due to the fact that the wrong and invalid configuration file is obtained can be avoided, and the accuracy of loading the configuration parameters is improved.
Further, the electronic device obtains the current time and the effective time of each configuration file recorded by the log file, and takes the configuration file corresponding to the effective time closest to the current time as the configuration file of the near field communication function effective when the near field communication function is started.
It may be appreciated that in the log file, one or at least two configuration files may be recorded at the time of validation, and a configuration file corresponding to the time of validation closest to the current time, that is, a configuration file of a near field communication function that is validated by the electronic device when the near field communication function is started.
In one embodiment, as shown in fig. 5, the method further includes:
and step 502, judging whether the firmware corresponding to the near field communication function is updated or not when the variable value of the control variable is a second preset value.
The second preset value refers to a value preset by the control variable and used for judging whether the firmware corresponding to the near field communication function is updated or not. Wherein the firmware upgrade also belongs to firmware update. For example, the second preset value may be false, N, 1 or 0, a or B, or not limited thereto. In one embodiment, the first preset value and the second preset value may be a correlation. For example, the first preset value is true and the second preset value is false; for example, the first preset value is Y and the second preset value is N.
Firmware refers to a program written in EPROM (Erasable Programmable Read-Only Memory ) or EEPROM (Electrically Erasable Programmable read Only Memory, electrically erasable programmable read-Only Memory). The EPROM is a ROM (Read-Only Memory) Memory having an erasable function, and being reprogrammed after being erased. EEPROM refers to an electrified erasable programmable read-only memory, which is a memory chip with no data loss after power failure.
When the variable value of the control variable is a second preset value, the electronic equipment acquires firmware corresponding to the near field communication function from the program code of the near field communication function, and judges whether the firmware corresponding to the near field communication function is updated or not.
In one embodiment, the electronic device may obtain a flag from the firmware corresponding to the near field communication function, and when the flag is an update flag, determine that there is an update in the firmware corresponding to the near field communication function; when the mark is not the update mark, judging that the firmware corresponding to the near field communication function has update. Wherein the user may preset the form, color, text, etc. of the update flag.
In another embodiment, the electronic device may obtain the firmware currently corresponding to the near field communication function and the firmware last corresponding to the near field communication function, compare the firmware currently corresponding to the firmware last corresponding to the near field communication function, and determine that the firmware corresponding to the near field communication function is updated when the firmware is different from the firmware last corresponding to the near field communication function; and when the firmware is the same, judging that the firmware corresponding to the near field communication function is updated.
Step 504, when the firmware corresponding to the near field communication function is updated, a configuration file of the near field communication function is obtained, and configuration parameters are obtained from the configuration file.
When the firmware corresponding to the near field communication function is updated, a configuration file of the near field communication function is obtained from the memory, and configuration parameters are obtained from the configuration file.
And step 506, loading configuration parameters, and performing near field communication according to the configuration parameters.
The configuration parameters loaded by the electronic device may be original configuration parameters of near field communication or modified configuration parameters, and are not limited to the original configuration parameters.
After the electronic equipment acquires the configuration parameters, the configuration parameters are loaded, and near field communication can be performed according to the configuration parameters. Further, after the electronic device loads the configuration parameters, other initialization operations may be performed, so that near field communication is performed according to the configuration parameters.
In this embodiment, when the variable value of the control variable is a second preset value, whether the firmware corresponding to the near field communication function is updated is determined; when the firmware corresponding to the near field communication function is updated, a configuration file of the near field communication function is obtained, configuration parameters are obtained from the configuration file, the configuration parameters can be loaded when the firmware corresponding to the near field communication function is updated, and near field communication is performed according to the configuration parameters.
In one embodiment, as shown in fig. 6, the method further includes:
step 602, when the firmware corresponding to the near field communication function is not updated, a configuration file of the near field communication function is obtained.
Step 604 detects if there is a modification of the configuration file of the near field communication function.
The electronic equipment acquires the configuration file of the near field communication function from the memory, and detects whether the configuration file of the near field communication function is modified or not.
In one embodiment, the electronic device obtains a configuration file of the near field communication function and a mark carried by the configuration file, and when the mark is a modification mark, the modification exists in the configuration file of the near field communication function; when the tag is not a modification tag, then there is no modification of the configuration file representing the near field communication function.
In another embodiment, the electronic device obtains a current configuration file of the near field communication function and a historical configuration file of the near field communication function, compares the current configuration file with the historical configuration file, and when the current configuration file is different from the historical configuration file, indicates that the modification exists in the configuration file of the near field communication function; when the current profile and the historical profile are the same, no modification exists in the profile representing the near field communication function.
Further, when the firmware corresponding to the near field communication function is not updated, the electronic equipment acquires a log file corresponding to the near field communication function; acquiring a configuration file of a near field communication function which takes effect when the near field communication function is started from a log file; it is detected whether there is a modification of the validated configuration file.
Step 606, when detecting that the configuration file of the near field communication function has modification, acquiring configuration parameters from the configuration file; loading configuration parameters, and performing near field communication according to the configuration parameters.
Step 608, when it is detected that the configuration file of the near field communication function is not modified, obtaining a variable value of a preset variable from the configuration file of the near field communication function; when the variable value of the preset variable is a third preset value, acquiring configuration parameters from the configuration file; loading configuration parameters, and performing near field communication according to the configuration parameters.
The preset variable refers to a variable preset by the configuration file. The variable value of the preset variable refers to a value given by the preset variable. The variable value of the preset variable may be true or false, Y or N, 1 or 0, a or B, or not limited thereto. The third preset value refers to a preset value in the configuration file for loading the configuration parameters.
When no modification exists in the configuration file of the near field communication function, acquiring a variable value of a preset variable NXP_SET_CONFIG_ALWAYS from the configuration file of the near field communication function; when the variable value of the preset variable is a third preset value, the configuration parameters of the configuration file need to be loaded, so that the configuration parameters are obtained from the configuration file, and the configuration parameters are loaded, so that near field communication can be accurately performed according to the configuration parameters.
Further, when no modification exists in the configuration file of the near field communication function, acquiring a log file corresponding to the near field communication function; acquiring a configuration file of a near field communication function which takes effect when the near field communication function is started from a log file; obtaining a variable value of a preset variable from the effective configuration file; when the variable value of the preset variable is a third preset value, acquiring configuration parameters from the configuration file; loading configuration parameters, and performing near field communication according to the configuration parameters.
In one embodiment, the storage of variable values of the control variables includes file storage and database storage. Similarly, the storage modes of the data such as the configuration file, the firmware, the attribute value of the preset attribute and the like comprise file storage and database storage.
File storage refers to storing data as files. The electronic equipment acquires the variable value of the control variable, and generates and stores a file in a specified format by the variable value of the control variable. The files with the specified format can be set according to the needs of users, such as doc format, PDF format and the like. The independence of data (variable values of control variables) can be ensured through file storage, and the influence caused by errors of other data is avoided.
Further, the generated file in the instruction format also comprises data such as a file identifier, a file storage path, a file size and the like, when the electronic equipment receives a search request for the variable value of the control variable, a target file corresponding to the search request is searched according to the file storage path and the file identifier carried in the search request, and then the variable value of the control variable is obtained from the target file.
The electronic equipment can search the position stored by the file through the file storage path, then searches the target file corresponding to the search request from the position stored by the file through the file identification, and obtains the variable value of the control variable from the target file.
Database storage refers to storing data in a database. The electronic device obtains the variable value of the control variable and stores the variable value of the control variable in the database. The data can be uniformly stored in the database through the database storage, so that the computer resources of the electronic equipment are saved.
Further, when the electronic device receives a search request for the variable value of the control variable, the control variable corresponding to the search request is searched from the database according to the identification of the control variable carried in the search request, and the variable value of the control variable is obtained.
In one embodiment, as shown in fig. 7, when the electronic device performs step 702 and turns on the near field communication function, step 704 is performed to obtain a variable value of a control variable corresponding to the near field communication function. Further, the electronic device may obtain the input attribute value 708 of the preset attribute through the preset interface 704, and obtain the variable value of the control variable corresponding to the near field communication function according to the attribute value of the preset attribute.
After the electronic device obtains the variable value of the control variable, step 710 is executed to determine whether the variable value of the control variable is a first preset value. When the determination is yes, the electronic device performs step 718; when the determination is negative, the electronic device performs step 712.
Step 712, it is determined whether there is an update to the firmware. When the determination is yes, the electronic device performs step 718; when the determination is negative, the electronic device performs step 714.
Step 714, it is determined whether there is a modification to the configuration file. When the determination is yes, the electronic device performs step 718; when the determination is negative, the electronic device performs step 716.
Step 716, determining whether the variable value of the preset variable in the configuration file is a third preset value, and executing step 718 by the electronic device when the variable value of the preset variable in the configuration file is determined to be the third preset value; when the determination is negative, the electronic device performs step 720.
Step 718, obtain the configuration parameters from the configuration file and write the configuration parameters into the EEPROM. The electronic device performs step 720, performing other initialization operations; the electronic device performs step 722 for near field communication.
It should be understood that, although the steps in the flowcharts of fig. 2 to 7 are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps of fig. 2-7 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the sub-steps or stages are performed necessarily occur in sequence, but may be performed alternately or alternately with at least a portion of other steps or sub-steps or stages of other steps.
Fig. 8 is a block diagram of a structure of a loading device of near field communication configuration parameters of an embodiment. As shown in fig. 8, there is provided a loading apparatus 800 of near field communication configuration parameters, including: a variable value acquisition module 802, a configuration parameter acquisition module 804, and a loading module 806, wherein:
the variable value obtaining module 802 is configured to obtain a variable value of a control variable corresponding to the near field communication function when the near field communication function is turned on.
The configuration parameter obtaining module 804 is configured to obtain a configuration file of the near field communication function when the variable value of the control variable is a first preset value, and obtain a configuration parameter from the configuration file.
The loading module 806 is configured to load the configuration parameters, and perform near field communication according to the configuration parameters.
The loading device of the near field communication configuration parameters acquires the variable value of the control variable corresponding to the near field communication function when the near field communication function is started; when the variable value of the control variable is a first preset value, acquiring a configuration file of the near field communication function, and acquiring configuration parameters from the configuration file; by controlling the variable value of the control variable, that is, controlling the variable value of the control variable to be a first preset value, the configuration parameters are obtained from the configuration file to be loaded, so that the loading of the configuration parameters can be ensured, and near field communication is performed according to the configuration parameters.
In one embodiment, the variable value obtaining module 802 is further configured to obtain, through a preset interface, an attribute value of the input preset attribute when the near field communication function is turned on; and acquiring a variable value of a control variable corresponding to the near field communication function according to the attribute value of the preset attribute.
In one embodiment, the variable value obtaining module 802 is further configured to use an attribute value of the preset attribute as a variable value of a control variable corresponding to the near field communication function.
In an embodiment, the configuration parameter obtaining module 804 is further configured to obtain a log file corresponding to the near field communication function when a variable value of the control variable is a first preset value; and acquiring a configuration file of the near field communication function which is effective when the near field communication function is started from the log file, and acquiring configuration parameters from the effective configuration file.
In an embodiment, the loading device 800 of the near field communication configuration parameter further includes a firmware update determining module, configured to determine whether the firmware corresponding to the near field communication function is updated when the variable value of the control variable is a second preset value; the above-mentioned configuration parameter obtaining module 804 is further configured to obtain a configuration file of the near field communication function and obtain configuration parameters from the configuration file when firmware corresponding to the near field communication function is updated; the loading module 806 is further configured to load configuration parameters, and perform near field communication according to the configuration parameters.
In one embodiment, the loading device 800 of the near field communication configuration parameter further includes a configuration file detection module, configured to obtain a configuration file of the near field communication function when no update exists in firmware corresponding to the near field communication function; detecting whether a configuration file of a near field communication function is modified or not; the configuration parameter obtaining module 804 is further configured to obtain a configuration parameter from a configuration file when it is detected that the configuration file of the near field communication function is modified; the loading module 806 is further configured to load configuration parameters, and perform near field communication according to the configuration parameters; the loading device 800 of the near field communication configuration parameter further includes a variable value obtaining module of a preset variable, configured to obtain, when detecting that there is no modification in the configuration file of the near field communication function, the variable value of the preset variable from the configuration file of the near field communication function; the configuration parameter obtaining module 804 is further configured to obtain a configuration parameter from the configuration file when the variable value of the preset variable is a third preset value; the loading module 806 is further configured to load configuration parameters, and perform near field communication according to the configuration parameters.
In one embodiment, the storage of variable values of the control variables includes file storage and database storage.
The above-mentioned division of each module in the near field communication configuration parameter loading device is only used for illustration, and in other embodiments, the near field communication configuration parameter loading device may be divided into different modules according to the need, so as to complete all or part of the functions of the near field communication configuration parameter loading device.
For specific limitations of the loading means for near field communication configuration parameters, reference may be made to the above limitations of the loading method for near field communication configuration parameters, and no further description is given here. The above-mentioned respective modules in the loading means of near field communication configuration parameters may be implemented wholly or partly by software, hardware and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
Fig. 9 is a schematic diagram of an internal structure of an electronic device in one embodiment. As shown in fig. 9, the electronic device includes a processor and a memory connected through a system bus. Wherein the processor is configured to provide computing and control capabilities to support operation of the entire electronic device. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program is executable by a processor for implementing a method of loading near field communication configuration parameters as provided in the various embodiments below. The internal memory provides a cached operating environment for operating system computer programs in the non-volatile storage medium. The electronic device may be any terminal device such as a mobile phone, a tablet computer, a PDA (Personal Digital Assistant ), a POS (Point of Sales), a car-mounted computer, and a wearable device.
The implementation of each module in the loading device of the near field communication configuration parameters provided in the embodiments of the present application may be in the form of a computer program. The computer program may run on a terminal or a server. Program modules of the computer program may be stored in the memory of the electronic device. Which when executed by a processor, performs the steps of the methods described in the embodiments of the present application.
Embodiments of the present application also provide a computer-readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the steps of a method of loading near field communication configuration parameters.
A computer program product comprising instructions which, when run on a computer, cause the computer to perform a method of loading near field communication configuration parameters.
Any reference to memory, storage, database, or other medium used herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. A method for loading near field communication configuration parameters, comprising:
when a near field communication function is started, obtaining a variable value of a control variable corresponding to the near field communication function;
when the variable value of the control variable is a first preset value, acquiring a configuration file of the near field communication function, and acquiring configuration parameters from the configuration file;
loading the configuration parameters, and performing near field communication according to the configuration parameters;
when the variable value of the control variable is a second preset value, judging whether firmware corresponding to the near field communication function is updated or not;
when the firmware corresponding to the near field communication function is updated, acquiring a configuration file of the near field communication function corresponding to the updated firmware, and acquiring configuration parameters from the configuration file;
loading the configuration parameters, and performing near field communication according to the configuration parameters;
when the firmware corresponding to the near field communication function is not updated, acquiring a configuration file of the effective near field communication function;
detecting whether a modification exists in a configuration file of the effective near field communication function;
when the configuration file of the effective near field communication function is detected to be modified, acquiring configuration parameters from the effective configuration file; loading the configuration parameters, and performing near field communication according to the configuration parameters;
when no modification exists in the configuration file of the effective near field communication function, acquiring a variable value of a preset variable from the configuration file of the effective near field communication function; when the variable value of the preset variable is a third preset value, acquiring configuration parameters from the effective configuration file; loading the configuration parameters, and performing near field communication according to the configuration parameters.
2. The method according to claim 1, wherein when the near field communication function is started, obtaining a variable value of a control variable corresponding to the near field communication function includes:
when the near field communication function is started, acquiring an attribute value of an input preset attribute through a preset interface;
and acquiring a variable value of a control variable corresponding to the near field communication function according to the attribute value of the preset attribute.
3. The method according to claim 2, wherein the obtaining the variable value of the control variable corresponding to the near field communication function according to the attribute value of the preset attribute includes:
and taking the attribute value of the preset attribute as the variable value of the control variable corresponding to the near field communication function.
4. The method according to claim 1, wherein when the variable value of the control variable is a first preset value, acquiring a configuration file of the near field communication function, and acquiring configuration parameters from the configuration file, includes:
when the variable value of the control variable is a first preset value, acquiring a log file corresponding to the near field communication function;
and acquiring a configuration file of the near field communication function which is effective when the near field communication function is started from the log file, and acquiring configuration parameters from the effective configuration file.
5. The method of claim 1, wherein the means for storing the variable values of the control variables comprises file storage and database storage.
6. A loading device for near field communication configuration parameters, comprising:
the variable value acquisition module is used for acquiring the variable value of the control variable corresponding to the near field communication function when the near field communication function is started;
the configuration parameter acquisition module is used for acquiring a configuration file of the near field communication function when the variable value of the control variable is a first preset value, and acquiring configuration parameters from the configuration file;
the loading module is used for loading the configuration parameters and performing near field communication according to the configuration parameters;
the firmware update judging module is used for judging whether the firmware corresponding to the near field communication function is updated or not when the variable value of the control variable is a second preset value;
the configuration parameter acquisition module is further used for acquiring a configuration file of the near field communication function corresponding to the updated firmware when the firmware corresponding to the near field communication function is updated, and acquiring configuration parameters from the configuration file;
the loading module is also used for loading the configuration parameters and performing near field communication according to the configuration parameters;
the configuration file detection module is used for acquiring a configuration file of the effective near field communication function when the firmware corresponding to the near field communication function is not updated; detecting whether a modification exists in a configuration file of the effective near field communication function;
the configuration parameter acquisition module is further used for acquiring configuration parameters from the effective configuration file when the configuration file of the effective near field communication function is detected to be modified;
the loading module is also used for loading the configuration parameters and performing near field communication according to the configuration parameters;
the variable value acquisition module is used for acquiring the variable value of the preset variable from the configuration file of the effective near field communication function when no modification exists in the configuration file of the effective near field communication function;
the configuration parameter obtaining module is further configured to obtain a configuration parameter from the effective configuration file when the variable value of the preset variable is a third preset value;
the loading module is also used for loading the configuration parameters and performing near field communication according to the configuration parameters.
7. The apparatus of claim 6, wherein the variable value obtaining module is further configured to obtain, when the near field communication function is turned on, an attribute value of the input preset attribute through a preset interface; and acquiring a variable value of a control variable corresponding to the near field communication function according to the attribute value of the preset attribute.
8. The apparatus of claim 7, wherein the variable value obtaining module is further configured to use an attribute value of the preset attribute as a variable value of a control variable corresponding to the near field communication function.
9. An electronic device comprising a memory and a processor, the memory having stored therein a computer program, characterized in that the computer program, when executed by the processor, causes the processor to perform the steps of the method for loading near field communication configuration parameters according to any of claims 1 to 5.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 5.
CN202010656831.XA 2020-07-09 2020-07-09 Loading method and device of near field communication configuration parameters and electronic equipment Active CN111885568B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010656831.XA CN111885568B (en) 2020-07-09 2020-07-09 Loading method and device of near field communication configuration parameters and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010656831.XA CN111885568B (en) 2020-07-09 2020-07-09 Loading method and device of near field communication configuration parameters and electronic equipment

Publications (2)

Publication Number Publication Date
CN111885568A CN111885568A (en) 2020-11-03
CN111885568B true CN111885568B (en) 2023-05-05

Family

ID=73150414

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010656831.XA Active CN111885568B (en) 2020-07-09 2020-07-09 Loading method and device of near field communication configuration parameters and electronic equipment

Country Status (1)

Country Link
CN (1) CN111885568B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991758A (en) * 2023-09-25 2023-11-03 苏州元脑智能科技有限公司 Spatial layout updating method, device, equipment and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101381A (en) * 2018-08-02 2018-12-28 Oppo(重庆)智能科技有限公司 Configuration file update method, system, electronic equipment and storage medium
CN111212412A (en) * 2020-01-03 2020-05-29 RealMe重庆移动通信有限公司 Near field communication method and device, computer readable storage medium and electronic equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8989658B2 (en) * 2011-06-24 2015-03-24 Qualcomm Incorporated Methods and apparatuses for improving NFC parameter update mechanisms
EP2887272B1 (en) * 2013-12-20 2017-11-01 Orange Hybrid NFC and RFID passive contactless card
CA2938546A1 (en) * 2015-08-21 2017-02-21 Wal-Mart Stores, Inc. Nfc to customer profile systems and methods
CN106960235B (en) * 2017-03-30 2020-03-27 北京字节跳动网络技术有限公司 File calling method and device and electronic equipment
CN107506670B (en) * 2017-08-24 2020-11-27 北京小米移动软件有限公司 Parameter loading method and device
CN110430558B (en) * 2019-06-26 2023-04-07 深圳绿米联创科技有限公司 Device control method, device, electronic device and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101381A (en) * 2018-08-02 2018-12-28 Oppo(重庆)智能科技有限公司 Configuration file update method, system, electronic equipment and storage medium
CN111212412A (en) * 2020-01-03 2020-05-29 RealMe重庆移动通信有限公司 Near field communication method and device, computer readable storage medium and electronic equipment

Also Published As

Publication number Publication date
CN111885568A (en) 2020-11-03

Similar Documents

Publication Publication Date Title
CN107908485B (en) Interface parameter transmission method, device, equipment and computer readable storage medium
JP6355699B2 (en) Writing data in the smart card's non-volatile memory
US20140067682A1 (en) Nfc-based information exchange method and device
CN109766072B (en) Information verification input method and device, computer equipment and storage medium
US9390259B2 (en) Method for activating an operating system in a security module
EP3273706B1 (en) Configuration of near field communication (nfc) settings in a mobile device
EP3828696A1 (en) Method invoke chain tracing method, electronic apparatus, and computer-readable storage medium
US9807595B2 (en) Terminal read with smart card update list
CN111885568B (en) Loading method and device of near field communication configuration parameters and electronic equipment
CN108200087B (en) Web intrusion detection method and device, computer equipment and storage medium
CN112083851A (en) Interface positioning method and device for BIOS (basic input output System) configuration options, server and computer readable storage medium
US9978056B2 (en) Smart card having multiple payment instruments
CN110414651A (en) Debug the method and device of smart card
CN111328068B (en) Card writing method and device, computer equipment and storage medium
EP3751437A1 (en) Information processing device, information processing method, and program
US9542632B2 (en) IC card, portable electronic device, and reader/writer
JP6194714B2 (en) Universal IC card and security attribute verification method
CN110134475B (en) Method and device for displaying interface parameter configuration, computer equipment and storage medium
CN110750162B (en) Input method and device
EP2898413B1 (en) A security module and a method for optimum memory utilization
CN111723887A (en) Service processing method and device based on NFC technology and computer equipment
US11901970B1 (en) Near-field communication functionality for partial applications accessed over a network
CN113408845B (en) Processing method and device of production flow, computer equipment and storage medium
CN112434273B (en) Database management method and device based on user verification
CN113780022B (en) Near field communication triggering method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant