CN109656169B - Multi-scheduling table switching method and device, computer equipment and storage medium - Google Patents

Multi-scheduling table switching method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN109656169B
CN109656169B CN201811562790.7A CN201811562790A CN109656169B CN 109656169 B CN109656169 B CN 109656169B CN 201811562790 A CN201811562790 A CN 201811562790A CN 109656169 B CN109656169 B CN 109656169B
Authority
CN
China
Prior art keywords
message
scheduling table
list
content
sending
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811562790.7A
Other languages
Chinese (zh)
Other versions
CN109656169A (en
Inventor
莫松文
辛朝洁
林灿盛
张业楚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Southern Dare Automotive Electronic Co Ltd
Original Assignee
Shenzhen Southern Dare Automotive Electronic Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Southern Dare Automotive Electronic Co Ltd filed Critical Shenzhen Southern Dare Automotive Electronic Co Ltd
Priority to CN201811562790.7A priority Critical patent/CN109656169B/en
Publication of CN109656169A publication Critical patent/CN109656169A/en
Application granted granted Critical
Publication of CN109656169B publication Critical patent/CN109656169B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/25Pc structure of the system
    • G05B2219/25257Microcontroller

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention relates to a method, a device, a computer device and a storage medium for switching multiple scheduling tables, wherein the method comprises the steps of judging whether a request for switching the scheduling tables exists; if yes, switching a scheduling table according to the request, and clearing the sending time slot counts of all messages; judging whether the sending time slot counts of all the messages are zero or not; if yes, judging whether the current scheduling table is empty or not; if not, acquiring the content of the message list from the message general list according to the current scheduling table; updating the transmission time slot count of the corresponding message according to the content of the message list; analyzing the content of the message list to obtain a message to be sent and a sending channel; and sending the message to be sent according to the sending channel. The invention improves the flexibility of the system, associates the scheduling table with the message general list, calls the specific message list content in the message general list, carries out message sending tasks, expands the functions of the system, supports the switching of a plurality of scheduling tables, and adapts to the increasingly complex ECU control requirements in the market.

Description

Multi-scheduling table switching method and device, computer equipment and storage medium
Technical Field
The present invention relates to a schedule table switching method, and more particularly, to a multiple schedule table switching method, apparatus, computer device, and storage medium.
Background
A Local Interconnect Network (LIN) bus is based on a universal asynchronous receiver/transmitter (UART) protocol, and a main purpose of the LIN bus is to provide a low-cost vehicle bus, and a general LIN bus Network is formed by interconnecting a master node and a plurality of slave nodes to form a single LIN physical channel, as shown in fig. 1, the nodes transmit serial communication through a single wire, the LIN bus Network includes a master task node and a plurality of slave task nodes, the master task node is mainly responsible for determining messages on the bus, the slave tasks are responsible for responding to requests of the master node, and the master node determines the order of sending the messages by querying the content of a scheduling table to form a single master-slave structure, thereby requiring no arbitration.
The LIN bus communication in the market is executed through a scheduling algorithm, the scheduling algorithm basically realizes a one-master multi-slave communication mode aiming at a single LIN channel, but because an ECU (Electronic Control Unit) controller circuit is increasingly complex and huge, a plurality of ECU controllers integrate multiple LIN physical channels, the traditional single-channel single-scheduling algorithm cannot meet the performance requirement, the single scheduling algorithm is lack of flexibility, the adjustment cannot be made according to the external condition, and the flexibility of the system cannot be improved.
Therefore, it is necessary to design a new method to support the switching of multiple scheduling tables, improve the flexibility of the system while expanding the performance, adapt to the increasingly complex ECU control requirements in the market, and make adjustments according to the external conditions.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a multi-scheduling table switching method, a multi-scheduling table switching device, a computer device and a storage medium.
In order to achieve the purpose, the invention adopts the following technical scheme: the multiple scheduling table switching method comprises the following steps:
judging whether a request for switching a scheduling table exists;
if yes, switching a scheduling table according to the request, and clearing the sending time slot counts of all messages;
judging whether the sending time slot counts of all the messages are zero or not;
if yes, judging whether the current scheduling table is empty or not;
if not, acquiring the content of the message list from the message general list according to the current scheduling table;
updating the transmission time slot count of the corresponding message according to the content of the message list;
analyzing the content of the message list to obtain a message to be sent and a sending channel;
and sending the message to be sent according to the sending channel.
The further technical scheme is as follows: before the determining whether there is a request for switching the schedule table, the method further includes:
and setting the data structure of the message general list and the content of the scheduling table.
The further technical scheme is as follows: the data structure of the message general list comprises the serial number of the message in the message general list, the LIN physical channel for sending the message, the flow direction of the message, the byte length for sending the message and the address for storing the message.
The further technical scheme is as follows: the content of the scheduling table comprises information associated with the message general list and the sending time slot of the message.
The further technical scheme is as follows: after judging whether the sending time slot counts of all the messages are zero, the method comprises the following steps:
if not, counting the sending time slots of all the messages by one;
judging whether the transmission time slot counts of all the subtracted messages are zero or not;
if not, receiving the sent message;
if yes, adding one to an index pointer in the schedule;
judging whether the current schedule index pointer points to the tail end of the schedule or not;
if so, resetting the index pointer in the scheduling table so that the index pointer in the scheduling table points to the head of the table;
if not, returning to the step of judging whether the current scheduling table is empty or not.
The further technical scheme is as follows: the method for acquiring the message list content from the message general list according to the current scheduling table comprises the following steps:
acquiring the position pointed by an index pointer in the current scheduling table;
acquiring information of the position associated with a message general list;
according to the information associated with the message general list, associating the message general list with the sequence number in the message general list to obtain the sequence number of the message to be sent in the message general list;
and acquiring data related to the sequence number in the message general list according to the sequence number of the message to be sent in the message general list so as to obtain the content of the message list.
The present invention also provides a multiple scheduling table switching apparatus, including:
a request judging unit for judging whether there is a request for switching the schedule table;
the switching unit is used for switching the scheduling table according to the request and clearing the sending time slot counts of all the messages if the request is positive;
a first count judgment unit, configured to judge whether the transmission timeslot counts of all the messages are zero;
the scheduling table judging unit is used for judging whether the current scheduling table is empty or not if the current scheduling table is empty;
a content obtaining unit, configured to obtain, if not, a message list content from the total message list according to the current scheduling table;
the updating unit is used for updating the sending time slot count of the message according to the content of the message list;
the analysis unit is used for analyzing the content of the message list to obtain a message to be sent and a sending channel;
and the sending unit is used for sending the message to be sent according to the sending channel.
The further technical scheme is as follows: the device further comprises:
and the setting unit is used for setting the data structure of the message general list and the content of the scheduling table.
The invention also provides computer equipment which comprises a memory and a processor, wherein the memory is stored with a computer program, and the processor realizes the method when executing the computer program.
The invention also provides a storage medium storing a computer program which, when executed by a processor, is operable to carry out the method as described above.
Compared with the prior art, the invention has the beneficial effects that: the invention relates to a scheduling table switching method, a scheduling table switching device and a scheduling table switching system, wherein the scheduling table switching device is used for switching the scheduling tables according to the requirement or not, selecting and adjusting the appropriate scheduling tables according to the external condition so as to improve the flexibility of the system, associating the scheduling tables with the message general list, calling the specific message list content in the message general list in the process of executing the scheduling tables, carrying out message sending tasks, expanding the functions of the system, supporting the switching of a plurality of scheduling tables and adapting to the increasingly complex ECU control requirement in the market.
The invention is further described below with reference to the accompanying drawings and specific embodiments.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of a prior art LIN bus structure;
fig. 2 is a schematic view of an application scenario of the multiple scheduling table switching method according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a method for switching multiple schedules according to an embodiment of the present invention;
FIG. 4 is a sub-flowchart of a multi-schedule switching method according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a data structure of a message general list according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating the contents of a schedule provided by an embodiment of the present invention;
fig. 7 is a schematic block diagram of a multiple schedule switching apparatus according to an embodiment of the present invention;
fig. 8 is a schematic block diagram of a content acquisition unit of the multiple schedule table switching apparatus provided by the embodiment of the present invention;
FIG. 9 is a schematic block diagram of a computer apparatus provided by an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a multi-channel LIN bus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 2 and fig. 3, fig. 2 is a schematic view illustrating an application scenario of the multiple scheduling table switching method according to an embodiment of the present invention. Fig. 3 is a schematic flowchart of a multiple scheduling table switching method according to an embodiment of the present invention.
The multi-scheduling table switching method can be applied to a server, performs data interaction with a terminal and the like, the terminal initiates a request whether the scheduling table needs to be switched, corresponding processing of the scheduling table is performed according to the currently initiated request, the relationship among the scheduling table, a message general list and the content of the message list is preset, scheduling response is rapidly performed according to the incidence relationship, switching and adjustment of the scheduling table can be performed according to actual conditions, the flexibility of the system is improved while the expansibility is achieved, and the method adapts to the increasingly complex ECU control requirements in the market.
The multi-schedule switching method is suitable for a multi-channel LIN bus, as shown in fig. 10, the multi-channel LIN bus refers to the fact that a main controller provides a plurality of LIN physical channels, LIN nodes with different baud rates or different levels can be selectively mounted in the proper physical channels, the main controller manages different nodes of the channels through an internal algorithm to communicate, and the nodes only allow access to the nodes in the same channel. The master node determines the sequence of sending messages by inquiring the content of the scheduling table, the traditional LIN monotonic table only allows a fixed scheduling table to be used, and a proper scheduling table cannot be selected for use according to the external situation, the communication sequence, the access cycle and the access content of the nodes can be changed by using the multiple scheduling tables, and the flexibility of the system is greatly improved.
Fig. 3 is a flowchart illustrating a method for switching multiple schedules according to an embodiment of the present invention. As shown in fig. 3, the method includes the following steps S110 to S250.
And S110, setting a data structure of the message general list and the content of the scheduling table.
The data structure of the message general list refers to a table including the storage location, flow direction, sending channel, and the like of the message, and the table and the scheduling table have a certain association relationship. As shown in fig. 5, the data structure of the message total list includes the serial number of the message in the message total list, the LIN physical channel for sending the message, the flow direction of the message, the byte length for sending the message, and the address for storing the message. The Index is the serial number of the message in the message general list, and the dispatch table can be associated to the message general list through the Index to obtain the message to be sent; the Channel is used for determining which LIN physical Channel the message is sent in; the Req Type is used for determining the flow direction of the message data; length is the Length of bytes sent; content is the address where the message data is stored.
The content of the scheduling table refers to information associated with the message total list and a sending time slot of the message, that is, the message list information and the sending time slot which need to be sent are included, the message list information exists in the message total list, and the scheduling table needs to be associated with the message total list, so that the scheduling function is achieved, as shown in fig. 6, the Msg Index is information associated with the message total list to obtain the message which needs to be sent; the Frame-Slot determines the sending time Slot of the message.
S120, judging whether a request for switching the scheduling table exists or not.
In this embodiment, the request is triggered by the terminal according to the external condition, so that the whole process has the function of selecting a proper scheduling table according to the external condition, and the flexibility of the system is improved.
In one embodiment, before executing the step S120, the following steps are further performed:
the LIN bus is initialized.
If not, the process goes to step S140.
And S130, if so, switching the scheduling table according to the request, and clearing the sending time slot counts of all the messages.
If a request needs to be switched, the scheduling table is switched to the corresponding scheduling table according to the scheduling table specified by the specific request, for example, each scheduling table can be identified, the request includes the identification, and the scheduling table is switched to the corresponding scheduling table through the identification, or the scheduling table can be switched to the corresponding scheduling table according to the category through the classification of external conditions. For example, pure digital messages are sent, and the scheduling table S is automatically switched to.
After the scheduling table is switched, the sending time slot counts of all messages need to be cleared, so that the message sending called by the next executing scheduling table is prevented from being influenced, and the normal working function of the whole system is ensured.
S140, judging whether the sending time slot counts of all the messages are zero or not.
In this embodiment, the schedule contents are executed only when the transmission slot technique of all messages is zero.
S150, if not, the sending time slot count of all the messages is reduced by one.
If the count still exists after the count is cleared, the count is decremented by one.
S160, judging whether the subtracted sending time slot count of the message is zero or not;
s170, if not, receiving the sent message.
If the count after subtracting is not zero, it indicates that the message to be sent has been sent, and the terminal receives the sent message.
S180, if yes, adding one to an index pointer in the schedule;
adding one to the index pointer refers to the scheduler next task.
S190, judging whether the current schedule index pointer points to the tail end of the schedule or not;
s200, if yes, resetting an index pointer in the scheduling table so that the index pointer in the scheduling table points to the head of the table, and returning to the step S210;
if not, the process goes to step S210.
And if the next task does not exist, namely all tasks in the scheduling table are executed completely and the associated messages needing to be sent are sent, returning to the most initial position of the scheduling table and repeatedly executing the scheduling table.
S210, if the sending time slot counts of all the messages are zero, judging whether the current scheduling table is empty or not.
If there is no task in the scheduling table to be executed, that is, there is no message to be sent, the ending step is entered, and a notification message can also be sent to the terminal to notify the terminal to switch the scheduling table, so as to improve the flexibility of the system.
And S220, if not, acquiring the content of the message list from the message general list according to the current scheduling table.
When the scheduling table is executed, the message to be sent and the related information thereof are mainly acquired; the message list content includes the storage location, flow direction, LIN physical channel of message transmission, and byte length of message transmission. The LIN physical channel mentioned above refers to an actual LIN network channel.
In one embodiment, as shown in fig. 4, the step S220 may include steps S221 to S224.
S221, acquiring the position pointed by the index pointer in the current scheduling table;
s222, acquiring information of the position related to a message general list;
s223, associating the serial number in the message general list according to the information associated with the message general list to obtain the serial number of the message to be sent in the message general list;
s224, acquiring data related to the sequence number in the message general list according to the sequence number of the message to be sent in the message general list, so as to obtain the content of the message list.
All data of the message to be sent can be obtained by utilizing the incidence relation between the scheduling table and the message general list and combining the data structure of the message general list so as to form the message list content.
And S230, updating the sending time slot count of the message according to the content of the message list.
In this embodiment, the updating of the count specifically replaces the current count value according to the message sending timeslot recorded in the message list content of the position pointed by the index pointer.
S240, analyzing the content of the message list to obtain a message to be sent and a sending channel;
and S250, sending the message to be sent according to the sending channel.
And determining which LIN physical channel the message to be sent is sent in according to the channel in the message list content, and after the message is sent, the terminal receives the message and performs corresponding processing.
If yes, entering the ending step.
According to the multi-scheduling table switching method, the scheduling table is switched according to the requirement or not, the proper scheduling table is selected and adjusted according to the external condition, so that the flexibility of the system is improved, the scheduling table is associated with the message general list, the specific message list content in the message general list is called in the scheduling table executing process, a message sending task is carried out, the functions of the system are expanded, the multi-scheduling table switching is supported, and the increasingly complex ECU control requirements in the market are met.
Fig. 7 is a schematic block diagram of a multiple scheduling table switching apparatus 300 according to an embodiment of the present invention. As shown in fig. 7, the present invention also provides a multiple scheduling table switching apparatus 300 corresponding to the above multiple scheduling table switching method. The multiple schedule switching apparatus 300 includes a unit for performing the multiple schedule switching method described above, and the apparatus may be configured in a server.
Specifically, referring to fig. 7, the multiple scheduling table switching apparatus 300 includes:
a request judgment unit 302 for judging whether there is a request for switching the schedule table;
a switching unit 303, configured to switch the scheduling table according to the request and clear the sending time slot counts of all messages if the request is positive;
a first count judgment unit 304, configured to judge whether the transmission timeslot counts of all the messages are zero;
a schedule determining unit 311, configured to determine whether the current schedule is empty if the current schedule is empty;
a content obtaining unit 312, configured to, if not, obtain a message list content from the total message list according to the current scheduling table;
an updating unit 313, configured to update the sending timeslot count of the packet according to the content of the packet list;
the analysis unit 314 is configured to analyze the content of the message list to obtain a message to be sent and a sending channel;
a sending unit 315, configured to send a message to be sent according to the sending channel.
In one embodiment, the apparatus further comprises:
the setting unit 301 is configured to set a data structure of the message total list and contents of the scheduling table.
In addition, the above apparatus further comprises:
a count processing unit 305, configured to count the sending time slots of all the messages by one if the number of the sending time slots is not less than the number of the sending time slots;
a second count judgment unit 306, configured to judge whether the transmission timeslot counts of all the subtracted messages are zero;
a receiving unit 307, configured to receive the sent message if the received message is not the same as the received message;
the pointer processing unit 308 is configured to add one to the index pointer in the schedule if the index pointer is in the first value;
a pointer position judging unit 309, configured to judge whether the current schedule table index pointer points to the end of the schedule table;
and a resetting unit 310, configured to reset the intra-schedule index pointer so that the intra-schedule index pointer points to the header if yes.
In an embodiment, as shown in fig. 8, the content obtaining unit 312 includes:
a position obtaining subunit 3121, configured to obtain a position pointed to by the index pointer in the current schedule;
the associated information acquiring subunit 3122 is configured to acquire information of the location, which is associated with the message general list;
a sequence number obtaining subunit 3123, configured to associate, according to the information associated with the message total list, a sequence number in the message total list, so as to obtain a sequence number of a message to be sent in the message total list;
the data obtaining subunit 3124 is configured to obtain, according to the sequence number of the message that needs to be sent in the message general list, data related to the sequence number in the message general list, so as to obtain the content of the message list.
It should be noted that, as can be clearly understood by those skilled in the art, the detailed implementation process of the multiple scheduling table switching apparatus 300 and each unit may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided herein.
The above-described multiple schedule table switching apparatus 300 may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 9.
Referring to fig. 9, fig. 9 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 may be a terminal or a server, where the terminal may be an electronic device with a communication function, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of a plurality of servers.
Referring to fig. 9, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 comprises program instructions that, when executed, cause the processor 502 to perform a multiple schedule switching method.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can be caused to execute a multi-schedule switching method.
The network interface 505 is used for network communication with other devices. Those skilled in the art will appreciate that the configuration shown in fig. 9 is a block diagram of only a portion of the configuration associated with the present application and does not constitute a limitation of the computer device 500 to which the present application may be applied, and that a particular computer device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to run the computer program 5032 stored in the memory to implement the following steps:
judging whether a request for switching a scheduling table exists;
if yes, switching a scheduling table according to the request, and clearing the sending time slot counts of all messages;
judging whether the sending time slot counts of all the messages are zero or not;
if yes, judging whether the current scheduling table is empty or not;
if not, acquiring the content of the message list from the message general list according to the current scheduling table;
updating the transmission time slot count of the corresponding message according to the content of the message list;
analyzing the content of the message list to obtain a message to be sent and a sending channel;
and sending the message to be sent according to the sending channel.
In one embodiment, the processor 502 further implements the following steps before implementing the step of determining whether there is a request to switch the schedule:
and setting the data structure of the message general list and the content of the scheduling table.
The data structure of the message general list comprises the serial number of the message in the message general list, an LIN physical channel for sending the message, the flow direction of the message, the byte length for sending the message and the address for storing the message.
The content of the scheduling table comprises information associated with the message general list and the sending time slot of the message.
In an embodiment, after implementing the step of determining whether the transmission timeslot counts of all packets are zero, the processor 502 further implements the following steps:
if not, counting the sending time slots of all the messages by one;
judging whether the transmission time slot counts of all the subtracted messages are zero or not;
if not, receiving the sent message;
if yes, adding one to an index pointer in the schedule;
judging whether the current schedule index pointer points to the tail end of the schedule or not;
if so, resetting the index pointer in the scheduling table so that the index pointer in the scheduling table points to the head of the table;
if not, returning to the step of judging whether the current scheduling table is empty or not.
In an embodiment, when implementing the step of obtaining the content of the message list from the total message list according to the current scheduling table, the processor 502 specifically implements the following steps:
acquiring the position pointed by an index pointer in the current scheduling table;
acquiring information of the position associated with a message general list;
according to the information associated with the message general list, associating the message general list with the sequence number in the message general list to obtain the sequence number of the message to be sent in the message general list;
and acquiring data related to the sequence number in the message general list according to the sequence number of the message to be sent in the message general list so as to obtain the content of the message list.
It should be understood that in the embodiment of the present Application, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program includes program instructions, and the computer program may be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program, when executed by a processor, causes the processor to perform the steps of:
judging whether a request for switching a scheduling table exists;
if yes, switching a scheduling table according to the request, and clearing the sending time slot counts of all messages;
judging whether the sending time slot counts of all the messages are zero or not;
if yes, judging whether the current scheduling table is empty or not;
if not, acquiring the content of the message list from the message general list according to the current scheduling table;
updating the transmission time slot count of the corresponding message according to the content of the message list;
analyzing the content of the message list to obtain a message to be sent and a sending channel;
and sending the message to be sent according to the sending channel.
In one embodiment, the processor further performs, before executing the computer program to perform the step of determining whether there is a request to switch a schedule, the steps of:
and setting the data structure of the message general list and the content of the scheduling table.
The data structure of the message general list comprises the serial number of the message in the message general list, an LIN physical channel for sending the message, the flow direction of the message, the byte length for sending the message and the address for storing the message.
The content of the scheduling table comprises information associated with the message general list and the sending time slot of the message.
In an embodiment, after the processor executes the computer program to implement the step of determining whether the transmission timeslot counts of all packets are zero, the processor further implements the following steps:
if not, counting the sending time slots of all the messages by one;
judging whether the transmission time slot counts of all the subtracted messages are zero or not;
if not, receiving the sent message;
if yes, adding one to an index pointer in the schedule;
judging whether the current schedule index pointer points to the tail end of the schedule or not;
if so, resetting the index pointer in the scheduling table so that the index pointer in the scheduling table points to the head of the table;
if not, returning to the step of judging whether the current scheduling table is empty or not.
In an embodiment, when the processor executes the computer program to implement the step of obtaining the content of the message list from the total message list according to the current scheduling table, the following steps are specifically implemented:
acquiring the position pointed by an index pointer in the current scheduling table;
acquiring information of the position associated with a message general list;
according to the information associated with the message general list, associating the message general list with the sequence number in the message general list to obtain the sequence number of the message to be sent in the message general list;
and acquiring data related to the sequence number in the message general list according to the sequence number of the message to be sent in the message general list so as to obtain the content of the message list.
The storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, which can store various computer readable storage media.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A multiple scheduling table switching method, comprising:
judging whether a request for switching a scheduling table exists;
if yes, switching a scheduling table according to the request, and clearing the sending time slot counts of all messages;
judging whether the sending time slot counts of all the messages are zero or not;
if yes, judging whether the current scheduling table is empty or not;
if not, acquiring the content of the message list from the message general list according to the current scheduling table;
updating the transmission time slot count of the corresponding message according to the content of the message list;
analyzing the content of the message list to obtain a message to be sent and a sending channel;
and sending the message to be sent according to the sending channel.
2. The multiple schedule switching method according to claim 1, wherein said determining whether there is a request to switch schedules further comprises:
and setting the data structure of the message general list and the content of the scheduling table.
3. The multi-scheduling table switching method according to claim 2, wherein the data structure of the message general list includes a sequence number of the message in the message general list, a LIN physical channel for message transmission, a flow direction of the message, a byte length for message transmission, and an address for storing the message.
4. The multi-schedule switching method according to claim 2, wherein the contents of the schedule include information associated with a total list of messages and transmission time slots of the messages.
5. The multi-scheduling table switching method according to any one of claims 1 to 4, wherein the determining whether the transmission slot counts of all the messages are zero comprises:
if not, counting the sending time slots of all the messages by one;
judging whether the transmission time slot counts of all the subtracted messages are zero or not;
if not, receiving the sent message;
if yes, adding one to an index pointer in the schedule;
judging whether the current schedule index pointer points to the tail end of the schedule or not;
if so, resetting the index pointer in the scheduling table so that the index pointer in the scheduling table points to the head of the table;
if not, returning to the step of judging whether the current scheduling table is empty or not.
6. The multi-scheduling table switching method according to claim 5, wherein the obtaining of the message list contents from the message total list according to the current scheduling table comprises:
acquiring the position pointed by an index pointer in the current scheduling table;
acquiring information of the position associated with a message general list;
according to the information associated with the message general list, associating the message general list with the sequence number in the message general list to obtain the sequence number of the message to be sent in the message general list;
and acquiring data related to the sequence number in the message general list according to the sequence number of the message to be sent in the message general list so as to obtain the content of the message list.
7. A multiple scheduling table switching apparatus, comprising:
a request judging unit for judging whether there is a request for switching the schedule table;
the switching unit is used for switching the scheduling table according to the request if the request for switching the scheduling table exists, and clearing the sending time slot counts of all messages;
a first count judgment unit, configured to judge whether the transmission timeslot counts of all the messages are zero;
the scheduling table judging unit is used for judging whether the current scheduling table is empty or not if the sending time slot counts of all the messages are zero;
a content obtaining unit, configured to obtain, according to a current scheduling table, a message list content from a total message list if the transmission timeslot counts of all messages are not zero;
the updating unit is used for updating the sending time slot count of the message according to the content of the message list;
the analysis unit is used for analyzing the content of the message list to obtain a message to be sent and a sending channel;
and the sending unit is used for sending the message to be sent according to the sending channel.
8. The multiple schedule switching apparatus according to claim 7, further comprising:
and the setting unit is used for setting the data structure of the message general list and the content of the scheduling table.
9. A computer device, characterized in that the computer device comprises a memory, on which a computer program is stored, and a processor, which when executing the computer program implements the method according to any of claims 1 to 6.
10. A storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 6.
CN201811562790.7A 2018-12-20 2018-12-20 Multi-scheduling table switching method and device, computer equipment and storage medium Active CN109656169B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811562790.7A CN109656169B (en) 2018-12-20 2018-12-20 Multi-scheduling table switching method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811562790.7A CN109656169B (en) 2018-12-20 2018-12-20 Multi-scheduling table switching method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109656169A CN109656169A (en) 2019-04-19
CN109656169B true CN109656169B (en) 2021-08-27

Family

ID=66115903

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811562790.7A Active CN109656169B (en) 2018-12-20 2018-12-20 Multi-scheduling table switching method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109656169B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114760161B (en) * 2021-11-19 2022-11-25 广州汽车集团股份有限公司 LIN bus scheduling method, device, equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102750149B (en) * 2012-06-13 2016-03-02 普华基础软件股份有限公司 The implementation method of dispatch list and system
CN105634983A (en) * 2014-10-30 2016-06-01 中兴通讯股份有限公司 Queue dispatching method and device
CN105303452A (en) * 2015-08-21 2016-02-03 国电南瑞科技股份有限公司 Power-grid regulation and control real-time data distributed processing method and system
CN108282415B (en) * 2017-12-29 2022-01-11 超聚变数字技术有限公司 Scheduling method and device
CN108989243B (en) * 2018-08-20 2022-03-11 清华大学 Real-time Ethernet scheduling method for transmitting real-time data

Also Published As

Publication number Publication date
CN109656169A (en) 2019-04-19

Similar Documents

Publication Publication Date Title
CN113485822A (en) Memory management method, system, client, server and storage medium
US20070070904A1 (en) Feedback mechanism for flexible load balancing in a flow-based processor affinity scheme
CN106921947B (en) Method, device and terminal for adjusting broadcast message queue
WO2020259227A1 (en) Thread task communication system, method, and related product
CN106851015B (en) Method, device and terminal for adjusting broadcast message queue
CN106484531B (en) Memory access arbitration method, circuit and device
CN109167737B (en) CAN scheduling method integrating data reduction and dynamic priority queue
CN109656169B (en) Multi-scheduling table switching method and device, computer equipment and storage medium
CN113452758A (en) Service access method and device
CN106330741B (en) Message transmission method and device
CN110311963B (en) Message pushing method and device, computer equipment and computer readable storage medium
CN112040001A (en) Request processing method and device based on distributed storage
CN113157465B (en) Message sending method and device based on pointer linked list
CN113542043A (en) Data sampling method, device, equipment and medium of network equipment
US20140304450A1 (en) Switching device, packet control method, and data communication system
US20170257323A1 (en) Mail Obtaining Method, Terminal, and System
EP1465370B1 (en) Predictable real time data communication on a serial bus
KR20170117326A (en) Direct memory access control device for at least one processing unit having a random access memory
CN115955441A (en) Management scheduling method and device based on TSN queue
US11516145B2 (en) Packet control method, flow table update method, and node device
CN110912958A (en) HTTP connection processing method, device, equipment and medium
CN114697270A (en) EPA network model-based arbitration method, system, equipment and medium
CN113765796A (en) Flow forwarding control method and device
CN110224779B (en) Method, device, equipment and medium for calculating absolute time of equipment for receiving and sending message
WO2017016300A1 (en) Method and apparatus for processing token application, computer storage medium

Legal Events

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