Device control method and apparatus, electronic device, and storage medium

By acquiring power grid function control commands and determining the target power grid mode, the problem of complex equipment mode switching and function implementation processes in existing technologies is solved, simplifying the operation process and improving efficiency.

CN116319725BActive Publication Date: 2025-11-28XI AN FIBOCOM WIRELESS INC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310176451.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2025-11-28
Estimated Expiration
2043-02-28

AI Technical Summary

Technical Problem

In existing technologies, users need to perform multiple steps to switch device modes and perform specific functions, which makes the process complex.

Method used

By acquiring power grid function control commands, determining the target power grid mode, and executing commands in that mode to output results, the operation process is simplified.

Benefits of technology

It simplifies the equipment control process, improves efficiency, and reduces user operation steps.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116319725B_ABST
    Figure CN116319725B_ABST
Patent Text Reader

Abstract

The application relates to a device control method and device, electronic equipment and a storage medium, and belongs to the technical field of computers, wherein the method comprises the following steps: acquiring a power grid function control instruction; determining a target power grid mode capable of executing the power grid function control instruction; executing the power grid function control instruction in the target power grid mode, obtaining an execution result, and outputting the execution result. The application solves the problem that in the prior art, a user needs to perform many operation steps, and the implementation process of a specific function is relatively complex.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a device control method, apparatus, electronic device, and storage medium. Background Technology

[0002] Remote communication modules using GSM, CDMA, PSTN, various 3G, LTE, and other standards are used to respond to AT (Attention) commands (AT commands are instructions used for connection and communication between terminal devices and PC applications). These modules are used to control and interact with the communication between the terminal and the remote master station. The AT commands supported in power projects include: commands specific to China Southern Power Grid, commands specific to State Grid, and commands shared by both China Southern Power Grid and State Grid.

[0003] In related technologies, when users need to implement specific functions on equipment, they first need to issue AT commands to switch the power grid mode (e.g., "AT+GTSET="ELECTYPE",0" or "AT+GTSET="ELECTYPE",1" to switch between the State Grid mode and the Southern Power Grid mode), and then implement the specific function through function instructions. This method requires many user steps, making the implementation of specific functions quite complex. Summary of the Invention

[0004] This application provides a device control method, apparatus, electronic device, and storage medium to solve the problem in the prior art that requires many user operation steps, making the implementation process of specific functions more complex.

[0005] In a first aspect, embodiments of this application provide a device control method, including:

[0006] Obtain power grid function control commands;

[0007] Determine the target power grid mode capable of executing the power grid function control commands;

[0008] In the target power grid mode, the power grid function control command is executed, the execution result is obtained, and the execution result is output.

[0009] Optionally, determining the target power grid mode capable of executing the power grid function control command includes:

[0010] Determine the target instruction type for the power grid function control instructions;

[0011] Determine the target power grid mode corresponding to the target instruction type.

[0012] Optionally, determining the target power grid mode corresponding to the target instruction type includes:

[0013] Obtain a database that maps command types to power grid modes;

[0014] From the corresponding relationship database, determine the target power grid mode corresponding to the target instruction type.

[0015] Optionally, determining the target power grid mode corresponding to the target instruction type includes:

[0016] Obtain the key fields from the target instruction type;

[0017] The target power grid mode is determined based on the key fields.

[0018] Optionally, before executing the power grid function control command, obtaining the execution result, and outputting the execution result in the target power grid mode, the method further includes:

[0019] Determine whether the current power grid mode is the target power grid mode;

[0020] If not, switch the current power grid mode to the target power grid mode.

[0021] Optionally, switching the power grid mode to the target power grid mode includes:

[0022] Invoke the switch command for the power grid mode at the target point;

[0023] Based on the switching command, switch to the target power grid mode.

[0024] Optionally, the power grid function control instructions include: standard power grid function control instructions and extended power grid function control instructions.

[0025] Secondly, embodiments of this application provide a device control apparatus, including:

[0026] The acquisition module is used to acquire power grid function control commands;

[0027] A determination module is used to determine the target power grid mode capable of executing the power grid function control commands;

[0028] An execution module is used to execute the power grid function control commands under the target power grid mode, obtain the execution results, and output the execution results.

[0029] Thirdly, embodiments of this application provide an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0030] The memory is used to store computer programs;

[0031] The processor is used to execute the program stored in the memory to implement the device control method described in the first aspect.

[0032] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the device control method described in the first aspect.

[0033] Compared with the prior art, the technical solution provided in this application has the following advantages: The method provided in this application obtains a power grid function control command; determines a target power grid mode capable of executing the power grid function control command; executes the power grid function control command in the target power grid mode, obtains the execution result, and outputs the execution result. Thus, by issuing a single power grid function control command, functional control of the equipment in the target power grid mode can be achieved, simplifying the equipment control process and improving equipment control efficiency. Attached Figure Description

[0034] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0035] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.

[0036] Figure 1 This is an application scenario diagram of the device control method provided in an embodiment of this application;

[0037] Figure 2 A flowchart of a device control method provided in an embodiment of this application;

[0038] Figure 3 A flowchart of a device control method provided in another embodiment of this application;

[0039] Figure 4 A flowchart illustrating a device control method provided in yet another embodiment of this application;

[0040] Figure 5 A flowchart of a device control method provided in another embodiment of this application;

[0041] Figure 6 This is a structural diagram of a device control apparatus provided in an embodiment of this application;

[0042] Figure 7This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0044] According to an embodiment of this application, a device control method is provided. Optionally, in embodiments of this application, the above-described device control method can be applied to, for example... Figure 1 The hardware environment shown consists of terminal 101 and server 102. For example... Figure 1 As shown, server 102 connects to terminal 101 via a network and can be used to provide services (such as video services, application services, etc.) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 102. The aforementioned network includes, but is not limited to, wide area networks (WANs), metropolitan area networks (MANs), or local area networks (LANs). Terminal 101 is not limited to a communication module, or any electronic device that includes a communication module. This electronic device can be, but is not limited to, a PC, mobile phone, tablet computer, etc.

[0045] The device control method of this application embodiment can be executed by server 102, terminal 101, or jointly by server 102 and terminal 101. The device control method of this application embodiment can also be executed by a client installed on terminal 101.

[0046] Taking the device control method of this application embodiment as an example, Figure 2 This is a flowchart illustrating an optional device control method according to an embodiment of this application, such as... Figure 2 As shown, the process of this method may include the following steps:

[0047] Step 201: Obtain power grid function control commands.

[0048] In some embodiments, the power grid function control command may refer to a control command issued by the user that requires the terminal to perform a certain function.

[0049] Among them, the power grid function control commands can be obtained by the user from the command standards in this field and then input into the terminal.

[0050] The power grid function control commands can be, but are not limited to, standard power grid function control commands and extended power grid function control commands. Standard power grid function control commands can be standard commands that meet the requirements of 3GPP TS 27 007 (GSM07.07) in this field. Extended power grid function control commands can be, but are not limited to, commands for powering off the control terminal, controlling network link status indicators, obtaining communication module version information, obtaining SIM card serial numbers, actively reporting switches, querying remote communication module types, setting initial network parameters, and activating / deactivating network connections, etc.

[0051] Step 202: Determine the target power grid mode that can execute the power grid function control command.

[0052] In some embodiments, by parsing the acquired power grid function control commands, the target power grid mode to be executed can be determined.

[0053] In an optional embodiment, determining the target power grid mode capable of executing the power grid function control command includes:

[0054] Determine the target instruction type of the power grid function control instruction; determine the target power grid mode corresponding to the target instruction type.

[0055] In some embodiments, the corresponding power grid function control commands are different for different power grid modes, especially the target command type in the power grid function control commands. Therefore, the corresponding target power grid mode can be determined by the target command type.

[0056] The target instruction type may be, but is not limited to, the instruction syntax used for power grid function control instructions. Power grid modes include a first power grid mode and a second power grid mode, which are different power grid modes. For example, the first power grid mode is the State Grid mode, and the second power grid mode is the Southern Power Grid mode.

[0057] The target command type for the first power grid mode can be “$MYSOCKETLED”, and the target command type for the second power grid mode can be “$MYMODEM”.

[0058] It is understandable that character recognition can be used to determine the type of the target instruction. The specific implementation of character recognition can be found in relevant technologies, and will not be elaborated upon here.

[0059] In an optional embodiment, determining the target power grid mode corresponding to the target instruction type includes:

[0060] Obtain a database that maps command types to power grid modes;

[0061] From the corresponding relationship database, determine the target power grid mode corresponding to the target instruction type.

[0062] In some embodiments, by constructing a correspondence library of instruction types and power grid modes, it is possible to compare the target instruction type with the instruction types in the correspondence library after determining the target instruction type, thereby identifying the power grid mode corresponding to the instruction type in the correspondence library that is the same as the target instruction type as the target power grid mode.

[0063] For example, when the target instruction type of the power grid function control instruction is "$MYMODEM", it can be determined that the target power grid mode that can execute the power grid function control instruction is the second power grid mode, and the first power grid mode does not support the instruction.

[0064] In an optional embodiment, determining the target power grid mode corresponding to the target instruction type includes:

[0065] Obtain the key fields from the target instruction type;

[0066] The target power grid mode is determined based on the key fields.

[0067] In some embodiments, the target instruction class in a certain power grid function control instruction may be included in the execution type of the first power grid mode and the second power grid mode. To avoid conflicts, different key fields are set in the target instruction type for differentiation.

[0068] For example, the target instruction type for a power grid function control command is "$MYSYSINFO", and this target instruction type is present in both the first and second power grid modes. However, when the target instruction type is "$MYSYSINFO = <sysmode>When the target instruction type is "$MYSYSINFO?", "$MYSYSINFO=", the first power grid mode can execute power grid function control commands. When the target instruction type is "$MYSYSINFO", the second power grid mode can execute power grid function control commands. Among these, "=" <sysmode>“, “=?” and “?” are all key fields.

[0069] Step 203: Under the target power grid mode, execute the power grid function control command, obtain the execution result, and output the execution result.

[0070] In some embodiments, after determining the target power grid mode, it is possible to execute power grid function control commands under the target power grid mode to achieve functional control of the terminal.

[0071] Among them, when the target power grid mode is different, the execution results of the power grid function control commands with the same function are the same.

[0072] In an optional embodiment, before executing the power grid function control command, obtaining the execution result, and outputting the execution result in the target power grid mode, the method further includes:

[0073] Determine whether the current power grid mode is the target power grid mode;

[0074] If not, switch the current power grid mode to the target power grid mode.

[0075] In some embodiments, under certain circumstances, there may be a situation where the current power grid mode of the terminal and the target power grid mode are not the same. In order to ensure the realization of the function, the power grid mode of the terminal needs to be switched, that is, the current power grid mode is switched to the target power grid mode.

[0076] In an optional embodiment, switching the power grid mode to the target power grid mode includes:

[0077] Invoke the switching command for the target power grid mode; switch to the target power grid mode based on the switching command.

[0078] In some embodiments, switching of the power grid mode can be achieved by invoking a power grid mode switching command.

[0079] In one specific embodiment, the power grid function control commands mainly include the following three types:

[0080] The first type is a command specific to the first power grid, such as "$MYSOCKETLED", which is not supported by the second power grid.

[0081] The second type is a command specific to the second power grid, such as "$MYMODEM", which is not supported by the first power grid.

[0082] The third type is a command that is common to both the first and second power grids but has different syntax, such as "$MYSYSINFO". The first power grid supports three syntax formats (locking network type, querying the currently locked network type, and querying the lockable network type), while the second power grid only supports one syntax format (querying the currently locked network type). Furthermore, there are differences between the first and second power grids in the syntax format of "querying the currently locked network type", and the format of the returned execution result also differs.

[0083] Based on the above three categories, the code logic is differentiated. The interface between the first grid-specific instruction and the second grid-specific instruction determines whether the current grid mode is compatible. If it is not compatible, the grid mode is switched directly to achieve the following three objectives.

[0084] Objective 1: See Figure 3 If the current instruction (i.e. the above-mentioned power grid function control instruction) is a first power grid-specific instruction, then it is determined whether the current power grid mode is the first power grid mode. If it conforms to the first power grid mode, the result of the first power grid standard is directly output; otherwise, the current power grid mode is first switched to the first power grid mode, and then the result of the first power grid standard is output.

[0085] Objective 2: See Figure 4 If the current instruction is a second grid-specific instruction, then it is determined whether the current grid mode is the second grid mode. If it is the second grid mode, the result of the second grid standard is directly output; otherwise, the current grid mode is first switched to the second grid mode, and then the result of the second grid standard is output.

[0086] Objective 3: See Figure 5 If the current instruction is a common instruction of the first power grid and the second power grid, it is determined whether the instruction syntax conforms to the standard of the first power grid or the standard of the second power grid. Then it is determined whether the current power grid mode conforms. If it does not conform, it is switched first, and then the result of the corresponding power grid mode standard is output.

[0087] This application identifies the differences between the commands of the first and second power grids. Based on these differences, the current power grid mode is determined at different command interface processing points, ensuring that all commands returned results corresponding to the power grid mode, preventing ERROR errors due to power grid mode mismatches. Furthermore, it implements an adaptive switching function between the first and second power grid modes. This reduces the number of steps required for customers to use power grid commands, eliminating the need to consider whether the current power grid mode is compatible. The process is simpler than in related technologies, requiring no new operation training for the customer.

[0088] Based on the same concept, this application provides a device control apparatus in its embodiments. Specific implementation of this apparatus can be found in the description of the method embodiments section; repeated details will not be elaborated upon. Figure 6 As shown, the device mainly includes:

[0089] Module 601 is used to acquire power grid function control commands;

[0090] The determining module 602 is used to determine the target power grid mode capable of executing the power grid function control command;

[0091] The execution module 603 is used to execute the power grid function control command in the target power grid mode, obtain the execution result, and output the execution result.

[0092] Based on the same concept, this application also provides an electronic device, such as... Figure 7 As shown, the electronic device mainly includes a processor 701, a memory 702, and a communication bus 703. The processor 701 and the memory 702 communicate with each other via the communication bus 703. The memory 702 stores programs that can be executed by the processor 701. The processor 701 executes the programs stored in the memory 702 to achieve the following steps:

[0093] Obtain power grid function control commands;

[0094] Determine the target power grid mode capable of executing the power grid function control commands;

[0095] In the target power grid mode, the power grid function control command is executed, the execution result is obtained, and the execution result is output.

[0096] The communication bus 703 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus 703 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0097] The memory 702 may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor 701.

[0098] The processor 701 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., or a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0099] The electronic device provided in this application embodiment can specifically be a module capable of communication functions or a terminal device containing such a module. The terminal device can be a mobile terminal or a smart terminal. Specifically, a mobile terminal can be at least one of a mobile phone, tablet computer, or laptop computer; a smart terminal can specifically be a smart car, smartwatch, shared bicycle, smart cabinet, or other terminal containing a wireless communication module; and the module can specifically be a wireless communication module, such as any one of a 2G communication module, 3G communication module, 4G communication module, 5G communication module, or NB-IoT communication module.

[0100] In another embodiment of this application, a computer-readable storage medium is provided, which stores a computer program that, when run on a computer, causes the computer to perform the device control method described in the above embodiments.

[0101] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. This computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape, etc.), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.

[0102] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one…" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0103] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.< / sysmode> < / sysmode>

Claims

1. A device control method characterized by, The method comprises: obtaining a power grid function control instruction; determining a target power grid mode capable of executing the power grid function control instruction; executing the power grid function control instruction in the target power grid mode to obtain an execution result and outputting the execution result; wherein the determining of the target power grid mode capable of executing the power grid function control instruction comprises: determining a target instruction type of the power grid function control instruction; determining a target power grid mode corresponding to the target instruction type, wherein different power grid modes correspond to different instruction types; wherein the power grid mode comprises a first power grid and a second power grid, and after the target power grid mode capable of executing the power grid function control instruction is determined, the method further comprises: if the power grid function control instruction is a common instruction of the first power grid and the second power grid, determining whether the instruction syntax of the power grid function control instruction conforms to a target power grid standard, wherein the target power grid standard is a first power grid standard or a second power grid standard; if the target power grid standard is met, determining whether the current power grid mode conforms to the target power grid mode; if not, switching the current power grid mode to the target power grid mode.

2. The device control method according to claim 1, characterized by, The determining of the target power grid mode corresponding to the target instruction type comprises: obtaining a corresponding relationship library of instruction types and power grid modes; from the corresponding relationship library, determining the target power grid mode corresponding to the target instruction type.

3. The device control method according to claim 1 or 2, characterized by, The determining of the target power grid mode corresponding to the target instruction type comprises: obtaining a key field in the target instruction type; determining the target power grid mode based on the key field.

4. The device control method according to claim 1, wherein Before the executing of the power grid function control instruction in the target power grid mode to obtain an execution result and the outputting of the execution result, the method further comprises: determining whether the current power grid mode is the target power grid mode; if not, switching the current power grid mode to the target power grid mode.

5. The device control method according to claim 4, wherein The switching of the power grid mode to the target power grid mode comprises: calling a switching command of the target power grid mode; switching to the target power grid mode based on the switching command.

6. The device control method according to claim 1, wherein The power grid function control instruction comprises a standard power grid function control instruction and an extended power grid function control instruction.

7. An apparatus control device characterized by comprising: The method comprises: an obtaining module configured to obtain a power grid function control instruction; a determining module configured to determine a target power grid mode capable of executing the power grid function control instruction; an executing module configured to execute the power grid function control instruction in the target power grid mode to obtain an execution result and output the execution result; wherein the determining module is configured to: determine a target instruction type of the power grid function control instruction; determine a target power grid mode corresponding to the target instruction type, wherein different power grid modes correspond to different instruction types; wherein the power grid mode comprises a first power grid and a second power grid, and the device is further configured to: if the power grid function control instruction is a common instruction of the first power grid and the second power grid, determine whether the instruction syntax of the power grid function control instruction conforms to a target power grid standard, wherein the target power grid standard is a first power grid standard or a second power grid standard; If the target grid standard is met, it is determined whether the current grid mode meets the target grid mode; If not, the current grid mode is switched to the target grid mode.

8. An electronic device, comprising: Comprise: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; The memory is used for storing a computer program; The processor is used for executing the program stored in the memory, and realizing the device control method in any one of claims 1-6.

9. A computer readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to realize the device control method in any one of claims 1-6.

Citation Information

Patent Citations

  • Remote control method of aerial camera and UAV (unmanned aerial vehicle)

    CN110502035A