Pulse signal synchronization method, device, equipment, medium and program product
By analyzing and monitoring the pulse signal information in the PLC project file, determining the start time of the pulse signal, batch synchronization of multiple pulse signals is achieved, and the pulse signal synchronization efficiency is improved, and the pulse signal synchronization efficiency is solved in the existing technology. The problem.
Patent Information
- Application Number
- CN202410997913.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-12-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing pulse signal synchronization method cannot batch synchronize multiple pulse signals, resulting in low efficiency of pulse signal synchronization in PLC and cannot adapt to the scenario requirements of multiple pulse signals in time.
By analyzing the controller's engineering files, the name, period and address information of the pulse signal are obtained, the signal value is collected based on this information, and the maximum or minimum value change time of the signal value is monitored, and the start time of the pulse signal is determined, thereby achieving multiple batch synchronization of pulse signals.
The synchronization of multiple pulse signals is achieved simultaneously, the synchronization efficiency of pulse signals of different controllers is improved, and the inefficiency problem of synchronizing single pulse signals is solved.
Smart Images

Figure CN119087899A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a pulse signal synchronization method, device, equipment, medium and program product. Background Art
[0002] Controllers used for equipment in industrial sites include programmable logic controllers (PLCs), distributed control systems (DCSs), and robot-specific controllers. Different types of controllers have different control methods and application scenarios. Among them, programmable logic controllers (PLCs) are widely used in manufacturing, transportation, energy, construction and other industries due to their high reliability, powerful functions, and easy use and maintenance. PLC historical data, especially intermediate process data, can record information when equipment is abnormal or fails. By collecting and analyzing PLC historical data, engineers can troubleshoot and accurately find the cause of the failure.
[0003] At present, the collection of PLC historical data is mainly carried out through polling or listening. Affected by network bandwidth and PLC maximum communication load, it is impossible to obtain the full amount of data within the PLC scanning cycle in time, and only partial and scattered data can be obtained.
[0004] In this regard, using soft PLC to simulate the operation logic of the on-site PLC in order to obtain the full amount of data of the on-site PLC through simulation calculation is an important way to obtain the full amount of PLC data. If the soft PLC and the on-site PLC cannot be synchronized before the simulation calculation, the simulation results of the soft PLC will be inconsistent with the actual operation results of the on-site PLC. Therefore, it is particularly important to synchronize the soft PLC and the on-site PLC.
[0005] In PLC, pulse signals have the characteristics of periodic changes, which are closely related to equipment switch information, sensor information, etc. For pulse signal synchronization, the existing synchronization method is to compare the phase difference between the sampled pulse signal and the analog pulse signal, and adjust the phase of the analog pulse signal. This synchronization method can only synchronize single pulse signals one by one, and cannot synchronize multiple pulse signals in batches. For the situation where there are many pulse signals that need to be synchronized in the PLC, the synchronization efficiency is low. Therefore, how to achieve efficient synchronization of pulse signals of different controllers is a technical problem that needs to be solved urgently. Summary of the invention
[0006] In order to solve the above technical problems, the present disclosure provides a pulse signal synchronization method, device, equipment, medium and program product.
[0007] A first aspect of an embodiment of the present disclosure provides a pulse signal synchronization method, including: Parsing the engineering file of the first controller to obtain the name, pulse period, and address information of at least one pulse signal of the first controller; Based on the name and address information of the pulse signal, collecting a signal value of at least one pulse signal of the first controller; The signal values of the multiple pulse signals acquired through monitoring and collection are obtained, and the time value when the signal values of the multiple pulse signals change to the maximum value or the minimum value at the same time is obtained, and the time value is used as the starting time of the corresponding pulse signal of the second controller.
[0008] A second aspect of an embodiment of the present disclosure provides a pulse signal synchronization device, including: A parsing module, used for parsing the engineering file of the first controller to obtain the pulse period and address information of at least one pulse signal of the first controller; A collection module, used for collecting a signal value of at least one pulse signal of the first controller based on the address information of the pulse signal; The start time acquisition module is used to monitor the signal values of multiple pulse signals acquired and obtain the time value when the signal values of multiple pulse signals change to the maximum value or the minimum value at the same time. The time value is used as the start time of the corresponding pulse signal of the second controller.
[0009] A third aspect of the embodiments of the present disclosure provides an electronic device, including: processor; A memory for storing executable instructions; The processor is used to read executable instructions from the memory and execute the executable instructions to implement the pulse signal synchronization method provided in the first aspect.
[0010] A fourth aspect of an embodiment of the present disclosure provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the pulse signal synchronization method provided by the first aspect above.
[0011] A fifth aspect of an embodiment of the present disclosure provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the pulse signal synchronization method as described in the first aspect above is implemented.
[0012] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages: The pulse signal synchronization method, apparatus, equipment, medium and program product provided in the embodiments of the present disclosure can obtain the name, pulse period and address information of at least one pulse signal of the first controller by parsing the engineering file of the first controller, collect the signal value of at least one pulse signal of the first controller based on the name and address information of the pulse signal, monitor the signal values of multiple pulse signals obtained by the collection, obtain the time value when the signal values of multiple pulse signals change to the maximum value or the minimum value at the same time, and use the time value as the start time of the corresponding pulse signal of the second controller. As a result, the start time of multiple pulse signals of the controller can be determined at the same time, and even the start time of all pulse signals can be determined at the same time, thereby realizing batch synchronization of multiple pulse signals and improving the synchronization efficiency of pulse signals of different controllers. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0014] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0015] Figure 1 is a flow chart of a pulse signal synchronization method provided by an embodiment of the present disclosure; Figure 2 is a flow chart of another pulse signal synchronization method provided by an embodiment of the present disclosure; Figure 3 It is a structural schematic diagram of a pulse signal synchronization device provided by an embodiment of the present disclosure; Figure 4 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0016] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0017] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0018] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0019] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0020] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0021] Normally, the pulse signal of the controller has the characteristic of periodic change, which is closely related to the device switch information, sensor information, etc. For the synchronization of the pulse signal of the controller, the phase difference between the sampled pulse signal and the analog pulse signal is compared, and the phase of the analog pulse signal is adjusted. This synchronization method can only synchronize single pulse signals one by one, and cannot synchronize multiple pulse signals in batches. It cannot adapt to the scenario requirements where a large number of pulse signals of controllers need to be synchronized in time. To address this problem, the embodiment of the present disclosure provides a pulse signal synchronization method, which is introduced below in conjunction with specific embodiments.
[0022] Figure 1 It is a flowchart of a pulse signal synchronization method provided in an embodiment of the present disclosure. The method can be executed by a pulse signal synchronization device. The pulse signal synchronization device can be implemented in software and / or hardware. The pulse signal synchronization device can be configured in an electronic device, such as a server or a terminal, wherein the terminal specifically includes a mobile phone, a computer or a tablet computer, etc.
[0023] like Figure 1 As shown, the pulse signal synchronization method provided in this embodiment includes the following steps.
[0024] S110, parsing the engineering file of the first controller to obtain the pulse period and address information of at least one pulse signal of the first controller.
[0025] In an embodiment of the present disclosure, after receiving a pulse signal synchronization instruction, the electronic device parses the engineering file of the first controller based on the pulse signal synchronization instruction to obtain the name, pulse period, address information, and number of pulse signals of at least one pulse signal of the first controller.
[0026] The electronic devices here include but are not limited to general-purpose computers and special-purpose computers, and the systems installed include but are not limited to Windows, Linux, and Unix.
[0027] The first controller refers to the controller used for equipment control in industrial sites, including but not limited to programmable logic controller (PLC), distributed control system (DCS) and robot-specific controller, etc. Different types of controllers have different control methods and application scenarios.
[0028] Accordingly, the second controller is a controller having a control program, including but not limited to a soft PLC, which is not limited here. The second controller is a controller that needs to be synchronized with the pulse signal of the first controller.
[0029] In the embodiments of the present disclosure, the engineering file of the first controller can be understood as a file created and used in the process of developing the controller, which contains all the information required to implement a specific automation control task, such as a configuration file for describing the hardware configuration, communication configuration, parameter configuration, etc. of the first controller, a program file for describing the control logic of the controller, etc. Further, the engineering file of the controller contains the names, pulse periods, address information, etc. of all pulse signals.
[0030] The pulse signal is a signal that changes regularly with a fixed period, and the pulse period of each pulse signal is fixed. For example, the Siemens PLC controller includes 8 pulse signals, whose changing frequencies are 10Hz, 5Hz, 2.5Hz, 2Hz, 1.25Hz, 1Hz, 0.625Hz, and 0.5Hz, respectively, and their corresponding pulse periods are 100ms, 200ms, 400ms, 500ms, 800ms, 1000ms, 1600ms, and 2000ms. The pulse periods of these 8 pulse signals can be obtained separately through the communication protocol subscription method, or the pulse periods of 8 pulse signals can be obtained at one time through the communication protocol round-robin method. The addresses of these 8 pulse signals correspond to the 0th to 7th bits of the same byte. The PLC project can freely set which address of the variable is located in the M area; the pulse signal generally includes 8 bits, and all variables in the M area can be collected through the communication protocol.
[0031] Optionally, the pulse signals in the engineering file include all pulse signals involved in the control program. Due to the stability of the acquisition network, it cannot be guaranteed that all pulse signals obtained by parsing the engineering file can be acquired to obtain corresponding signal values.
[0032] Optionally, the project file may be in XML format, JSON format, or other formats.
[0033] In the disclosed embodiment, the pulse period of the pulse signal of the first controller obtained through analysis needs to be sent to the controller to be synchronized, so that the pulse period of the corresponding pulse signal of the controller to be synchronized is the same as the pulse period of the corresponding pulse signal of the first controller.
[0034] S120. Based on the name and address information of the pulse signal, collect a signal value of at least one pulse signal of the first controller.
[0035] In the embodiment of the present disclosure, a data acquisition device is used to acquire a signal value of at least one pulse signal of the first controller based on the name and address information of the pulse signal acquired through analysis.
[0036] Optionally, the pulse signal collection method includes but is not limited to: obtaining multiple pulse signals of the first controller through round-robin access via a communication protocol; or subscribing to multiple pulse signals of the first controller in real time via a communication protocol. Multiple pulse signals here refer to the number of pulse signals being greater than or equal to two.
[0037] In the disclosed embodiment, the pulse signal includes a square wave pulse signal, a rectangular pulse signal, a triangular wave pulse signal, etc. Among them, the high level duration period of the square wave pulse signal is the same as the low level duration period. The pulse period value of the square wave pulse signal is fixed, and is the sum of the high level duration period and the low level duration period.
[0038] The signal value of a pulse signal refers to the value of the pulse signal at different time points. The signal values of different pulse signals have different rules. Each pulse signal has a maximum and minimum signal value.
[0039] For example, the signal value of the square wave pulse signal includes 0 and 1. When the signal value is 0, it corresponds to a low level, which is the minimum signal value; when the signal value is 1, it corresponds to a high level, which is the maximum signal value.
[0040] In the disclosed embodiment, due to the influence of on-site network fluctuations and equipment failures, it is impossible to ensure that the signal values of all pulse signals obtained by analysis are collected, so the number of pulse signals collected may be smaller than the number of pulse signals obtained by analysis.
[0041] S130, monitoring and collecting the signal values of the multiple pulse signals, obtaining the time value when the signal values of the multiple pulse signals change to the maximum value or the minimum value at the same time, and using the time value as the start time of the corresponding pulse signal of the second controller.
[0042] In an embodiment of the present disclosure, signal values of multiple pulse signals at different time points are obtained by simultaneously monitoring and collecting. When it is monitored that multiple pulse signals change to maximum values or minimum values at the same time, corresponding time values are obtained. The first time value can be used as the start time of the corresponding pulse signal of the second controller, thereby achieving simultaneous synchronization of multiple pulse signals of the second controller with those of the first controller.
[0043] When the pulse period of each pulse signal is determined, the start time of the pulse signal is determined, and the synchronization of the corresponding pulse signals of different controllers can be achieved. The corresponding pulse signals here refer to the pulse signals with the same name in different controllers.
[0044] The start time of the pulse signal can be understood as the start time of a new cycle of the pulse signal. The time value when the pulse signal changes to the maximum value or the minimum value is the start time of the pulse signal. The time value when the pulse signal changes to the maximum value here refers to the instant when the signal value of the pulse signal changes from the non-maximum value to the maximum value; the time value when the pulse signal changes to the minimum value refers to the instant when the signal value of the pulse signal changes from the non-minimum value to the minimum value.
[0045] For example, the time value corresponding to the rising edge and falling edge of the square wave pulse signal is the starting time of the square wave pulse signal. Among them, the rising edge refers to the transition moment when the signal changes from a low level to a high level, that is, the transition moment when the signal value changes from 0 to 1, that is, the time value of the rising edge is the time value when the signal value of the pulse signal changes to the maximum value. Correspondingly, the falling edge refers to the transition moment when the signal changes from a high level to a low level, that is, the transition moment when the signal value changes from 1 to 0, that is, the time value of the falling edge is the time value when the signal value of the pulse signal changes to the minimum value.
[0046] In an embodiment of the present disclosure, the name, pulse period, and address information of at least one pulse signal of the first controller are obtained by parsing the engineering file of the first controller; based on the name and address information of the pulse signal, the signal value of at least one pulse signal of the first controller is collected; the signal values of multiple pulse signals obtained by collection are monitored; and the time value at which the signal values of multiple pulse signals simultaneously change to a maximum value or simultaneously change to a minimum value is obtained. The time value is used as the start time of the corresponding pulse signal of the second controller. According to an embodiment of the present disclosure, the start time of multiple pulse signals of the controller can be determined simultaneously, and even the start time of all pulse signals can be determined simultaneously, thereby realizing batch synchronization of multiple pulse signals. Compared with synchronizing single pulse signals one by one, the synchronization efficiency of multiple pulse signals of different controllers can be greatly improved.
[0047] In the embodiment of the present disclosure, before performing controller pulse signal synchronization, the pulse signal synchronization method may further include: synchronizing the clocks of the first controller and the second controller to make the clock times of the first controller and the second controller the same.
[0048] In the disclosed embodiment, synchronizing the clocks of the first controller and the second controller includes: obtaining the current clock time of the first controller, setting the clock time as the clock time of the second controller, thereby overcoming the error caused by the difference in the quality of the clock hardware of different controllers, and then providing an accurate time reference. For example, the current clock time can be requested from the clock server used by the current first controller, such as the on-site PLC controller, and then the obtained current clock time is sent to the second controller, and the second controller sets the received current clock time as the clock time of the clock server of the second controller.
[0049] In the disclosed embodiment, the clock synchronization process of the first controller and the second controller may be performed once, for example, when the controller is initialized, or may be performed multiple times, for example, at regular intervals. Multiple clock synchronization processes can avoid long-term accumulation of clock errors leading to large time differences.
[0050] In the embodiment of the present disclosure, the initial time of the pulse signal of the first controller obtained by analysis is the same; or, the initial time of the pulse signal of the first controller obtained by analysis is the same and the pulse period of the pulse signal has a common multiple. The same initial time here refers to the time when the pulse signal is powered on, that is, the initialization time of the pulse signal.
[0051] like Figure 2 As shown, the embodiment of the present disclosure provides another method for synchronizing a pulse signal, specifically, comprising the following steps: S210, parsing the engineering file of the first controller to obtain the name, pulse period, and address information of at least one pulse signal of the first controller.
[0052] The implementation process and effect of this step are the same as those of S110 and will not be described in detail here.
[0053] S220. Based on the name and address information of the pulse signal, collect a signal value of at least one pulse signal of the first controller.
[0054] The implementation process and effect of this step are the same as those of S120 and will not be described in detail here.
[0055] S230 , counting the number of pulse signals obtained through analysis, and determining whether the number of pulse signals obtained through collection is the same as the number of pulse signals obtained through analysis.
[0056] In an embodiment of the present disclosure, by parsing the engineering file of the first controller, the name, pulse period and address information of all relevant pulse signals of the controller can be obtained, and by counting the number of all pulse signals obtained by the analysis, the number of all pulse signals can be obtained.
[0057] Due to the instability of the on-site network and equipment failures, some pulse signals cannot be collected, so the number of pulse signals collected is less than the number of pulse signals analyzed.
[0058] In the embodiment of the present disclosure, by comparing the number of pulse signals acquired by collection with the number of pulse signals acquired by analysis, it is determined whether the two are the same. When the numbers are the same and when the numbers are different, the synchronization method of the pulse signals is different.
[0059] S240: When the number of pulse signals obtained by collection is less than the number of pulse signals obtained by analysis, the pulse signals obtained by analysis are grouped based on a preset grouping rule, wherein the preset grouping rule is set according to a pulse period regularity of the pulse signals obtained by analysis.
[0060] In an embodiment of the present disclosure, when the number of pulse signals obtained by collection is less than the number of pulse signals obtained by analysis, it means that the signal values of some pulse signals have not been successfully collected. At this time, for the pulse signals that failed to be collected, the corresponding pulse signals with the same name in the second controller cannot be synchronized through the monitoring of the signal value. At this time, the pulse signals obtained by analysis can be grouped by analyzing the regularity of the pulse period of the pulse signals obtained by analysis, the pulse period of each group of pulse signals conforms to a specific regularity, and each group of pulse signals includes the pulse signals obtained by collection and the pulse signals not obtained by collection; or each group of pulse signals includes the pulse signals obtained by collection.
[0061] In an embodiment of the present disclosure, the preset grouping rules include analyzing whether the pulse period of the pulse signal obtained by analysis is consistent, and grouping the pulse signal obtained by analysis according to different m values, where m value is the minimum pulse period of each group of pulse signals, and n is a positive integer.
[0062] Specifically, due to the influence of network fluctuations, there may be one or more pulse signals that have not been detected to be high or low for a long time, resulting in the inability to obtain the excitation time when all pulse signals are high / low. In this case, by analyzing the pulse period of all pulse signals, they are grouped so that the pulse period of each pulse signal in each group is twice that of the pulse signal with the smallest pulse period. n times, where n is a positive integer (for example, 1, 2, 3, 4, 5, etc.).
[0063] For example, in a group of pulse signals, the pulse periods of each pulse signal are 100ms, 200ms, 400ms, 800ms, and 1600ms respectively. The pulse period of this group of pulse signals conforms to the rule of 100*2 n . Among them, 200ms=100*2 1 , 400ms=100*2 2 , 800ms=100*2 3 , 1600ms=100*2 4 The pulse periods of this group of pulse signals have a common multiple of 2 n .
[0064] For example, in a group of pulse signals, the pulse periods of the three pulse signals are 500ms, 1000ms, and 2000ms respectively. The pulse period of this group of pulse signals conforms to the rule of 500×2 n . Among them, 1000ms=500*2 1 , 2000ms=500*2 2 The pulse periods of this group of pulse signals have a common multiple of 2 n .
[0065] S250, monitoring the signal values of each group of collected pulse signals in groups, obtaining the time value when the signal values of the multiple pulse signals change to the maximum value or the minimum value at the same time, and using the time value as the start time of the corresponding pulse signal of the second controller.
[0066] In the embodiment of the present disclosure, for each group of pulse signals grouped according to the pulse period of the pulse signal, the time value when the signal value obtained by each group of acquisition changes to the maximum value or changes to the minimum value at the same time is monitored, and the time value is used as the start time of the corresponding pulse signal of the second controller. Here, each group of pulse signals after grouping refers to a plurality of pulse signals that conform to the pulse period law of the group obtained by analysis, including pulse signals of the signal value that can be acquired and pulse signals of the signal value that are not acquired, so that the synchronization of the pulse signals of the signal value that are not acquired is achieved through grouping. Specifically, since each group of pulse signals after grouping is a plurality of pulse signals that are obtained by analysis and conform to the law of the pulse period of the group, it means that the pulse period of the group of pulse signals has a common multiple. By grouping and monitoring the signal values of the pulse signals that can be collected, the time value at which the signal values of the plurality of pulse signals change to the maximum value or to the minimum value at the same time is obtained, which is used as the start time of the group of pulse signals, thereby realizing the synchronization of pulse signals in group batches and improving the efficiency of pulse signal synchronization.
[0067] In an embodiment of the present disclosure, the signal values of the multiple pulse signals acquired in each group are monitored in groups, and the time values when the signal values of the multiple pulse signals change to the maximum value or the minimum value at the same time are obtained, and the time values are used as the starting time of the corresponding pulse signal of the second controller. It also includes: the time value when the signal value of the pulse signal with the largest pulse period in each group changes to the maximum value or the minimum value is obtained in groups, and the time value is used as the starting time of the corresponding pulse signal of the second controller.
[0068] Optionally, by monitoring the signal value of the pulse signal with the largest pulse period in the group, the time value when the signal value of the pulse signal with the largest pulse period in each group changes to the maximum value or changes to the minimum value is obtained, and the time value is used as the start time of the corresponding pulse signal of the second controller. In this way, there is no need to monitor the signal values of all pulse signals in the group, which further improves the efficiency of pulse signal synchronization.
[0069] In the embodiments of the present disclosure, by counting the number of pulse signals obtained by analysis, it is determined whether the number of pulse signals obtained by collection is the same as the number of pulse signals obtained by analysis; when the number of pulse signals obtained by collection is less than the number of pulse signals obtained by analysis, the pulse signals obtained by analysis are grouped based on preset grouping rules, and the preset grouping rules are set according to the pulse period law of the pulse signals obtained by analysis; the signal values of each group of multiple pulse signals obtained by collection are monitored in groups, and the time values when the signal values of the multiple pulse signals change to the maximum value or to the minimum value at the same time are obtained, and the time values are used as the start time of the corresponding pulse signal of the second controller. Therefore, by only grouping synchronization according to the pulse period law of the pulse signals obtained by analysis, pulse signals whose signal values have not been collected can also be synchronized, thereby improving the integrity and accuracy of pulse signal synchronization.
[0070] Figure 3 It is a structural schematic diagram of a pulse signal synchronization device provided in an embodiment of the present disclosure.
[0071] In the disclosed embodiment, the pulse signal synchronization device can be arranged in an electronic device, and is understood as a part of the functional modules in the above electronic device. Specifically, the electronic device can be a server or a terminal, wherein the terminal specifically includes a mobile phone, a computer or a tablet computer, etc., and can also be any device capable of processing pulse signal synchronization, which is not limited here.
[0072] like Figure 3 As shown, the pulse signal synchronization device 300 may include The parsing module 310 is used to parse the engineering file of the first controller to obtain the name, pulse period, and address information of at least one pulse signal of the first controller; The acquisition module 320 is used to acquire a signal value of at least one pulse signal of the first controller based on the name and address information of the pulse signal; The start time acquisition module 330 is used to monitor the signal values of the multiple pulse signals acquired and obtain the time value when the signal values of the multiple pulse signals change to the maximum value or the minimum value at the same time, and the time value is used as the start time of the corresponding pulse signal of the second controller.
[0073] In the embodiment of the present disclosure, it is possible to parse the engineering file of the first controller to obtain the name, pulse period, and address information of at least one pulse signal of the first controller; based on the name and address information of the pulse signal, the signal value of at least one pulse signal of the first controller is collected; the signal values of multiple pulse signals collected are monitored; and the time value at which the signal values of the multiple pulse signals simultaneously change to the maximum value or simultaneously change to the minimum value is obtained. The time value is used as the start time of the corresponding pulse signal of the second controller. According to the embodiment of the present disclosure, the start time of multiple pulse signals of the controller can be determined simultaneously, and even the start time of all pulse signals can be determined simultaneously, thereby realizing batch synchronization of multiple pulse signals, and thereby improving the synchronization efficiency of pulse signals of different controllers.
[0074] In some embodiments of the present disclosure, the pulse signal synchronization device 300 may further include a pulse signal quantity determination module.
[0075] The pulse signal quantity judgment module is used to count the number of pulse signals obtained by analysis and determine whether the number of pulse signals obtained by collection is the same as the number of pulse signals obtained by analysis.
[0076] In some embodiments of the present disclosure, the pulse signal synchronization device 300 may further include a pulse signal grouping module.
[0077] The pulse signal grouping module is used to group the pulse signals obtained by analysis based on preset grouping rules when the number of pulse signals collected is less than the number of pulse signals obtained by analysis. The preset grouping rules are set according to the pulse period regularity of the pulse signals obtained by analysis.
[0078] The preset grouping rule includes analyzing whether the pulse period of the pulse signal obtained by analysis is consistent, and grouping the pulse signal obtained by analysis according to different m values, where m value is the minimum pulse period of each group of pulse signals, and n is a positive integer.
[0079] In some embodiments of the present disclosure, the pulse signal synchronization device 300 may further include a packet start time acquisition module.
[0080] The group start time acquisition module is used to monitor the signal values of each group of collected pulse signals in groups, and obtain the time value when the signal values of multiple pulse signals change to the maximum value or the minimum value at the same time. The time value is used as the start time of the corresponding pulse signal of the second controller.
[0081] Preferably, the group start time acquisition module obtains the time value when the signal value of the pulse signal with the largest pulse period in each group changes to the maximum value or the minimum value, and the time value is used as the start time of the corresponding pulse signal of the second controller.
[0082] It should be noted that Figure 3 The pulse signal synchronization device 300 shown can execute each step in the above method embodiment and realize each process and effect in the above method embodiment, which will not be described in detail here.
[0083] Figure 4 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure.
[0084] In the disclosed embodiment, Figure 4 The electronic device shown may be a server or a terminal, wherein the terminal specifically includes a mobile phone, a computer or a tablet computer, etc., and may also be any device that can synchronously process pulse signals, which is not limited here.
[0085] like Figure 4 As shown, the electronic device may include a processor 410 and a memory 420 storing computer program instructions.
[0086] Specifically, the processor 410 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present disclosure.
[0087] The memory 420 may include a large capacity memory for information or instructions. By way of example and not limitation, the memory 420 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 420 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 420 may be inside or outside the integrated gateway device. In a particular embodiment, the memory 420 is a non-volatile solid-state memory. In a particular embodiment, the memory 420 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (Electrically Erasable Programmable ROM, EEPROM), an electrically rewritable ROM (EAROM) or a flash memory, or a combination of two or more of these.
[0088] The processor 410 reads and executes the computer program instructions stored in the memory 420 to perform the steps of the pulse signal synchronization method provided in the embodiment of the present disclosure.
[0089] In one example, the electronic device may further include a transceiver 430 and a bus 440. Figure 4 As shown, the processor 410, the memory 420 and the transceiver 430 are connected via a bus 440 and communicate with each other.
[0090] The bus 440 includes hardware, software, or both. For example, but not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a Memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 440 may include one or more buses.
[0091] The embodiment of the present disclosure further provides a computer-readable storage medium, which may store a computer program. When the computer program is executed by a processor, the processor implements the pulse signal synchronization method provided by the embodiment of the present disclosure.
[0092] The above-mentioned storage medium may, for example, include a memory 420 of computer program instructions, and the above-mentioned instructions may be executed by the processor 410 of the electronic device to complete the pulse signal synchronization method provided by the embodiment of the present disclosure. Optionally, the storage medium may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a ROM, a random access memory (Random Access Memory, RAM), a compact disc read-only memory (Compact Disc ROM, CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0093] The embodiments of the present disclosure also provide a vehicle, which includes electronic equipment and can implement the various processes and effects in the above embodiments of the present disclosure, which will not be elaborated here.
[0094] The embodiments of the present disclosure also provide a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the pulse signal synchronization method provided by the embodiments of the present disclosure is implemented, and the various processes and effects in the above-mentioned embodiments of the present disclosure can be implemented, which will not be repeated here.
[0095] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A pulse signal synchronization method, It is characterized in that include: Parsing the engineering file of the first controller to obtain the name, pulse period, and address information of at least one pulse signal of the first controller; Based on the name and address information of the pulse signal, collecting a signal value of at least one pulse signal of the first controller; The signal values of the multiple pulse signals obtained by monitoring and collecting are obtained to obtain the time value when the signal values of the multiple pulse signals change to the maximum value or the minimum value at the same time, and the time value is used as the starting time of the corresponding pulse signal of the second controller.
2. The method according to claim 1, It is characterized in that Counting the number of the pulse signals obtained by analysis, and determining whether the number of the pulse signals obtained by collection is the same as the number of the pulse signals obtained by analysis; When the number of the pulse signals obtained by collection is less than the number of the pulse signals obtained by analysis, the pulse signals obtained by analysis are grouped based on a preset grouping rule, wherein the preset grouping rule is set according to the pulse period regularity of the pulse signals obtained by analysis; The signal values of the multiple pulse signals acquired in each group are monitored in groups, and the time values when the signal values of the multiple pulse signals change to the maximum value or the minimum value at the same time are obtained, and the time values are used as the starting time of the corresponding pulse signal of the second controller.
3. The method according to claim 2, It is characterized in that When the number of the pulse signals obtained by collection is less than the number of the pulse signals obtained by analysis, the pulse signals obtained by analysis are grouped based on a preset grouping rule, and the preset grouping rule is set according to the pulse period regularity of the pulse signals obtained by analysis and further includes: The grouping rule includes analyzing whether the pulse period of the pulse signal obtained by analysis is consistent, and grouping the pulse signal obtained by analysis according to different m values, where the m value is the minimum pulse period of each group of pulse signals, and n is a positive integer.
4. The method according to claim 2, It is characterized in that The group monitoring of the signal values of the plurality of pulse signals acquired in each group, obtaining the time value when the signal values of the plurality of pulse signals change to the maximum value or the minimum value at the same time, the time value being the start time of the corresponding pulse signal of the second controller also includes: The time value when the signal value of the pulse signal with the largest pulse period in each group changes to the maximum value or the minimum value is obtained in groups, and the time value is used as the starting time of the corresponding pulse signal of the second controller.
5. The method according to claim 1, It is characterized in that The initial times of the pulse signals of the first controller obtained through analysis are the same; or, the initial times of the pulse signals of the first controller obtained through analysis are the same and there is a common multiple of the pulse periods of the pulse signals.
6. The method according to claim 1, It is characterized in that The pulse period of the pulse signal of the first controller obtained by analysis is sent to the second controller.
7. A pulse signal synchronization device, It is characterized in that include: A parsing module, used for parsing the engineering file of the first controller to obtain the name, pulse period, and address information of at least one pulse signal of the first controller; A collection module, used for collecting a signal value of at least one pulse signal of the first controller based on the name and address information of the pulse signal; The starting time acquisition module is used to monitor the signal values of the multiple pulse signals acquired and obtained, and obtain the time value when the signal values of the multiple pulse signals change to the maximum value or the minimum value at the same time. The time value is used as the starting time of the corresponding pulse signal of the second controller.
8. An electronic device, It is characterized in that include: processor; A memory for storing executable instructions; Wherein, the processor is used to read the executable instructions from the memory and execute the executable instructions to implement the pulse signal synchronization method described in any one of claims 1-6.
9. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the pulse signal synchronization method described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program or instructions, It is characterized in that When the computer program or instruction is executed by a processor, the pulse signal synchronization method according to any one of claims 1 to 6 is implemented.
