Data reading method and device based on shared memory, computer equipment and medium

By setting flag bits in shared memory communication to control data processing, the problem of repeated data reading in medical electronic products is solved, and the accuracy of communication transmission is improved.

CN119179586APending Publication Date: 2024-12-24SHENZHEN COMEN MEDICAL INSTR
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410990456.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

In medical electronic products, when using shared memory for data communication, repeated reading occasionally occurs, resulting in inaccurate communication transmission.

Method used

By setting a flag for the program that reads shared memory, the processing of subsequent data is controlled according to the read data type (end signal data or normal data), and repeated readings are avoided. The specific steps include setting the flag bit, sending and reading data, and performing corresponding processing based on the authenticity of the flag bit.

Benefits of technology

Improve the accuracy of shared memory communication, prevent repeated read behavior, and ensure the accuracy of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119179586A_ABST
    Figure CN119179586A_ABST
Patent Text Reader

Abstract

The invention discloses a data reading method and device based on a shared memory, computer equipment and a medium, and relates to the technical field of data processing.The method comprises the steps that in response to a setting instruction, a flag bit is set for a first program for reading data in the shared memory; in response to a sending instruction, controlling a second program to send target data to the shared memory; in response to a reading instruction, controlling the first program to read the target data in the shared memory; wherein when the target data read by the first program is ending signal data, the flag bit becomes true; when the target data read by the first program is common data, the flag bit becomes false; and based on the authenticity of the flag bit, controlling the first program to perform corresponding processing on subsequent data read in the shared memory. Through the method provided by the invention, the accidental repeated reading behavior in the shared memory communication can be corrected, so that the accuracy rate in communication transmission is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a data reading method, device, computer equipment and non-volatile computer-readable storage medium based on shared memory. Background Art

[0002] At present, in some medical electronic products, when multiple programs need to be run simultaneously in a chip, the communication between multiple programs can use the shared memory method; among them, shared memory is a communication method between multiple processes under Unix, which is usually used for communication between one or more programs. At present, for medical electronic products to run two programs on a chip at the same time, the two programs can use shared memory for communication. When using shared memory for data communication, when the program as the receiving party reads data, it occasionally reads the same data repeatedly, thereby repeatedly triggering the corresponding operation, causing inaccurate communication transmission.

[0003] Based on this, how to provide a data reading method, device, computer equipment and non-volatile computer-readable storage medium based on shared memory, which can correct the occasional repeated reading behavior in shared memory communication to increase the accuracy of communication transmission, is a problem that needs to be urgently solved by technical personnel in this field. Summary of the invention

[0004] In view of the above-mentioned deficiencies in the prior art, an object of the present invention is to provide a data reading method, apparatus, computer device and non-volatile computer-readable storage medium based on shared memory, which can correct occasional repeated reading behaviors in shared memory communication to increase the accuracy of communication transmission.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] A data reading method based on shared memory, comprising:

[0007] In response to the setting instruction, a flag is set for the first program that reads data in the shared memory; wherein the flag is a flag indicating whether the first program has read end signal data in the shared memory, and its initial value is false;

[0008] In response to the sending instruction, controlling the second program to send the target data to the shared memory;

[0009] In response to a read instruction, the first program is controlled to read the target data in the shared memory; wherein, when the target data read by the first program is end signal data, the flag bit becomes true; when the target data read by the first program is ordinary data, the flag bit becomes false;

[0010] Based on the truth or falsity of the flag bit, the first program is controlled to take corresponding processing on subsequent data read from the shared memory.

[0011] In a further technical solution, the shared memory-based data reading method, wherein, in response to the sending instruction, controlling the second program to send the target data to the shared memory includes:

[0012] In response to the sending instruction, the second program is controlled to send target data to the shared memory at intervals of a first target time.

[0013] In a further technical solution, the shared memory-based data reading method, wherein, in response to a read instruction, controlling the first program to read the target data in the shared memory includes:

[0014] In response to the read instruction, the first program is controlled to read the target data from the shared memory at intervals of a second target time.

[0015] In a further technical solution, the shared memory-based data reading method, wherein, based on the truth or falsity of the flag bit, controlling the first program to take corresponding processing on subsequent data read from the shared memory, comprises:

[0016] When the flag is true, the first program is controlled to perform normal acceptance processing on subsequent data read from the shared memory;

[0017] When the flag is false, the first program is controlled to reject subsequent data read from the shared memory.

[0018] In a further technical solution, the shared memory-based data reading method, wherein, in response to the sending instruction, controls the second program to send target data to the shared memory at intervals of a first target time, wherein the first target time is 25ms.

[0019] In a further technical solution, the shared memory-based data reading method, wherein, in response to a read instruction, controls the first program to read the target data in the shared memory at intervals of a second target time, wherein the second target time is 25 ms.

[0020] In a further technical solution, the shared memory-based data reading method, wherein, in response to the sending instruction, before controlling the second program to send the target data to the shared memory, comprises:

[0021] In response to the initialization instruction, the shared memory is initialized.

[0022] A data reading device based on shared memory, comprising:

[0023] A setting module, configured to set a flag bit for the first program that reads data in the shared memory in response to a setting instruction; wherein the flag bit is a flag bit indicating whether the first program has read end signal data in the shared memory, and its initial value is false;

[0024] A sending module, used for controlling the second program to send target data to the shared memory in response to a sending instruction;

[0025] a reading module, configured to control the first program to read the target data in the shared memory in response to a reading instruction; wherein when the target data read by the first program is end signal data, the flag becomes true; and when the target data read by the first program is ordinary data, the flag becomes false;

[0026] A processing module is used to control the first program to take corresponding processing on subsequent data read from the shared memory based on the truth of the flag bit.

[0027] A computer device, wherein the computer device comprises at least one processor; and

[0028] a memory communicatively connected to the at least one processor; wherein,

[0029] The memory stores a computer program that can be executed by the at least one processor. When the computer program is executed by the at least one processor, any of the above-mentioned shared memory-based data reading methods can be implemented.

[0030] A non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the shared memory-based data reading method as described in any one of the above items can be implemented.

[0031] Compared with the prior art, the present invention provides a data reading method, device, computer equipment and non-volatile computer-readable storage medium based on shared memory, wherein the method includes: in response to a setting instruction, setting a flag for a first program that reads data in a shared memory; wherein the flag is a flag indicating whether the first program has read end signal data in the shared memory, and its initial value is false; in response to a sending instruction, controlling the second program to send target data to the shared memory; in response to a reading instruction, controlling the first program to read the target data in the shared memory; wherein, when the target data read by the first program is end signal data, the flag becomes true; when the target data read by the first program is ordinary data, the flag becomes false; based on the truth or falsity of the flag, controlling the first program to take corresponding processing on the subsequent data read in the shared memory. In this way, the method of the present invention can correct the occasional repeated reading behavior in shared memory communication to increase the accuracy of communication transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0033] Figure 1 A schematic flow chart of a data reading method based on a shared memory provided in an embodiment of the present invention.

[0034] Figure 2 A schematic diagram of functional modules of a data reading device based on a shared memory provided by an embodiment of the present invention.

[0035] Figure 3 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0037] In the description of the present invention, the terms "include", "including", "have", "contain", etc. are all open terms, which mean including but not limited to. The descriptions with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", etc. mean that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. The order of steps involved in each embodiment is used to schematically illustrate the implementation of the present application, and the order of steps therein is not limited and can be appropriately adjusted as needed.

[0038] Various non-limiting embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.

[0039] At present, in some medical electronic products, when multiple programs need to be run simultaneously in a chip, the communication between multiple programs can use the shared memory method; among them, shared memory is a communication method between multiple processes under Unix, which is usually used for communication between one or more programs. At present, for medical electronic products to run two programs on a chip at the same time, the two programs can use shared memory for communication. When using shared memory for data communication, when the program as the receiving party reads data, it occasionally reads the same data repeatedly, thereby repeatedly triggering the corresponding operation, causing inaccurate communication transmission.

[0040] Based on this, how to provide a data reading method, device, computer equipment and non-volatile computer-readable storage medium based on shared memory, which can correct the occasional repeated reading behavior in shared memory communication to increase the accuracy of communication transmission, is a problem that needs to be urgently solved by technical personnel in this field.

[0041] Therefore, to solve the above problem, please refer to Figure 1 , an embodiment of the present invention provides a data reading method based on a shared memory, wherein the method comprises the steps of:

[0042] S100, in response to a setting instruction, setting a flag bit for a first program that reads data in a shared memory; wherein the flag bit is a flag bit indicating whether the first program has read end signal data in the shared memory, and its initial value is false;

[0043] S200, in response to a sending instruction, controlling the second program to send target data to the shared memory;

[0044] S300, in response to a read instruction, controlling the first program to read the target data in the shared memory; wherein, when the target data read by the first program is end signal data, the flag bit becomes true; when the target data read by the first program is ordinary data, the flag bit becomes false;

[0045] S400: Based on the truth or falsity of the flag bit, control the first program to take corresponding processing on subsequent data read from the shared memory.

[0046] Further, the method for reading data based on the shared memory, wherein, in response to the setting instruction, a flag is set for the first program that reads the data in the shared memory;

[0047] In specific implementation, in this embodiment, in response to a setting instruction, when the first program starts running, a flag is set for the first program that reads data in the shared memory; wherein the flag is a flag indicating whether the first program has read the end signal data in the shared memory, and its initial value is false.

[0048] Furthermore, the data reading method based on shared memory, wherein, in response to the sending instruction, controlling the second program to send the target data to the shared memory includes:

[0049] In response to the sending instruction, controlling the second program to send target data to the shared memory at intervals of a first target time;

[0050] Furthermore, in the data reading method based on shared memory, in response to the sending instruction, the second program is controlled to send target data to the shared memory at intervals of a first target time, wherein the first target time is 25ms;

[0051] In specific implementation, in this embodiment, in response to the sending instruction, the second program is controlled to send the target data to the shared memory every 25 ms.

[0052] Furthermore, the method for reading data based on a shared memory, wherein, in response to a read instruction, controlling the first program to read the target data in the shared memory comprises:

[0053] In response to a read instruction, controlling the first program to read the target data from the shared memory at intervals of a second target time;

[0054] Furthermore, in the shared memory-based data reading method, in response to the read instruction, the first program is controlled to read the target data in the shared memory at intervals of a second target time, wherein the second target time is 25 ms;

[0055] In specific implementation, in this embodiment, in response to a read instruction, the first program is controlled to read the target data in the shared memory every 25 ms; wherein, when the target data read by the first program is end signal data, the flag becomes true; when the target data read by the first program is normal data, the flag becomes false.

[0056] Furthermore, the method for reading data based on a shared memory, wherein, based on the truth or falsity of the flag bit, controlling the first program to take corresponding processing on subsequent data read from the shared memory, comprises:

[0057] When the flag is true, the first program is controlled to perform normal acceptance processing on subsequent data read from the shared memory;

[0058] When the flag is false, the first program is controlled to reject subsequent data read from the shared memory;

[0059] In specific implementation, in this embodiment, when the flag is true, the first program is controlled to take normal acceptance processing for subsequent data read from the shared memory, that is, only when the flag is true, the first program will continue to process; when the flag is false, the first program is controlled to not accept subsequent data read from the shared memory, that is, if the flag is false, when the first program reads ordinary data again, it will not process it, and only wait for the second program to send the end signal data, and then the flag becomes true before processing the data normally.

[0060] Furthermore, the data reading method based on shared memory, wherein, before the second program is controlled to send the target data to the shared memory in response to the sending instruction, it includes:

[0061] In response to the initialization instruction, initializing the shared memory;

[0062] In specific implementation, in this embodiment, to ensure that the first data sent by the second program can be processed normally, this embodiment will respond to the initialization instruction and initialize the shared memory before the second program sends the target data to the shared memory, even if the shared memory clears the previous data to complete the initialization.

[0063] As can be seen from the above method embodiments, the data reading method based on shared memory provided by the present invention includes: in response to a setting instruction, setting a flag for the first program that reads data in the shared memory; wherein the flag is a flag indicating whether the first program has read the end signal data in the shared memory, and its initial value is false; in response to a sending instruction, controlling the second program to send target data to the shared memory; in response to a reading instruction, controlling the first program to read the target data in the shared memory; wherein, when the target data read by the first program is the end signal data, the flag becomes true; when the target data read by the first program is ordinary data, the flag becomes false; based on the truth or falsity of the flag, controlling the first program to take corresponding processing on the subsequent data read in the shared memory. In this way, the method of the present invention can correct the occasional repeated reading behavior in the shared memory communication to increase the accuracy of communication transmission and ensure normal communication.

[0064] It should be understood that, although the present application provides method operation steps as described in the embodiments or flowcharts, more or less operation steps may be included based on conventional or non-creative labor, and these operation steps are not necessarily performed in sequence according to the embodiment or flowchart. The order of steps listed in the embodiment or flowchart is only one way of executing the order of many steps, and does not represent the only execution order. It should be noted that there is not necessarily a certain order between the above steps. A person of ordinary skill in the art can understand from the description of the embodiment of the present invention that in different embodiments, the above steps may have different execution orders, that is, they may be executed in parallel, or they may be executed in exchange, etc. Moreover, at least a part of the steps in the embodiment or flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but may be executed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but may be executed in turn, alternately or synchronously with other steps or at least a part of the sub-steps or stages of other steps.

[0065] Based on the above examples, please refer to Figure 2 Another embodiment of the present invention further provides a data reading device based on a shared memory, wherein the device comprises:

[0066] A setting module 11 is used to set a flag bit for the first program that reads data in the shared memory in response to a setting instruction; wherein the flag bit is a flag bit indicating whether the first program has read end signal data in the shared memory, and its initial value is false;

[0067] A sending module 12, configured to control the second program to send target data to the shared memory in response to a sending instruction;

[0068] The reading module 13 is used to control the first program to read the target data in the shared memory in response to the reading instruction; wherein, when the target data read by the first program is end signal data, the flag bit becomes true; when the target data read by the first program is ordinary data, the flag bit becomes false;

[0069] The processing module 14 is used to control the first program to perform corresponding processing on subsequent data read from the shared memory based on the truth of the flag bit.

[0070] The specific implementation method is shown in the above method embodiment, which will not be described again here.

[0071] As can be seen from the above device embodiments, the data reading device based on shared memory provided by the present invention includes: a setting module, which is used to set a flag bit for the first program that reads data in the shared memory in response to a setting instruction; wherein the flag bit is a flag bit indicating whether the first program has read the end signal data in the shared memory, and its initial value is false; a sending module, which is used to control the second program to send target data to the shared memory in response to a sending instruction; a reading module, which is used to control the first program to read the target data in the shared memory in response to a reading instruction; wherein when the target data read by the first program is the end signal data, the flag bit becomes true; when the target data read by the first program is ordinary data, the flag bit becomes false; a processing module, which is used to control the first program to take corresponding processing on the subsequent data read in the shared memory based on the true or false of the flag bit. In this way, the device of the present invention can correct the occasional repeated reading behavior in the shared memory communication to increase the accuracy of communication transmission and ensure normal communication.

[0072] Based on the above examples, please refer to Figure 3 Another embodiment of the present invention further provides a computer device, wherein the computer device 10 comprises:

[0073] memory 120 and one or more processors 110, Figure 3 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a communication bus or other means. Figure 3 The example of connecting via a communication bus is taken as an example.

[0074] The processor 110 is used to complete various control logics of the computer device 10. It can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration.

[0075] The memory 120 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the computer program corresponding to the shared memory-based data reading method in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the computer device 10 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, implementing the shared memory-based data reading method in the above method embodiment.

[0076] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store an application required for operating the device or at least one function; the data storage area may store data created according to the use of the computer device 10, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the computer device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0077] One or more units are stored in the memory 120. When executed by one or more processors 110, the data reading method based on the shared memory in any of the above method embodiments can be implemented. For example, the above described method can be implemented. Figure 1 The method comprises steps S100 to S400.

[0078] Those skilled in the art will understand that Figure 3 The hardware structure diagram shown in the figure is only a schematic diagram of a partial structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0079] Based on the above embodiments, the present invention further provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the shared memory-based data reading method in any of the above method embodiments can be implemented, for example, the above described Figure 1 The method comprises steps S100 to S400.

[0080] As an example, the non-volatile storage medium can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable ROM (EEPROM), or a flash memory. Volatile memory can include a random access memory (RAM) as an external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synch link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.

[0081] Another embodiment of the present invention further provides a computer program product, the computer program product comprising a computer program stored on a non-volatile computer-readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a processor, the data reading method based on the shared memory in any of the above method embodiments can be implemented, for example, the above described method can be implemented. Figure 1 The method comprises steps S100 to S400.

[0082] The embodiments described above are merely illustrative, in which the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0083] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can exist in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0084] Conditional language such as "can," "can," "might," or "may," unless specifically stated otherwise or otherwise understood within the context as used, is generally intended to convey, among other things, that a particular embodiment can include (while other embodiments do not) a particular feature, element, and / or operation. Thus, such conditional language is also generally intended to imply that a feature, element, and / or operation is required for one or more embodiments anyway or that one or more embodiments must include logic for determining, with or without input or prompting, whether such features, elements, and / or operations are included or will be performed in any particular embodiment.

[0085] What has been described herein, in this specification and in the accompanying drawings includes an example that a method, device, computer equipment, and non-volatile computer-readable storage medium based on shared memory can be provided. Of course, it is not possible to describe every conceivable combination of elements and / or methods for the purpose of describing the various features of the present disclosure, but it can be recognized that many other combinations and permutations of the disclosed features are possible. Therefore, it is obvious that various modifications can be made to the present disclosure without departing from the scope or spirit of the present disclosure, but all these various modifications should belong to the scope of protection of the claims attached to the present invention. In addition, or in an alternative, other embodiments of the present disclosure may be obvious from consideration of the present specification and the accompanying drawings and the practice of the present disclosure as presented herein. It is intended that the examples proposed in the present specification and the accompanying drawings are considered to be illustrative and non-restrictive in all respects. Although specific terms are used in this article, they are used in a general and descriptive sense and are not used for the purpose of limitation.

Claims

1. A data reading method based on shared memory, characterized in that: include: In response to the setting instruction, a flag is set for the first program that reads data in the shared memory; wherein the flag is a flag indicating whether the first program has read end signal data in the shared memory, and its initial value is false; In response to the sending instruction, controlling the second program to send the target data to the shared memory; In response to a read instruction, the first program is controlled to read the target data in the shared memory; wherein, when the target data read by the first program is end signal data, the flag bit becomes true; when the target data read by the first program is ordinary data, the flag bit becomes false; Based on the truth or falsity of the flag bit, the first program is controlled to take corresponding processing on subsequent data read from the shared memory.

2. The data reading method based on shared memory according to claim 1, characterized in that: In response to the sending instruction, controlling the second program to send the target data to the shared memory includes: In response to the sending instruction, the second program is controlled to send target data to the shared memory at intervals of a first target time.

3. The data reading method based on shared memory according to claim 2, characterized in that: In response to the read instruction, controlling the first program to read the target data in the shared memory includes: In response to the read instruction, the first program is controlled to read the target data from the shared memory at intervals of a second target time.

4. The method for reading data based on shared memory according to claim 3, characterized in that: The controlling the first program to perform corresponding processing on subsequent data read from the shared memory based on the truth of the flag bit includes: When the flag is true, the first program is controlled to perform normal acceptance processing on subsequent data read from the shared memory; When the flag is false, the first program is controlled to reject subsequent data read from the shared memory.

5. The method for reading data based on shared memory according to claim 2, characterized in that: In response to the sending instruction, the second program is controlled to send target data to the shared memory at intervals of a first target time, wherein the first target time is 25 ms.

6. The method for reading data based on shared memory according to claim 3, characterized in that: In response to the read instruction, the first program is controlled to read the target data in the shared memory at intervals of a second target time, wherein the second target time is 25 ms.

7. The shared memory-based data reading method according to any one of claims 1 to 6, characterized in that: Before the second program is controlled to send the target data to the shared memory in response to the sending instruction, the method includes: In response to the initialization instruction, the shared memory is initialized.

8. A data reading device based on shared memory, characterized in that: include: A setting module, configured to set a flag bit for the first program that reads data in the shared memory in response to a setting instruction; wherein the flag bit is a flag bit indicating whether the first program has read end signal data in the shared memory, and its initial value is false; A sending module, used for controlling the second program to send target data to the shared memory in response to a sending instruction; a reading module, configured to control the first program to read the target data in the shared memory in response to a reading instruction; wherein when the target data read by the first program is end signal data, the flag becomes true; and when the target data read by the first program is ordinary data, the flag becomes false; A processing module is used to control the first program to take corresponding processing on subsequent data read from the shared memory based on the truth of the flag bit.

9. A computer device, characterized in that: The computer device comprises at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor. When the computer program is executed by the at least one processor, the shared memory-based data reading method as described in any one of claims 1 to 7 can be implemented.

10. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the shared memory-based data reading method according to any one of claims 1 to 7 can be implemented.