I actually solved this problem recently on my own, though my approach was not based entirely on operations research, but relied a bit on the logic of running the whole program. So if you are looking for an academic solution to a similar problem, please prioritize @Sutanu Majumdar's solution.
First of all, this model is part of one of my work projects, which is used to calculate a suitable production schedule for factory production. The project is divided into a discrete modeling part, a distribution modeling part, and a continuous time modeling part， with the focus mainly on the discrete and distribution models.
In operation, the production plan is first calculated in the discrete model for discrete time (the constraints I presented in the question come from the discrete model), and you can see from this flow balance constraints that the results from the discrete model don't actually know where the process products are going to flow, but only how much of each process will be produced at each t， and that's where the allocation model comes in handy. The allocation model connects the inputs of each process in the discrete model results to the outputs of another process, creating a process-to-process supply relationship.
Note that the allocation model determines whether a process i1 that produces p can supply a process i2 that consumes p based on the fact that i1 is produced earlier than i2 and that the product produced by i1 has the same product id as the product demanded by i2. So I was wondering if there could be a way to get i1 production into i2 whenever it is produced.
If i1 produces, its product can only go into the process that consumes it, or into inventory, according to the flow balance constraint. While I can't know exactly which process supplied the amount of inventory at each t at which previous t, conversely, the amount of inventory can be thought of as being produced by any of the production processes that produced before t, as long as it produced!
Thus, when i1 produces, I just have to make sure that the amount of inventory must be greater than i2's current total production, all the way up to the point when i1 starts to consume it, so that in the view of the allocation model, i1 and i2 can establish a supply relationship, and in between, even if some other consuming process tries to take away the inventory, a new production process will be induced to produce it, based on my constraints as well as on the flow balance!
Here are the constraints I added.
Constraint (2) guarantees that, for all supply relationships I want to control, the production quantity of a preceding production process will "always" be held in inventory if its successor does not start consuming it when it starts producing; and constraint (3) makes it possible for each pair of successors in the controlled supply relationship to have a sufficient supply of supply "from i1".
By working with the three constraints, the results obtained from the discrete model can then be processed by the preprocessing function of the assignment model into the supply relationship I want