Network timing control method and device, electronic equipment and storage medium
By detecting network connection and disconnection events, obtaining time intervals, and executing automatic operations, the problem of wireless CPE devices needing to manually connect or disconnect from the network is solved, realizing automated network management with user self-control.
Patent Information
- Application Number
- CN202310526662.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-10
- Publication Date
- 2024-11-19
AI Technical Summary
Existing wireless CPE devices require manual operation to connect or disconnect from the network, which cannot meet users' needs for automatic control anytime and anywhere, resulting in inconvenience.
By detecting network connection events and network disconnection events, the corresponding timed network connection time and timed network disconnection time are obtained, and network connection or disconnection operation is performed according to the current system time to achieve automatic timed control.
It enables automatic network connection or disconnection based on user needs, solving the inconvenience of manual operation and improving user experience and device lifespan.
Smart Images

Figure CN118984466A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a timing control method, device, electronic device and storage medium for a network. Background Art
[0002] At present, common wireless CPE (Customer Premise Equipment) often needs physical methods to connect or disconnect the network, such as manually turning on or off the power, and manually plugging and unplugging the network cable. It is impossible to automatically connect or disconnect the network anytime and anywhere according to the user's own needs. When the user wants to avoid traffic running out at night, traffic being stolen, or wants the CPE to run at low power consumption to extend the service life of the CPE, the user still needs to manually disconnect the network, which is very inconvenient.
[0003] With respect to the above-mentioned problems existing in the related technologies, no effective solutions have been found so far. Summary of the invention
[0004] The present disclosure provides a timing control method, device, electronic device and storage medium of a network to solve the inconvenient technical problem that the related technology requires manual disconnection or disconnection of the network.
[0005] According to one aspect of an embodiment of the present disclosure, a timing control method for a network is provided, including: detecting networking events and network disconnection events, and obtaining the scheduled networking time corresponding to the networking event and the scheduled network disconnection time corresponding to the network disconnection event; obtaining the current system time; and performing a networking operation or a network disconnection operation according to the current system time, the scheduled networking time, and the scheduled network disconnection time.
[0006] According to another aspect of an embodiment of the present disclosure, a timing control device for a network is also provided, including: a detection module, used to detect networking events and network disconnection events, and obtain the scheduled networking time corresponding to the networking event and the scheduled network disconnection time corresponding to the network disconnection event; an acquisition module, used to obtain the current system time; and an execution module, used to perform a networking operation or a network disconnection operation according to the current system time, the scheduled networking time, and the scheduled network disconnection time.
[0007] According to another aspect of an embodiment of the present disclosure, a storage medium is further provided, the storage medium including a stored program, and the above steps are executed when the program is run.
[0008] According to another aspect of an embodiment of the present disclosure, there is also provided 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 via the communication bus; wherein: the memory is used to store computer programs; and the processor is used to execute the steps in the above method by running the programs stored in the memory.
[0009] The embodiment of the present disclosure also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.
[0010] Through the present disclosure, networking events and network disconnection events are detected, and the scheduled networking time corresponding to the networking events and the scheduled network disconnection time corresponding to the network disconnection events are obtained; the current system time is obtained; the networking operation or the network disconnection operation is performed according to the current system time, the scheduled networking time and the scheduled network disconnection time, and the networking events and network disconnection events are triggered by monitoring the time nodes to automatically control the network disconnection, so as to realize automatic network disconnection according to the user's timing requirements, thereby solving the technical problem that the related technology needs to manually disconnect or disconnect the network, which is inconvenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:
[0012] Figure 1 is a hardware structure block diagram of a computer according to an embodiment of the present disclosure;
[0013] Figure 2 is a flow chart of a timing control method of a network according to an embodiment of the present disclosure;
[0014] Figure 3 is a flow chart of timing control of networking or disconnection in an embodiment of the present disclosure;
[0015] Figure 4 is a flowchart of restoring the previous network state after the timing ends in the embodiment of the present disclosure;
[0016] Figure 5 It is a structural block diagram of a timing control device of a network according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0017] In order to enable those skilled in the art to better understand the scheme of the present disclosure, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only embodiments of a part of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present disclosure. It should be noted that the embodiments in the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0018] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0019] Example 1
[0020] The method embodiment provided in the first embodiment of the present disclosure can be executed in a mobile phone, a computer, a tablet or a similar computing device. For example, running on a computer, Figure 1 is a hardware structure block diagram of a computer according to an embodiment of the present disclosure. Figure 1 As shown, the computer may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the computer may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0021] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a timing control method of a network in an embodiment of the present disclosure. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 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 memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0022] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0023] In this embodiment, a timing control method for a network is provided. Figure 2 is a flow chart of a timing control method of a network according to an embodiment of the present disclosure, such as Figure 2 As shown, the process includes the following steps:
[0024] Step S10, detecting a networking event and a network disconnection event, and obtaining a scheduled networking time corresponding to the networking event and a scheduled network disconnection time corresponding to the network disconnection event;
[0025] Step S20, obtaining the current system time;
[0026] Step S30: performing a networking operation or a network disconnection operation according to the current system time, the scheduled networking time, and the scheduled network disconnection time.
[0027] Before detecting networking events and disconnection events, the networking events and disconnection events are registered. Specifically, in the dial-up module NDIS module, the interface function of the time management module is called to register the networking events and disconnection events. The parameters of the interface function include the NDIS module ID number and the triggered event type (networking event and disconnection event). The event reports the registration message of the networking event and disconnection event to the time management module on the application processing unit AP side. Among them, the NDIS module is used to perform networking operations or disconnection operations; the time management module is used to record the event types, scheduled networking time and scheduled disconnection time that the NDIS module can execute in the form of a database table. The event types include networking events and disconnection events, and are used to determine the time node and perform the corresponding event issuance operation, that is, according to the current system time, scheduled networking time and scheduled disconnection time, the networking event or disconnection event is issued to the NDIS module, and the NDIS module executes the networking operation or disconnection operation.
[0028] This embodiment detects networking events and disconnection events, and obtains the scheduled networking time corresponding to the networking events and the scheduled disconnection time corresponding to the disconnection events; obtains the current system time; and performs networking operations or disconnection operations according to the current system time, the scheduled networking time and the scheduled disconnection time. By automatically connecting to or disconnecting from the network by monitoring the scheduled networking time or the scheduled disconnection time, it is possible to automatically disconnect from the network according to the user's scheduled networking or disconnection requirements, thereby solving the problem of requiring the user to manually turn on or off the power supply, manually plug in and unplug the network cable, and other operations at a certain point in time.
[0029] In one implementation of this embodiment, performing a network connection operation or a network disconnection operation according to the current system time, the scheduled network connection time, and the scheduled network disconnection time includes:
[0030] Step 31, obtaining the network connection start time of the scheduled network connection time and the network disconnection start time of the scheduled network disconnection time;
[0031] Step 32, cyclically comparing the network startup time and the network disconnection startup time with the current system time respectively;
[0032] Step 33, when the current system time reaches the network startup time or the network disconnection startup time, generate a corresponding control instruction;
[0033] Step 34, executing a networking operation or a network disconnection operation according to the control instruction.
[0034] The user can set the start time of networking and the start time of disconnection in the webUI (Website User Interface) or ztelink, and can also set the time period of networking or disconnection (i.e., start time and end time), etc. Optionally, a cycle mode can be set, including daily cycle or weekly cycle. The start time or time period of networking and disconnection is written into the time information table, and the time management module judges the time of disconnection according to the scheduled start time or time period in the event information table. The sql database of the time management module is updated cyclically to search for valid events in the event information table, and valid events include registered networking events and disconnection events. When there is a valid event in the database, the event is passed to the process of the time management module in the form of a message queue. In the process, the start time in the valid event and the current system time are compared in real time in a loop. When the system time reaches the time point set by the user, the time management module will first record the type of event triggered, record the current system time, and change the execution status msgbuf (the flag bit indicating whether to execute the command) from the default end state unexcuted to the start execution state executed and record the status, so that the last execution result can be queried at the end time point, compared and updated to the end state, and then the time management module process sends the corresponding message command queue to the NDIS module.
[0035] Specifically, refer to Figure 3 , obtain the networking startup time of the scheduled networking time and the network disconnection startup time of the scheduled network disconnection time, and perform a cyclic real-time comparison between the networking startup time in the networking event and the current system time. When the current system reaches the networking startup time, it means that the current time has reached the networking time point set by the user. At this time, the corresponding control instruction is generated, and the networking operation is executed according to the control instruction.
[0036] Similarly, the network disconnection start time in the network disconnection event and the current system time are compared in real time in a loop. When the current system reaches the network disconnection start time, it means that the current time has reached the network disconnection time point set by the user. At this time, the corresponding control instruction is generated and the network disconnection operation is executed according to the control instruction.
[0037] In this implementation, when the current system time reaches the network startup time or the network disconnection startup time, generating a corresponding control instruction includes:
[0038] Step 331, when the current system time reaches the networking start time, determine that the event type is a networking event, and determine that the execution state corresponding to the networking event is a start execution state; generate a control instruction for executing a networking operation according to the start execution state and the networking event type; or,
[0039] Step 332, when the current system time reaches the network disconnection start time, determine the event type as a network disconnection event, and determine the execution state corresponding to the network disconnection event as the start execution state; generate a control instruction for executing the network disconnection operation according to the start execution state and the network disconnection event type.
[0040] When the current system time reaches the networking start time, the event type is determined to be a networking event, and the execution state corresponding to the networking event is determined to be the start execution state, and a control instruction of "start executing the networking operation" is generated according to the start execution state and the networking event type.
[0041] Similarly, when the current system time reaches the network disconnection start time, the event type is determined to be a network disconnection event, and the execution state corresponding to the network disconnection event is determined to be the start execution state, and a control instruction of "start executing the network disconnection operation" is generated according to the start execution state and the network disconnection event type.
[0042] When the current system time reaches the scheduled networking time or scheduled disconnection time, the time management module will record the triggered event type and the current system time, and change the execution status of the corresponding event from the default end state to the start execution state and record the state, so that when the end time point is reached, the last execution result can be queried, compared and updated to the end state, so as to restore the previous network state after the timing ends. Then the time management module process sends the corresponding message command queue to the NDIS module, and the NDIS module executes the networking or disconnection operation.
[0043] In this embodiment, the control instruction includes a source module (the sending source of the control instruction), a target module (the receiving source of the control instruction), an event type, and a flag bit (i.e., the execution status) indicating whether the command is executed. Different modules have different ID numbers. According to the ID number of the source module, the NDIS module can distinguish and process different module messages. The command types carried in the control instructions sent by different modules are fixed according to the events previously registered by the NDIS module, which will not cause repeated execution of the same command or cause contradictions, and will be more helpful for developers to find error code errors through log files later. The NDIS module determines whether the source module is a time management module by judging the source module ID in the control instruction. If so, it enters the command type judgment interface. Otherwise, the NDIS module returns a message: "Unrecognized module" and continues to wait for receiving a new message queue.
[0044] In this embodiment, after cyclically comparing the networking startup time and the disconnection startup time with the current system time respectively, the method also includes: obtaining an event information table, wherein the event type, the start time, end time, loop mode and execution status corresponding to the event type are stored in the event information table, wherein the event type includes the networking event and the disconnection event, and the execution status includes a start execution status or an end status; when the current system time reaches the networking startup time or the disconnection startup time, the execution status corresponding to the networking event or the disconnection event in the event information table is updated to a start execution status.
[0045] The event information table is obtained from the database of the time management module. When the current system time reaches the networking startup time or the network disconnection startup time, the parameters in the event information table need to be synchronously updated so that when an abnormal situation occurs later, the abnormality can be located according to the data recorded in the event information table. Specifically, when the current system time reaches the networking startup time or the network disconnection startup time, the execution state corresponding to the networking event or the network disconnection event in the event information table is updated to the start execution state, and the current system time when the networking or network disconnection operation starts can also be recorded, indicating that the networking or network disconnection operation has been executed under the current system time. Among them, the event information table stores the event type (networking event and network disconnection event), the start time and end time corresponding to the event type, the cycle mode and the execution state, among which the cycle mode can be a daily cycle or a weekly cycle, etc., which can be set according to actual needs, and the execution state includes the end state and the start execution state.
[0046] The time management module creates a corresponding event information table event-info in the database of the time management module according to the registered and reported networking events and disconnection events. The event information table contains the corresponding event type, the start time, end time, cycle mode and execution status corresponding to the event type. The time added by the user in the webUI or ztelink, the information of daily cycle or weekly cycle will be written into the event information table. The event information table is created in the database to record the information of networking events and disconnection events, and the relevant data can be saved without occupying memory. In the event of abnormal power outages and network disconnections, data loss can be prevented. In the event of abnormal situations, it is easy to locate the abnormality. For example, the scheduled networking time is 2 pm, but there is no networking at 2 pm. According to the event information table in the database, the execution status of the networking event can be checked to locate the cause of the abnormality.
[0047] In another implementation of this embodiment, after performing the networking operation according to the control instruction, the method further includes:
[0048] Step a1, obtaining the networking end time of the scheduled networking time;
[0049] Step a2, cyclically comparing the networking end time with the current system time;
[0050] Step a3, when the current system time reaches the networking end time, determining the event type as a networking event, and changing the execution state corresponding to the networking event from the start execution state to the end state;
[0051] Step a4: generating a control instruction for ending the networking operation according to the end state and the networking event type, and ending the networking operation according to the control instruction for ending the networking operation, and restoring the disconnected state.
[0052] Reference Figure 4 , obtain the networking end time. After the system time reaches the networking start time and the networking operation is executed, continue to cyclically compare the networking end time with the current system time in real time. When the current system time reaches the networking end time, it means that the scheduled networking time has ended and the network state before networking needs to be restored. Then, the event type is determined to be a networking event, and the execution state corresponding to the networking event is changed from the start execution state to the end state. According to the end state and the networking event type, a control instruction of "ending the networking operation" is generated, and the networking operation is ended according to the control instruction of ending the networking operation, and the previous disconnected state is restored.
[0053] In another implementation of this embodiment, after performing the network disconnection operation according to the control instruction, the method further includes:
[0054] Step b1, obtaining the end time of the scheduled network disconnection time;
[0055] Step b2, cyclically comparing the network disconnection end time with the current system time;
[0056] Step b3, when the current system time reaches the network disconnection end time, determining the event type as a network disconnection event, and changing the execution state corresponding to the network disconnection event from the start execution state to the end state;
[0057] Step b4, generating a control instruction for ending the network disconnection operation according to the end state and the network disconnection event type, and ending the network disconnection operation according to the control instruction for ending the network disconnection operation to restore the network connection state.
[0058] Get the end time of the network disconnection. After the system time reaches the network disconnection start time and the network disconnection operation is executed, continue to compare the network disconnection end time with the current system time in a loop in real time. When the current system time reaches the network disconnection end time, it means that the scheduled network disconnection time has ended and the network status before the network disconnection needs to be restored. Then, determine that the event type is a network disconnection event, and change the execution status corresponding to the network disconnection event from the start execution status to the end status. Generate a control instruction of "end network disconnection operation" according to the end status and network disconnection event type, and end the network disconnection operation according to the control instruction of ending the network disconnection operation, and restore the previous networking status.
[0059] In this embodiment, executing a networking operation according to the control instruction includes: parsing the event type corresponding to the control instruction; if the event type is a networking event, obtaining the current network status; if the current network status is a networking status, returning a message to ignore the networking request; if the current network status is a disconnected status, executing the networking operation.
[0060] Parse the event type corresponding to the control instruction. If the event type is a networking event, obtain the current network status. If the current network status is a networking status, it means that the current network status is already a networking status or is being connected to the network. Then return a message to ignore the networking request. If the current network status is a disconnected status, perform the networking operation.
[0061] Similarly, if the event type is a network disconnection event, the current network status is obtained. If the current network status is a network disconnection status, it means that the current network status is already a network disconnection status, and a message to ignore the network disconnection request is returned. If the current network status is a connected state, the network disconnection operation is performed.
[0062] After the time management module sends a control instruction to the NDIS module, it determines the command type corresponding to the control instruction. If the command type is to execute a networking operation, it is a networking request. Determine the execution status parameter passed in the control instruction. The parameter value is the end status unexcuted and the start execution status executed. When the system time reaches the start time written in the database table, the execution status is the start execution status. First, it is determined whether the network is connected based on the NV (Network Variable) of the current network status. If it is already connected or is being connected, the interface returns a "connection request ignored" message. Otherwise, the NDIS module executes networking. When the system time reaches the end time written in the database table, the execution status is the end status, which means that the scheduled networking time has ended, the previous network status is restored, and the NDIS module executes network disconnection.
[0063] If the command type is to execute the disconnection operation, it is a disconnection request. Determine the execution status parameter passed in the control instruction. The parameter value is the end status unexcuted and the start execution status excuted. If the execution status is the start execution status, first determine whether the network has been disconnected based on the NV of the current network status. If the network has been disconnected, the interface returns a "connection request ignored" message. Otherwise, the network is disconnected. If the execution status is the end status, it means that the scheduled network disconnection time has ended, the previous network status is restored, and the network is connected.
[0064] In one example, the implementation process of timing control of the network includes:
[0065] Step 1: In the NDIS module, call the interface function of the time management module to register the disconnection event, which reports the registration message of connection and disconnection to the time management module on the AP side. The parameters of the interface function include the id number of the NDIS module (the function of this module is to connect / disconnect the network) and the type of event triggered (disconnection and connection).
[0066] Step 2: The time management module will create a corresponding event_info table in the database of the time management module for the registered and reported events (connection to the Internet, disconnection from the Internet). The table contains the corresponding event type, start time, end time, loop mode, and msgbuf (execution status field).
[0067] Step 3: After the device is powered on, the user sets the time period for scheduled networking or disconnection on the webUI. The SQL database of the time management module is updated cyclically, and the event whose enabled field in the table is 1 is searched, where 1 represents valid. When there is a valid event in the database, the event is passed to the process of the time management module in the form of a message queue.
[0068] Step 3: In this process, the start_hour, start_min in the valid event and the current system time current_hour, current_min are compared in real time in a loop. When the time reaches the time point set by the user, the time management module process sends the corresponding message command queue to the NDIS module.
[0069] Step 4: When the time reaches the start time point set by the user, the time management module will first record the type of event triggered, record the current system time, and change the execution status from the default unexcuted to executed and record the status, so that when the end time point is reached, the last execution result can be queried and compared and updated to unexcuted. Then the time management module process sends the corresponding message command queue to the NDIS module.
[0070] Step 5: The NDIS module determines whether the source module ID in the message queue is the time management module. If so, it enters the command type judgment interface. Otherwise, the NDIS module returns the message: "Unrecognized module" and continues to wait for receiving a new message queue.
[0071] Step 6: After entering the command type judgment interface, determine the type of command passed. If it is timed_connect_network, it is a network connection request. If it is timed_disconnect_network, it is a network disconnection request.
[0072] Step 7: Determine the msgbuf parameter passed in the message queue. The parameter value is executed or unexecuted, which means execution. If msgbuf is executed, first determine whether the network is connected or disconnected based on the parameters of the current network status. If it is connected or connected, the interface returns a "connection request ignored" message. Otherwise, it executes the connection or disconnection.
[0073] Step 8: When the time reaches the end time point set by the user, the time management module will first record the type of event triggered, record the current system time, and read the content of the last msgbuf. If it is excuted, it will be reset to unexcuted, so that when the new time period is cycled, the content of msgbuf can be used to determine whether the last event is completed. If it is unexcuted, it means that the last event is over. Then the time management module process sends the corresponding message command queue to the NDIS module.
[0074] Step 9: After entering the command type judgment interface, judge the command type passed. If it is timed_connect_network, it is a network connection request. If it is timed_disconnect_network, it is a network disconnection request. Judge the msgbuf parameter passed in the message queue. The value of this parameter is unexcuted, which means the end. The scheduled network connection or network disconnection time is over, and the previous network state is restored to execute network disconnection or network connection.
[0075] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course 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 disclosure, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present disclosure.
[0076] Example 2
[0077] In the present embodiment, a timing control device for a network is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0078] FIG. 5 is a structural block diagram of a timing control device for a network according to an embodiment of the present disclosure. Figure 5 As shown, the device includes: a detection module 60, an acquisition module 62, and an execution module 64, wherein:
[0079] A detection module 60, configured to detect a networking event and a network disconnection event, and obtain a scheduled networking time corresponding to the networking event and a scheduled network disconnection time corresponding to the network disconnection event;
[0080] The acquisition module 62 is used to obtain the current system time;
[0081] The execution module 64 is used to execute a network connection operation or a network disconnection operation according to the current system time, the scheduled network connection time and the scheduled network disconnection time.
[0082] Optionally, the execution module includes: an execution unit, used to obtain the networking startup time of the scheduled networking time, and the disconnection startup time of the scheduled disconnection time; cyclically comparing the networking startup time and the disconnection startup time with the current system time respectively; generating a corresponding control instruction when the current system time reaches the networking startup time or the disconnection startup time; and executing the networking operation or the disconnection operation according to the control instruction.
[0083] Optionally, the execution unit includes: a first execution sub-unit, used to determine that the event type is a networking event when the current system time reaches the networking startup time, and determine that the execution state corresponding to the networking event is a start execution state; generate a control instruction for executing a networking operation according to the start execution state and the networking event type; or, when the current system time reaches the network disconnection startup time, determine that the event type is a network disconnection event, and determine that the execution state corresponding to the network disconnection event is a start execution state; generate a control instruction for executing a network disconnection operation according to the start execution state and the network disconnection event type.
[0084] Optionally, the execution unit includes: a second execution sub-unit, used to obtain an event information table, the event information table storing the event type, the start time, end time, loop mode and execution status corresponding to the event type, wherein the event type includes the networking event and the disconnection event, and the execution status includes a start execution status or an end status; when the current system time reaches the networking start time or the disconnection start time, the execution status corresponding to the networking event or the disconnection event in the event information table is updated to the start execution status.
[0085] Optionally, the execution unit includes: a third execution sub-unit, used to obtain the networking end time of the scheduled networking time; cyclically compare the networking end time with the current system time; when the current system time reaches the networking end time, determine that the event type is a networking event, and change the execution state corresponding to the networking event from the start execution state to the end state; generate a control instruction to end the networking operation according to the end state and the networking event type, and end the networking operation according to the control instruction to end the networking operation, and restore the disconnected state.
[0086] Optionally, the execution unit includes: a fourth execution sub-unit, used to obtain the end time of the scheduled network disconnection time; cyclically compare the network disconnection end time with the current system time; when the current system time reaches the network disconnection end time, determine that the event type is a network disconnection event, and change the execution state corresponding to the network disconnection event from the start execution state to the end state; generate a control instruction for ending the network disconnection operation according to the end state and the network disconnection event type, and end the network disconnection operation according to the control instruction for ending the network disconnection operation, and restore the network connection state.
[0087] Optionally, the execution unit includes: a fifth execution sub-unit, used to parse the event type corresponding to the control instruction; if the event type is a networking event, obtaining the current network status; if the current network status is a networking status, returning a message to ignore the networking request; if the current network status is a disconnected status, executing a networking operation.
[0088] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0089] Example 3
[0090] An embodiment of the present disclosure further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0091] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0092] S1, detecting a networking event and a network disconnection event, and obtaining a scheduled networking time corresponding to the networking event and a scheduled network disconnection time corresponding to the network disconnection event;
[0093] S2, obtain the current system time;
[0094] S3, performing an online connection operation or an offline connection operation according to the current system time, the scheduled online connection time, and the scheduled offline connection time.
[0095] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0096] An embodiment of the present disclosure further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0097] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0098] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0099] S1, detecting a networking event and a network disconnection event, and obtaining a scheduled networking time corresponding to the networking event and a scheduled network disconnection time corresponding to the network disconnection event;
[0100] S2, obtain the current system time;
[0101] S3, performing an online connection operation or an offline connection operation according to the current system time, the scheduled online connection time, and the scheduled offline connection time.
[0102] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0103] The serial numbers of the above-mentioned embodiments of the present disclosure are only for description and do not represent the advantages or disadvantages of the embodiments.
[0104] In the above embodiments of the present disclosure, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0105] In the several embodiments provided in the present disclosure, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0106] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0107] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0108] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially 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, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0109] The above is only a preferred embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present disclosure. These improvements and modifications should also be regarded as the scope of protection of the present disclosure.
Claims
1. A timing control method for a network, characterized in that: The method comprises: Detecting networking events and network disconnection events, and obtaining the scheduled networking time corresponding to the networking events and the scheduled network disconnection time corresponding to the network disconnection events; Get the current system time; An online connection operation or an offline connection operation is performed according to the current system time, the scheduled online connection time, and the scheduled offline connection time.
2. The method according to claim 1, characterized in that Performing a networking operation or a network disconnection operation according to the current system time, the scheduled networking time, and the scheduled network disconnection time includes: Obtaining the online start time of the scheduled online time and the offline start time of the scheduled offline time; Compare the network startup time and the network disconnection startup time with the current system time in a circular manner; When the current system time reaches the network startup time or the network disconnection startup time, generating a corresponding control instruction; The network connection operation or the network disconnection operation is performed according to the control instruction.
3. The method according to claim 2, characterized in that When the current system time reaches the network startup time or the network disconnection startup time, generating a corresponding control instruction includes: When the current system time reaches the networking start time, determining the event type as a networking event, and determining the execution state corresponding to the networking event as a start execution state; generating a control instruction for executing a networking operation according to the start execution state and the networking event type; or, When the current system time reaches the network disconnection start time, the event type is determined to be a network disconnection event, and the execution state corresponding to the network disconnection event is determined to be a start execution state; and a control instruction for executing the network disconnection operation is generated according to the start execution state and the network disconnection event type.
4. The method according to claim 2, characterized in that: After cyclically comparing the network-connected startup time and the network-disconnected startup time with the current system time respectively, the method further includes: Acquire an event information table, wherein the event information table stores an event type, a start time, an end time, a loop mode, and an execution status corresponding to the event type, wherein the event type includes the networking event and the disconnection event, and the execution status includes a start execution status or an end status; When the current system time reaches the networking start time or the disconnection start time, the execution state corresponding to the networking event or the disconnection event in the event information table is updated to the start execution state.
5. The method according to claim 2, characterized in that: After performing the networking operation according to the control instruction, the method further includes: Obtaining the end time of the scheduled networking time; Circularly comparing the networking end time with the current system time; When the current system time reaches the networking end time, determining the event type as a networking event, and changing the execution state corresponding to the networking event from the start execution state to the end state; A control instruction for ending the networking operation is generated according to the end state and the networking event type, and the networking operation is ended according to the control instruction for ending the networking operation, and the disconnected state is restored.
6. The method according to claim 2, characterized in that After executing the network disconnection operation according to the control instruction, the method further includes: Obtaining the end time of the scheduled network disconnection; Compare the network disconnection end time with the current system time in a circular manner; When the current system time reaches the network disconnection end time, determining the event type as a network disconnection event, and modifying the execution state corresponding to the network disconnection event from the start execution state to the end state; A control instruction for ending the network disconnection operation is generated according to the end state and the network disconnection event type, and the network disconnection operation is ended according to the control instruction for ending the network disconnection operation to restore the network connection state.
7. The method according to claim 2, characterized in that Executing the networking operation according to the control instruction includes: Parsing the event type corresponding to the control instruction; If the event type is a networking event, then obtaining the current network status; If the current network state is a connected state, a message of ignoring the connection request is returned; if the current network state is a disconnected state, a connection operation is performed.
8. A timing control device for a network, characterized in that: include: A detection module, used to detect networking events and network disconnection events, and obtain the scheduled networking time corresponding to the networking event and the scheduled network disconnection time corresponding to the network disconnection event; Acquisition module, used to obtain the current system time; An execution module is used to execute an online operation or an offline operation according to the current system time, the scheduled online time and the scheduled offline time.
9. An electronic device, characterized in that: It includes 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; wherein: Memory, used to store computer programs; A processor, configured to execute the method steps of any one of claims 1 to 7 by running a program stored in a memory.
10. A storage medium, characterized in that: The storage medium comprises a stored program, wherein the program executes the method steps of any one of claims 1 to 7 when executed.
