Method and apparatus for repairing instructions, storage medium, and electronic device
By obtaining and replacing abnormal operation instructions in NFC tags on the smart terminal, the problem that NFC tag instructions cannot be fixed is solved, ensuring the effectiveness and correct execution of instructions, and improving the user experience of NFC devices.
Patent Information
- Application Number
- CN202111538955.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2041-12-15
AI Technical Summary
In the prior art, the instructions of the NFC tag cannot be effectively repaired in the passive mode, resulting in the problem of inability to execute or execution of incorrect operation instructions.
By obtaining the sequence of instructions saved on the smart terminal, the abnormal operation instructions in the NFC tag are replaced with matching normal operation instructions based on the matching results, including calculating the matching degree and user interaction to determine the replacement instructions.
It realizes the repair of exception instructions in NFC tags, ensures the effectiveness and correct execution of instructions, and improves the user experience of NFC devices.
Smart Images

Figure CN114201218B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home, and in particular, to a method and device for repairing instructions, a storage medium, and an electronic device. Background Art
[0002] NFC is a short-range high-frequency radio technology. The NFCIP-1 standard stipulates that the communication distance of NFC is within 10 centimeters, the operating frequency is 13.56 MHz, and the transmission speed has three types: 106 Kbit / s, 212 Kbit / s, or 424 Kbit / s. The NFCIP-1 standard details the transmission speed, encoding and decoding methods, modulation schemes, and frame formats of the RF interface of NFC devices. This standard also defines the transmission protocol of NFC, including the activation protocol and data exchange methods, etc.
[0003] The working mode of NFC is divided into passive mode and active mode. In the passive mode, the NFC initiating device (also called the master device) requires a power supply device. The master device uses the energy of the power supply device to provide a radio frequency field and sends data to the NFC target device (also called the slave device). The transmission rate needs to be selected from one of 106 kbps, 212 kbps, or 424 kbps. The slave device does not generate a radio frequency field, so it can do without a power supply device. Instead, it converts the radio frequency field generated by the master device into electrical energy to power the circuit of the slave device, receives the data sent by the master device, and uses load modulation technology to send the data of the slave device back to the master device at the same speed. Since the slave device does not generate a radio frequency field in this working mode but passively receives the radio frequency field generated by the master device, it is called the passive mode. In this mode, the NFC master device can detect a contactless card or an NFC target device and establish a connection with it.
[0004] There are many application scenarios for the passive mode of NFC, such as touch stickers, etc. When the user reads an instruction through the touch sticker function and finds that the corresponding operation cannot be performed, it means that the instruction is invalid or is itself an incorrect operation instruction. Aiming at the problem that an error occurs or the instruction cannot be executed when executing the instruction in the NFC tag in the related art, no effective solution has been proposed yet. Summary of the Invention
[0005] Embodiments of the present application provide a method and device for repairing instructions, a storage medium, and an electronic device, so as to at least solve the technical problem that instruction repair cannot be performed in the related art.
[0006] According to one aspect of the embodiments of the present application, a method for repairing an instruction is provided, including: when the first operation instruction stored in the NFC tag is an abnormal operation instruction, obtaining an instruction sequence saved on the intelligent terminal, where the instruction sequence includes normal operation instructions read by the intelligent terminal; according to the matching result between the first operation instruction and each operation instruction in the instruction sequence, replacing the first operation instruction in the NFC tag with a second operation instruction that matches the first operation instruction.
[0007] Optionally, according to the matching result between the first operation instruction and each operation instruction in the instruction sequence, replacing the first operation instruction in the NFC tag with a second operation instruction that matches the first operation instruction includes: obtaining the matching degree between each operation instruction in the instruction sequence and the first operation instruction; taking the operation instruction with the highest matching degree with the first operation instruction in the instruction sequence as the second operation instruction; writing the second operation instruction into the NFC tag to replace the first operation instruction.
[0008] Optionally, according to the matching result between the first operation instruction and each operation instruction in the instruction sequence, replacing the first operation instruction in the NFC tag with a second operation instruction that matches the first operation instruction includes: obtaining the matching degree between each operation instruction in the instruction sequence and the first operation instruction; displaying the operation instructions in the instruction sequence on the intelligent terminal in descending order of the matching degree with the first operation instruction; taking the selected operation instruction in the instruction sequence as the second operation instruction; writing the second operation instruction into the NFC tag to replace the first operation instruction.
[0009] Optionally, according to the matching result between the first operation instruction and each operation instruction in the instruction sequence, replacing the first operation instruction in the NFC tag with a second operation instruction that matches the first operation instruction includes: obtaining the matching degree between each operation instruction in the instruction sequence and the first operation instruction; when there is no operation instruction in the instruction sequence with a matching degree greater than a specified threshold with the first operation instruction, displaying all the instructions in the first operation instruction on the intelligent terminal; taking the operation instruction obtained after an editing operation on the intelligent terminal as the second operation instruction; writing the second operation instruction into the NFC tag to replace the first operation instruction.
[0010] Optionally, after displaying all the instructions in the first operation instruction on the intelligent terminal, the method further includes at least one of the following: detecting a deletion operation on the displayed instructions on the intelligent terminal; detecting a modification operation on the displayed instructions on the intelligent terminal; detecting an operation of adding an instruction on the intelligent terminal.
[0011] Optionally, each operation instruction includes multiple basic instructions in the instruction set. Among them, obtaining the matching degree between each operation instruction in the instruction sequence and the first operation instruction includes: obtaining all the basic instructions in the third operation instruction of the instruction sequence and all the instructions of the first operation instruction, where the third operation instruction is any operation instruction in the instruction sequence; dividing the number of the same basic instructions in the first operation instruction and the third operation instruction by the number of all the basic instructions in the third operation instruction to obtain the matching degree between the third operation instruction and the first operation instruction.
[0012] Optionally, after replacing the first operation instruction in the NFC tag with the second operation instruction that matches the first operation instruction according to the matching result between the first operation instruction and each operation instruction in the instruction sequence, the method further includes: performing corresponding operations according to the second operation instruction.
[0013] According to another aspect of the embodiments of the present application, there is also provided an instruction repair device, including: an obtaining unit, configured to obtain an instruction sequence saved on the smart terminal when the first operation instruction stored in the NFC tag is an abnormal operation instruction, where the instruction sequence includes normal operation instructions read by the smart terminal; a repair unit, configured to replace the first operation instruction in the NFC tag with the second operation instruction that matches the first operation instruction according to the matching result between the first operation instruction and each operation instruction in the instruction sequence.
[0014] Optionally, when replacing the first operation instruction in the NFC tag with the second operation instruction that matches the first operation instruction according to the matching result between the first operation instruction and each operation instruction in the instruction sequence, the repair unit is further configured to: obtain the matching degree between each operation instruction in the instruction sequence and the first operation instruction; use the operation instruction with the highest matching degree with the first operation instruction in the instruction sequence as the second operation instruction; write the second operation instruction into the NFC tag to replace the first operation instruction.
[0015] Optionally, when replacing the first operation instruction in the NFC tag with the second operation instruction that matches the first operation instruction according to the matching result between the first operation instruction and each operation instruction in the instruction sequence, the repair unit is further configured to: obtain the matching degree between each operation instruction in the instruction sequence and the first operation instruction; display the operation instructions in the instruction sequence on the smart terminal in descending order of the matching degree with the first operation instruction; use the selected operation instruction in the instruction sequence as the second operation instruction; write the second operation instruction into the NFC tag to replace the first operation instruction.
[0016] Optionally, when the repair unit replaces the first operation instruction in the NFC tag with the second operation instruction that matches the first operation instruction according to the matching result between the first operation instruction and each operation instruction in the instruction sequence, it is further configured to: obtain the matching degree between each operation instruction in the instruction sequence and the first operation instruction; in the case that there is no operation instruction in the instruction sequence whose matching degree with the first operation instruction is greater than a specified threshold, display all the instructions in the first operation instruction on the intelligent terminal; use the operation instruction obtained after performing an editing operation on the intelligent terminal as the second operation instruction; write the second operation instruction into the NFC tag to replace the first operation instruction.
[0017] Optionally, after the repair unit displays all the instructions in the first operation instruction on the intelligent terminal, it is further configured to: detect a deletion operation on the displayed instructions on the intelligent terminal; detect a modification operation on the displayed instructions on the intelligent terminal; detect an operation of adding an instruction on the intelligent terminal.
[0018] Optionally, each operation instruction includes multiple basic instructions in the instruction set. When the repair unit obtains the matching degree between each operation instruction in the instruction sequence and the first operation instruction, it is further configured to: obtain all the basic instructions in the third operation instruction in the instruction sequence and all the instructions in the first operation instruction, where the third operation instruction is any operation instruction in the instruction sequence; divide the number of the same basic instructions in the first operation instruction and the third operation instruction by the number of all the basic instructions in the third operation instruction to obtain the matching degree between the third operation instruction and the first operation instruction.
[0019] Optionally, the device of the present application may further include: an operation unit, configured to perform corresponding operations according to the second operation instruction after replacing the first operation instruction in the NFC tag with the second operation instruction that matches the first operation instruction according to the matching result between the first operation instruction and each operation instruction in the instruction sequence.
[0020] According to another aspect of the embodiments of the present application, there is also provided a storage medium, which includes a stored program, and when the program runs, it executes the above method.
[0021] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor executes the above method through the computer program.
[0022] According to one aspect of the present application, there is provided a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps of any one of the above-mentioned methods.
[0023] In an embodiment of the present application, when the first operation instruction stored in the NFC tag is an abnormal operation instruction, an instruction sequence saved on the intelligent terminal is obtained, and the instruction sequence includes normal operation instructions read by the intelligent terminal; according to the matching result between the first operation instruction and each operation instruction in the instruction sequence, the first operation instruction in the NFC tag is replaced with a second operation instruction that matches the first operation instruction, which can solve the technical problem that instruction repair cannot be performed in the related art. Description of the Drawings
[0024] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:
[0025] Figure 1 is a flowchart of an optional instruction repair method according to an embodiment of the present application;
[0026] Figure 2 is a schematic diagram of an optional instruction repair device according to an embodiment of the present application; and,
[0027] Figure 3 is a structural block diagram of a terminal according to an embodiment of the present application. Detailed Embodiments
[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present application.
[0029] It should be noted that the terms "first", "second", etc. in the description, claims and the above-mentioned drawings of this application are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products or devices.
[0030] The reasons for abnormal instructions in the NFC tag may be: it may have expired at the time of factory, or be written wrongly at the time of factory, damaged midway, an error occurs or it cannot be executed when executing the instructions in the NFC tag, etc. To solve the above problems, according to one aspect of the embodiments of the present application, a method embodiment of an instruction repair method is provided. The instruction repair method of the embodiments of the present application can be executed by an intelligent terminal with NFC function, and the terminal executing the instruction repair method of the embodiments of the present application can also be executed by a client installed thereon.
[0031] Figure 1 is a flowchart of an optional instruction repair method according to an embodiment of the present application, as Figure 1 shown, the method may include the following steps:
[0032] Step S12, when the first operation instruction stored in the NFC tag is an abnormal operation instruction, the intelligent terminal obtains the saved instruction sequence, and the instruction sequence includes the normal operation instructions read by the intelligent terminal.
[0033] For example, the NFC tag can communicate with a portable communication device such as a mobile phone, so as to change the working state of the device or open relevant software and settings, etc. The NFC tag stores data pre-written by a mobile phone (with NFC function). When the mobile phone with NFC function approaches the NFC tag and is effectively recognized by the mobile phone, the working state of the mobile phone can be converted through the mobile phone software, such as automatically opening the navigation, automatically entering the meeting mode, automatically connecting to a specified Wifi hotspot, automatically listening to music, automatically turning off the Wifi signal, and entering the flight mode, etc.
[0034] Optionally, due to different operation habits of each user, only view the instruction sequence of the current user's historical operation instructions, such as calling the camera to confirm the current user, viewing the account of the client to confirm, etc.
[0035] Step S14: The intelligent terminal replaces the first operation instruction in the NFC tag with the second operation instruction that matches the first operation instruction according to the matching result between the first operation instruction and each operation instruction in the instruction sequence.
[0036] Optionally, step S14 includes but is not limited to the following cases:
[0037] One of them is:
[0038] Step S142: Obtain the matching degree between each operation instruction in the instruction sequence and the first operation instruction.
[0039] Optionally, each operation instruction includes multiple basic instructions in the instruction set, and the matching degree can be calculated according to the instruction coincidence situation: Obtain all the basic instructions in the third operation instruction of the instruction sequence and all the instructions of the first operation instruction, where the third operation instruction is any operation instruction in the instruction sequence; Divide the number of the same basic instructions in the first operation instruction and the third operation instruction by the number of all the basic instructions in the third operation instruction to obtain the matching degree A between the third operation instruction and the first operation instruction (the matching degree A here is obtained after normalization, and the value ranges from 0 to 1, and the highest matching degree is 1).
[0040] Optionally, the matching degree B can also be determined according to the execution times of the operation instructions in the current time period (the matching degree B here is obtained after normalization, and the value ranges from 0 to 1, and the highest matching degree is 1): Obtain the total running times of each operation instruction in the instruction sequence in the current time period of each day, and record the maximum value as M. Divide the total running times of each operation instruction in the current time period by M to obtain the matching degree B.
[0041] Optionally, the matching degree C can also be determined according to the execution times of the operation instructions in the current scenario (the matching degree C here is obtained after normalization, and the value ranges from 0 to 1, and the highest matching degree is 1): Obtain the total running times of each operation instruction in the instruction sequence in the current scenario, and record the maximum value as N. Divide the total running times of each operation instruction in the current scenario by N to obtain the matching degree C.
[0042] After weighted summation of the above matching degree A, matching degree B, and matching degree C, the final matching degree is obtained, such as (matching degree A + matching degree B + matching degree C) / 3.
[0043] Step S144: Use the operation instruction with the highest matching degree with the first operation instruction in the instruction sequence as the second operation instruction.
[0044] It should be noted that the operation instruction with the highest matching degree here needs to not coincide with the normal instructions in the NFC tag.
[0045] Step S146, write the second operation instruction into the NFC tag to replace the first operation instruction.
[0046] The second is:
[0047] Step S142, obtain the matching degree between each operation instruction in the instruction sequence and the first operation instruction. The specific calculation method refers to the above text.
[0048] Step S144, display the operation instructions in the instruction sequence on the intelligent terminal in the order from high to low of the matching degree with the first operation instruction.
[0049] It should be noted that the display here means that the previous operation instructions need to not overlap with the normal instructions in the NFC tag. In other words, if there is an overlap, it is directly deleted or displayed at the end.
[0050] Step S146, use the selected operation instruction in the instruction sequence as the second operation instruction.
[0051] Step S148, write the second operation instruction into the NFC tag to replace the first operation instruction.
[0052] The third is:
[0053] Step S142, obtain the matching degree between each operation instruction in the instruction sequence and the first operation instruction. The specific calculation method refers to the above text.
[0054] Step S144, in the case that there is no operation instruction in the instruction sequence with a matching degree greater than the specified threshold with the first operation instruction, display all the instructions in the first operation instruction on the intelligent terminal.
[0055] Step S146, use the operation instruction obtained after the editing operation on the intelligent terminal as the second operation instruction.
[0056] Optionally, the user can delete the displayed instructions on the intelligent terminal; modify the displayed instructions on the intelligent terminal; add instructions on the intelligent terminal.
[0057] Step S148, write the second operation instruction into the NFC tag to replace the first operation instruction.
[0058] Optionally, after replacing the first operation instruction in the NFC tag with the second operation instruction that matches the first operation instruction according to the matching result between the first operation instruction and each operation instruction in the instruction sequence, the corresponding operation can be performed according to the second operation instruction.
[0059] Through the above steps, when the first operation instruction stored in the NFC tag is an abnormal operation instruction, obtain the instruction sequence saved on the intelligent terminal, where the instruction sequence includes the normal operation instructions read by the intelligent terminal; according to the matching result between the first operation instruction and each operation instruction in the instruction sequence, replace the first operation instruction in the NFC tag with the second operation instruction that matches the first operation instruction, which can solve the technical problem that instruction repair cannot be performed in the related art.
[0060] As an optional embodiment, the technical solution of the present application will be further described in detail below in combination with specific implementation manners:
[0061] When the user's mobile phone (i.e., the NFC device) contacts the sticker (i.e., the NFC tag) and reads the operation instruction in the sticker, if the corresponding operation instruction cannot be executed, it means that the operation instruction in the sticker has expired, or the stored operation instruction itself is an incorrect operation instruction.
[0062] In this case, when the NFC device senses the NFC tag, it will read the instruction in the NFC tag. When the NFC device cannot execute the instruction:
[0063] Step 1, the NFC device obtains the error instruction and the historical execution instruction (i.e., the previously executed operation instruction searched, and the historical execution instruction is saved in the database of the NFC device).
[0064] Step 2, match out the alternative instructions from the historical execution instructions whose similarity to the error instruction exceeds a preset threshold (for example, a similarity of 90%).
[0065] For example, obtain the execution codes of the error instruction and the historical execution instructions, and use a code comparison tool and a similarity detection algorithm to calculate the similarity between the execution code of the error instruction and the execution code of each historical execution instruction. Those with a similarity exceeding 90% are used as alternative instructions.
[0066] When alternative instructions are matched, display the alternative instructions in descending order of similarity in the NFC device, prompt the user to select a replacement instruction, and when the user selects an instruction, the NFC device executes the replacement instruction selected by the user; when the user does not make a selection, the NFC device executes the instruction with the highest similarity.
[0067] When no alternative instructions are matched, display the error instruction in the NFC device, prompt the user to modify the error instruction; the NFC device executes the target instruction modified by the user; the NFC device writes the target instruction into the NFC tag to replace the error instruction.
[0068] Before execution and replacement, it can also be confirmed with the user, and the operation can be executed after confirmation. In addition to replacing incorrect instructions, the operation can also be returned to the editing interface, that is, the user can re-edit the operation instructions based on the incorrect instructions, and save them to the sticker after completion for subsequent use.
[0069] Step 3, the NFC device automatically packages the incorrect instruction and its related error data and sends them to the developer.
[0070] In the technical solution of the present application, the incorrect instructions in the sticker can be cleared / modified, ensuring that all instructions in the sticker are valid instructions;. After reading this invalid or incorrect instruction, this data is retained and passed to the developer, who determines what caused the error in this instruction, whether it was written incorrectly during factory production or damaged midway, so as to avoid such problems in subsequent production processes. Completing the clearing / modifying operation of the incorrect instructions in the sticker to ensure that all instructions in the sticker are valid instructions. If the incorrect instructions are deleted, it can also reduce the memory occupancy in the NFC storage chip and improve the utilization rate of the NFC chip.
[0071] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0072] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions to enable a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0073] According to another aspect of the embodiments of the present application, there is also provided an instruction repair device for implementing the above-mentioned instruction repair method. Figure 2 It is a schematic diagram of an optional instruction repair device according to an embodiment of the present application, as Figure 2 shown. The device may include:
[0074] An acquisition unit 21, configured to acquire an instruction sequence saved on the intelligent terminal when a first operation instruction stored in the NFC tag is an abnormal operation instruction, where the instruction sequence includes normal operation instructions read by the intelligent terminal; a repair unit 23, configured to replace the first operation instruction in the NFC tag with a second operation instruction that matches the first operation instruction according to a matching result between the first operation instruction and each operation instruction in the instruction sequence.
[0075] Through the above modules, when a first operation instruction stored in the NFC tag is an abnormal operation instruction, an instruction sequence saved on the intelligent terminal is acquired, where the instruction sequence includes normal operation instructions read by the intelligent terminal; according to a matching result between the first operation instruction and each operation instruction in the instruction sequence, the first operation instruction in the NFC tag is replaced with a second operation instruction that matches the first operation instruction, so that the technical problem that instruction repair cannot be performed in the related art can be solved.
[0076] Optionally, when the repair unit replaces the first operation instruction in the NFC tag with a second operation instruction that matches the first operation instruction according to a matching result between the first operation instruction and each operation instruction in the instruction sequence, the repair unit is further configured to: acquire a matching degree between each operation instruction in the instruction sequence and the first operation instruction; use the operation instruction with the highest matching degree with the first operation instruction in the instruction sequence as the second operation instruction; write the second operation instruction into the NFC tag to replace the first operation instruction.
[0077] Optionally, when the repair unit replaces the first operation instruction in the NFC tag with a second operation instruction that matches the first operation instruction according to a matching result between the first operation instruction and each operation instruction in the instruction sequence, the repair unit is further configured to: acquire a matching degree between each operation instruction in the instruction sequence and the first operation instruction; display the operation instructions in the instruction sequence on the intelligent terminal in descending order of the matching degree with the first operation instruction; use the selected operation instruction in the instruction sequence as the second operation instruction; write the second operation instruction into the NFC tag to replace the first operation instruction.
[0078] Optionally, when the repair unit replaces the first operation instruction in the NFC tag with the second operation instruction that matches the first operation instruction according to the matching result between the first operation instruction and each operation instruction in the instruction sequence, the repair unit is further configured to: obtain the matching degree between each operation instruction in the instruction sequence and the first operation instruction; in the case that there is no operation instruction in the instruction sequence whose matching degree with the first operation instruction is greater than a specified threshold, display all instructions in the first operation instruction on the intelligent terminal; use the operation instruction obtained after an editing operation is performed on the intelligent terminal as the second operation instruction; and write the second operation instruction into the NFC tag to replace the first operation instruction.
[0079] Optionally, after the repair unit displays all instructions in the first operation instruction on the intelligent terminal, the repair unit is further configured to: detect a deletion operation on the displayed instructions on the intelligent terminal; detect a modification operation on the displayed instructions on the intelligent terminal; and detect an operation of adding a new instruction on the intelligent terminal.
[0080] Optionally, each operation instruction includes a plurality of basic instructions in an instruction set. When the repair unit obtains the matching degree between each operation instruction in the instruction sequence and the first operation instruction, the repair unit is further configured to: obtain all basic instructions in a third operation instruction of the instruction sequence and all instructions of the first operation instruction, where the third operation instruction is any operation instruction in the instruction sequence; and divide the number of identical basic instructions in the first operation instruction and the third operation instruction by the number of all basic instructions in the third operation instruction to obtain the matching degree between the third operation instruction and the first operation instruction.
[0081] Optionally, the device according to the present application may further include: an operation unit, configured to perform corresponding operations according to the second operation instruction after replacing the first operation instruction in the NFC tag with the second operation instruction that matches the first operation instruction according to the matching result between the first operation instruction and each operation instruction in the instruction sequence.
[0082] It should be noted here that the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the content disclosed in the above embodiments. It should be noted that the above modules, as a part of the device, may run in the corresponding hardware environment, and may be implemented by software or by hardware, where the hardware environment includes a network environment.
[0083] According to another aspect of the embodiments of the present application, a server or a terminal for implementing the above instruction repair method is further provided.
[0084] Figure 3 is a structural block diagram of a terminal according to an embodiment of the present application. As Figure 3 shown, the terminal may include: one or more ( Figure 3 only one is shown in the figure) processors 301, a memory 303, and a transmission device 305. As Figure 3 shown, the terminal may further include an input / output device 307.
[0085] Among them, the memory 303 can be used to store software programs and modules, such as the program instructions / modules corresponding to the instruction repair method and device in the embodiment of the present application. The processor 301 executes various functional applications and data processing by running the software programs and modules stored in the memory 303, that is, implements the above-mentioned instruction repair method. The memory 303 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 303 may further include a memory remotely disposed relative to the processor 301, and these remote memories can be connected to the terminal through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0086] The above-mentioned transmission device 305 is used to receive or send data via a network, and can also be used for data transmission between the processor and the memory. Specific examples of the above network may include a wired network and a wireless network. In one instance, the transmission device 305 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable, so as to communicate with the Internet or a local area network. In one instance, the transmission device 305 is a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.
[0087] Among them, specifically, the memory 303 is used to store application programs.
[0088] The processor 301 can call the application programs stored in the memory 303 through the transmission device 305 to execute the following steps:
[0089] When the first operation instruction stored in the NFC tag is an abnormal operation instruction, obtain the instruction sequence saved on the smart terminal, where the instruction sequence includes normal operation instructions read by the smart terminal; according to the matching result between the first operation instruction and each operation instruction in the instruction sequence, replace the first operation instruction in the NFC tag with a second operation instruction that matches the first operation instruction.
[0090] Optionally, specific examples in this embodiment may refer to the examples described in the above embodiments, and details thereof are not described herein again.
[0091] Those of ordinary skill in the art can understand that Figure 3 the structure shown is only illustrative, and the terminal can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, and a mobile Internet device (MID), a PAD, and other terminal devices. Figure 3 It does not limit the structure of the above electronic device. For example, the terminal may further include more or fewer components (such as a network interface, a display device, etc.) than those shown in Figure 3 and may have a different configuration from that shown in Figure 3 the figure.
[0092] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware of the terminal device through a program, and the program can be stored in a computer-readable storage medium. The storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc.
[0093] An embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the above storage medium may be used for the program code of the instruction repair method.
[0094] Optionally, in this embodiment, the above storage medium may be located on at least one of multiple network devices in the network shown in the above embodiment.
[0095] Optionally, in this embodiment, the storage medium is set to store program code for performing the following steps:
[0096] When the first operation instruction stored in the NFC tag is an abnormal operation instruction, obtain the instruction sequence saved on the smart terminal, where the instruction sequence includes normal operation instructions read by the smart terminal; according to the matching result between the first operation instruction and each operation instruction in the instruction sequence, replace the first operation instruction in the NFC tag with a second operation instruction that matches the first operation instruction.
[0097] Optionally, specific examples in this embodiment may refer to the examples described in the above embodiments, and details thereof are not described herein again.
[0098] Optionally, in this embodiment, the above storage medium may include but is not limited to: various media that can store program codes such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs.
[0099] The serial numbers of the embodiments of the present application are only for description and do not represent the superiority or inferiority of the embodiments.
[0100] If the integrated unit in the above embodiments is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in the storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0101] In the above embodiments of the present application, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0102] In the several embodiments provided by the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the units or modules can be in electrical or other forms.
[0103] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0104] In addition, the functional units in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0105] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A method for repairing instructions, characterized in that, Including: When the first operation instruction stored in the NFC tag is an abnormal operation instruction, obtaining an instruction sequence saved on the intelligent terminal, where the instruction sequence includes normal operation instructions read by the intelligent terminal; According to the matching result between the first operation instruction and each operation instruction in the instruction sequence, replacing the first operation instruction in the NFC tag with a second operation instruction that matches the first operation instruction, specifically including: obtaining the matching degree between each operation instruction in the instruction sequence and the first operation instruction; The method further includes calculating the matching degree in the following manner: Obtaining all basic instructions in the third operation instruction of the instruction sequence and all instructions of the first operation instruction, where the third operation instruction is any operation instruction in the instruction sequence; dividing the number of identical basic instructions in the first operation instruction and the third operation instruction by the number of all basic instructions in the third operation instruction to obtain the matching degree A between the third operation instruction and the first operation instruction; Obtaining the total number of times each operation instruction in the instruction sequence runs in the current time period of each day, where the maximum value is denoted as M, and dividing the total number of times each operation instruction runs in the current time period by M to obtain the matching degree B; Obtaining the total number of times each operation instruction in the instruction sequence runs in the current scenario, where the maximum value is denoted as N, and dividing the total number of times each operation instruction runs in the current scenario by N to obtain the matching degree C; Calculating the result of (matching degree A + matching degree B + matching degree C) / 3 to obtain the final matching degree.
2. The method according to claim 1, wherein According to the matching result between the first operation instruction and each operation instruction in the instruction sequence, replacing the first operation instruction in the NFC tag with a second operation instruction that matches the first operation instruction, including: Obtaining the matching degree between each operation instruction in the instruction sequence and the first operation instruction; Taking the operation instruction with the highest matching degree with the first operation instruction in the instruction sequence as the second operation instruction; Writing the second operation instruction into the NFC tag to replace the first operation instruction.
3. The method according to claim 1, wherein According to the matching result between the first operation instruction and each operation instruction in the instruction sequence, replacing the first operation instruction in the NFC tag with a second operation instruction that matches the first operation instruction, including: Obtaining the matching degree between each operation instruction in the instruction sequence and the first operation instruction; Displaying the operation instructions in the instruction sequence on the intelligent terminal in descending order of the matching degree with the first operation instruction; Taking the selected operation instruction in the instruction sequence as the second operation instruction; Writing the second operation instruction into the NFC tag to replace the first operation instruction.
4. The method according to claim 1, characterized in that, According to the matching result between the first operation instruction and each operation instruction in the instruction sequence, replacing the first operation instruction in the NFC tag with a second operation instruction that matches the first operation instruction, including: Obtaining the matching degree between each operation instruction in the instruction sequence and the first operation instruction; In the case that there is no operation instruction in the instruction sequence with a matching degree greater than a specified threshold with the first operation instruction, all instructions in the first operation instruction are displayed on the intelligent terminal; The operation instruction obtained after performing an editing operation on the intelligent terminal is used as the second operation instruction; The second operation instruction is written into the NFC tag to replace the first operation instruction.
5. The method according to claim 4, characterized in that, After all instructions in the first operation instruction are displayed on the intelligent terminal, the method further includes at least one of the following: A deletion operation on the displayed instruction is detected on the intelligent terminal; A modification operation on the displayed instruction is detected on the intelligent terminal; An operation of adding an instruction is detected on the intelligent terminal.
6. The method according to any one of claims 1 to 5, characterized in that, After replacing the first operation instruction in the NFC tag with the second operation instruction that matches the first operation instruction according to the matching result between the first operation instruction and each operation instruction in the instruction sequence, the method further includes: Performing corresponding operations according to the second operation instruction.
7. An instruction repair device for implementing the instruction repair method according to any one of claims 1 to 6, characterized in that, Including: An acquisition unit, configured to acquire an instruction sequence saved on an intelligent terminal when the first operation instruction stored in the NFC tag is an abnormal operation instruction, where the instruction sequence includes normal operation instructions read by the intelligent terminal; A repair unit, configured to replace the first operation instruction in the NFC tag with the second operation instruction that matches the first operation instruction according to the matching result between the first operation instruction and each operation instruction in the instruction sequence.
8. A storage medium, characterized in that, The storage medium includes a stored program, where the program, when running, executes the method described in any one of claims 1 to 6 above.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the method described in any one of claims 1 to 6 above through the computer program.
Citation Information
Patent Citations
Self-repair method and apparatus for abnormal application program
CN107632901A
Data input method and, electronic device, and readable storage medium
CN113780018A