CN114297109A - Data processing method and device based on subscription and publishing mode, electronic equipment and storage medium - Google Patents

Data processing method and device based on subscription and publishing mode, electronic equipment and storage medium Download PDF

Info

Publication number
CN114297109A
CN114297109A CN202111627224.1A CN202111627224A CN114297109A CN 114297109 A CN114297109 A CN 114297109A CN 202111627224 A CN202111627224 A CN 202111627224A CN 114297109 A CN114297109 A CN 114297109A
Authority
CN
China
Prior art keywords
data
queue
storage area
data processing
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111627224.1A
Other languages
Chinese (zh)
Inventor
秦民
张媛
花子岚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Automotive Innovation Co Ltd
Original Assignee
China Automotive Innovation Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Automotive Innovation Co Ltd filed Critical China Automotive Innovation Co Ltd
Priority to CN202111627224.1A priority Critical patent/CN114297109A/en
Publication of CN114297109A publication Critical patent/CN114297109A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application relates to a data processing method and device based on a subscription and publication mode, electronic equipment and a storage medium, and the data processing method comprises the steps of obtaining data sent by at least one publication end, writing the data into at least one first storage area corresponding to the at least one publication end one by one, copying the data of each first storage area, and writing the copied data into a plurality of second storage areas corresponding to a plurality of subscription ends one by one respectively. Based on the embodiment of the application, the automobile bus message data processing based on the subscription and publishing mode can be realized, so that the bus message data can be efficiently read from a plurality of interface card input devices in real time and synchronously displayed in a plurality of independent monitoring windows in various forms, additional locking is not needed, the real-time performance and the data consistency are ensured, the efficiency and the isolation among levels are improved, and the realization of the related analysis of the bus communication data is facilitated.

Description

Data processing method and device based on subscription and publishing mode, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of automobile buses, in particular to a data processing method and device based on a subscription and publication mode, electronic equipment and a storage medium.
Background
In modern automotive systems, there are a plurality of electronic control units, which are responsible for the functional units of the respective electrical subsystems, such as anti-lock systems, engine management systems, etc., and the communication between these subsystems depends on the automotive bus. Currently, a bus commonly used includes a Controller Area Network (CAN), an intranet (LIN), a Media Oriented System Transport (MOST), an Ethernet (Ethernet), and the like, and the buses have different bandwidths and costs, and different communication modes and standard protocols.
With the diversity of modern automobile components and the complexity of bus network topology, real-time monitoring and analysis, network simulation, test, fault diagnosis, panel design and the like of a bus network have important significance for research and development of an electronic control unit of an automobile and fault diagnosis of the whole automobile. Taking the real-time monitoring function as an example, for achieving the monitoring purpose, a hardware part and a software part are needed, the hardware part refers to an interface card device, data received from a bus network is placed into a buffer zone, the software part is used for managing the interface card device, message transmission is carried out between a hardware interface card and a monitoring window example of a bus analysis system, and the data in the interface card buffer zone is received and displayed in a table or graphical form. In the prior art, bus message data of each channel is usually written into a cache, and an independent thread is started for each channel input; and the window corresponding to each function directly reads the cache block, and an independent thread is started for each window to receive data. In order to ensure the consistency of the cached data, only one thread can access the data, a mutual exclusion lock needs to be added during each writing or reading, and then the operation is finished and the unlocking is carried out.
However, for a plurality of monitoring windows and at least one interface card channel, the locking times are integer multiples of the product of the two numbers, and when one window or one channel is added, the locking times are multiplied, so that the efficiency is low. And the interface card channel is used as an input layer, the monitoring window is used as an output layer, the interaction between the interface card channel and the monitoring window is too transparent and not isolated enough, for each cache, the data is directly read by the monitoring window, and the change of any party causes the modification of the other party, so that the expansion is not convenient.
Disclosure of Invention
The embodiment of the application provides a data processing method, a device, electronic equipment and a storage medium based on a subscription and publication mode, wherein a data storage area of a publication end is isolated from a data acquisition area of a subscription end, and an independent thread is adopted to copy data of each first storage area to a second storage area, so that the independence of the two areas is ensured, locking operation caused by competition among multiple threads during data reading or writing is avoided, the data processing efficiency of a bus analysis tool is improved, and data change of any party can not cause data modification of the other party immediately.
The embodiment of the application provides a data processing method based on a subscription and publication mode, which comprises the following steps:
acquiring data sent by at least one issuing end;
writing data into at least one first storage area corresponding to at least one release end one to one;
copying the data of each first storage area;
and respectively writing the copied data into a plurality of second storage areas which are in one-to-one correspondence with the plurality of subscribers.
Further, the method further comprises:
determining a first number of distribution ends;
creating a first number of first storage areas;
determining a second number of subscribers;
a second number of second storage areas is created.
Further, the method further comprises:
determining at least one first queue based on the at least one first storage area; the at least one first storage area corresponds to the at least one first queue one by one;
determining a plurality of second queues based on the plurality of second storage areas; the plurality of second storage areas correspond to the plurality of second queues one by one;
the first queue and the second queue are circular queues;
the circular queue is a fixed-length array.
Further, the data of each first storage area is copied, and the copying comprises the following steps:
determining a first head area of each of the at least one first queue;
if the first head area has data, acquiring the data;
the first queue header area is shifted back by one data unit.
Further, writing the copied data into a plurality of second storage areas corresponding to the plurality of subscribers one to one, respectively, including:
determining a second tail area of each of the plurality of second queues;
if the second queue tail area is empty, writing the data into the second queue tail area;
and moving the second queue tail area backward by one data unit.
Correspondingly, an embodiment of the present application further provides a data processing apparatus, including:
the data acquisition module is used for acquiring data sent by at least one publishing terminal;
the first storage area writing module is used for writing data into at least one first storage area corresponding to at least one issuing end one by one;
the data copying module is used for copying the data of each first storage area;
and the second storage area writing module is used for writing the copied data into a plurality of second storage areas corresponding to the plurality of subscribers one to one.
Further, the apparatus further comprises:
the first quantity determining module is used for determining the first quantity of the issuing ends;
a first storage area creation module for creating a first number of first storage areas based on the first number;
a second quantity determining module, configured to determine a second quantity of the subscribers;
a second storage area creation module to create a second number of second storage areas based on the second number.
Further, the apparatus further comprises:
a first queue determination module for determining at least one first queue based on the at least one first storage area; the first storage areas correspond to the first queues one by one;
a second queue determining module for determining a plurality of second queues based on the plurality of second storage areas; the second storage areas correspond to the second queues one by one.
Further, a data replication module to:
determining a first head area of each of the at least one first queue;
if the first head area has data, acquiring the data;
the first queue header area is shifted back by one data unit.
Further, the second storage area writing module is configured to:
determining a second tail area of each of the plurality of second queues;
if the second queue tail area is empty, writing the data into the second queue tail area;
and moving the second queue tail area backward by one data unit.
Accordingly, an embodiment of the present application further provides an electronic device, which includes a processor and a memory, where the memory stores at least one instruction, at least one program, a code set, or a set of instructions, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by the processor to implement the data processing method described above.
Accordingly, an embodiment of the present application further provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set, or a set of instructions is stored, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by a processor to implement the data processing method described above.
By adopting the technical scheme, the invention has the following beneficial effects:
(1) the subscription publishing mode is applied to the processing of data streams in the automobile bus monitoring analysis, a first storage area corresponding to a channel and a second storage area corresponding to a window are respectively arranged, a data cache area corresponding to the channel is isolated from a data cache area corresponding to the window, and by applying the mode, a monitoring output window can be effectively and completely isolated from a hardware input layer, so that the later maintenance and the understandability are greatly enhanced;
(2) an independent thread is adopted to read and write data between the first storage area and the second storage area, competition among the threads does not exist during data reading, additional locking is not needed, performance loss caused by locking is reduced, and therefore the efficiency of the system is improved;
(3) and setting the first storage area and the second storage area as circular queues, defining data units of the circular queues as a fixed-length array, wherein data members comprise interface data types and actual interface data, and the interface data types CAN be used for identifying CAN data frames or LIN data frames and the like. And maintaining two key information of a head area and a tail area of the circular queue, and reading data from the head area and writing data from the tail area. The reading and writing of the thread are operations on different data members, whether the queue is empty or not is judged before the reading and writing, the backward movement operation is carried out after the reading and writing are finished, no conflict exists between the reading thread and the writing thread, the real-time performance and the data consistency are ensured, the bus communication data are easy to monitor, and the further analysis is facilitated.
Drawings
In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic diagram of an application environment provided by an embodiment of the present application;
fig. 2 is a schematic flowchart of a data processing method according to an embodiment of the present application;
fig. 3 is a first flowchart of a data processing method according to an embodiment of the present application;
fig. 4 is a flowchart illustrating a data processing method according to an embodiment of the present application;
fig. 5 is a third schematic flowchart of a data processing method according to an embodiment of the present application;
fig. 6 is a fourth schematic flowchart of a data processing method according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 8 is a hardware block diagram of a server in a data processing method according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings. It should be apparent that the described embodiment is only one embodiment of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
An "embodiment" as referred to herein relates to a particular feature, structure, or characteristic that may be included in at least one implementation of the present application. In the description of the embodiments of the present application, it should be understood that the terms "upper", "lower", and the like refer to orientations or positional relationships based on those shown in the drawings, and are used for convenience in describing the present application and simplifying the description, but do not indicate or imply that the referred device/system or element must have a specific orientation, be constructed in a specific orientation, and be operated, and thus should not be construed as limiting the present application. The terms "first", "second", "third", "fourth" and "fifth" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first," "second," "third," "fourth," and "fifth" may explicitly or implicitly include one or more of the features. Moreover, the terms "first," "second," "third," "fourth," and "fifth," etc. are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in other sequences than described or illustrated herein. Furthermore, the terms "comprising," "having," and "being," as well as any variations thereof, are intended to cover non-exclusive inclusions.
Referring to fig. 1, fig. 1 is a schematic view of an application environment provided by an embodiment of the present application, where the schematic view includes a vehicle 101 and a server 102, where in an alternative implementation, the server 102 may be an on-board server disposed in the vehicle 101, and the on-board server may obtain desired data in real time so as to obtain a result of data processing later. In another alternative embodiment, the vehicle 101 may be provided with its own vehicle-mounted server, and the vehicle-mounted server is not the same as the server 102 shown in fig. 1, and after the vehicle-mounted server transmits the obtained data to the server 102, the server may complete the subsequent steps to finally obtain the result of data processing. The in-vehicle server relating to the first case and the server relating to the second case will be collectively referred to as a server hereinafter. In another alternative embodiment, the server may be an external server, such as one provided by the vehicle manufacturer.
Optionally, the server may include an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a web service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and artificial intelligence platform, and the like.
In particular, a subscription publish schema, also commonly referred to as an observer schema, refers to when an object changes state, all objects that depend on it are notified. The subscription and release mode is applied to an automobile bus analysis system, an intermediate processing end is added between a release end and a subscription end of the bus analysis system by a server 102 of the vehicle 101, the intermediate processing end acquires data sent by at least one release end, writes the data into at least one first storage area corresponding to at least one release end one by one, copies the data of each first storage area, and writes the copied data into a plurality of second storage areas corresponding to a plurality of subscription ends one by one respectively.
While specific embodiments of a data processing method of the present application are described below, the present specification provides method steps as illustrated in the embodiments or flowcharts, but may include more or fewer steps based on routine or non-inventive efforts. The order of steps recited in the embodiments is only one of many possible orders of execution and does not represent the only order of execution, and in actual execution, the steps may be performed sequentially or in parallel as in the embodiments or methods shown in the figures (e.g., in the context of parallel processors or multi-threaded processing). Fig. 2 is a schematic flowchart of a data processing method provided in an embodiment of the present application, and as shown in fig. 2, the method may include:
s201: acquiring data sent by at least one issuing end;
in an alternative embodiment, the distribution end may be an interface card device, and the interface cards currently on the market may be simultaneously connected to a multi-channel bus network. The hardware interface card channel is a port belonging to interface card hardware equipment, can support several different types of ports, and is connected into automobile bus network by using connecting line, and is a channel for receiving and transmitting message.
In an optional implementation manner, the issuing end includes a controller and a transceiver, and the controller may transmit data received from the bus network to the intermediate processing end according to some bus basic parameter configurations, and the intermediate processing end obtains data sent by at least one issuing end.
S203: writing data into at least one first storage area corresponding to at least one release end one to one;
in an optional implementation manner, the acquired data sent by the issuing end is stored in the corresponding first storage area, where each issuing end has one corresponding first storage area to isolate the data corresponding to different issuing ends, so that the data of different issuing ends have independence when cached.
S205: copying the data of each first storage area;
in an alternative embodiment, the intermediate processing terminal may serve as a module for managing subscription and publication, and schedule an independent thread to read data in each first storage area.
In an alternative embodiment, the internal implementation of the independent thread scheduled by the intermediate processing end may be a double-layer loop, and the data in the first storage area is copied to the second storage area. Optionally, the outer loop traverses the second storage area, the inner loop traverses the first storage area, and the next outer loop for the second storage area can be performed only after each first storage area of the inner loop is completed, where the outer loop is suspended when the inner loop executes the code, and resumes after the inner loop is completed.
S207: and respectively writing the copied data into a plurality of second storage areas which are in one-to-one correspondence with the plurality of subscribers.
In an alternative embodiment, the subscriber may be a bus analysis system, which is used to manage the interface card device, and receive and display the data in the first storage area corresponding to the interface card channel in a table or graphic form.
In an optional implementation manner, when the function of the subscriber is to perform real-time monitoring on the automobile bus system, a plurality of monitoring windows exist, and communication message data in the automobile bus is displayed in a monitoring window interface in a certain format and can be used for message analysis. Each monitoring window is provided with a corresponding second storage area, and the independent thread scheduled by the intermediate processing end sequentially writes the data read from each first storage area into each second storage area. By only using one thread to read and write data, the competition relationship among the threads does not exist, the mutual exclusion locking operation is not required to be carried out, and the efficiency of bus analysis is improved. The data sent by the interface card equipment is stored in the first storage area, and after the data is copied, the data is written into the second storage area corresponding to the monitoring window, so that the isolation between levels can be improved, and the bus communication data can be easily monitored.
In an optional implementation manner, the subscriber may also be a window corresponding to functions of the automobile bus, such as network simulation, testing, fault diagnosis, panel design, and the like.
In this embodiment of the present application, fig. 3 is a first schematic flow chart of a data processing method provided in this embodiment of the present application, and specifically as shown in fig. 3:
s301: determining a first number of distribution ends;
in an alternative embodiment, the intermediate processing side determines the first number of the distribution sides by determining the number of interface card channels.
S303: creating a first number of first storage areas;
in an alternative embodiment, a corresponding number of first storage areas is created according to the first number determined by the publisher. The number of the interface cards is more than or equal to 1, and the intermediate processing end can at least obtain bus message data from one interface card channel. Optionally, when the number of the interface card channels is 3, the number of the first storage areas is also 3, and the interface card channels correspond to the first storage areas one to one. Each time an interface card channel is added, the intermediate processing side creates a new independent first storage area for the interface card channel.
S305: determining a second number of subscribers;
in an optional implementation manner, the intermediate processing terminal determines the second number of the subscribing terminals by judging the number of the monitoring windows.
S307: a second number of second storage areas is created.
In an alternative embodiment, a corresponding number of second storage areas is created according to the second number determined by the subscriber and the subscriber is informed of the address. Optionally, a plurality of monitoring windows, such as a window for monitoring basic information of the bus message and a window for monitoring real-time dynamic change of a signal in the message, are often required to be established during monitoring, and any one of the windows may instantiate more windows by applying different message filters, the number of the monitoring windows is greater than or equal to 2, and the intermediate processing terminal can transmit bus message data to two or more windows. In practical application, a plurality of monitoring window instances are added simultaneously, each time a monitoring output window is added to a user, the subscription terminal registers the window to the intermediate processing terminal, the intermediate processing terminal applies for an independent second storage area for the added window, and optionally, the second storage area contains all types of input data. Each monitoring window corresponds to a unique second storage area, and the independence of data processing among the examples is guaranteed.
In this embodiment of the present application, for a first storage area and a second storage area, fig. 4 is a schematic flow chart of a data processing method provided in this embodiment of the present application, which is specifically shown in fig. 4:
s401: determining at least one first queue based on the at least one first storage area; the at least one first storage area corresponds to the at least one first queue one by one;
s403: determining a plurality of second queues based on the plurality of second storage areas; the plurality of second storage areas correspond to the plurality of second queues one by one.
In an alternative embodiment, the first queue and the second queue are circular queues, and the circular queues are fixed-length arrays. The internal implementation of each first storage area is a circular queue and the internal implementation of each second storage area is a circular queue. The data unit of the circular queue is defined as a fixed-length array, the data member is a complex structure body and comprises an interface data type and actual interface data, and the interface data type is used for identifying a CAN data frame or a LIN data frame and the like.
In this embodiment of the present application, fig. 5 is a schematic flowchart of a data processing method provided in this embodiment of the present application, and specifically as shown in fig. 5, the copying data in each first storage area includes:
s2051: determining a first head area of each of the at least one first queue;
s2053: if the first head area has data, acquiring the data;
s2055: the first queue header area is shifted back by one data unit.
In an alternative embodiment, the maintenance circular queue includes a head area of key information, and optionally, when there is data in the first head area, the independent thread used for scheduling by the intermediate processing end can read data from the first head area of the first queue, and when the reading is finished, the first head area is moved backward by one data unit.
In an alternative implementation manner, the internal implementation of the independent thread scheduled by the intermediate processing end is a double-layer loop, the outer-layer loop traverses the second storage area, and the inner-layer loop traverses the first storage area, and copies the data in the first storage area to the second storage area. Because the read operation and the write operation are different data members, the backward moving operation is always performed at the end of the read and write operations, and whether the queue is empty before the read and write operations is judged.
In this embodiment of the present application, fig. 6 is a fourth flowchart of a data processing method provided in this embodiment of the present application, and specifically as shown in fig. 6, writing copied data into a plurality of second storage areas corresponding to a plurality of subscribers one to one respectively includes:
s2071: determining a second tail area of each of the plurality of second queues;
s2073: if the second queue tail area is empty, writing the data into the second queue tail area;
s2075: and moving the second queue tail area backward by one data unit.
In an optional implementation manner, the maintenance circular queue includes a queue tail area of the key information, and optionally, when the second queue tail area is empty, the independent thread scheduled by the intermediate processing end may write data into the second queue tail area. The second queue tail area is shifted back by one data unit each time the writing ends.
In an optional implementation manner, data is written into a corresponding first storage area from a publishing end, a first queue tail area of each first queue in at least one first queue is determined, if the first queue tail area of the first queue is empty, the data is written into the first queue tail area, and the first queue tail area is moved backward by one data unit. When the interface card device sends data to the first storage area, the thread corresponding to each channel reads the data corresponding to the first storage area, and after the first queue tail area of the first queue is determined to be empty, the corresponding thread can write the first queue tail area of the corresponding first queue, and the first queue tail area is moved backward by one data unit. Because the data written by each thread belongs to different channels, the conflict between the threads does not exist, additional locking operation is not needed, the efficiency is improved, and the performance loss caused by locking is reduced.
In an optional implementation manner, when the subscriber acquires the data of the second storage area, the thread corresponding to each subscriber reads the data of the second storage area, and optionally, after determining that the second head-of-line area of the second queue has the data, the thread corresponding to each subscriber may read the second head-of-line area of the corresponding second queue, and move the second head-of-line area backward by one data unit. Because the data read by each thread belongs to the corresponding second storage area, conflict between threads does not exist, additional mutual exclusion locking operation is not needed, the efficiency of bus analysis message transmission is improved, and performance loss caused by locking is reduced. Each monitoring window corresponds to a unique second storage area, and the independence of data processing among the examples is guaranteed.
In an alternative embodiment, data can also be read from the tail area of the queue and written from the head area of the queue.
By adopting the data processing method provided by the embodiment of the application, the data sent by at least one publishing terminal is obtained, the data is written into at least one first storage area corresponding to at least one publishing terminal one by one, the data of each first storage area is copied, and the copied data is respectively written into a plurality of second storage areas corresponding to a plurality of subscribing terminals one by one. Based on this application embodiment can realize subscribing the data processing of publishing the mode, be favorable to reading data from a plurality of interface card input device high-efficiently in real time to in the synchronous with various forms display to a plurality of independent monitor windows, and guarantee real-time and data uniformity, need not additionally to lock, improve efficiency nature and the isolation between the level, make bus communication data easily control, be convenient for further analysis.
Fig. 7 is a schematic structural diagram of a data processing apparatus provided in an embodiment of the present application, and as shown in fig. 7, the apparatus may include:
a data obtaining module 701, configured to obtain data sent by at least one publishing terminal;
a first storage area writing module 702, configured to write data into at least one first storage area corresponding to at least one publishing end one to one;
a data copying module 703, configured to copy data in each first storage area;
a second storage area writing module 704, configured to write the copied data into a plurality of second storage areas corresponding to the plurality of subscribers one to one, respectively.
In an alternative embodiment, the apparatus further comprises:
the first quantity determining module is used for determining the first quantity of the issuing ends;
a first storage area creation module for creating a first number of first storage areas based on the first number;
a second quantity determining module, configured to determine a second quantity of the subscribers;
a second storage area creation module to create a second number of second storage areas based on the second number.
In an alternative embodiment, the apparatus further comprises:
a first queue determination module for determining at least one first queue based on the at least one first storage area; the first storage areas correspond to the first queues one by one;
a second queue determining module for determining a plurality of second queues based on the plurality of second storage areas; the second storage areas correspond to the second queues one by one.
In an optional embodiment, the data replication module 703 is configured to determine a first head area of each of the at least one first queue;
if the first head area has data, acquiring the data;
the first queue header area is shifted back by one data unit.
In an alternative embodiment, the second storage area writing module 704 is configured to determine a second tail area of each of the plurality of second queues;
if the second queue tail area is empty, writing the data into the second queue tail area;
and moving the second queue tail area backward by one data unit.
The device and method embodiments in the embodiments of the present application are based on the same application concept.
The method provided by the embodiment of the application can be executed in a computer terminal, a server or a similar operation device. Taking the example of running on a server, fig. 8 is a hardware structure block diagram of the server of the data processing method provided in the embodiment of the present application. As shown in fig. 8, the server 800 may have a relatively large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 810 (the processor 810 may include but is not limited to a Processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 830 for storing data, one or more storage media 820 (e.g., one or more mass storage devices) for storing applications 823 or data 822. Memory 830 and storage medium 820 may be, among other things, transient or persistent storage. The program stored in storage medium 820 may include one or more modules, each of which may include a series of instruction operations for a server. Still further, the central processor 810 may be configured to communicate with the storage medium 820 to execute a series of instruction operations in the storage medium 820 on the server 800. The server 800 may also include one or more power supplies 860, one or more wired or wireless network interfaces 850, one or more input-output interfaces 840, and/or one or more operating systems 821, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, and so forth.
The input-output interface 840 may be used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the server 800. In one example, i/o Interface 840 includes a Network adapter (NIC) that may be coupled to other Network devices via a base station to communicate with the internet. In one example, the input/output interface 840 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
It will be understood by those skilled in the art that the structure shown in fig. 8 is only an illustration and is not intended to limit the structure of the electronic device. For example, server 800 may also include more or fewer components than shown in FIG. 8, or have a different configuration than shown in FIG. 8.
Embodiments of the present application further provide a storage medium, which may be disposed in a server to store at least one instruction, at least one program, a code set, or a set of instructions related to implementing a data processing method in the method embodiments, where the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by the processor to implement the data processing method.
Alternatively, in this embodiment, the storage medium may be located in at least one network server of a plurality of network servers of a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
As can be seen from the embodiments of the data processing method, the data processing apparatus, or the storage medium provided in the present application, data sent by at least one publishing terminal is obtained, the data is written into at least one first storage area corresponding to the at least one publishing terminal one to one, the data in each first storage area is copied, and the copied data is written into a plurality of second storage areas corresponding to a plurality of subscribing terminals one to one. So, can realize data processing, be favorable to reading data from a plurality of interface card input device high-efficiently in real time to in showing a plurality of independent monitor windows with various forms in step, and guarantee real-time and data uniformity, need not additionally to lock, the isolation between raise the efficiency nature and the level makes bus communication data easily control, the further analysis of being convenient for.
It should be noted that: the sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
It will be understood by those skilled in the art that all or part of the steps of implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The present invention is not intended to be limited to the particular embodiments shown and described, but is to be accorded the widest scope consistent with the principles and novel features herein disclosed.

Claims (10)

1. A data processing method based on a subscription and publication mode is characterized by comprising the following steps:
acquiring data sent by at least one issuing end;
writing the data into at least one first storage area corresponding to the at least one issuing end one by one;
copying the data of each first storage area;
and respectively writing the copied data into a plurality of second storage areas which are in one-to-one correspondence with the plurality of subscribers.
2. The data processing method of claim 1, wherein the method further comprises:
determining a first number of the distribution ends;
creating the first number of the first storage areas;
determining a second number of said subscribers;
creating the second number of the second storage areas.
3. The data processing method of claim 1, wherein the method further comprises:
determining at least one first queue based on the at least one first holding area; the at least one first storage area corresponds to the at least one first queue one to one;
determining a plurality of second queues based on the plurality of second storage areas; the plurality of second storage areas correspond to the plurality of second queues one by one;
the first queue and the second queue are circular queues;
the circular queue is a fixed-length array.
4. The data processing method of claim 3, wherein the copying the data of each of the first storage areas comprises:
determining a first head of line region of each of the at least one first queue;
if the data exist in the first head area, acquiring the data;
the first queue header area is shifted back by one data unit.
5. The data processing method according to claim 3, wherein the writing the copied data into a plurality of second storage areas corresponding to a plurality of subscribers one to one respectively comprises:
determining a second tail region of each of the plurality of second queues;
if the second queue tail area is empty, writing the data into the second queue tail area;
and moving the second queue tail area backward by one data unit.
6. A data processing apparatus, comprising:
the data acquisition module is used for acquiring data sent by at least one publishing terminal;
a first storage area writing module, configured to write the data into at least one first storage area corresponding to the at least one publishing end one to one;
the data replication module is used for replicating the data of each first storage area;
and the second storage area writing module is used for writing the copied data into a plurality of second storage areas corresponding to the plurality of subscribers one to one.
7. The data processing apparatus of claim 6, wherein the apparatus further comprises:
a first number determining module, configured to determine a first number of the distribution ends;
a first storage area creation module to create the first number of the first storage areas based on the first number;
a second quantity determining module, configured to determine a second quantity of the subscribers;
a second storage area creation module to create the second number of the second storage areas based on the second number.
8. The data processing apparatus of claim 6, wherein the apparatus further comprises:
the first queue determining module is used for determining at least one first queue based on at least one first storage area; the first storage areas correspond to the first queues one by one;
a second queue determining module for determining a plurality of second queues based on a plurality of the second storage areas; the second storage areas correspond to the second queues one by one.
9. An electronic device comprising a memory and a processor, the electronic device comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, set of codes, or set of instructions, the at least one instruction, the at least one program, set of codes, or set of instructions, which is loaded and executed by the processor to implement the data processing method of any of claims 1-5.
10. A computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement the data processing method according to any one of claims 1 to 5.
CN202111627224.1A 2021-12-28 2021-12-28 Data processing method and device based on subscription and publishing mode, electronic equipment and storage medium Pending CN114297109A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111627224.1A CN114297109A (en) 2021-12-28 2021-12-28 Data processing method and device based on subscription and publishing mode, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111627224.1A CN114297109A (en) 2021-12-28 2021-12-28 Data processing method and device based on subscription and publishing mode, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114297109A true CN114297109A (en) 2022-04-08

Family

ID=80971724

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111627224.1A Pending CN114297109A (en) 2021-12-28 2021-12-28 Data processing method and device based on subscription and publishing mode, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114297109A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115086365A (en) * 2022-05-26 2022-09-20 上海赫千电子科技有限公司 Time-sensitive network vehicle-mounted communication method of data distribution service

Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1953426A (en) * 2005-10-19 2007-04-25 国际商业机器公司 Publish/subscribe system and method for managing subscriptions
CN103514053A (en) * 2013-09-22 2014-01-15 中国科学院信息工程研究所 Shared-memory-based method for conducting communication among multiple processes
CN103581250A (en) * 2012-07-31 2014-02-12 盛趣信息技术(上海)有限公司 Data processing, issuing and obtaining method and system
US20160103783A1 (en) * 2013-06-13 2016-04-14 Tsx Inc. Low latency device interconnect using remote memory access with segmented queues
CN106960054A (en) * 2017-04-01 2017-07-18 北京奇虎科技有限公司 The access method and device of data file
CN107015872A (en) * 2016-12-09 2017-08-04 上海壹账通金融科技有限公司 The processing method and processing device of monitoring data
CN107678866A (en) * 2017-09-22 2018-02-09 北京东土科技股份有限公司 A kind of subregion communication means and device based on embedded OS
CN108230487A (en) * 2017-12-21 2018-06-29 上海新案数字科技有限公司 The method and apparatus of shared camera resource
CN108370345A (en) * 2015-10-09 2018-08-03 萨托里环球有限责任公司 System and method for storing message data
CN110121863A (en) * 2016-09-23 2019-08-13 萨托里环球有限责任公司 For providing the system and method for message to multiple subscribers
CN111105521A (en) * 2019-11-21 2020-05-05 视联动力信息技术股份有限公司 Data reading method and device
CN111212100A (en) * 2018-11-22 2020-05-29 财团法人工业技术研究院 Synchronization method and system for publishing and subscribing message queue
CN111314217A (en) * 2019-12-09 2020-06-19 上海金融期货信息技术有限公司 Multilink transmission system
CN111787055A (en) * 2020-05-22 2020-10-16 中国科学院信息工程研究所 Redis-based transaction mechanism and multi-data center oriented data distribution method and system
CN111984421A (en) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 Data processing method, device and storage medium
CN112164155A (en) * 2020-09-29 2021-01-01 广州小鹏自动驾驶科技有限公司 Vehicle data acquisition method and device
CN112840332A (en) * 2018-08-23 2021-05-25 阿尔库斯有限公司 Independent data storage in a network routing environment
CN113434297A (en) * 2021-06-30 2021-09-24 北京小米移动软件有限公司 Hot spot peak clipping method and device, storage server, client and storage medium
CN113630449A (en) * 2021-07-26 2021-11-09 中汽创智科技有限公司 Vehicle cloud data transmission system, method, equipment and storage medium

Patent Citations (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1953426A (en) * 2005-10-19 2007-04-25 国际商业机器公司 Publish/subscribe system and method for managing subscriptions
CN103581250A (en) * 2012-07-31 2014-02-12 盛趣信息技术(上海)有限公司 Data processing, issuing and obtaining method and system
US20160103783A1 (en) * 2013-06-13 2016-04-14 Tsx Inc. Low latency device interconnect using remote memory access with segmented queues
CN103514053A (en) * 2013-09-22 2014-01-15 中国科学院信息工程研究所 Shared-memory-based method for conducting communication among multiple processes
CN108370345A (en) * 2015-10-09 2018-08-03 萨托里环球有限责任公司 System and method for storing message data
CN110121863A (en) * 2016-09-23 2019-08-13 萨托里环球有限责任公司 For providing the system and method for message to multiple subscribers
CN107015872A (en) * 2016-12-09 2017-08-04 上海壹账通金融科技有限公司 The processing method and processing device of monitoring data
WO2018103315A1 (en) * 2016-12-09 2018-06-14 上海壹账通金融科技有限公司 Monitoring data processing method, apparatus, server and storage equipment
CN106960054A (en) * 2017-04-01 2017-07-18 北京奇虎科技有限公司 The access method and device of data file
CN107678866A (en) * 2017-09-22 2018-02-09 北京东土科技股份有限公司 A kind of subregion communication means and device based on embedded OS
CN108230487A (en) * 2017-12-21 2018-06-29 上海新案数字科技有限公司 The method and apparatus of shared camera resource
CN112840332A (en) * 2018-08-23 2021-05-25 阿尔库斯有限公司 Independent data storage in a network routing environment
CN111212100A (en) * 2018-11-22 2020-05-29 财团法人工业技术研究院 Synchronization method and system for publishing and subscribing message queue
CN111105521A (en) * 2019-11-21 2020-05-05 视联动力信息技术股份有限公司 Data reading method and device
CN111314217A (en) * 2019-12-09 2020-06-19 上海金融期货信息技术有限公司 Multilink transmission system
CN111787055A (en) * 2020-05-22 2020-10-16 中国科学院信息工程研究所 Redis-based transaction mechanism and multi-data center oriented data distribution method and system
CN111984421A (en) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 Data processing method, device and storage medium
CN112164155A (en) * 2020-09-29 2021-01-01 广州小鹏自动驾驶科技有限公司 Vehicle data acquisition method and device
CN113434297A (en) * 2021-06-30 2021-09-24 北京小米移动软件有限公司 Hot spot peak clipping method and device, storage server, client and storage medium
CN113630449A (en) * 2021-07-26 2021-11-09 中汽创智科技有限公司 Vehicle cloud data transmission system, method, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
史彦山;: "多机系统内部数据交互实现方法研究", 现代电子技术, no. 10, pages 71 - 73 *
张宝芬,张毅,曹丽: "自动检测技术及仪表控制系统", 化学工业出版社, pages: 291 - 293 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115086365A (en) * 2022-05-26 2022-09-20 上海赫千电子科技有限公司 Time-sensitive network vehicle-mounted communication method of data distribution service

Similar Documents

Publication Publication Date Title
US20210357276A1 (en) System, method and computer program product for sharing information in a distributed framework
DE102015214915A9 (en) Flexible planning method and device in LIN communication
CN110120970A (en) Data processing method, device and gateway system based on car networking
US20170019478A1 (en) Apparatus and method of operating a system
CN108701055A (en) Controller of vehicle and Vehicular system
CN114297109A (en) Data processing method and device based on subscription and publishing mode, electronic equipment and storage medium
CN111756625B (en) Function transfer service method, device and system based on central gateway, electronic equipment and storage medium
CN109062820A (en) A kind of software performance testing method and device
CN111752920A (en) Method, system, and storage medium for managing metadata
CN103399776B (en) Reusable MOCK creation method and system
CN117056201A (en) Intelligent cabin testing method, device and medium
CN111885173A (en) ECU (electronic control unit) conforming to AUSTOSAR (autonomous Underwater vehicle assisted synthetic aperture radar) architecture and sleep/wake-up management method thereof
CN113157796A (en) Data acquisition display system based on micro-service
CN110113181B (en) Node configuration method, node configuration device, computer device, and readable storage medium
US20220091887A1 (en) System and method for finding and identifying computer nodes in a network
CN111294250B (en) Pressure testing method, device and system
CN112052104A (en) Message queue management method based on multi-computer-room realization and electronic equipment
CN115277886A (en) Vehicle data acquisition method based on data distribution service
CN116842763B (en) Simulation test method, simulation test device, electronic equipment and storage medium
CN115249074B (en) Distributed federal learning method based on Spark cluster and Ring-AllReduce architecture
CN116662037B (en) Processing method and device for shared memory, electronic equipment and storage medium
CN114710432B (en) Vehicle-mounted Ethernet communication joint debugging method and system
CN115756443B (en) Script generation method and device, electronic equipment and readable storage medium
CN117251297B (en) Equipment distribution method, electronic equipment and storage medium
CN117032684A (en) Service integration processing method, service integration system, device and storage medium

Legal Events

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