Data acquisition method, equipment and device based on multiple acquisition cards and medium

By automatically distinguishing between the main acquisition card and the secondary acquisition card, automatic parameters synchronization and parallel data acquisition are realized, which solves the problems of cumbersome user operations and low data acquisition efficiency in the existing technology, and improves the efficiency, accuracy and scalability of data acquisition.

CN120029686APending Publication Date: 2025-05-23HANGZHOU HIKROBOT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510094094.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The existing multi-acquisition card data acquisition products have significant limitations at the user interaction level. Users need to adjust the parameters of each acquisition card one by one, resulting in cumbersome operation, high cost and easy to introduce configuration errors, affecting the efficiency and accuracy of data acquisition.

Method used

By automatically distinguishing the main acquisition card and the secondary acquisition card connected to the same acquisition device, users only need to configure the main acquisition card parameter, the device automatically synchronizes the parameters to the secondary acquisition card, and collects data frames in parallel through the main acquisition card and the secondary acquisition card, simplifying user operations and improving data acquisition efficiency.

Benefits of technology

It has achieved simplification of user operations, improved data acquisition efficiency and accuracy, reduced data acquisition costs, and enhanced data acquisition scalability and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029686A_ABST
    Figure CN120029686A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data acquisition method, equipment and device based on multiple acquisition cards and a medium, a main acquisition card and an auxiliary acquisition card connected to the same acquisition equipment are automatically distinguished, a parameter configuration process is simplified, a user only needs to set main card parameters, the equipment is synchronized to the auxiliary card, human errors are reduced through automatic synchronization, user operation is simplified, and user experience is improved. And the data acquisition efficiency and accuracy are improved. In the data acquisition process, the main acquisition card and the auxiliary acquisition card acquire each data frame in parallel, so that the data acquisition efficiency is improved. Besides, by increasing the number of the auxiliary acquisition cards, input channels of the acquisition equipment can be expanded, data acquisition requirements of different scales and complexity can be met flexibly, and expandability and stability of data acquisition are enhanced. In conclusion, through the automatic and parallelized configuration process and data acquisition, the user operation is simplified, the data acquisition efficiency and accuracy are improved, and the expandability and stability of data acquisition are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of machine vision technology, and in particular to a data acquisition method, equipment, device and medium based on multiple acquisition cards. Background Art

[0002] In the current field of data acquisition technology, in order to meet the needs of wider and more flexible data acquisition, many data acquisition products that use acquisition devices and multi-acquisition card topology connections have emerged on the market. This design aims to expand the input channels of the acquisition device by increasing the number of acquisition cards, thereby supporting data acquisition tasks with higher resolution, more viewing angles or longer distances and improving data acquisition efficiency. However, these products have significant limitations in terms of user interaction. Specifically, the client software or SDK (Software Development Kit) interface design presents each acquisition card to the user independently, requiring the user to adjust the parameters of each card one by one during configuration to ensure consistency to avoid abnormal data output. This card-by-card configuration method is not only cumbersome and increases the user's operating burden, but also increases the cost of data acquisition due to its high reliance on manual inspection, and is very easy to introduce configuration errors, resulting in data output failure. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a data acquisition method, device, apparatus and medium based on multiple acquisition cards to simplify user operations, improve data acquisition efficiency and accuracy, enhance the scalability and stability of data acquisition, and reduce costs. The specific technical solutions are as follows:

[0004] In a first aspect, an embodiment of the present application provides a data acquisition method based on multiple acquisition cards, which is applied to a terminal device, wherein the terminal device runs multiple acquisition cards, wherein the acquisition cards are used to connect to an acquisition device, wherein the acquisition device establishes a link with at least two acquisition cards, wherein one of the at least two acquisition cards is a main acquisition card, and the other acquisition cards are secondary acquisition cards;

[0005] In response to a parameter configuration instruction input for the main acquisition card, configure the parameters of the main acquisition card according to the parameter configuration instruction, and synchronously configure the parameters of the main acquisition card to the secondary acquisition card;

[0006] The main acquisition card and the auxiliary acquisition card acquire each data frame acquired by the acquisition device in parallel according to the configured parameters.

[0007] In a possible implementation manner, the main acquisition card and the secondary acquisition card are determined in advance in the following manner:

[0008] Sending a first instruction to the collection device through each of the links respectively, so that the collection device responds to the first instruction, determines the link through which the first instruction is received, and sends a link identifier of the determined link to the terminal device, wherein the link identifier is used to indicate that the link is a main link or an extended link;

[0009] Among the links, determining a main control link whose link identifier indicates a main link and an extended control link whose link identifier indicates an extended link;

[0010] An acquisition card that has established the main control link with the acquisition device is determined as the main acquisition card, and an acquisition card that has established the extended control link with the acquisition device but has not established the main control link is determined as the secondary acquisition card.

[0011] In a possible implementation manner, the acquiring each data frame acquired by the acquisition device in parallel according to the configured parameters by the main acquisition card and the auxiliary acquisition card includes:

[0012] The first sub-data frame in each data frame collected by the collection device is collected by the main collection card according to the configured parameters, and each second sub-data frame in each data frame collected by the collection device is collected by each auxiliary collection card according to the configured parameters, wherein the collection of the first sub-data frame and each second sub-data frame in the same data frame is performed in parallel, and the first sub-data frame and each second sub-data frame in the same data frame are obtained by dividing the same data frame.

[0013] In a possible implementation, the method further includes:

[0014] In response to a configuration request instruction for the acquisition device, determining and displaying parameters to be configured of the main acquisition card;

[0015] A parameter configuration instruction input for the displayed parameter to be configured is obtained as a parameter configuration instruction input for the main acquisition card.

[0016] In a possible implementation manner, the parameters to be configured include a first parameter used to instruct the main acquisition card to acquire data frames, and a second parameter used to instruct the main acquisition card to perform services other than acquiring data frames;

[0017] The method of synchronously configuring the parameters of the main acquisition card to the secondary acquisition card includes:

[0018] The first parameter of the main acquisition card is synchronously configured to the secondary acquisition card.

[0019] In a possible implementation manner, before determining the acquisition card that has established the extended control link with the acquisition device and has not established the main control link as the secondary acquisition card, the method further includes:

[0020] Verify whether the acquisition card information of all acquisition cards that have established the link with the acquisition device matches, wherein the acquisition card information includes one or more of a model, a version, and a number of links established with the acquisition device;

[0021] If they are the same, the step of determining the acquisition card that has established the extended control link with the acquisition device and has not established the main control link as the secondary acquisition card is performed.

[0022] In a possible implementation manner, the terminal device maintains a cache area corresponding to the acquisition device, and the method further includes:

[0023] Determine the total number of the main acquisition cards and the secondary acquisition cards corresponding to the acquisition device, and divide the cache area corresponding to the acquisition device into the total number of cache sub-areas as the first cache sub-area corresponding to the main acquisition card and the second cache sub-area corresponding to each of the secondary acquisition cards;

[0024] The collecting, by the main collection card according to the configured parameters, the first sub-data frame in each data frame collected by the collection device comprises:

[0025] The main acquisition card acquires the first sub-data frame in each data frame acquired by the acquisition device according to the configured parameters, and caches the first sub-data frame in the first cache sub-area;

[0026] The collecting of each second sub-data frame in each data frame collected by the collection device by each of the auxiliary collection cards according to the configured parameters comprises:

[0027] The second sub-data frames in each data frame collected by the collection device are collected by each of the sub-collection cards according to the configured parameters, and are cached in the second cache sub-areas corresponding to each of the sub-collection cards respectively;

[0028] The method further comprises:

[0029] In response to an output instruction for a target data frame collected by the acquisition device, a first sub-data frame and each second sub-data frame of the target data frame are read in sequence from all cache sub-areas in the cache area corresponding to the acquisition device, the read first sub-data frame and each second sub-data frame are spliced ​​to obtain the target data frame and output it.

[0030] In a possible implementation, the method further includes:

[0031] Determine the number of links established between each of the acquisition cards and the acquisition device;

[0032] The first sub-data frame and the second sub-data frame are obtained by dividing in the following manner:

[0033] Divide the same data frame collected by the acquisition device into the linked number of sub-data frames as the first sub-data frame corresponding to the main acquisition card and the second sub-data frame corresponding to the auxiliary acquisition card;

[0034] The step of dividing the buffer area corresponding to the acquisition device into the total number of buffer sub-areas as the buffer sub-areas corresponding to the main acquisition card and each of the secondary acquisition cards includes:

[0035] The cache area corresponding to the acquisition device is divided into cache sub-areas of the link number, which serve as a first cache sub-area corresponding to the main acquisition card and a second cache sub-area corresponding to each of the secondary acquisition cards.

[0036] In a possible implementation, the sending the first instruction to the collection device through each of the links respectively, so that the collection device responds to the first instruction, determines the link through which the first instruction is received, and sends the link identifier of the determined link to the terminal device, includes:

[0037] sending a reset command to the acquisition device through each of the links respectively, so that the acquisition device responds to the reset command and locks the link through which the first instruction is received;

[0038] In response to the link being locked, a read request for the link is sent to the collection device, so that the collection device returns a link identifier of the link indicated by the read request in response to the read request.

[0039] In a second aspect, an embodiment of the present application provides a data acquisition device based on multiple acquisition cards, the device comprising a terminal device and an acquisition device, the terminal device running multiple acquisition cards, the acquisition card being used to connect to the acquisition device, the acquisition device establishing a link with at least two acquisition cards, one of the at least two acquisition cards being a main acquisition card, and the other acquisition cards being secondary acquisition cards;

[0040] The terminal device is used to respond to the parameter configuration instruction input for the main acquisition card, configure the parameters of the main acquisition card according to the parameter configuration instruction, and synchronously configure the parameters of the main acquisition card to the auxiliary acquisition card; and collect each data frame collected by the acquisition device according to the configured parameters in parallel through the main acquisition card and the auxiliary acquisition card;

[0041] The acquisition device is used to acquire each of the data frames.

[0042] In a third aspect, an embodiment of the present application provides a data acquisition device based on multiple acquisition cards, which is applied to a terminal device, wherein the terminal device runs multiple acquisition cards, wherein the acquisition cards are used to connect to an acquisition device, wherein the acquisition device establishes a link with at least two acquisition cards, wherein one of the at least two acquisition cards is a main acquisition card, and the other acquisition cards are secondary acquisition cards, wherein the device comprises:

[0043] A parameter synchronization module, configured to respond to a parameter configuration instruction input for the main acquisition card, configure the parameters of the main acquisition card according to the parameter configuration instruction, and synchronize the parameters of the main acquisition card to the secondary acquisition card;

[0044] The first acquisition module is used to acquire each data frame acquired by the acquisition device in parallel according to the configured parameters through the main acquisition card and the auxiliary acquisition card.

[0045] In a possible implementation manner, the main acquisition card and the secondary acquisition card are determined in advance in the following manner:

[0046] Sending a first instruction to the collection device through each of the links respectively, so that the collection device responds to the first instruction, determines the link through which the first instruction is received, and sends a link identifier of the determined link to the terminal device, wherein the link identifier is used to indicate that the link is a main link or an extended link;

[0047] Among the links, determining a main control link whose link identifier indicates a main link and an extended control link whose link identifier indicates an extended link;

[0048] An acquisition card that has established the main control link with the acquisition device is determined as the main acquisition card, and an acquisition card that has established the extended control link with the acquisition device but has not established the main control link is determined as the secondary acquisition card.

[0049] In a possible implementation, the first acquisition module includes:

[0050] The first acquisition submodule is used to acquire the first sub-data frame in each data frame acquired by the acquisition device according to the configured parameters through the main acquisition card, and to respectively acquire the second sub-data frames in each data frame acquired by the acquisition device through each of the auxiliary acquisition cards according to the configured parameters, wherein the acquisition of the first sub-data frame and each of the second sub-data frames in the same data frame is performed in parallel, and the first sub-data frame and each of the second sub-data frames in the same data frame are obtained by dividing the same data frame.

[0051] In a possible implementation, the device further includes:

[0052] A parameter display module, used to determine and display the parameters to be configured of the main acquisition card in response to a configuration request instruction for the acquisition device;

[0053] The parameter configuration module is used to obtain parameter configuration instructions input for the displayed parameters to be configured as parameter configuration instructions input for the main acquisition card.

[0054] In a possible implementation manner, the parameters to be configured include a first parameter used to instruct the main acquisition card to acquire data frames, and a second parameter used to instruct the main acquisition card to perform services other than acquiring data frames;

[0055] The parameter synchronization module comprises:

[0056] The first synchronization submodule is used to synchronize the first parameter of the main acquisition card to the auxiliary acquisition card.

[0057] In a possible implementation, the device further includes:

[0058] An information verification module, used to verify whether the acquisition card information of all acquisition cards that have established the link with the acquisition device matches, wherein the acquisition card information includes one or more of a model, a version, and a number of links established with the acquisition device;

[0059] If they are the same, the step of determining the acquisition card that has established the extended control link with the acquisition device and has not established the main control link as the secondary acquisition card is performed.

[0060] In a possible implementation manner, the terminal device maintains a cache area corresponding to each of the acquisition devices, and the apparatus further includes:

[0061] A region division module, used to determine the total number of the main acquisition cards and the secondary acquisition cards corresponding to the acquisition device, and divide the cache area corresponding to the acquisition device into the total number of cache sub-areas as the first cache sub-area corresponding to the main acquisition card and the second cache sub-area corresponding to each of the secondary acquisition cards;

[0062] The first acquisition submodule includes:

[0063] A first acquisition unit, configured to acquire, through the main acquisition card, a first sub-data frame in each data frame acquired by the acquisition device according to configured parameters, and cache the first sub-data frame in the first cache sub-area;

[0064] The first acquisition submodule includes:

[0065] A second acquisition unit, used to respectively acquire the second sub-data frames in each data frame acquired by the acquisition device through each of the secondary acquisition cards according to the configured parameters, and cache them respectively in the second cache sub-areas corresponding to each of the secondary acquisition cards;

[0066] The device also includes:

[0067] A data output module is used to respond to an output instruction for a target data frame collected by the acquisition device, read the first sub-data frame and each second sub-data frame of the target data frame in sequence from all cache sub-areas in the cache area corresponding to the acquisition device, splice the read first sub-data frame and each second sub-data frame, obtain the target data frame and output it.

[0068] In a possible implementation, the device further includes:

[0069] A number determination module, used to determine the number of links established between each acquisition card and the acquisition device;

[0070] The first sub-data frame and the second sub-data frame are obtained by dividing in the following manner:

[0071] Divide the same data frame collected by the acquisition device into the linked number of sub-data frames as the first sub-data frame corresponding to the main acquisition card and the second sub-data frame corresponding to the auxiliary acquisition card;

[0072] The area division module comprises:

[0073] The first sub-module is used to divide the cache area corresponding to the acquisition device into the linked number of cache sub-areas as the first cache sub-area corresponding to the main acquisition card and the second cache sub-area corresponding to each of the secondary acquisition cards.

[0074] In a possible implementation, the identifier determination module includes:

[0075] Determine a first submodule, which is used to send a reset command to the acquisition device through each of the links, so that the acquisition device responds to the reset command and locks the link through which the first instruction is received;

[0076] A second submodule is determined, which is used to send a read request for the link to the acquisition device in response to the link being locked, so that the acquisition device returns a link identifier of the link indicated by the read request in response to the read request.

[0077] In a fourth aspect, an embodiment of the present application provides an electronic device, including:

[0078] Memory, used to store computer programs;

[0079] The processor is used to implement any of the above-mentioned data collection methods when executing the program stored in the memory.

[0080] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the above-mentioned data collection methods is implemented.

[0081] In a sixth aspect, an embodiment of the present application provides an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-mentioned data collection methods.

[0082] Beneficial effects of the embodiments of the present application:

[0083] The data acquisition method based on multiple acquisition cards provided in the embodiment of the present application automatically distinguishes between the main acquisition card and the auxiliary acquisition card in the acquisition card connected to the same acquisition device. For the same acquisition device, the user only needs to perform a one-time parameter configuration on the main acquisition card connected to the acquisition device, and the device can intelligently synchronize these parameters to all auxiliary acquisition cards connected to the acquisition device. This process avoids the cumbersome process of traditional card-by-card parameter configuration, greatly simplifies the operation steps, and improves data acquisition efficiency. It not only reduces the user's workload, but also fundamentally reduces the configuration errors that may be caused by human operation errors or negligence, thereby ensuring the accuracy of data acquisition. In the data acquisition process, a parallel acquisition mechanism is introduced, and each data frame is collected by the main acquisition card and the auxiliary acquisition card at the same time, further improving the data acquisition efficiency. In addition, by increasing the number of auxiliary acquisition cards, the input channel of the acquisition device can be easily expanded, and data acquisition requirements of different scales and complexities can be flexibly responded to, thereby enhancing the scalability and stability of data acquisition. In summary, the data acquisition method based on multiple acquisition cards proposed in this application not only simplifies user operations and improves data acquisition efficiency and accuracy, but also enhances the scalability and stability of data acquisition through automated and parallelized data acquisition and configuration processes.

[0084] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0086] Figure 1 A schematic diagram of the structure of an image acquisition product provided in an embodiment of the present application;

[0087] Figure 2 A schematic diagram of a flow chart of a data acquisition method based on multiple acquisition cards provided in an embodiment of the present application;

[0088] Figure 3 A schematic diagram of the structure of a data acquisition device based on multiple acquisition cards provided in an embodiment of the present application;

[0089] Figure 4a A schematic diagram of a first process for distinguishing between a main acquisition card and a secondary acquisition card provided in an embodiment of the present application;

[0090] Figure 4b A second flow chart of distinguishing between a main acquisition card and a secondary acquisition card provided in an embodiment of the present application;

[0091] Figure 5 A schematic diagram of the structure of the connection between the multi-acquisition card and the multi-acquisition device provided in the embodiment of the present application;

[0092] Figure 6 A schematic diagram of the process of synchronizing acquisition card parameters provided in an embodiment of the present application;

[0093] Figure 7 A schematic diagram of the process of modifying acquisition card parameters provided in an embodiment of the present application;

[0094] Figure 8 A schematic diagram of a data frame processing flow provided in an embodiment of the present application;

[0095] Fig. 9 A schematic diagram of the structure of the cache area provided in the embodiment of the present application;

[0096] Fig.10 A schematic diagram of the structure of a data acquisition device based on multiple acquisition cards provided in an embodiment of the present application;

[0097] Fig.11 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0098] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.

[0099] In order to more clearly explain the data acquisition method based on multiple acquisition cards provided by the present application, the application scenario of the data acquisition method based on multiple acquisition cards provided by the present application will be first exemplified below. It can be understood that the following example is only one possible application scenario of the data acquisition method based on multiple acquisition cards provided by the present application. In other possible embodiments, the data acquisition method based on multiple acquisition cards provided by the present application can also be applied to other possible application scenarios, and the following example does not impose any limitation on this.

[0100] Capture cards are devices that can collect, quantize and encode analog video signals. They are used to capture external photoelectric, video, audio and other analog signals and digitize them into computers and other platform devices for digital processing. They are mainly divided into image capture cards, video capture cards, audio capture cards, etc. Taking image capture cards as an example, in order to meet more extensive and flexible image acquisition needs, many image acquisition products that use camera and multi-capture card topology connection have emerged on the market. Figure 1 , Figure 1 This is a schematic diagram of the structure of the image acquisition product provided in the embodiment of the present application. The camera 100 is linked with multiple acquisition cards. For the convenience of description, Figure 1 In the example, only the establishment of a link between the camera 100 and two acquisition cards 3011 is used for explanation. The camera 100 captures image data, and the acquisition card 3011 is used to capture the image data captured by the camera 100 to the platform device 200.

[0101] However, although this multi-capture card solution provides powerful scalability and flexibility at the hardware level, it generally faces a series of challenges at the software level, especially in the design of client software or software development kit (SDK) interfaces. In the existing multi-capture card solution, users need to configure parameters for each capture card separately during use, that is, they need to enter the setting interface of each capture card one by one and manually adjust various parameters, such as resolution, frame rate, exposure time, etc. This one-by-one configuration method is not only cumbersome and inefficient, but also greatly increases the user's workload. Especially when multiple capture cards need to be configured at the same time or large-scale image acquisition tasks are performed, the problem is particularly prominent. And because each capture card needs to be configured separately, it must be ensured that the parameter settings of all capture cards connected to the same camera are completely consistent, otherwise it may cause problems such as abnormal image transmission or failure to output images. This strict requirement for parameter consistency not only increases the complexity of configuration, but also increases the risk of error. Users need to spend a lot of time and energy to check and verify the parameter settings of each capture card to ensure the stable operation of the entire device, thereby reducing the efficiency of image acquisition.

[0102] Based on the above problems, the embodiment of the present application provides a data acquisition method based on multiple acquisition cards, which is used to simplify user operations, improve data acquisition efficiency and accuracy, and enhance the scalability and stability of data acquisition. Figure 2 , Figure 2 A flow chart of a data acquisition method based on multiple acquisition cards provided in an embodiment of the present application, the method comprising:

[0103] S201, in response to a parameter configuration instruction input for a main acquisition card, configuring parameters of the main acquisition card according to the parameter configuration instruction, and synchronously configuring the parameters of the main acquisition card to the secondary acquisition card.

[0104] S202, each data frame collected by the collection device is collected in parallel by the main collection card and the auxiliary collection card according to the configured parameters.

[0105] By applying the above embodiment, by automatically distinguishing the acquisition cards corresponding to the acquisition device, and the main acquisition card and the secondary acquisition card in the acquisition card connected to the same acquisition device, for the same acquisition device, the user only needs to perform a one-time parameter configuration on the main acquisition card connected to the acquisition device, and the device can intelligently synchronize these parameters to all the secondary acquisition cards connected to the acquisition device. This process avoids the cumbersome process of traditional card-by-card parameter configuration, greatly simplifies the operation steps, and improves data acquisition efficiency. It not only reduces the user's workload, but also fundamentally reduces the configuration errors that may be caused by human operation errors or negligence, thereby ensuring the accuracy of data acquisition. In the data acquisition process, a parallel acquisition mechanism is introduced, and each data frame is collected by the main acquisition card and the secondary acquisition card at the same time, further improving the data acquisition efficiency. In addition, by increasing the number of secondary acquisition cards, the input channel of the acquisition device can be easily expanded, and data acquisition requirements of different scales and complexities can be flexibly responded to, thereby enhancing the scalability and stability of data acquisition. In summary, the data acquisition method based on multiple acquisition cards proposed in this application not only simplifies user operations and improves data acquisition efficiency and accuracy, but also enhances the scalability and stability of data acquisition through automated and parallelized data acquisition and configuration processes.

[0106] In order to more clearly explain the data acquisition method based on multiple acquisition cards of the present application, the data acquisition device that executes the data acquisition method is first explained below. Figure 3 , Figure 3The structural diagram of the data acquisition device based on multiple acquisition cards provided in the embodiment of the present application, the data acquisition device 300 includes a terminal device 301 and an acquisition device 302, the terminal device 301 runs multiple acquisition cards, the terminal device is connected to the acquisition device, and the acquisition device can be one or more. The acquisition device is linked to at least two acquisition cards, and one of the at least two acquisition cards is the main acquisition card, and the other acquisition cards are auxiliary acquisition cards. For the convenience of description, the figure only shows the case where the terminal device 301 includes two acquisition cards 3011, and the data acquisition device 300 includes only one acquisition device, that is, the acquisition device 302, and the two acquisition cards 3011 are linked to the acquisition device 302. Among them, the terminal device 301 is used to execute the aforementioned steps S201-step S202, and the acquisition device 302 is used to acquire each data frame.

[0107] Steps S201 and S202 are described below respectively:

[0108] In step S201, the primary acquisition card is one of the multiple acquisition cards that are linked to the acquisition device, and the secondary acquisition card is another acquisition card that is linked to the acquisition device.

[0109] The following will explain how to determine the main acquisition card and the secondary acquisition card corresponding to each acquisition device. Figure 4a , Figure 4a A first flow chart of distinguishing a primary acquisition card from a secondary acquisition card provided in an embodiment of the present application, the method includes:

[0110] S401, sending a first instruction to the collection device through each link respectively, so that the collection device responds to the first instruction, determines the link through which the first instruction is received, and sends a link identifier of the determined link to the terminal device, where the link identifier is used to indicate whether the link is a main link or an extended link.

[0111] S402: Determine, among the links, a main control link whose link identifier indicates a main link and an extended control link whose link identifier indicates an extended link.

[0112] S403, determining an acquisition card that has a main control link established with the acquisition device as a main acquisition card, and determining an acquisition card that has an extended control link established with the acquisition device but has not a main control link established as a secondary acquisition card.

[0113] In step S401, before sending the first instruction, the terminal device needs to first call PCIe (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) to obtain the number of included acquisition cards. Through a preset channel (such as the default channel 0), the terminal device will request and obtain the acquisition card information of each acquisition card, including but not limited to key information such as serial number, model specifications, and firmware version number.

[0114] After determining the acquisition cards connected to the same acquisition device, it is necessary to further determine the acquisition devices connected to the terminal device. This stage aims to confirm which acquisition devices have successfully established links with the corresponding acquisition cards. Once all acquisition devices that have successfully established links with the acquisition cards are confirmed, the terminal device will use these confirmed links to send the first instruction to each acquisition device.

[0115] The first instruction is a unique identifier that is used to prompt the acquisition device to feedback to the terminal device after successfully receiving the first instruction. The identifier is the link identifier of the link through which the acquisition device receives the first instruction. Therefore, the first instruction is not specific to a command with a fixed format or content, but is an arbitrary instruction that can be pre-defined and deployed between the terminal device and the acquisition device, as long as the terminal device and the acquisition device can recognize that the instruction has the function of triggering the return of the link identifier.

[0116] For example, in a possible embodiment, the first instruction may be a simple data packet, which includes a specific command code (such as "return link identifier") and possible other control information. The command code is agreed upon in advance by the terminal device and the acquisition device. Once the acquisition device detects the command code, it knows that the operation of returning the link identifier needs to be executed.

[0117] In another possible embodiment, the first instruction may be a Reset command. After receiving the reset command, the acquisition device responds to the reset command and locks the link through which the first instruction is received. In response to the link being locked, the terminal device sends a read request for the link to the acquisition device, so that the acquisition device returns a link identifier of the link indicated by the read request in response to the read request.

[0118] By applying the above embodiment, by sending a reset command to the acquisition device through each link respectively, it is possible to ensure that the acquisition device accurately locks and confirms its receiving channel, i.e., the link, when receiving the first instruction. Subsequently, by sending a read request to the locked link, the acquisition device accurately returns the corresponding link identifier. This process enables different communication links to be clearly identified and distinguished, providing a basis for subsequent data acquisition, processing, monitoring and other tasks, and also improving the efficiency and accuracy of data transmission, significantly improving the overall performance of data acquisition and user experience.

[0119] In step S402, the link identifier is used to indicate whether the link is a main link or an extended link, that is, the role of the link identifier is to enable the device to distinguish which link is the main link and which link is the extended link. Therefore, which link identifier represents the main link and which link identifier represents the extended link should be pre-defined and widely known between the terminal device and the acquisition device according to user needs or business needs. Exemplarily, the link identifier includes "link 1", "link 2", "link 3", "link 4", "link 5", "link 6", "link 7" and "link 8", and the link identifier may be pre-defined as "link 1" to represent the main link, and the link identifier is not "link 1" to represent the extended link. In the case where multiple link identifiers meet the conditions, the link represented by any one of the link identifiers may be determined as the main link. For example, a link identifier less than 5 is pre-defined to represent the main link, that is, the aforementioned link identifiers "link 1", "link 2", "link 3", and "link 4" are used to represent the main link, and any one of the links represented by "link 1", "link 2", "link 3", and "link 4" may be used as the main link.

[0120] In step S403, in a possible embodiment, for the acquisition device, the acquisition card with which the main control link is established, or the acquisition card with which the main control link is established and the extended control link is established is determined as the main acquisition card, and the acquisition card with which the extended control link is established and the main control link is not established is determined as the secondary acquisition card. However, in this way, there may be a mismatch in the acquisition card information of each acquisition card, such as the model, version, and the number of links established with the acquisition device, which will directly affect the accuracy and reliability of data acquisition.

[0121] Based on this, in another possible embodiment, when determining the secondary acquisition cards that have established an extended control link with the acquisition device but have not established a main control link, the acquisition card information of each acquisition card is first verified.

[0122] Specifically, the matching condition can be pre-set according to user needs. For example, the pre-set matching condition can be that the model of the acquisition card is the same and the number of links established with the acquisition device is the same, or the model of the acquisition card is the same and the number of links established with the acquisition device meets the ratio of 1:2, or the model of the acquisition card is the same, the version is the same and the number of links established with the acquisition device meets the ratio of 1:2, etc. Among them, the model of the acquisition card is used to indicate the hardware model of the acquisition card, and the version of the acquisition card is used to indicate the firmware version of the acquisition card.

[0123] By applying the above embodiment, by verifying whether key information such as the model, version, and number of links established with the acquisition device of each acquisition card connected to the acquisition device matches, the sub-acquisition cards corresponding to the acquisition device are determined only when they match, thereby ensuring the consistency of the model, version, or number of links of the determined acquisition cards. Through this pre-verification step, compatibility problems or data acquisition errors caused by mismatched acquisition card information can be effectively prevented, reducing the possibility of failures in subsequent data acquisition processes, improving the reliability and security of data acquisition, and providing users with a more stable and efficient data acquisition and processing experience.

[0124] The following is an explanation of the process of determining the main acquisition card and the secondary acquisition card. Figure 4b , Figure 4b The second flow diagram of distinguishing the main acquisition card from the auxiliary acquisition card provided in the embodiment of the present application includes:

[0125] S4001, obtaining the number of acquisition cards, that is, the aforementioned terminal device calls the relevant interface of the PCIe device to obtain the number of acquisition cards included;

[0126] S4002, obtaining information of each acquisition card, that is, the aforementioned terminal device will request and obtain acquisition card information of each acquisition card, including but not limited to key information such as serial number, model specification and firmware version number;

[0127] S4003, judging whether the link is connected to a main link or an extended link through the link identifier of the locked link;

[0128] S4004, determining whether there is a capture device connected to multiple capture cards at the same time, if so, executing step S4005, if not, executing step S4008;

[0129] S4005, check whether the acquisition card information matches, if yes, execute steps S4006 and 4007, if no, execute step S4008;

[0130] S4006, the acquisition card connected to the main link of the acquisition device is put into the main card list, and the card end register is configured to 0, that is, the acquisition card connected to the main link of the acquisition device is determined as the main acquisition card;

[0131] S4007, the acquisition card connected to the acquisition device extension link is added to the secondary card list, and the card end register is configured to be 1, that is, the acquisition card connected to the acquisition device extension link is determined as the secondary acquisition card;

[0132] S4008, all acquisition cards are put into the main card list.

[0133] In step S4003, it can be determined by the link identifier of the locked link whether the link is connected to the main link or the extended link. The following example takes the terminal devices including acquisition card 1, acquisition card 2, acquisition card 3 and acquisition card 4, the acquisition devices including acquisition device 1 and acquisition device 2, the first instruction is a Reset command, and the link identifier is 0 indicating the main link as an example. Figure 5 , how to determine whether the main link is an extended link by using the link identifier of the locked link, that is, the steps of determining the main control link and the extended control link by sending the first instruction in the aforementioned steps S401-S402 are described in detail:

[0134] See also Figure 5 , Figure 5 A structural diagram of the connection between multiple acquisition cards and multiple acquisition devices provided in an embodiment of the present application. After determining the acquisition card connected to the same acquisition device and confirming all acquisition devices that have successfully established links with the acquisition card, the data acquisition device will create 6 channels for each acquisition card, which are recorded as channel 0, channel 1, channel 2, channel 3, channel 4 and channel 5. Among them, channel 0 is used for embedded communication with the acquisition card end, mainly for reading acquisition card information and debugging. Channels 1-4 correspond to the links 0-3 of acquisition card 1, acquisition card 2 and acquisition card 3 in the figure. Channel 5 is used for acquisition card event feedback, such as acquisition card fault information feedback, etc.

[0135] The terminal device sends a Reset command to acquisition device 1 through channels 1-4, that is, the links 0-3 of acquisition card 1 and acquisition card 4 in the figure. The acquisition card 2 and acquisition card 3 in the figure send a Reset command to acquisition device 2. After receiving the Reset command, acquisition device 1 and acquisition device 2 will lock all the links that receive the command. The acquisition device returns the link identifier of each locked link and determines the link with the link identifier of 0 as the main control link. After the subsequent acquisition card information verification is passed, the acquisition card that maintains connection with the acquisition device through the main control link is the main acquisition card.

[0136] In addition, after finding the main link, the data acquisition device will write the unique main link identifier of each acquisition device into the register of the acquisition device through the main link. At this time, other extended links connected to the acquisition device can read the main link identifier.

[0137] like Figure 5 As shown, the link identifier of link 0 of acquisition card 1 is 0, the main link identifier of acquisition device 1 is 0, and the link identifier of link 1 of acquisition card 1 is 1. Similarly, the link identifiers of link 0 and link 1 of acquisition card 4 connected to acquisition device 1 are 4 and 5 respectively. After the subsequent acquisition card information is verified, it can be determined that acquisition card 1 connected to the main control link of acquisition device 1 is the main acquisition card, and acquisition card 4 is the secondary acquisition card. The master-slave relationship of acquisition card 2 and acquisition card 3 is determined similarly. Acquisition card 3 connected to the main control link of acquisition device 2 is the main acquisition card, and acquisition card 2 is the secondary acquisition card.

[0138] After the above steps are followed to determine the main acquisition card and the secondary acquisition card connected to the acquisition device, when each acquisition card is turned on, the device will control each acquisition card to synchronize its parameters, that is, synchronize the initial parameters of the main acquisition card to the secondary acquisition card. Figure 6 , Figure 6 The schematic diagram of the process of synchronizing acquisition card parameters provided in the embodiment of the present application includes:

[0139] S601, turn on the main acquisition card;

[0140] S602, determine whether there is a corresponding secondary acquisition card, if yes, execute step S603, if not, execute step S606;

[0141] S603, exporting the main acquisition card parameters;

[0142] S604, opening the secondary acquisition card;

[0143] S605, importing the parameters of the main acquisition card into the secondary acquisition card;

[0144] S606, the acquisition card is opened successfully.

[0145] That is, when the user opens the main acquisition card, the data acquisition device will traverse the list of secondary acquisition cards (the secondary acquisition card information will record the information of the main acquisition card). If a secondary acquisition card is found, the parameter information of the main acquisition card needs to be synchronized to the secondary acquisition card. The acquisition card parameters may include acquisition frequency, resolution, transmission rate, accuracy, interface type, cache type, cache size and other parameters.

[0146] After turning on each acquisition card, in one possible method, the user can manually input parameter configuration instructions to the terminal device, and then the device will directly adjust the parameter settings of the main acquisition card according to these instructions. However, this method may increase the difficulty of configuration due to complex operations, thereby reducing configuration efficiency, thereby affecting the timeliness and accuracy of data collection, and it is difficult to meet the diverse needs of users.

[0147] Based on this, in another possible embodiment, when a user initiates a configuration request for any acquisition device, the terminal device can recognize and respond to the request, automatically retrieve and display all the parameters to be configured of the main acquisition card associated with the acquisition device. The user then only needs to select and adjust these clearly displayed parameters to be configured, and enter the corresponding configuration instructions.

[0148] By applying the above embodiment, by automatically responding to configuration request instructions and displaying the parameters to be configured in a visual manner, the user can intuitively obtain the original parameters of the main acquisition card, and personalize the main acquisition card of each acquisition device according to actual needs, so that the configuration process is faster and more accurate, meeting the data acquisition needs in different application scenarios, improving the user experience, greatly improving the parameter configuration efficiency, enhancing the flexibility of parameter configuration, improving the accuracy and reliability of parameter configuration, and ensuring the accuracy and stability of data acquisition.

[0149] After the parameters of the main acquisition card are modified, the parameters of the secondary acquisition card need to be modified synchronously to ensure the success rate and accuracy of data acquisition. Figure 7 , Figure 7 The flowchart of modifying acquisition card parameters provided in the embodiment of the present application includes:

[0150] S701, modify the main acquisition card parameters;

[0151] S702, determine whether there is a corresponding secondary acquisition card, if yes, execute step S703, if not, execute step S705;

[0152] S703, find the corresponding secondary acquisition card;

[0153] S704, modify the secondary acquisition card parameters;

[0154] S705: Parameter modification is successful.

[0155] Through the above steps, it can be ensured that the main acquisition card and the auxiliary acquisition card are completely consistent when acquiring data, preventing the user from forgetting to modify the parameters of another card after modifying the parameters of one card, resulting in data abnormality. At the same time, it can also simplify user operations and improve user experience.

[0156] In a possible embodiment, it may be preferred to synchronize all parameters of the modified main acquisition card (including first parameters directly related to the acquisition data frame, such as acquisition frequency, resolution, transmission rate, accuracy, etc., and second parameters not directly related to the acquisition data frame, such as interface type, buffer type, buffer size, etc.) to the secondary acquisition card without distinction. However, this approach may unnecessarily occupy the resources of the terminal device, especially when those non-critical second parameters are synchronized to the secondary acquisition card, which may cause a waste of resources.

[0157] Based on this, in another possible embodiment, when synchronizing the modified parameters of the main acquisition card to the secondary acquisition card, only the first parameter related to the acquisition data frame is synchronized to the secondary acquisition card.

[0158] The application of the above embodiment effectively avoids synchronizing unnecessary second parameters to the secondary acquisition card, thereby significantly reducing the resource usage of the terminal device and avoiding waste of resources. At the same time, since only the key acquisition parameters are synchronized, it ensures that the secondary acquisition card can quickly and accurately perform data acquisition according to the configuration of the main acquisition card, thereby improving the efficiency and accuracy of data synchronization. In addition, this refined synchronization mechanism also makes the configuration of the data acquisition device more flexible, and can flexibly adjust the synchronization parameter range according to different acquisition requirements, further improving the performance of the data acquisition device and user satisfaction.

[0159] In the subsequent data collection process, if it is necessary to obtain some parameter information of the secondary acquisition card, the terminal device can display the hidden parameter information of the secondary acquisition card by adding a configuration file.

[0160] In step S202, the main acquisition card and the auxiliary acquisition card acquire the data frames acquired by the acquisition device in parallel according to the configured parameters.

[0161] In a possible embodiment, the main acquisition card and the auxiliary acquisition card can collect different data frames in parallel. For example, the data frames collected by the acquisition device include data frame 1, data frame 2, data frame 3 and data frame 4. The acquisition card includes the main acquisition card 1 and the auxiliary acquisition card 2. When the main acquisition card 1 collects data frame 1, the auxiliary acquisition card 2 collects data frame 2. When the main acquisition card 1 collects data frame 3, the auxiliary acquisition card 2 collects data frame 4. However, in this way, due to the different sizes of data frames, the acquisition speed is also different. There may be a situation where some acquisition cards have a greater acquisition pressure and other acquisition cards have a longer idle time, resulting in low data acquisition efficiency.

[0162] Based on this, in another possible embodiment, in order to improve data acquisition efficiency, the main acquisition card and the auxiliary acquisition card may acquire the same data frame in parallel, specifically:

[0163] The main acquisition card corresponding to the acquisition device acquires the first sub-data frame in each data frame acquired by the acquisition device according to the configured parameters, and the secondary acquisition cards corresponding to the acquisition device respectively acquire the second sub-data frames in each data frame acquired by the acquisition device according to the configured parameters.

[0164] The acquisition of the first sub-data frame and each second sub-data frame in the same data frame is performed in parallel, and the first sub-data frame and each second sub-data frame in the same data frame are obtained by dividing the same data frame.

[0165] Among them, the first sub-data frame and each second sub-data frame are obtained by dividing the same data frame. In a possible embodiment, the same data frame can be obtained by equally dividing it according to the number of acquisition cards connected to the acquisition device. For example, the acquisition device is connected with three acquisition cards, including a main acquisition card 1, a sub-acquisition card 2, and a sub-acquisition card 3. Then, the same data frame is equally divided into three parts, and the first part of the data frame is used as data frame 1, the second part of the data frame is used as data frame 2, and the third part of the data frame is used as data frame 3, a total of three data frames, and the main acquisition card 1 collects data frame 1, the sub-acquisition card 2 collects data frame 2, and the sub-acquisition card 3 collects data frame 3. However, in this way, since the number of links established between the acquisition devices of each acquisition card is inconsistent, if the data frames are equally divided according to the number of acquisition cards, there may be links on some acquisition cards that are in an idle state during the data acquisition process, and links on some acquisition cards that are in an overloaded state during the data acquisition process, which may cause data acquisition abnormalities and low data acquisition efficiency.

[0166] Based on this, in another possible embodiment, resource allocation of data acquisition is optimized, acquisition efficiency and flexibility are improved, and data frames are flexibly divided according to the number of links established between each acquisition card and the acquisition device.

[0167] Exemplarily, the acquisition device is connected to three acquisition cards, including a main acquisition card 1, a sub-acquisition card 2 and a sub-acquisition card 3. The number of links between the main acquisition card 1 and the acquisition device is 1, the number of links between the sub-acquisition card 2 and the acquisition device is 2, and the number of links between the sub-acquisition card 3 and the acquisition device is 1. Then, the same data frame is first divided into four parts, the first part of the data frame is used as data frame 1, the second part of the data frame and the third part are used as data frame 2, and the fourth part of the data frame is used as data frame 3, for a total of three data frames. Data frame 1 is collected by the main acquisition card 1, data frame 2 is collected by the sub-acquisition card 2, and data frame 3 is collected by the sub-acquisition card 3.

[0168] By applying the above embodiment, the number of links established between each acquisition card (including the main acquisition card and the auxiliary acquisition card) and the acquisition device is accurately determined for each acquisition device, and the same acquired data frame is divided into a corresponding number of sub-data frames (i.e., the first sub-data frame corresponding to the main acquisition card and the second sub-data frame corresponding to the auxiliary acquisition card) accordingly. The data frames are dynamically divided according to the number of links of the acquisition cards, thereby avoiding the problem of resource imbalance caused by simple equal division, effectively reducing the impact of some acquisition cards on the overall acquisition efficiency due to overload, and also preventing other acquisition cards from wasting resources due to idleness, thereby improving the efficiency, flexibility and adaptability of data acquisition, and improving the accuracy and reliability of data acquisition.

[0169] The above has described the specific method of collecting data frames when the acquisition device is connected to both the main acquisition card and the secondary acquisition card. However, in some scenarios, the acquisition device may only be connected to the main acquisition card. In this case, for the acquisition device that does not correspond to the secondary acquisition card, the main acquisition card corresponding to the acquisition device collects the data frames collected by the acquisition device according to the configured parameters.

[0170] After each data frame is acquired, a buffer area corresponding to the acquisition device is maintained in the terminal device for storing each acquired data frame.

[0171] For an acquisition device that is not connected to a secondary acquisition card, the main acquisition card can directly acquire each data frame acquired by the acquisition device according to the configured parameters and cache it in a cache area corresponding to the acquisition device.

[0172] Corresponding to the acquisition device connected with the secondary acquisition card, the total number of the main acquisition cards and the secondary acquisition cards corresponding to the acquisition device is first determined, and the cache area corresponding to the acquisition device is divided into a total number of cache sub-areas, which are used as the first cache sub-area corresponding to the main acquisition card corresponding to the acquisition device and the second cache sub-area corresponding to each of the secondary acquisition cards. After the data acquisition is completed, the first sub-data frame acquired by the main acquisition card is cached in the first cache sub-area, and the second sub-data frames acquired by each of the secondary acquisition cards are cached in the corresponding second cache sub-areas.

[0173] By applying the above embodiment, an independent cache area is maintained in the terminal device for the acquisition device with a main and a sub-acquisition card, and these cache areas are finely divided into the corresponding cache sub-areas of the main acquisition card and each sub-acquisition card, which significantly improves the flexibility and parallel processing capability of data acquisition, and can achieve the purpose of large data transmission without central processing unit copying, and reduce the central processing unit occupancy rate. At the same time, the independent division of the cache sub-areas ensures the security and consistency of the data, avoids mutual interference between data, and provides a more reliable and orderly data source for subsequent data processing and analysis.

[0174] Corresponding to the division of the same data frame mentioned above, when dividing the first cache sub-area and each second cache sub-area, in order to effectively reduce the impact of some cache areas on the overall data storage efficiency due to overload, and also prevent other caches from wasting resources due to idleness, the efficiency, flexibility and adaptability of data storage are improved, and the reliability of data storage is improved. The cache area corresponding to the acquisition device can be divided into the linked number of cache sub-areas, as the first cache sub-area corresponding to the main acquisition card corresponding to the acquisition device and the second cache sub-area corresponding to each of the secondary acquisition cards.

[0175] After the data frames are stored in each cache sub-area, the terminal device can also splice the stored data frames and output them to other devices.

[0176] For a collection device that is not connected to a secondary collection card, the data frames stored in the buffer area corresponding to the collection device can be directly spliced ​​and output directly.

[0177] Corresponding to the acquisition device connected to each sub-acquisition card, when the terminal device receives the output instruction for the target data frame collected by the acquisition device, it reads the first sub-data frame and each second sub-data frame of the target data frame in sequence from all cache sub-areas in the cache area corresponding to the acquisition device, splices the read first sub-data frame and each second sub-data frame, obtains the target data frame and outputs it.

[0178] In a possible embodiment, in order to improve the accuracy of data output, the frame identifiers of the first sub-data frame and the second sub-data frame read out sequentially can also be checked. When the frame identifiers are the same, the first sub-data frame and each second sub-data frame are spliced ​​to obtain the target data frame and output.

[0179] By applying the above embodiment, in a complex scenario where multiple slave acquisition cards are connected, when a specific output instruction is received, the corresponding data frame parts (including the first sub-data frame of the main acquisition card and the second sub-data frame of each slave acquisition card) can be accurately retrieved and spliced ​​from each cache sub-area, thereby restoring the complete target data frame, which not only ensures the integrity and accuracy of the data, but also effectively reduces the data waiting time and processing delay through parallel processing and cache optimization, thereby improving the response speed and data processing capability of the overall device.

[0180] In order to more clearly explain the process of data frame acquisition, data frame storage and target data frame output, the following example will be taken as an example in which the acquisition device includes a main acquisition card and a secondary acquisition card, and the number of links established between the acquisition card and the acquisition device is the same. Figure 7 For detailed explanation, Figure 8 The schematic diagram of the process of data frame processing provided in the embodiment of the present application includes:

[0181] S801, allocating a cache area and registering it in a configuration file containing camera and capture card information;

[0182] S802, dividing the cache area into two and putting them into two input cache lists in the data set respectively, that is, obtaining a first cache sub-area and a second cache sub-area;

[0183] S803, start the stream acquisition thread, that is, start collecting data frames;

[0184] S804, obtaining a first cache sub-region;

[0185] S805, obtaining a second cache sub-region;

[0186] S806, determining whether the frame identifiers of the data frames read from the first cache sub-area and the second cache sub-area are equal, if so, executing step S807, if not, executing step S808;

[0187] S807, putting it into the output buffer list, that is, splicing to obtain the target data frame and output it, and returning to execute step S804;

[0188] S808, discard the frame data and return to execute step S804.

[0189] In step S802, the cache area is divided into two logically. The cache area is still a complete cache, but it is divided into "two" caches by means of pointers. For specific implementation, see Fig. 9 As shown, Fig. 9 A schematic diagram of the structure of the cache area provided for an embodiment of the present application, wherein 901 is a first cache sub-area, 902 is a second cache sub-area, the first address of the cache area is used as the first address of the "first cache sub-area", and the address of the middle position is used as the first address of the "second cache sub-area".

[0190] In step S806 and step S807, the frame identifiers of the data frames read from the first cache sub-area and the second cache sub-area are first written into the output cache list, and then it is determined whether the frame identifiers of the two data frames are the same. If they are the same, DMA (Direct Memory Access) is enabled, and the data frames are read from the first cache sub-area and the second cache sub-area by DMA, and are put into the output cache list. If they are not the same, the data frame with the smaller frame identifier is discarded.

[0191] Corresponding to the aforementioned data acquisition method, the present application also provides a data acquisition device, which is applied to a terminal device, wherein the terminal device runs multiple acquisition cards, the acquisition cards are used to connect to the acquisition device, the acquisition device establishes a link with at least two acquisition cards, and one of the at least two acquisition cards is a main acquisition card, and the other acquisition cards are auxiliary acquisition cards, see Fig.10 , Fig.10 A schematic diagram of the structure of a data acquisition device based on multiple acquisition cards provided in an embodiment of the present application, the device comprising:

[0192] A parameter synchronization module 1001 is used to respond to a parameter configuration instruction input for the main acquisition card, configure the parameters of the main acquisition card according to the parameter configuration instruction, and synchronize the parameters of the main acquisition card to the secondary acquisition card;

[0193] The first acquisition module 1002 is used to acquire each data frame acquired by the acquisition device in parallel according to the configured parameters through the main acquisition card and the auxiliary acquisition card.

[0194] By applying the above embodiment, by automatically distinguishing the main acquisition card and the secondary acquisition card in the acquisition card connected to the same acquisition device, for the same acquisition device, the user only needs to perform a one-time parameter configuration on the main acquisition card connected to the acquisition device, and the device can intelligently synchronize these parameters to all the secondary acquisition cards connected to the acquisition device. This process avoids the cumbersome process of traditional card-by-card parameter configuration, greatly simplifies the operation steps, improves the data acquisition efficiency, not only reduces the user's workload, but also fundamentally reduces the configuration errors that may be caused by human operation errors or negligence, thereby ensuring the accuracy of data acquisition. In the data acquisition process, a parallel acquisition mechanism is introduced, and each data frame is collected by the main acquisition card and the secondary acquisition card at the same time, further improving the data acquisition efficiency. In addition, by increasing the number of secondary acquisition cards, the input channel of the acquisition device can be easily expanded, and data acquisition requirements of different scales and complexities can be flexibly responded to, thereby enhancing the scalability and stability of the data acquisition device. In summary, the data acquisition method based on multiple acquisition cards proposed in this application not only simplifies user operations, improves data acquisition efficiency and accuracy, but also enhances the scalability and stability of data acquisition through automated and parallelized data acquisition and configuration processes.

[0195] In a possible implementation manner, the main acquisition card and the secondary acquisition card are determined in advance in the following manner:

[0196] Sending a first instruction to the collection device through each of the links respectively, so that the collection device responds to the first instruction, determines the link through which the first instruction is received, and sends a link identifier of the determined link to the terminal device, wherein the link identifier is used to indicate that the link is a main link or an extended link;

[0197] Among the links, determining a main control link whose link identifier indicates a main link and an extended control link whose link identifier indicates an extended link;

[0198] An acquisition card that has established the main control link with the acquisition device is determined as the main acquisition card, and an acquisition card that has established the extended control link with the acquisition device but has not established the main control link is determined as the secondary acquisition card.

[0199] In a possible implementation, the first acquisition module includes:

[0200] The first acquisition submodule is used to acquire the first sub-data frame in each data frame acquired by the acquisition device according to the configured parameters through the main acquisition card, and to respectively acquire the second sub-data frames in each data frame acquired by the acquisition device through each of the auxiliary acquisition cards according to the configured parameters, wherein the acquisition of the first sub-data frame and each of the second sub-data frames in the same data frame is performed in parallel, and the first sub-data frame and each of the second sub-data frames in the same data frame are obtained by dividing the same data frame.

[0201] In a possible implementation, the device further includes:

[0202] A parameter display module, used to determine and display the parameters to be configured of the main acquisition card in response to a configuration request instruction for the acquisition device;

[0203] The parameter configuration module is used to obtain parameter configuration instructions input for the displayed parameters to be configured as parameter configuration instructions input for the main acquisition card.

[0204] In a possible implementation manner, the parameters to be configured include a first parameter used to instruct the main acquisition card to acquire data frames, and a second parameter used to instruct the main acquisition card to perform services other than acquiring data frames;

[0205] The parameter synchronization module comprises:

[0206] The first synchronization submodule is used to synchronize the first parameter of the main acquisition card to the auxiliary acquisition card.

[0207] In a possible implementation, the device further includes:

[0208] An information verification module, used to verify whether the acquisition card information of all acquisition cards that have established the link with the acquisition device matches, wherein the acquisition card information includes one or more of a model, a version, and a number of links established with the acquisition device;

[0209] If they are the same, the step of determining the acquisition card that has established the extended control link with the acquisition device and has not established the main control link as the secondary acquisition card is performed.

[0210] In a possible implementation manner, the terminal device maintains a cache area corresponding to each of the acquisition devices, and the apparatus further includes:

[0211] A region division module, used to determine the total number of the main acquisition cards and the secondary acquisition cards corresponding to the acquisition device, and divide the cache area corresponding to the acquisition device into the total number of cache sub-areas as the first cache sub-area corresponding to the main acquisition card and the second cache sub-area corresponding to each of the secondary acquisition cards;

[0212] The first acquisition submodule includes:

[0213] A first acquisition unit, configured to acquire, through the main acquisition card, a first sub-data frame in each data frame acquired by the acquisition device according to configured parameters, and cache the first sub-data frame in the first cache sub-area;

[0214] The first acquisition submodule includes:

[0215] A second acquisition unit, used to respectively acquire the second sub-data frames in each data frame acquired by the acquisition device through each of the secondary acquisition cards according to the configured parameters, and cache them respectively in the second cache sub-areas corresponding to each of the secondary acquisition cards;

[0216] The device also includes:

[0217] A data output module is used to respond to an output instruction for a target data frame collected by the acquisition device, read the first sub-data frame and each second sub-data frame of the target data frame in sequence from all cache sub-areas in the cache area corresponding to the acquisition device, splice the read first sub-data frame and each second sub-data frame, obtain the target data frame and output it.

[0218] In a possible implementation, the device further includes:

[0219] A number determination module, used to determine the number of links established between each acquisition card and the acquisition device;

[0220] The first sub-data frame and the second sub-data frame are obtained by dividing in the following manner:

[0221] Divide the same data frame collected by the acquisition device into the linked number of sub-data frames as the first sub-data frame corresponding to the main acquisition card and the second sub-data frame corresponding to the auxiliary acquisition card;

[0222] The area division module comprises:

[0223] The first sub-module is used to divide the cache area corresponding to the acquisition device into the linked number of cache sub-areas as the first cache sub-area corresponding to the main acquisition card and the second cache sub-area corresponding to each of the secondary acquisition cards.

[0224] In a possible implementation, the identifier determination module includes:

[0225] Determine a first submodule, which is used to send a reset command to the acquisition device through each of the links, so that the acquisition device responds to the reset command and locks the link through which the first instruction is received;

[0226] A second submodule is determined, which is used to send a read request for the link to the acquisition device in response to the link being locked, so that the acquisition device returns a link identifier of the link indicated by the read request in response to the read request.

[0227] The present application also provides an electronic device, such as Fig.11 As shown, including:

[0228] Memory 1101, used for storing computer programs;

[0229] The processor 1102 is used to implement the following steps when executing the program stored in the memory 1101:

[0230] In response to a parameter configuration instruction input for the main acquisition card, configure the parameters of the main acquisition card according to the parameter configuration instruction, and synchronously configure the parameters of the main acquisition card to the secondary acquisition card;

[0231] The main acquisition card and the auxiliary acquisition card acquire each data frame acquired by the acquisition device in parallel according to the configured parameters.

[0232] In addition, the electronic device may further include a communication bus and / or a communication interface, and the processor 1102, the communication interface, and the memory 1101 communicate with each other via the communication bus.

[0233] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0234] The communication interface is used for communication between the above electronic device and other devices.

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

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

[0237] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned data acquisition methods are implemented.

[0238] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any of the data collection methods in the above embodiments.

[0239] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.

[0240] It should be noted that, in this article, relational terms such as first and second, etc. 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.

[0241] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0242] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A data acquisition method based on multiple acquisition cards, characterized in that: Applied to a terminal device, the terminal device runs multiple acquisition cards, the acquisition cards are used to connect to the acquisition device, the acquisition device establishes a link with at least two acquisition cards, one of the at least two acquisition cards is a main acquisition card, and the other acquisition cards are auxiliary acquisition cards; In response to a parameter configuration instruction input for the main acquisition card, configure the parameters of the main acquisition card according to the parameter configuration instruction, and synchronously configure the parameters of the main acquisition card to the secondary acquisition card; The main acquisition card and the auxiliary acquisition card acquire each data frame acquired by the acquisition device in parallel according to the configured parameters.

2. The method according to claim 1, characterized in that: The main acquisition card and the auxiliary acquisition card are determined in advance in the following manner: Sending a first instruction to the collection device through each of the links respectively, so that the collection device responds to the first instruction, determines the link through which the first instruction is received, and sends a link identifier of the determined link to the terminal device, wherein the link identifier is used to indicate that the link is a main link or an extended link; Among the links, determining a main control link whose link identifier indicates a main link and an extended control link whose link identifier indicates an extended link; An acquisition card that has established the main control link with the acquisition device is determined as the main acquisition card, and an acquisition card that has established the extended control link with the acquisition device but has not established the main control link is determined as the secondary acquisition card.

3. The method according to claim 1, characterized in that The collecting of each data frame collected by the collection device according to the configured parameters by the main collection card and the auxiliary collection card in parallel includes: The first sub-data frame in each data frame collected by the collection device is collected by the main collection card according to the configured parameters, and each second sub-data frame in each data frame collected by the collection device is collected by each auxiliary collection card according to the configured parameters, wherein the collection of the first sub-data frame and each second sub-data frame in the same data frame is performed in parallel, and the first sub-data frame and each second sub-data frame in the same data frame are obtained by dividing the same data frame.

4. The method according to claim 1, characterized in that: The method further comprises: In response to a configuration request instruction for the acquisition device, determining and displaying parameters to be configured of the main acquisition card; A parameter configuration instruction input for the displayed parameter to be configured is obtained as a parameter configuration instruction input for the main acquisition card.

5. The method according to claim 4, characterized in that The parameters to be configured include a first parameter for instructing the main acquisition card to acquire data frames, and a second parameter for instructing the main acquisition card to perform services other than acquiring data frames; The method of synchronously configuring the parameters of the main acquisition card to the secondary acquisition card includes: The first parameter of the main acquisition card is synchronously configured to the secondary acquisition card.

6. The method according to claim 2, characterized in that Before determining the acquisition card that has established the extended control link with the acquisition device and has not established the main control link as the secondary acquisition card, the method further includes: Verify whether the acquisition card information of all acquisition cards that have established the link with the acquisition device matches, wherein the acquisition card information includes one or more of a model, a version, and a number of links established with the acquisition device; If they are the same, the step of determining the acquisition card that has established the extended control link with the acquisition device and has not established the main control link as the secondary acquisition card is performed.

7. The method according to claim 3, characterized in that The terminal device maintains a cache area corresponding to the acquisition device, and the method further includes: Determine the total number of the main acquisition cards and the secondary acquisition cards corresponding to the acquisition device, and divide the cache area corresponding to the acquisition device into the total number of cache sub-areas as the first cache sub-area corresponding to the main acquisition card and the second cache sub-area corresponding to each of the secondary acquisition cards; The collecting, by the main collection card according to the configured parameters, the first sub-data frame in each data frame collected by the collection device comprises: The main acquisition card acquires the first sub-data frame in each data frame acquired by the acquisition device according to the configured parameters, and caches the first sub-data frame in the first cache sub-area; The collecting of each second sub-data frame in each data frame collected by the collection device by each of the auxiliary collection cards according to the configured parameters comprises: The second sub-data frames in each data frame collected by the collection device are collected by each of the sub-collection cards according to the configured parameters, and are cached in the second cache sub-areas corresponding to each of the sub-collection cards respectively; The method further comprises: In response to an output instruction for a target data frame collected by the acquisition device, a first sub-data frame and each second sub-data frame of the target data frame are read in sequence from all cache sub-areas in the cache area corresponding to the acquisition device, the read first sub-data frame and each second sub-data frame are spliced ​​to obtain the target data frame and output it.

8. The method according to claim 7, characterized in that The method further comprises: Determine the number of links established between each of the acquisition cards and the acquisition device; The first sub-data frame and the second sub-data frame are obtained by dividing in the following manner: Divide the same data frame collected by the acquisition device into the linked number of sub-data frames as the first sub-data frame corresponding to the main acquisition card and the second sub-data frame corresponding to the auxiliary acquisition card; The step of dividing the buffer area corresponding to the acquisition device into the total number of buffer sub-areas as the buffer sub-areas corresponding to the main acquisition card and each of the secondary acquisition cards includes: The cache area corresponding to the acquisition device is divided into cache sub-areas of the link number, which serve as a first cache sub-area corresponding to the main acquisition card and a second cache sub-area corresponding to each of the secondary acquisition cards.

9. The method according to claim 2, characterized in that: The sending of the first instruction to the collection device through each of the links respectively, so that the collection device responds to the first instruction, determines the link through which the first instruction is received, and sends the link identifier of the determined link to the terminal device, includes: sending a reset command to the acquisition device through each of the links respectively, so that the acquisition device responds to the reset command and locks the link through which the first instruction is received; In response to the link being locked, a read request for the link is sent to the collection device, so that the collection device returns a link identifier of the link indicated by the read request in response to the read request.

10. A data acquisition device based on multiple acquisition cards, characterized in that: The device includes a terminal device and an acquisition device, wherein the terminal device runs a plurality of acquisition cards, wherein the acquisition cards are used to connect to the acquisition device, wherein the acquisition device establishes a link with at least two acquisition cards, wherein one acquisition card among the at least two acquisition cards is a main acquisition card, and the other acquisition cards are secondary acquisition cards; The terminal device is used to respond to the parameter configuration instruction input for the main acquisition card, configure the parameters of the main acquisition card according to the parameter configuration instruction, and synchronously configure the parameters of the main acquisition card to the auxiliary acquisition card; and collect each data frame collected by the acquisition device according to the configured parameters in parallel through the main acquisition card and the auxiliary acquisition card; The acquisition device is used to acquire each of the data frames.

11. A data acquisition device based on multiple acquisition cards, characterized in that: Applied to a terminal device, the terminal device runs multiple acquisition cards, the acquisition cards are used to connect to the acquisition device, the acquisition device is linked to at least two acquisition cards, one of the at least two acquisition cards is a main acquisition card, and the other acquisition cards are auxiliary acquisition cards, the device comprises: A parameter synchronization module, configured to respond to a parameter configuration instruction input for the main acquisition card, configure the parameters of the main acquisition card according to the parameter configuration instruction, and synchronize the parameters of the main acquisition card to the secondary acquisition card; The first acquisition module is used to acquire each data frame acquired by the acquisition device in parallel according to the configured parameters through the main acquisition card and the auxiliary acquisition card.

12. The device according to claim 11, characterized in that The main acquisition card and the auxiliary acquisition card are determined in advance in the following manner: Sending a first instruction to the collection device through each of the links respectively, so that the collection device responds to the first instruction, determines the link through which the first instruction is received, and sends a link identifier of the determined link to the terminal device, wherein the link identifier is used to indicate that the link is a main link or an extended link; Among the links, determining a main control link whose link identifier indicates a main link and an extended control link whose link identifier indicates an extended link; Determine the acquisition card that has established the main control link with the acquisition device as the main acquisition card, and determine the acquisition card that has established the extended control link with the acquisition device but has not established the main control link as the secondary acquisition card; The first acquisition module includes: A first acquisition submodule, used for acquiring the first sub-data frame in each data frame acquired by the acquisition device according to the configured parameters through the main acquisition card, and acquiring each second sub-data frame in each data frame acquired by the acquisition device according to the configured parameters through each of the secondary acquisition cards, wherein the acquisition of the first sub-data frame and each second sub-data frame in the same data frame is performed in parallel, and the first sub-data frame and each second sub-data frame in the same data frame are obtained by dividing the same data frame; The device also includes: A parameter display module, used to determine and display the parameters to be configured of the main acquisition card in response to a configuration request instruction for the acquisition device; A parameter configuration module, used to obtain parameter configuration instructions input for the displayed parameters to be configured as parameter configuration instructions input for the main acquisition card; The parameters to be configured include a first parameter for instructing the main acquisition card to acquire data frames, and a second parameter for instructing the main acquisition card to perform services other than acquiring data frames; The parameter synchronization module comprises: A first synchronization submodule, used for synchronously configuring the first parameter of the main acquisition card to the secondary acquisition card; The device also includes: An information verification module, used to verify whether the acquisition card information of all acquisition cards that have established the link with the acquisition device matches, wherein the acquisition card information includes one or more of a model, a version, and a number of links established with the acquisition device; If they are the same, the step of determining the acquisition card that has established the extended control link with the acquisition device and has not established the main control link as the secondary acquisition card is performed; The terminal device maintains a cache area corresponding to each of the acquisition devices, and the apparatus further includes: A region division module, used to determine the total number of the main acquisition cards and the secondary acquisition cards corresponding to the acquisition device, and divide the cache area corresponding to the acquisition device into the total number of cache sub-areas as the first cache sub-area corresponding to the main acquisition card and the second cache sub-area corresponding to each of the secondary acquisition cards; The first acquisition submodule includes: A first acquisition unit, configured to acquire, through the main acquisition card, a first sub-data frame in each data frame acquired by the acquisition device according to configured parameters, and cache the first sub-data frame in the first cache sub-area; The first acquisition submodule includes: A second acquisition unit, used to respectively acquire the second sub-data frames in each data frame acquired by the acquisition device through each of the secondary acquisition cards according to the configured parameters, and cache them respectively in the second cache sub-areas corresponding to each of the secondary acquisition cards; The device also includes: A data output module, configured to respond to an output instruction for a target data frame collected by the acquisition device, sequentially read a first sub-data frame and each second sub-data frame of the target data frame from all cache sub-areas in the cache area corresponding to the acquisition device, splice the read first sub-data frame and each second sub-data frame, obtain the target data frame, and output it; The device also includes: A number determination module, used to determine the number of links established between each acquisition card and the acquisition device; The first sub-data frame and the second sub-data frame are obtained by dividing in the following manner: Divide the same data frame collected by the acquisition device into the linked number of sub-data frames as the first sub-data frame corresponding to the main acquisition card and the second sub-data frame corresponding to the auxiliary acquisition card; The area division module comprises: A first sub-division module is used to divide the cache area corresponding to the acquisition device into the linked number of cache sub-areas as the first cache sub-area corresponding to the main acquisition card and the second cache sub-area corresponding to each of the secondary acquisition cards; The identifier determination module comprises: Determine a first submodule, which is used to send a reset command to the acquisition device through each of the links, so that the acquisition device responds to the reset command and locks the link through which the first instruction is received; A second submodule is determined, which is used to send a read request for the link to the acquisition device in response to the link being locked, so that the acquisition device returns a link identifier of the link indicated by the read request in response to the read request.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.