CN110597644B - Data stream transmission method, transmission device, electronic equipment and storage medium - Google Patents

Data stream transmission method, transmission device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110597644B
CN110597644B CN201910854182.1A CN201910854182A CN110597644B CN 110597644 B CN110597644 B CN 110597644B CN 201910854182 A CN201910854182 A CN 201910854182A CN 110597644 B CN110597644 B CN 110597644B
Authority
CN
China
Prior art keywords
data stream
value
target
array
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910854182.1A
Other languages
Chinese (zh)
Other versions
CN110597644A (en
Inventor
刘均
李河金
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Launch Technology Co Ltd
Original Assignee
Shenzhen Launch Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Launch Technology Co Ltd filed Critical Shenzhen Launch Technology Co Ltd
Priority to CN201910854182.1A priority Critical patent/CN110597644B/en
Publication of CN110597644A publication Critical patent/CN110597644A/en
Application granted granted Critical
Publication of CN110597644B publication Critical patent/CN110597644B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC

Abstract

The application provides a data stream interaction method, which is applied to a display process and comprises the following steps: defining a state array containing at least one first element, wherein the first element occupies one byte and one bit represents the selection state of one data stream, and the initial value of each first element represents that the initial selection state of each corresponding data stream is unselected; selecting target second elements with the actual selection states corresponding to the selected target bit positions from the mark data according to the actual selection states of the data streams corresponding to the first elements, and calculating the actual values of the first elements; and updating the state array by using the actual value of each first element, and outputting the updated state array. The method and the device can reduce the transmission data volume of the data stream, greatly compress the space for data storage, improve the data transmission efficiency and avoid the risk of memory overflow caused by excessive data stream.

Description

Data stream transmission method, transmission device, electronic equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data stream transmission method, a transmission apparatus, an electronic device, and a storage medium.
Background
The data stream refers to data parameters communicated inside or between the electronic devices, and truly reflects the operating voltage and the state of the electronic devices.
The current general flow of data stream transmission is as follows: and listing the names of all data streams in sequence, selecting the data stream to be checked by a user, storing the selection states of all the data streams in an array, and transmitting the data streams in a memory sharing mode.
However, since each element of the array occupies at least one byte, when the number of the data streams is infinite, the transmission method occupies a very large memory, and may cause memory overflow to cause program crash.
Disclosure of Invention
In view of the above, in order to solve the above problems, the present application provides a data stream transmission method, a transmission apparatus, an electronic device, and a storage medium. The technical scheme is as follows:
a method of data streaming, the method comprising:
defining a state array, wherein the state array comprises at least one first element, one first element occupies one byte, one bit represents the selection state of one data stream, and the initial value of each first element represents that the initial selection state of each data stream corresponding to each first element is unselected;
aiming at each first element in the state array, acquiring the actual selection state of each data stream corresponding to the first element, and determining the actual selection state of at least one data stream as a selected target bit;
calling a predefined tag array, wherein the tag array comprises a plurality of second elements, and the numerical value of one second element is used for marking a selected bit in one byte;
selecting a target second element corresponding to each target bit from the mark array, and calculating an actual value of the first element according to the initial value of the first element and the numerical value of each target second element;
and updating the state array by using the actual value of each first element, and outputting the updated state array.
Preferably, the defining a state array includes:
calculating the number of first elements in the state array, including:
acquiring the quantity of all data streams;
calculating a first ratio of the number of all data streams to 8 and a remainder of the number of all data streams to 8;
judging whether the remainder is 0;
if so, taking the first ratio as the number of first elements in the state array;
if not, taking the sum of the first ratio and 1 as the number of the first elements in the state array.
Preferably, the defining a state array includes:
determining a correspondence between a data stream and one of the first elements in the state array, including:
acquiring the serial number of the data stream;
calculating a second ratio of the serial number of the data stream to 8;
and establishing a corresponding relation between the data stream and the first element corresponding to the second ratio in the state array.
Preferably, the calculating an actual value of the first element according to the initial value of the first element and the numerical value of each target second element includes:
taking the initial value of the first element as the current value of the first element;
determining a target second element to be processed, and carrying out bit or operation on the current value of the first element and the numerical value of the target second element to be processed to obtain a middle value of the first element;
judging whether an unprocessed target second element exists;
if so, taking the intermediate value of the first element as the current value of the first element, and returning to execute the determination of a target second element to be processed;
if not, the intermediate value of the first element is taken as the actual value of the first element.
Preferably, the outputting the updated state array includes:
and the display process sends the updated state array to a diagnosis process so that the diagnosis process determines that the actual selection state is the selected data stream based on the updated state array and the marker array.
Preferably, the data type of the first element is any one of binary, octal, decimal and hexadecimal.
A data streaming apparatus, the apparatus comprising:
the defining module is used for defining a state array, the state array comprises at least one first element, one first element occupies one byte, one bit represents the selection state of one data stream, and the initial value of each first element represents that the initial selection state of each data stream corresponding to each first element is unselected;
a determining module, configured to obtain, for each first element in the state array, an actual selection state of each data stream corresponding to the first element, and determine that the actual selection state of at least one data stream is a selected target bit;
the system comprises a calling module, a judging module and a judging module, wherein the calling module is used for calling a predefined tag array, the tag array comprises a plurality of second elements, and the numerical value of one second element is used for marking a selected bit in one byte;
the calculation module is used for selecting a target second element corresponding to each target bit from the mark array and calculating the actual value of the first element according to the initial value of the first element and the numerical value of each target second element;
and the updating module is used for updating the state array by using the actual value of each first element and outputting the updated state array.
Preferably, the calculating module for calculating the actual value of the first element according to the initial value of the first element and the numerical value of each target second element is configured to:
taking the initial value of the first element as the current value of the first element; determining a target second element to be processed, and carrying out bit or operation on the current value of the first element and the numerical value of the target second element to be processed to obtain a middle value of the first element; judging whether an unprocessed target second element exists; if so, taking the intermediate value of the first element as the current value of the first element, and returning to execute the determination of a target second element to be processed; if not, the intermediate value of the first element is taken as the actual value of the first element.
An electronic device, comprising: at least one memory and at least one processor; the memory stores a program, and the processor calls the program stored in the memory, wherein the program is used for realizing any one of the data stream transmission methods.
A computer-readable storage medium having stored thereon computer-executable instructions for performing any of the data streaming methods.
The above application provides a data stream transmission method, a transmission apparatus, an electronic device, and a storage medium, where a first element occupies one byte, a bit of the first element represents a state array of a selection state of a data stream, and an initial value of each first element represents that an initial selection state of each corresponding data stream is unselected, and since a byte may be split into 8 bits, a first element may represent a selection state of at most 8 data streams. Further, for each first element in the state array, an actual value of the first element characterizing an actual selection state of the corresponding data stream may be calculated based on the actual selection state of the data stream to which the first element corresponds and the tag array. Finally, the state array updated by the actual values of the first elements is output. Based on the application, the data transmission amount of the data stream can be reduced, the space for storing the data is greatly compressed, the data transmission efficiency is improved, and the risk of memory overflow caused by excessive data stream is avoided.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method of a data stream interaction method according to an embodiment of the present application;
FIG. 2 is an example of a first element provided by an embodiment of the present application;
fig. 3 is a partial flowchart of a data stream interaction method according to an embodiment of the present disclosure;
fig. 4 is a flowchart of another part of a method for data stream interaction according to an embodiment of the present application;
FIG. 5 is an example of a data flow display interface provided by an embodiment of the present application;
FIG. 6 is an example of a tag array provided by an embodiment of the present application;
fig. 7 is a flowchart of a part of a data stream interaction method according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a data stream interaction apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the 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.
For convenience of understanding, the embodiment of the present application is described by taking an example of reading an automobile data stream by a diagnostic instrument. It should be understood that it is only one application scenario of the present application, and other application scenarios involving data stream transmission, which are not listed, are also within the scope of the present application.
The automobile data flow refers to data parameters of communication between an ECU (electronic control unit) and sensors and actuators, truly reflects the working voltage and state of each sensor and each actuator, and provides basis for automobile fault diagnosis.
The read data stream is an important function of the diagnostic instrument. The current general flow of reading data streams is: the display process lists the names of all data streams in sequence, a user selects the data stream to be viewed, the display process stores the selection states of all the data streams in an array and transmits the array to the diagnosis process in a shared memory mode. And the diagnosis process reads the information of the data stream with the selected state and displays the final diagnosis result to the user.
However, since each element of the array occupies at least one byte, when the number of the data streams is infinite, the memory occupied by the transfer method is very large, and the memory overflow may occur, which may cause program crash.
In order to solve the problem, an embodiment of the present application provides a data stream interaction method, where a flowchart of the method is shown in fig. 1, and the method includes the following steps:
s10, defining a state array, wherein the state array comprises at least one first element, one first element occupies one byte, one bit represents the selection state of one data stream, and the initial value of each first element represents that the initial selection state of each data stream corresponding to each first element is unselected.
In this embodiment, the number of the first elements in the state array may be determined according to the number of the currently displayed data streams, and since one byte may be split into 8 bits, one first element may represent the selection states of at most 8 data streams. Of course, if the number of data streams is not an integer multiple of 8, a first element, i.e., a byte, is added to characterize the selection state of the excess data stream.
For convenience of understanding, the data streams with sequence numbers 0 to 7 are described below as an example. The selection states of these 8 data streams can be characterized by a first element Arr [0], each bit of Arr [0] representing a selection state of one data stream, a bit having a value of 0, indicating unselected, and a bit having a value of 1, indicating selected. The corresponding relationship between each bit and the data stream may be preset, for example, the data stream with the sequence number of 7 may be set before the data stream with the higher bit, the data stream with the sequence number of 7 may be set by the bit 0, the data stream with the sequence number of 6 may be set by the bit 1, and the data stream with the sequence number of 0 may be set by the bit … …, the bit 7.
Fig. 2 is an example of a first element, which has an initial value of 0, and the corresponding bit values bit 0-bit 7 are all 0, i.e. 00000000.
In practical applications, the process of calculating the number of the first elements in the state array in step S10 "define a state array" may adopt the following steps, and the method flowchart is shown in fig. 3:
s1011, the number of all data streams is acquired.
In this embodiment, all data streams are currently displayed data streams.
S1012, a first ratio of the number of all data streams to 8 and a remainder of the number of all data streams to 8 are calculated.
In this embodiment, assuming that the number of all data streams is a, two variables, i.e., a first ratio b and a remainder c, are defined. The first ratio b is a/8, and the remainder c is a% 8.
S1013, judging whether the remainder is 0 or not; if yes, go to step S1014; if not, go to step S1015.
S1014, the first ratio is used as the number of the first elements in the state array.
And S1015, taking the sum of the first ratio and 1 as the number of the first elements in the state array.
In addition, the process of determining the corresponding relationship between a data stream and a first element in the state array in step S10 "define a state array" may adopt the following steps, and the method flowchart is shown in fig. 4:
s1016, a sequence number of the data stream is acquired.
In this embodiment, a data stream includes information such as a data stream name, a data stream value, and a data stream unit, and a sequence number of the data stream is a number that is assigned to the data stream when the data stream is displayed, and referring to a data stream display interface shown in fig. 5, in order from top to bottom and from left to right, a sequence number of "left-view mirror folding/opening SW" of the data stream is 0, a sequence number of "left front door switch input" of the data stream is 1, and a sequence number of "right front door switch input" of the data stream is 2 … ….
S1017, a second ratio of the sequence number of the data stream to 8 is calculated.
In this embodiment, the corresponding first elements are sequentially determined according to the sequence number of the data stream. Since a byte can be split into 8 bits, the second ratio can be used as the sequence number of the first element in the state array.
And S1018, establishing a corresponding relation between the data stream and the first element corresponding to the second ratio in the state array.
S20, for each first element in the state array, obtaining an actual selection state of each data stream corresponding to the first element, and determining the actual selection state of at least one data stream as a selected target bit.
In this embodiment, the actual selection state of each currently displayed data stream may be determined by responding to a user operation. And one data stream corresponds to one bit in one first element, so that the actual selection state of the data stream corresponding to each bit can be determined, and the actual selection state is selected as the selected target bit.
S30, calling a predefined tag array, wherein the tag array comprises a plurality of second elements, and the value of one second element is used for marking a selected bit in one byte.
In this embodiment, a flag array BYTE ucMask [ ] [ {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01} is defined in advance. Referring to the example of the tag array shown in fig. 6, taking 0x80 as an example, the value of the bits bit 0-bit 7 is 10000000, which is 10000000 when the bit or operation is performed with the first element 00000000, so that it can be determined that the data stream corresponding to the bit 0 is selected. Similarly, if the bit or operation of the first element 00000000 and 0x40 (the value of bit 0-bit 7 is 01000000) results in 01000000, it can be determined that the data stream corresponding to bit 1 is selected; if the first element 00000000 and 0x20 (the value of bit 0-bit 7 is 00100000) bits or operations result in 00100000, it can be determined that the data stream corresponding to bit 2 is selected … ….
In summary, according to the target bit of the first element corresponding to the selected data stream, the second element corresponding to the target bit and the initial value of the first element are selected for bit or operation to calculate the actual value of the first element.
It should be noted that, in the above description of the tag array, the data type of the second element is hexadecimal, and it is understood that other data types, such as binary, octal or decimal, are also within the protection scope of the present embodiment.
And S40, selecting the target second element corresponding to each target bit from the state array, and calculating the actual value of the first element according to the initial value of the first element and the numerical value of each target second element.
In this embodiment, for each first element in the state array, a target second element corresponding to a target bit is determined, for example, the target second element is 0x80 when the target bit is bit 0, and the target second element is 0x40 when the target bit is bit 1, and so on.
And further, combining the bits or operation results of the initial values of the first element and each target second element to determine the actual value of the first element.
For example, the target second elements are 0x80, 0x20, and 0x02, respectively, it can be determined that the bit or operation result of 0x80 and the first element 00000000 is 10000000, the bit or operation result of 0x20 and the first element 000000000000 is 00100000, 0x02 and the bit or operation result of the first element 000000000000 is 00000010, and then the bit or operation can be performed on 10000000, 00100000, and 00000010 again to obtain the actual value 10100010 of the first element.
Of course, the data type of the first element may be any one of binary, octal, decimal and hexadecimal, which is not limited in this embodiment. For example, the actual value of the first element is 10100010 in hexadecimal and 269484048 in decimal.
Of course, in some other embodiments, the step S40 of "calculating the actual value of the first element according to the initial value of the first element and the numerical value of each target second element" may adopt the following steps, and the method flowchart is shown in fig. 7:
s401, the initial value of the first element is used as the current value of the first element.
S402, determining a target second element to be processed, and carrying out bit or operation on the current value of the first element and the numerical value of the target second element to be processed to obtain the intermediate value of the first element.
S403, judging whether an unprocessed target second element exists or not; if yes, go to step S404; if not, go to step S405.
S404, taking the intermediate value of the first element as the current value of the first element, and returning to execute the step S402.
S405, the intermediate value of the first element is used as the actual value of the first element.
For convenience of understanding, the description is continued by taking as examples that the target second elements are 0x80, 0x20, and 0x02, respectively:
the initial value of the first element is 00000000, which is taken for the first time as the current value of the first element. Further, 0x80 is selected as the target second element to be processed, the bit or operation result of 0x80 and 00000000 is 10000000, and then 10000000 is the middle value of the first element and is taken as the current value of the first element. Further, 0x20 is selected as the target second element to be processed, the bit or operation result of 0x20 and 10000000 is 10100000, and then 10100000 is the middle value of the first element and is taken as the current value of the first element. Further, 0x02 is selected as the target second element to be processed, and the bit or operation result of 0x02 and 10100000 is 10100010, since there is no unprocessed target second element at this time, 10100010 is taken as the actual value of the first element.
Of course, it should be noted that when the target second element to be processed is selected, the target second element may be selected randomly, or according to a certain rule, which is not limited in this embodiment.
S50, updating the state array with the actual value of each first element, and outputting the updated state array.
In an application scenario where the diagnostic instrument reads the automobile data stream, the updated state array may be sent to the diagnostic process by the display process, so that the diagnostic process determines the actual selected state as the selected data stream based on the updated state array and the tag array.
Specifically, the diagnostic process may perform bit and operation on the actual value and the marked number group of a first element in the array to obtain the actual selection state of each data stream corresponding to the first element.
Continuing with the example of the actual value of the first element being 10100010, bit-and-operate 10100010 with each second element in the and-state array, assuming that the order of the bit-and-operation is 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, then:
firstly, 10100010 and 0x80 perform a bit and operation to obtain 10000000, and since the bit 0 of 10000000 is 1, it can be determined that the actual selection state of the data stream corresponding to the bit 0 of the first element is selected;
further, 10100010 and 0x40 perform a bit and operation to obtain 00000000, and since the bit 1 of 00000000 is 0, it can be determined that the actual selection state of the data stream corresponding to the bit 1 of the first element is unselected;
similarly, the bit AND operation of 10100010 and 0x20 can determine that the actual selection state of the data stream corresponding to the bit 2 of the first element is selected; 10100010 and 0x10 may determine that the actual selection status of the data stream corresponding to bit 3 of the first element is unselected; 10100010 and 0x08 may determine that the actual selection status of the data stream corresponding to bit 4 of the first element is unselected; 10100010 and 0x04 may determine that the actual selection status of the data stream corresponding to bit 5 of the first element is unselected; 10100010 and 0x02 may determine that the actual selection state of the data stream corresponding to bit 6 of the first element is selected; 10100010 bit AND with 0x01 may determine that the actual selection state of the data stream corresponding to bit 7 of the first element is unselected.
The data stream transmission method provided by the embodiment of the application can reduce the transmission data volume of the data stream, greatly compress the data storage space, improve the data transmission efficiency and avoid the risk of memory overflow caused by excessive data.
Based on the data stream transmission method provided in the foregoing embodiment, an embodiment of the present application further provides an apparatus for performing the data stream transmission method, where a schematic structural diagram of the apparatus is shown in fig. 8, and the apparatus includes:
a defining module 10, configured to define a state array, where the state array includes at least one first element, where one first element occupies one byte and one bit represents a selection state of one data stream, and an initial value of each first element represents that an initial selection state of each data stream corresponding to each first element is unselected;
a determining module 20, configured to obtain, for each first element in the state array, an actual selection state of each data stream corresponding to the first element, and determine that the actual selection state of at least one data stream is a selected target bit;
the retrieving module 30 is configured to retrieve a predefined tag array, where the tag array includes a plurality of second elements, and a value of one second element is used to tag a selected bit in one byte;
a calculating module 40, configured to select a target second element corresponding to each target bit from the tag number group, and calculate an actual value of the first element according to the initial value of the first element and the numerical value of each target second element;
and an updating module 50, configured to update the state array by using the actual value of each first element, and output the updated state array.
Optionally, the definition module 10 is specifically configured to:
calculating the number of first elements in the state array, comprising:
acquiring the number of all data streams; calculating a first ratio of the number of all data streams to 8 and a remainder of the number of all data streams to 8; judging whether the remainder is 0; if so, taking the first ratio as the number of the first elements in the state array; if not, taking the sum of the first ratio and 1 as the number of the first elements in the state array.
Optionally, the definition module 10 is specifically configured to:
determining a correspondence between a data stream and a first element in the state array, comprising:
acquiring a serial number of a data stream; calculating a second ratio of the serial number of the data stream to 8; and establishing a corresponding relation between the data stream and a first element corresponding to the second ratio in the state array.
Optionally, the calculating module 40, configured to calculate the actual value of the first element according to the initial value of the first element and the numerical value of each target second element, is configured to:
taking the initial value of the first element as the current value of the first element; determining a target second element to be processed, and carrying out bit or operation on the current value of the first element and the numerical value of the target second element to be processed to obtain a middle value of the first element; judging whether an unprocessed target second element exists; if so, taking the intermediate value of the first element as the current value of the first element, and returning to execute the determination of a target second element to be processed; if not, the intermediate value of the first element is taken as the actual value of the first element.
Optionally, the updating module 50 configured to output the updated state array is specifically configured to:
and the display process sends the updated state array to a diagnosis process so that the diagnosis process determines that the actual selection state is the selected data stream based on the updated state array and the marker array. The data flow transmission device provided by the embodiment of the application can reduce the transmission data volume of data flow, greatly compress the space for data storage, improve the data transmission efficiency and avoid the risk of memory overflow caused by excessive data.
An embodiment of the present application further provides an electronic device, including: at least one memory and at least one processor; the memory stores a program, and the processor calls the program stored in the memory, and the program is used for realizing any data stream transmission method.
Embodiments of the present application further provide a computer-readable storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are configured to execute the data stream transmission method according to any one of the above items.
The foregoing describes in detail a data stream transmission method, a transmission apparatus, an electronic device, and a computer-readable storage medium, which are provided by the present application, and specific examples are applied herein to explain the principles and implementations of the present application, and the descriptions of the foregoing examples are only used to help understand the method and the core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include or include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A method for data stream transmission, the method comprising:
defining a state array, wherein the state array comprises at least one first element, one first element occupies one byte, one bit represents the selection state of one data stream, and the initial value of each first element represents that the initial selection state of each data stream corresponding to each first element is unselected;
aiming at each first element in the state array, acquiring the actual selection state of each data stream corresponding to the first element, and determining the actual selection state of at least one data stream as a selected target bit;
calling a predefined tag array, wherein the tag array comprises a plurality of second elements, and the numerical value of one second element is used for marking a selected bit in one byte;
selecting a target second element corresponding to each target bit from the mark array, and calculating an actual value of the first element according to the initial value of the first element and the numerical value of each target second element;
updating the state array by using the actual value of each first element, and outputting the updated state array;
wherein the calculating an actual value of the first element according to the initial value of the first element and the numerical value of each target second element comprises:
taking the initial value of the first element as the current value of the first element;
determining a target second element to be processed, and carrying out bit or operation on the current value of the first element and the numerical value of the target second element to be processed to obtain a middle value of the first element;
judging whether an unprocessed target second element exists;
if so, taking the intermediate value of the first element as the current value of the first element, and returning to execute the determination of a target second element to be processed;
if not, the intermediate value of the first element is taken as the actual value of the first element.
2. The method of claim 1, wherein defining a state array comprises:
calculating the number of first elements in the state array, including:
acquiring the number of all data streams;
calculating a first ratio of the number of all data streams to 8 and a remainder of the number of all data streams to 8;
judging whether the remainder is 0;
if yes, taking the first ratio as the number of first elements in the state array;
if not, taking the sum of the first ratio and 1 as the number of the first elements in the state array.
3. The method of claim 1, wherein defining a state array comprises:
determining a correspondence between a data stream and one of the first elements in the state array, including:
acquiring the serial number of the data stream;
calculating a second ratio of the serial number of the data stream to 8;
and establishing a corresponding relation between the data stream and the first element corresponding to the second ratio in the state array.
4. The method of claim 1, wherein outputting the updated state array comprises:
and the display process sends the updated state array to a diagnosis process so that the diagnosis process determines that the actual selection state is the selected data stream based on the updated state array and the marker array.
5. The method of claim 1, wherein the data type of the first element is any one of binary, octal, decimal, and hexadecimal.
6. A data stream transmission apparatus, characterized in that the apparatus comprises:
the defining module is used for defining a state array, the state array comprises at least one first element, one first element occupies one byte, one bit represents the selection state of one data stream, and the initial value of each first element represents that the initial selection state of each data stream corresponding to each first element is unselected;
a determining module, configured to obtain, for each first element in the state array, an actual selection state of each data stream corresponding to the first element, and determine that the actual selection state of at least one data stream is a selected target bit;
the system comprises a calling module, a storage module and a processing module, wherein the calling module is used for calling a predefined tag array, the tag array comprises a plurality of second elements, and the numerical value of one second element is used for marking a selected bit in one byte;
the calculation module is used for selecting a target second element corresponding to each target bit from the mark array and calculating the actual value of the first element according to the initial value of the first element and the numerical value of each target second element;
the updating module is used for updating the state array by using the actual value of each first element and outputting the updated state array;
wherein the calculation module is specifically configured to:
taking the initial value of the first element as the current value of the first element; determining a target second element to be processed, and carrying out bit or operation on the current value of the first element and the numerical value of the target second element to be processed to obtain a middle value of the first element; judging whether an unprocessed target second element exists; if so, taking the intermediate value of the first element as the current value of the first element, and returning to execute the determination of a target second element to be processed; if not, the intermediate value of the first element is taken as the actual value of the first element.
7. An electronic device, comprising: at least one memory and at least one processor; the memory stores a program that the processor calls, the program being for implementing the data streaming method according to any of claims 1-5.
8. A computer-readable storage medium having stored thereon computer-executable instructions for performing the data streaming method of any of claims 1-5.
CN201910854182.1A 2019-09-10 2019-09-10 Data stream transmission method, transmission device, electronic equipment and storage medium Active CN110597644B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910854182.1A CN110597644B (en) 2019-09-10 2019-09-10 Data stream transmission method, transmission device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910854182.1A CN110597644B (en) 2019-09-10 2019-09-10 Data stream transmission method, transmission device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110597644A CN110597644A (en) 2019-12-20
CN110597644B true CN110597644B (en) 2022-05-10

Family

ID=68858623

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910854182.1A Active CN110597644B (en) 2019-09-10 2019-09-10 Data stream transmission method, transmission device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110597644B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111079390B (en) * 2019-12-20 2023-03-14 五八有限公司 Method and device for determining selection state of check box list
CN111722618A (en) * 2020-06-30 2020-09-29 深圳市元征科技股份有限公司 Unit switching method and related device for automobile data stream
CN117234977B (en) * 2023-11-10 2024-02-27 浪潮电子信息产业股份有限公司 Data processing method, system, device and computer readable storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7400271B2 (en) * 2005-06-21 2008-07-15 International Characters, Inc. Method and apparatus for processing character streams
US7630982B2 (en) * 2007-02-24 2009-12-08 Trend Micro Incorporated Fast identification of complex strings in a data stream
CN105843591B (en) * 2016-04-08 2018-06-19 龙芯中科技术有限公司 Multidimensional numerical slides the method, apparatus and processor of generation data
CN108205577B (en) * 2016-12-20 2022-06-03 阿里巴巴集团控股有限公司 Array construction method, array query method, device and electronic equipment
CN108647176B (en) * 2018-05-15 2020-09-29 北京经纬恒润科技有限公司 Data transmission method for Internet of vehicles equipment and Internet of vehicles equipment
CN109995473A (en) * 2018-12-17 2019-07-09 芜湖智久机器人有限公司 TCP communication data packets and its packaging method, check system, method of calibration
CN109829083A (en) * 2019-01-25 2019-05-31 深圳市金泰克半导体有限公司 SPD data automatic verification method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN110597644A (en) 2019-12-20

Similar Documents

Publication Publication Date Title
CN110597644B (en) Data stream transmission method, transmission device, electronic equipment and storage medium
CN106657197B (en) File uploading method and device
CN108388598A (en) Electronic device, date storage method and storage medium
US20100223549A1 (en) System and method for controlling entertainment devices using a display
CN110851206A (en) Vehicle type configuration file expanding method, device, equipment and readable storage medium
CN110888974A (en) Data visualization method and device
CN111324629A (en) Business data processing method and device, electronic equipment and computer storage medium
CN109542385B (en) Multi-data-stream on-screen display method, system and device and readable storage medium
CN108062401A (en) Using recommendation method, apparatus and storage medium
CN113688102A (en) File name modification method and device and storage medium
CN109857295B (en) Focus control method and device and storage medium
CN111090364A (en) Page style switching method and device, electronic equipment and readable storage medium
CN114780326B (en) Cross-platform calibration test method, device and equipment
CN113791984B (en) Automatic interface testing method and device
CN109857740A (en) Storage method, matching process, electronic equipment and the readable storage medium storing program for executing of character string
CN115291793A (en) Attribute data conversion method and device, storage medium and electronic device
CN110019431A (en) Processing method, system and the terminal device of data visualization
CN111078518B (en) Data acquisition method, terminal device and computer readable storage medium
CN111813754A (en) File processing method, file processing device, diagnostic equipment and electronic equipment
CN113542333A (en) Method for monitoring vehicle signals
CN113811019B (en) Terminal identity and IPv6 address mapping method and device
CN109388385A (en) Method and apparatus for application and development
CN110781194B (en) Application program table data processing method and device, electronic equipment and storage medium
US20230409169A1 (en) Interaction method and apparatus for media object in media library, and electronic device
JP2001027984A5 (en)

Legal Events

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