Embedded Linux system control method, device, system and acquisition equipment

By judging and sleeping non-target serial peripherals and controlling the embedded Linux system, the embedded Linux system is solved, and the problem of insufficient real-time performance of embedded Linux systems is insufficient when reducing power consumption, real-time performance is achieved, and power consumption reduction and real-time performance guarantee is applicable to a variety of Business requirements.

CN118260114BActive Publication Date: 2025-01-07CHINA GEOKON INSTR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410450295.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-15
Publication Date
2025-01-07
Estimated Expiration
2044-04-15

AI Technical Summary

Technical Problem

The existing embedded Linux systems are difficult to ensure the real-time performance of the system while reducing power consumption, especially when the serial port peripheral cannot wake up the CPU in a sleep state, resulting in increased power consumption and hardware reliability problems.

Method used

By determining whether the currently connected serial port peripheral is a target serial port peripheral, sending a sleep command to the non-target serial port peripheral, and controlling the USB bus to suspend, the 4G module enters a low-power standby state, and controlling the Linux system to sleep. When receiving data from the target serial peripheral or wake-up command from the 4G module, the system is awakened and the mem standby level sleeps to balance power consumption and real-time.

Benefits of technology

It effectively reduces the power consumption of Linux systems and non-target serial port peripherals, ensures that the target serial port peripherals can wake up the system, ensure real-time performance, and automatically wakes up the system after the 4G module receives data to meet different business needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118260114B_ABST
    Figure CN118260114B_ABST
Patent Text Reader

Abstract

This application discloses a control method, apparatus, system, and acquisition device for an embedded Linux system, belonging to the field of communications. When the Linux system is idle, it first controls different peripherals to enter sleep, standby, or power-off states according to the configuration, and then controls the Linux system to enter sleep mode. This application's solution can control the Linux system and non-target serial port peripherals to enter sleep mode, reducing power consumption. Furthermore, the target serial port peripheral can wake up the system, ensuring real-time performance. On the other hand, the 4G module consumes a lot of power when powered on. After the USB bus is suspended, the 4G module enters standby mode, reducing power consumption. After the 4G module receives wireless data, it automatically wakes up and sends a wake-up command to the Linux system, ensuring system real-time performance. In addition, a real-time clock can also wake up the Linux system to meet tasks that require timed wake-up execution. These multiple wake-up methods ensure that the system can meet different business needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular, to an embedded Linux system control method, device, system and acquisition equipment. Background Art

[0002] In the field of security monitoring, many applications have high requirements for the power consumption of automated data acquisition equipment, which requires the power consumption of the acquisition equipment to be as low as possible. Traditional acquisition equipment is mostly designed with a single-chip microcomputer system, which can control the power consumption of the whole machine very well, but the performance of the single-chip microcomputer system is much inferior to that of the peripherals and embedded Linux system, especially the support of the Linux system for the network. The use of the Linux system can greatly improve the network communication capabilities. In addition, with the support of the Linux system, the development efficiency of embedded software will also be greatly improved.

[0003] Compared with single-chip microcomputer systems, embedded Linux systems consume relatively more power. Currently, there are generally two ways to reduce power consumption in embedded Linux systems:

[0004] <1> Reduce power consumption by controlling the way to turn off the power of peripherals;

[0005] <2> Linux system + MCU mode, low power consumption is achieved by timing control of Linux system power by MCU.

[0006] Both methods have their own disadvantages: although the first method can reduce some power consumption, the power consumption of the Linux system kernel itself and the power consumption of peripherals that need to be monitored cannot be eliminated; the second method uses the microcontroller to control and shut down the entire Linux system, which can greatly reduce power consumption, but its real-time performance will be reduced, and frequent power outages of the file system will cause file system damage, which will have a serious impact on hardware reliability. Summary of the invention

[0007] In order to overcome the deficiencies of the prior art, the present application provides a control method, device, system and acquisition equipment for an embedded Linux system to solve the problem that the existing embedded Linux system cannot reduce power consumption while ensuring the real-time performance of the system.

[0008] The technical solution adopted by this application to solve its technical problem is:

[0009] In a first aspect, an embedded Linux system control method is provided, comprising:

[0010] When the Linux system is idle, determining whether the currently connected serial port peripheral is a target serial port peripheral;

[0011] Sending a sleep command to a non-target serial port peripheral to put the non-target serial port peripheral into sleep mode; and controlling the USB bus to suspend so that the 4G module enters a low-power standby state; and controlling the Linux system to sleep mode at the same time;

[0012] When serial port data sent by the target serial port peripheral is received or a wake-up instruction sent by the 4G module is received, the Linux system is woken up.

[0013] Furthermore, it also includes:

[0014] After controlling the Linux system to sleep, obtaining the current time;

[0015] When the current time is the preset wake-up time, the Linux system is woken up.

[0016] Furthermore, it also includes:

[0017] When the Linux system does not execute any task, it is determined that the Linux system is idle.

[0018] Furthermore, it also includes:

[0019] After the Linux system is started, an idle task is created, and the execution priority of the idle task is the lowest;

[0020] When it is detected that the idle task is executed, it is determined that the Linux system is idle.

[0021] Further, the determining whether the currently connected serial port peripheral is a target serial port peripheral includes:

[0022] When any serial port peripheral is connected to the Linux system via a serial port, identifying the type of the serial port peripheral according to the serial port data sent by the serial port peripheral;

[0023] Determine whether the currently connected serial port peripheral is the target serial port peripheral according to a preset target serial port peripheral list; or determine whether the currently connected serial port peripheral is the target serial port peripheral according to a function code, wherein the function code is a code for implementing various functions of the Linux system.

[0024] Further, judging whether the currently connected serial port peripheral is a target serial port peripheral according to the function code includes:

[0025] Identify the control logic of each function according to the code and construct a control logic diagram for each function according to the control logic, wherein the control logic diagram is nodes executed in sequence when implementing each function and execution objects of the nodes;

[0026] Determine a target node in each control logic diagram, wherein the execution object of the target node is the CPU, and the execution object of any node before the target node is not the CPU;

[0027] The target execution object corresponding to each node before the target node is obtained. If the target execution object is a serial port peripheral, the serial port peripheral is used as the target serial port peripheral.

[0028] Further, controlling the Linux system to sleep includes:

[0029] The Linux system is controlled to hibernate at the mem standby level.

[0030] In a second aspect, an embedded Linux system control device is provided, comprising:

[0031] A judgment module, used for judging whether the currently connected serial port peripheral is a target serial port peripheral when the Linux system is idle;

[0032] A sleep module is used to send a sleep instruction to a non-target serial port peripheral to put the non-target serial port peripheral into sleep mode; and to control the USB bus to suspend so that the 4G module enters a low-power standby state; and to control the Linux system to sleep mode at the same time;

[0033] The wake-up module is used to wake up the Linux system when receiving serial port data sent by the target serial port peripheral or receiving a wake-up instruction sent by the 4G module.

[0034] A third aspect is to provide an embedded Linux system, applying the above method.

[0035] In a fourth aspect, a collection device is provided, comprising the above-mentioned embedded Linux system.

[0036] Beneficial effects:

[0037] The technical solution of the present application provides a control method, device, system and acquisition equipment for an embedded Linux system. When the Linux system is idle, first determine whether the currently connected serial port peripheral is a target serial port peripheral, then send a sleep command to the non-target serial port peripheral to make the non-target serial port peripheral sleep, and control the Linux system to sleep. The purpose of controlling the non-target serial port peripheral to sleep is to reduce power consumption, and to avoid all serial port peripherals being able to wake up the system when the Linux system is in sleep mode. In this way, after the non-target serial port peripheral is in sleep mode, only the target serial port peripheral can wake up the Linux system. The present application solution can control the Linux system and the non-target serial port peripheral to sleep, reducing power consumption, and the target serial port peripheral can wake up the system again, ensuring real-time performance. In addition, the power consumption of the 4G module is large when it is turned on. After the USB bus is suspended, the 4G module enters the standby state, reducing power consumption, and after the 4G module receives data, the 4G module automatically wakes up, and sends a wake-up command to the Linux system to wake up the system, ensuring the real-time performance of the system. Multiple wake-up methods ensure that the system can meet different business needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 This is a schematic diagram of the structure principle of an embedded Linux system provided by an embodiment of the present application;

[0040] Figure 2 This is a flow chart of an embedded Linux system control method provided by an embodiment of the present application;

[0041] Figure 3 It is a control logic diagram provided by an embodiment of the present application;

[0042] Figure 4 It is a schematic diagram of the structure of an embedded Linux system control device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme of the present application is described in detail below in conjunction with the accompanying drawings and embodiments. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other implementation methods obtained by ordinary technicians in the field without making creative work belong to the scope of protection of the present application.

[0044] The underlying logic of the computer Linux system is fixed and cannot be changed. That is, its wake-up method is fixed. For example, the conventional USB peripheral wake-up can be achieved because the wake-up interrupt is set in the USB. However, because the computer Linux system cannot be changed, it is impossible to implement serial port peripheral wake-up for serial ports that are not set. Therefore, in existing embedded Linux systems, there is no serial port peripheral wake-up. However, for acquisition devices that use embedded Linux systems, their serial port peripherals are required to collect information and then transmit it to the CPU. Since there is no serial port peripheral wake-up, when the system is dormant, the serial port peripherals cannot send data to the CPU and real-time performance cannot be guaranteed. If you want to ensure that the serial port peripherals can send the collected information to the CPU, you need to ensure that the CPU is not in a dormant state, which greatly increases the power consumption of the system. The structural principle diagram of the embedded Linux system is shown below. Figure 1 As shown, the power supply provides power to devices such as the CPU, memory, and serial port peripherals. The CPU is connected to the memory, serial port peripherals, 4G module, real-time clock, and other peripherals for data exchange with these components, including USB peripherals such as a mouse and keyboard.

[0045] Reference Figure 2 , the embodiment of the present application provides an embedded Linux system control method, including:

[0046] S11: When the Linux system is idle, determine whether the currently connected serial port peripheral is a target serial port peripheral.

[0047] Among them, Linux system idle means that the Linux system does not perform any task. Therefore, it is possible to detect whether the Linux system is performing a task. If it is performing a task, the Linux system is judged to be idle. When the Linux system does not perform any task, the Linux system is judged to be idle. To ensure accurate judgment, it can be specifically set that when the Linux system does not perform any task for a preset period of time, the Linux system is judged to be idle.

[0048] In another embodiment, in order to determine whether the Linux system is idle, an idle task can be created after the Linux system is started, and the execution priority of the idle task is the lowest; when it is detected that the idle task is executed, the Linux system is judged to be idle. The lowest execution priority means that the idle task is executed only when there are no other tasks. Therefore, when the idle task is executed, it means that there are no other tasks, and the system is judged to be idle at this time.

[0049] It should be noted that the premise of judging whether the currently connected serial port peripheral is the target serial port peripheral is to know what the serial port peripheral is, that is, the type of the serial port peripheral. A possible implementation method is that when the serial port peripheral is connected to the system, it is defined or configured by the operation task. In order to improve efficiency, the embodiment of the present application adopts the type of serial port peripheral identified according to the serial port data. It can be implemented in two ways. One is that when any serial port peripheral is connected to the Linux system through the serial port, that is, after the serial port peripheral is connected to the system, the system is set to send an inquiry instruction (used to inquire what type of serial port peripheral it is) to the serial port peripheral, and the serial port peripheral informs the system. The other is that when the serial port peripheral is connected to the system, the type information of the serial port data sent by the serial port peripheral is set to protect itself, and the system verifies the serial port data. Only after the serial port data contains the type information, the system allows the serial port peripheral to communicate with the system.

[0050] After understanding the type of the serial port peripheral, the conventional judgment method is that the operator configures a target serial port peripheral list according to the business needs of the system. The target serial port peripheral list includes the types of serial port peripherals that should be the target serial port peripherals in the system. Therefore, the system can judge whether the currently connected serial port peripheral is the target serial port peripheral according to the preset target serial port peripheral list.

[0051] In another embodiment, the currently connected serial port peripheral is judged whether it is the target serial port peripheral according to the function code, and the function code is the code for the Linux system to implement various functions. Specifically, the control logic of each function is identified according to the code and a control logic diagram is constructed for each function according to the control logic. The control logic diagram is the nodes executed in sequence when each function is implemented and the execution objects of the nodes; the control logic diagram in the embodiment of the present application is actually to configure an execution object for each node in the flowchart on the basis of the flowchart. That is, a flowchart is first generated according to the code, and then the execution object corresponding to each node is obtained from the flowchart in the code, so that a control logic diagram can be generated.

[0052] Determine a target node in each control logic diagram, wherein the execution object of the target node is the CPU, and the execution object of any node before the target node is not the CPU;

[0053] The target execution object corresponding to each node before the target node is obtained. If the target execution object is a serial port peripheral, the serial port peripheral is used as the target serial port peripheral.

[0054] For example, the present application provides a card swiping image acquisition solution, wherein the serial port peripherals include a serial port camera and a serial port card reader. The process is as follows: after the serial port card reader reads the card, the CPU verifies it. After the verification is passed, a shooting instruction is sent to the serial port camera, and the serial port camera starts shooting, and then uploads the image to the CPU, which processes it and stores it in the memory. Figure 3 As shown, each node is: card reading-verification-shooting-processing-storage, and the execution objects corresponding to each node are serial card reader-CPU-serial camera-CPU-memory. In conventional card swiping image acquisition, both the serial camera and the serial card reader need to be turned on in real time. However, in the actual process, image acquisition can only be performed after swiping the card. Therefore, for the serial camera, it does not need to be turned on at the beginning. It can be woken up after the system wakes up. This can greatly reduce power consumption. When determining the target node, you can first determine the pending node whose execution object is the CPU, and then use the pending node that is the first in the flowchart as the target node. Figure 3 The pending nodes are verification and processing, and the order of verification is higher, so verification is used as the target node. The node before verification has only one card reading node, which just corresponds to the serial port peripheral: serial port reader. In this way, the serial port reader is used as the target serial port peripheral. Assuming that there are no other nodes before the target node, or although there are, the execution objects of other nodes are not serial port peripherals, then there is no target serial port peripheral in this function. In this way, the target serial port peripheral (actually a set) can be obtained according to all functions. It should be noted that in this function, the serial port camera is not the target serial port peripheral, but it may be the target serial port peripheral in other functions. Therefore, in actual processing, this application first determines the target serial port peripheral (set) according to all functions, and then, when judging, if it does not belong to the target serial port peripheral, it is judged as a non-target transmission peripheral.

[0055] Specifically, in practice, in order to adapt to various scenarios, many functions are developed, but in actual use, only a part of them can be used. In this way, the target serial port peripheral (set) obtained according to all functions has a large range. A certain serial port peripheral in the currently used function should actually be a non-target serial port peripheral, but according to the target serial port peripheral (set) obtained from all functions, it is judged as the target serial port peripheral. In this way, when the system is idle, the serial port peripheral does not actually need to be used as a wake-up source and can sleep to reduce power consumption. For example, in a certain function, the above-mentioned serial port camera is the target serial port peripheral, but this function is not currently used. Instead, the above-mentioned card swipe image acquisition function is used. At this time, the serial port camera should be a non-target serial port peripheral and needs to sleep when the system is idle.

[0056] Based on this, the present application also provides a method for judging the currently used function according to the currently connected serial port peripherals, and determining the target serial port peripheral set according to the currently used function. Compared with the target serial port peripheral set determined according to all functions, the number of target serial port peripherals is smaller and more in line with the current situation.

[0057] Specifically, a type set of all currently connected serial port peripherals is obtained, and if any type of a serial port peripheral executed in a control logic diagram of a function is in the type set, or a subtype set of a serial port peripheral executed in a control logic diagram of a function is a subset of the type set, then the function is the currently used function. The target serial port peripheral set is determined according to the control logic diagram of the currently used function.

[0058] For example, assume that all currently connected serial port peripherals are A, B, C, and D; then the type set is {A, B, C, D}. If the execution object in the control logic diagram of function A is a serial port peripheral, and the types are A, B, and C respectively, then function A is judged to be the currently used function, and if the execution object in the control logic diagram of function B is a serial port peripheral, and the types are A, E, and F respectively, then function B is judged not to be a control logic diagram. Because to implement function B, serial port peripherals E and F must be used, but E and F are not currently connected, so function B is judged not to be the currently used function.

[0059] S12: Sending a sleep instruction to a non-target serial port peripheral to put the non-target serial port peripheral into sleep mode; and controlling the USB bus to suspend so that the 4G module enters a low-power standby state; and controlling the Linux system to sleep mode at the same time; wherein the non-target serial port peripheral is a serial port peripheral other than the target serial port peripheral;

[0060] Embedded Linux systems generally support three standby sleep modes: standby, mem and disk.

[0061] Standby: In addition to freezing I / 0 devices, it will also suspend the system, wake up faster, and consume more power than other mem and disk methods;

[0062] mem: Stores the running status data in memory, turns off peripherals, and enters standby mode. It wakes up slowly and consumes more power than the disk mode.

[0063] disk: Save the running status data to the hard disk, then shut down and wake up the slowest.

[0064] Balance power consumption and real-time requirements, select the mem sleep level, which can wake up quickly and significantly reduce power consumption. The rtcwake instruction is used to specify the sleep level.

[0065] S13: When receiving serial port data sent by the target serial port peripheral or receiving a wake-up instruction sent by the 4G module, waking up the Linux system. After controlling the Linux system to sleep, obtaining the current time; when the current time is the preset wake-up time, waking up the Linux system.

[0066] 4G module refers to the module for the embedded Linux system to communicate with the base station, which can complete the functions of wireless reception, transmission, and baseband signal processing, and supports functions such as voice dialing, SMS sending and receiving, and dial-up networking. In the prior art, in order to ensure the communication of the embedded Linux system, the 4G module is always in the on state, but when the system is dormant, if the 4G module is still turned on, it will greatly increase the power consumption of the system. Based on this, in this application, the automatic dormancy configuration function of the 4G module is first turned on, so that after the 4G module is started and dialed successfully, when the system is dormant and the USB bus is suspend-operated. The 4G module will automatically enter the 4G low-power standby state. At this time, the 4G module supports remote wireless wake-up. When the 4G module receives a data packet, it can send a resume command to the host to wake up the host, thereby realizing remote wake-up of the device.

[0067] The wake-up time is set according to the wake-up time specified by rtcwake, and the system will be automatically awakened. This wake-up method is used to execute tasks that the system needs to execute periodically, such as timed collection tasks.

[0068] That is, the embedded Linux system control method provided by the present application, when the Linux system is idle, first controls different peripherals to be in sleep, standby or power-off state according to the configuration, and then controls the Linux system to sleep. The present application scheme can control the Linux system and non-target serial port peripherals to sleep, reducing power consumption, and the target serial port peripherals can wake up the system, ensuring real-time performance. On the other hand, the power consumption is large when the 4G module is turned on. After the USB bus is suspended, the 4G module enters the standby state, reducing power consumption, and after the 4G module receives wireless data, the 4G module automatically wakes up and sends a wake-up instruction to the Linux system to wake up the system, ensuring the real-time performance of the system. In addition, the real-time clock can also wake up the Linux system to meet the tasks that need to be woken up regularly. The above multiple wake-up methods ensure that the system can meet different business needs.

[0069] Based on the same inventive concept, the present application provides an embedded Linux system control device, such as Figure 4 As shown, including:

[0070] A judgment module 41 is used to judge whether the currently connected serial port peripheral is a target serial port peripheral when the Linux system is idle;

[0071] In one embodiment, when the Linux system does not execute any task, the determination module 41 determines that the Linux system is idle.

[0072] In another embodiment, after the Linux system is started, an idle task is created, and the execution priority of the idle task is the lowest; when it is detected that the idle task is executed, the judgment module 41 determines that the Linux system is idle.

[0073] In addition, judging whether the currently connected serial port peripheral is the target serial port peripheral includes: when any serial port peripheral is connected to the Linux system via a serial port, identifying the type of the serial port peripheral according to the serial port data sent by the serial port peripheral; judging whether the currently connected serial port peripheral is the target serial port peripheral according to a preset target serial port peripheral list; or judging whether the currently connected serial port peripheral is the target serial port peripheral according to a function code, wherein the function code is a code for the Linux system to implement various functions.

[0074] Among them, judging whether the currently connected serial port peripheral is the target serial port peripheral according to the function code includes: identifying the control logic of each function according to the code and constructing a control logic diagram for each function according to the control logic, wherein the control logic diagram is the nodes executed in sequence when implementing each function and the execution objects of the nodes; determining the target node in each control logic diagram, the execution object of the target node is the CPU, and the execution object of any node before the target node is not the CPU; obtaining the target execution object corresponding to each node before the target node, and if the target execution object is a serial port peripheral, taking the serial port peripheral as the target serial port peripheral.

[0075] The sleep module 42 is used to send a sleep instruction to a non-target serial port peripheral to put the non-target serial port peripheral into sleep mode; and control the USB bus to suspend so that the 4G module enters a low-power standby state; and control the Linux system to sleep; controlling the Linux system to sleep includes: controlling the Linux system to sleep at the mem standby level.

[0076] The wake-up module 43 is used to wake up the Linux system when receiving serial port data sent by the target serial port peripheral or receiving a wake-up instruction sent by the 4G module. After controlling the Linux system to sleep, the wake-up module 43 obtains the current time; when the current time is the preset wake-up time, the wake-up module 43 wakes up the Linux system.

[0077] The embedded Linux system control device provided in the embodiment of the present application, when the Linux system is idle, first controls different peripherals to be in sleep, standby or power-off state according to the configuration, and then controls the Linux system to sleep. The present application scheme can control the Linux system and non-target serial port peripherals to sleep, reducing power consumption, and the target serial port peripherals can wake up the system, ensuring real-time performance. On the other hand, the power consumption is large when the 4G module is turned on. After the USB bus is suspended, the 4G module enters the standby state, reducing power consumption, and after the 4G module receives wireless data, the 4G module automatically wakes up and sends a wake-up instruction to the Linux system to wake up the system, ensuring the real-time performance of the system. In addition, the real-time clock can also wake up the Linux system to meet the tasks that need to be woken up regularly. The above multiple wake-up methods ensure that the system can meet different business needs.

[0078] Based on the same inventive concept, the present application provides an embedded Linux system, and applies the embedded Linux system control method provided in the above embodiment.

[0079] The embedded Linux system provided by the embodiment of the present application, when the Linux system is idle, first determines whether the currently connected serial port peripheral is the target serial port peripheral, and then sends a sleep instruction to the non-target serial port peripheral to make the non-target serial port peripheral sleep, and controls the Linux system to sleep. The purpose of controlling the non-target serial port peripheral to sleep is to reduce power consumption, and to avoid all serial port peripherals being able to wake up the system when the Linux system is in sleep. In this way, after the non-target serial port peripheral sleeps, only the target serial port peripheral can wake up the Linux system. The present application scheme can control the Linux system and the non-target serial port peripheral to sleep, reducing power consumption, and the target serial port peripheral can wake up the system again, ensuring real-time performance. In addition, the 4G module consumes more power when it is turned on. After the USB bus is suspended, the 4G module enters the standby state, reducing power consumption, and after the 4G module receives data, the 4G module automatically wakes up, and sends a wake-up instruction to the Linux system to wake up the system, ensuring the real-time performance of the system. Multiple wake-up methods ensure that the system can meet different business needs.

[0080] Based on the same inventive concept, the present application provides a collection device, including the embedded Linux system provided by the above embodiment, that is, the collection device is a collection device based on the embedded Linux system.

[0081] The acquisition device provided in the embodiment of the present application, when the Linux system is idle, first controls different peripherals to be in sleep, standby or power-off state according to the configuration, and then controls the Linux system to sleep. The solution of the present application can control the Linux system and non-target serial port peripherals to sleep, reducing power consumption, and the target serial port peripherals can wake up the system, ensuring real-time performance. On the other hand, the power consumption is large when the 4G module is turned on. After the USB bus is suspended, the 4G module enters the standby state, reducing power consumption, and after the 4G module receives wireless data, the 4G module automatically wakes up and sends a wake-up instruction to the Linux system to wake up the system, ensuring the real-time performance of the system. In addition, the real-time clock can also wake up the Linux system to meet the tasks that need to be woken up regularly. The above multiple wake-up methods ensure that the system can meet different business needs.

[0082] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.

[0083] It should be noted that, in the description of this application, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "plurality" refers to at least two.

[0084] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0085] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0086] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0087] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0088] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0089] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0090] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. An embedded Linux system control method, characterized in that: include: When the Linux system is idle, determining whether the currently connected serial port peripheral is a target serial port peripheral; Sending a sleep instruction to a non-target serial port peripheral device to put the non-target serial port peripheral device into sleep mode; And control the USB bus to suspend so that the 4G module enters a low-power standby state; and at the same time control the Linux system to sleep; When receiving serial port data sent by the target serial port peripheral or receiving a wake-up command sent by the 4G module, waking up the Linux system; The determining whether the currently connected serial port peripheral is a target serial port peripheral comprises: When any serial port peripheral is connected to the Linux system via a serial port, identifying the type of the serial port peripheral according to the serial port data sent by the serial port peripheral; Determine whether the currently connected serial port peripheral is a target serial port peripheral according to a function code, wherein the function code is a code for implementing various functions of the Linux system; The step of judging whether the currently connected serial port peripheral device is a target serial port peripheral device according to the function code includes: Identify the control logic of each function according to the function code and construct a control logic diagram for each function according to the control logic, wherein the control logic diagram is nodes executed in sequence when implementing each function and execution objects of the nodes; Determine a target node in each control logic diagram, wherein the execution object of the target node is the CPU, and the execution object of any node before the target node is not the CPU; The target execution object corresponding to each node before the target node is obtained. If the target execution object is a serial port peripheral, the serial port peripheral is used as the target serial port peripheral.

2. The method according to claim 1, characterized in that Also includes: After controlling the Linux system to sleep, obtaining the current time; When the current time is the preset wake-up time, the Linux system is woken up.

3. The method according to claim 1, characterized in that Also includes: When the Linux system does not execute any task, it is determined that the Linux system is idle.

4. The method according to claim 1, characterized in that: Also includes: After the Linux system is started, an idle task is created, and the execution priority of the idle task is the lowest; When it is detected that the idle task is executed, it is determined that the Linux system is idle.

5. The method according to claim 1, characterized in that: The controlling the Linux system to sleep comprises: The Linux system is controlled to hibernate at the mem standby level.

6. An embedded Linux system control device, characterized in that: include: A judgment module, used for judging whether the currently connected serial port peripheral is a target serial port peripheral when the Linux system is idle; The method of judging whether the currently connected serial port peripheral is a target serial port peripheral comprises: when any serial port peripheral is connected to the Linux system via a serial port, identifying the type of the serial port peripheral according to the serial port data sent by the serial port peripheral; judging whether the currently connected serial port peripheral is a target serial port peripheral according to a function code, wherein the function code is a code for the Linux system to implement various functions; judging whether the currently connected serial port peripheral is a target serial port peripheral according to the function code comprises: identifying the control logic of each function according to the function code and constructing a control logic diagram for each function according to the control logic, wherein the control logic diagram is nodes executed in sequence when implementing each function and the execution objects of the nodes; determining the target node in each control logic diagram, wherein the execution object of the target node is a CPU, and the execution object of any node before the target node is not a CPU; obtaining the target execution object corresponding to each node before the target node, and if the target execution object is a serial port peripheral, taking the serial port peripheral as the target serial port peripheral; A sleep module is used to send a sleep instruction to a non-target serial port peripheral to put the non-target serial port peripheral into sleep mode; and to control the USB bus to suspend so that the 4G module enters a low-power standby state; and to control the Linux system to sleep mode at the same time; The wake-up module is used to wake up the Linux system when receiving serial port data sent by the target serial port peripheral or receiving a wake-up instruction sent by the 4G module.

7. An embedded Linux system, characterized in that: The method according to any one of claims 1 to 5 is used.

8. A collection device, characterized in that: Including the embedded Linux system described in claim 7.

Citation Information

Patent Citations

  • Data processing equipment and status switching method thereof

    CN101520745A

  • Terminal equipment level-to-level management method and system

    CN114460868A